Refactoring difficulty checks
This commit is contained in:
parent
8aba361ea9
commit
cc6fe6909c
@ -274,7 +274,7 @@ label hg_pf_strip_T4_snape:
|
||||
her @ cheeks blush "......" ("annoyed", "narrow", "worried", "down")
|
||||
sna "............." ("snape_13")
|
||||
|
||||
"-Unleash your rage {size=-2}(Hardcore){/size}-" if game.difficulty >= 3: #Hardcore difficulty dialogue.
|
||||
"-Unleash your rage {size=-2}(Hardcore){/size}-" if states.env.difficulty >= 3: #Hardcore difficulty dialogue.
|
||||
$ states.her.mood += 18
|
||||
gen "Both of you..." ("base", xpos="far_left", ypos="head")
|
||||
stop music
|
||||
|
@ -74,9 +74,9 @@ label snape_hangout:
|
||||
# Rain puts him in a good mood.
|
||||
$ states.sna.level += 1
|
||||
|
||||
if game.difficulty == 1:
|
||||
if states.env.difficulty == 1:
|
||||
$ states.sna.level += 5
|
||||
elif game.difficulty == 2:
|
||||
elif states.env.difficulty == 2:
|
||||
$ states.sna.level += 4
|
||||
else:
|
||||
$ states.sna.level += 3
|
||||
|
@ -65,9 +65,9 @@ label tonks_hangout:
|
||||
if states.fireplace_started: # Tonks is feeling hot.
|
||||
$ states.ton.level += 2
|
||||
|
||||
if game.difficulty < 2: #Easy difficulty
|
||||
if states.env.difficulty < 2: #Easy difficulty
|
||||
$ states.ton.level += 5
|
||||
elif game.difficulty == 2: #Normal
|
||||
elif states.env.difficulty == 2: #Normal
|
||||
$ states.ton.level += 4
|
||||
else: #Hardcore
|
||||
$ states.ton.level += 3
|
||||
|
@ -65,11 +65,11 @@ label day_start:
|
||||
states.sus.busy = bool(sb_summon_pause)
|
||||
|
||||
# Improve Mood
|
||||
if game.difficulty == 1: # Easy difficulty
|
||||
if states.env.difficulty == 1: # Easy difficulty
|
||||
val = 3
|
||||
elif game.difficulty == 2: # Normal difficulty
|
||||
elif states.env.difficulty == 2: # Normal difficulty
|
||||
val = 2
|
||||
elif game.difficulty == 3: # Hardcore difficulty
|
||||
elif states.env.difficulty == 3: # Hardcore difficulty
|
||||
val = 1
|
||||
|
||||
states.ton.mood = max(states.ton.mood-val, 0)
|
||||
|
@ -11,13 +11,13 @@ label start_wt:
|
||||
menu:
|
||||
"Difficulty" "How difficult do you want the game to be?"
|
||||
"-Easy-{size=-8}\nIncreased gold, item drop rate and Slytherin-points gains.\nMood will improve faster.\nCheats are available.{/size}":
|
||||
$ game.difficulty = 1
|
||||
$ states.env.difficulty = 1
|
||||
$ game.cheats = True
|
||||
"-Normal-{size=-8}\nBalanced gold, item drop rate and Slytherin-points gains.\nMood will improve normally.\nCheats are available.{/size}":
|
||||
$ game.difficulty = 2
|
||||
$ states.env.difficulty = 2
|
||||
$ game.cheats = True
|
||||
"-Hardcore-{size=-8}\nReduced gold, item drop rate and Slytherin-points gains.\nMood will not improve over time.\nNo cheats.{/size}":
|
||||
$ game.difficulty = 3
|
||||
$ states.env.difficulty = 3
|
||||
$ game.cheats = False
|
||||
|
||||
if persistent.game_complete:
|
||||
|
@ -47,9 +47,9 @@ init python:
|
||||
|
||||
reports_gold = states.paperwork_reports * (int(progress_factor * max(random_gold, progress_flat)) + progress_flat)
|
||||
|
||||
if game.difficulty <= 1: # Easy
|
||||
if states.env.difficulty <= 1: # Easy
|
||||
reports_gold = int(reports_gold * 1.2)
|
||||
elif game.difficulty == 2: # Normal
|
||||
elif states.env.difficulty == 2: # Normal
|
||||
pass
|
||||
else: # Hardcore
|
||||
reports_gold = int(reports_gold * 0.9)
|
||||
|
@ -212,7 +212,7 @@ screen ui_menu():
|
||||
ypos 15
|
||||
textbutton "Save" action ShowMenu("save") background None xalign 0.5 text_outlines [ (2, "#00000080", 1, 0) ]
|
||||
textbutton "Load" action ShowMenu("load") background None xalign 0.5 text_outlines [ (2, "#00000080", 1, 0) ]
|
||||
if game.cheats and game.difficulty <= 2 and game.day > 1:
|
||||
if game.cheats and states.env.difficulty <= 2 and game.day > 1:
|
||||
textbutton "Cheats" action [SetScreenVariable("toggle_menu", False), Jump("cheats")] background None xalign 0.5 text_outlines [ (2, "#00000080", 1, 0) ]
|
||||
if game.day > 1 and renpy.android:
|
||||
textbutton "Preferences" action ShowMenu("preferences") background None xalign 0.5 text_outlines [ (2, "#00000080", 1, 0) ]
|
||||
|
@ -235,10 +235,10 @@ label genie_attack:
|
||||
|
||||
if pentogram:
|
||||
hide screen duel_damage
|
||||
if game.difficulty <= 1: #Easy
|
||||
if states.env.difficulty <= 1: #Easy
|
||||
show screen duel_damage(500)
|
||||
$ snape_hp -= 500
|
||||
elif game.difficulty == 2: #Normal
|
||||
elif states.env.difficulty == 2: #Normal
|
||||
show screen duel_damage(500)
|
||||
$ snape_hp -= 500
|
||||
else: #Hardcore
|
||||
@ -246,10 +246,10 @@ label genie_attack:
|
||||
$ snape_hp -= 500
|
||||
else:
|
||||
hide screen duel_damage
|
||||
if game.difficulty <= 1: #Easy
|
||||
if states.env.difficulty <= 1: #Easy
|
||||
show screen duel_damage(300)
|
||||
$ snape_hp -= 300
|
||||
elif game.difficulty == 2: #Normal
|
||||
elif states.env.difficulty == 2: #Normal
|
||||
show screen duel_damage(200)
|
||||
$ snape_hp -= 200
|
||||
else: #Hardcore
|
||||
@ -287,9 +287,9 @@ label snapes_turn:
|
||||
$ duel_OBJ.snape = ""
|
||||
|
||||
hide screen duel_damage
|
||||
if game.difficulty <= 1: #Easy
|
||||
if states.env.difficulty <= 1: #Easy
|
||||
show screen duel_damage(0, False)
|
||||
elif game.difficulty == 2: #Normal
|
||||
elif states.env.difficulty == 2: #Normal
|
||||
show screen duel_damage(100, False)
|
||||
$ genie_hp -= 100
|
||||
else: #Hardcore #Shouldn't increase the penalty if you blocked correctly...
|
||||
@ -314,10 +314,10 @@ label snapes_turn:
|
||||
$ duel_OBJ.snape = ""
|
||||
|
||||
hide screen duel_damage
|
||||
if game.difficulty <= 1: #Easy
|
||||
if states.env.difficulty <= 1: #Easy
|
||||
show screen duel_damage(300, False)
|
||||
$ genie_hp -= 300
|
||||
elif game.difficulty == 2: #Normal
|
||||
elif states.env.difficulty == 2: #Normal
|
||||
show screen duel_damage(400, False)
|
||||
$ genie_hp -= 400
|
||||
else: #Hardcore
|
||||
@ -393,10 +393,10 @@ label snape_attack:
|
||||
$ duel_OBJ.snape = ""
|
||||
|
||||
hide screen duel_damage
|
||||
if game.difficulty <= 1: #Easy
|
||||
if states.env.difficulty <= 1: #Easy
|
||||
show screen duel_damage(100, False)
|
||||
$ genie_hp -= 100
|
||||
elif game.difficulty == 2: #Normal
|
||||
elif states.env.difficulty == 2: #Normal
|
||||
show screen duel_damage(100, False)
|
||||
$ genie_hp -= 100
|
||||
else: #Hardcore
|
||||
|
@ -39,7 +39,7 @@ screen puzzle_minigame():
|
||||
zorder 30
|
||||
|
||||
default tries = 0
|
||||
default tiles = generate_puzzle(grid=4, difficulty=game.difficulty, blank=15)
|
||||
default tiles = generate_puzzle(grid=4, difficulty=states.env.difficulty, blank=15)
|
||||
default hint = False
|
||||
$ score = 0
|
||||
|
||||
|
@ -112,7 +112,7 @@ init python:
|
||||
elif wine_ITEM.owned < 1:
|
||||
return wine_ITEM
|
||||
|
||||
if game.difficulty == 1:
|
||||
if states.env.difficulty == 1:
|
||||
# Easy
|
||||
# Soft diminishing returns, more rubber banding. Guaranteed item drop.
|
||||
if game.gold < int(170 * math.log(game.day)) and random_percent <= 56 - dr:
|
||||
@ -122,7 +122,7 @@ init python:
|
||||
random_item = renpy.random.choice(filtered_list or drop_list)
|
||||
return random_item
|
||||
|
||||
elif game.difficulty == 2:
|
||||
elif states.env.difficulty == 2:
|
||||
# Normal
|
||||
# Fair diminishing returns, soft rubber banding. High chance for item drop. (Recommended)
|
||||
if game.gold < int(120 * math.log(game.day)) and random_percent <= 38 - dr:
|
||||
@ -143,7 +143,7 @@ init python:
|
||||
else:
|
||||
return "nothing"
|
||||
|
||||
elif game.difficulty == 3:
|
||||
elif states.env.difficulty == 3:
|
||||
# Hard
|
||||
# Harsh diminishing returns, no rubber banding. Chance for item drop.
|
||||
if game.gold < int(90 * math.log(game.day)) and random_percent <= 33 - dr:
|
||||
|
@ -11,7 +11,7 @@ label start:
|
||||
label start_quick:
|
||||
python:
|
||||
version = version_float()
|
||||
game.difficulty = 2
|
||||
states.env.difficulty = 2
|
||||
states.ton.level = 5
|
||||
states.sna.level = 5
|
||||
states.map.unlocked = True
|
||||
@ -27,7 +27,7 @@ label start_quick:
|
||||
label start_dev:
|
||||
python:
|
||||
version = version_float()
|
||||
game.difficulty = 2
|
||||
states.env.difficulty = 2
|
||||
game.cheats = True
|
||||
game.gold = 100000
|
||||
states.map.unlocked = True
|
||||
|
@ -154,7 +154,7 @@ init -1 python:
|
||||
word_list = {"tonks": "friendship", "astoria": "affection", "susan": "confidence", "luna": "corruption", "cho": "recklessness", "hermione": "whoring"}
|
||||
word = word_list.get(states.active_girl, "whoring")
|
||||
|
||||
if game.cheats or game.difficulty <= 2:
|
||||
if game.cheats or states.env.difficulty <= 2:
|
||||
renpy.show_screen("blktone")
|
||||
renpy.with_statement(d3)
|
||||
renpy.say(None, "{size=+6}> Try again at "+word+" level {color=#7a0000}"+str(value)+"{/color}.{/size}")
|
||||
|
Loading…
Reference in New Issue
Block a user