Refactoring cheats checks

This commit is contained in:
LoafyLemon 2024-04-25 20:11:30 +01:00
parent cc6fe6909c
commit b56d84a301
6 changed files with 9 additions and 9 deletions

View File

@ -566,7 +566,7 @@ init python:
for o in self.wardrobe_list: for o in self.wardrobe_list:
if x[0] == o.id: if x[0] == o.id:
if not o.unlocked and not game.cheats: if not o.unlocked and not states.env.cheats:
renpy.notify("Import failed: You don't own these items. Buy them first.") renpy.notify("Import failed: You don't own these items. Buy them first.")
return None return None

View File

@ -12,13 +12,13 @@ label start_wt:
"Difficulty" "How difficult do you want the game to be?" "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}": "-Easy-{size=-8}\nIncreased gold, item drop rate and Slytherin-points gains.\nMood will improve faster.\nCheats are available.{/size}":
$ states.env.difficulty = 1 $ states.env.difficulty = 1
$ game.cheats = True $ states.env.cheats = True
"-Normal-{size=-8}\nBalanced gold, item drop rate and Slytherin-points gains.\nMood will improve normally.\nCheats are available.{/size}": "-Normal-{size=-8}\nBalanced gold, item drop rate and Slytherin-points gains.\nMood will improve normally.\nCheats are available.{/size}":
$ states.env.difficulty = 2 $ states.env.difficulty = 2
$ game.cheats = True $ states.env.cheats = True
"-Hardcore-{size=-8}\nReduced gold, item drop rate and Slytherin-points gains.\nMood will not improve over time.\nNo cheats.{/size}": "-Hardcore-{size=-8}\nReduced gold, item drop rate and Slytherin-points gains.\nMood will not improve over time.\nNo cheats.{/size}":
$ states.env.difficulty = 3 $ states.env.difficulty = 3
$ game.cheats = False $ states.env.cheats = False
if persistent.game_complete: if persistent.game_complete:
menu: menu:

View File

@ -212,7 +212,7 @@ screen ui_menu():
ypos 15 ypos 15
textbutton "Save" action ShowMenu("save") background None xalign 0.5 text_outlines [ (2, "#00000080", 1, 0) ] 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) ] textbutton "Load" action ShowMenu("load") background None xalign 0.5 text_outlines [ (2, "#00000080", 1, 0) ]
if game.cheats and states.env.difficulty <= 2 and game.day > 1: if states.env.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) ] 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: if game.day > 1 and renpy.android:
textbutton "Preferences" action ShowMenu("preferences") background None xalign 0.5 text_outlines [ (2, "#00000080", 1, 0) ] textbutton "Preferences" action ShowMenu("preferences") background None xalign 0.5 text_outlines [ (2, "#00000080", 1, 0) ]

View File

@ -57,7 +57,7 @@ default desk_OBJ = RoomObject(
"Jerk Off": (Text("🍆", align=(0.5, 0.5)), Jump("jerk_off"), "True"), "Jerk Off": (Text("🍆", align=(0.5, 0.5)), Jump("jerk_off"), "True"),
"Do Paperwork": (Text("📝", align=(0.5, 0.5)), Jump("paperwork"), "states.paperwork_unlocked"), "Do Paperwork": (Text("📝", align=(0.5, 0.5)), Jump("paperwork"), "states.paperwork_unlocked"),
"Open Deck Builder": (Text("🃏", align=(0.5, 0.5)), Jump("deck_builder"), "states.cardgame.unlocked"), "Open Deck Builder": (Text("🃏", align=(0.5, 0.5)), Jump("deck_builder"), "states.cardgame.unlocked"),
"Open Cheats Menu": (Text("🕹️", align=(0.5, 0.5)), Jump("cheats"), "game.cheats"), "Open Cheats Menu": (Text("🕹️", align=(0.5, 0.5)), Jump("cheats"), "states.env.cheats"),
}, },
hovered=Show( hovered=Show(
"gui_tooltip", "gui_tooltip",

View File

@ -15,7 +15,7 @@ label start_quick:
states.ton.level = 5 states.ton.level = 5
states.sna.level = 5 states.sna.level = 5
states.map.unlocked = True states.map.unlocked = True
game.cheats = True states.env.cheats = True
renpy.block_rollback() renpy.block_rollback()
@ -28,7 +28,7 @@ label start_dev:
python: python:
version = version_float() version = version_float()
states.env.difficulty = 2 states.env.difficulty = 2
game.cheats = True states.env.cheats = True
game.gold = 100000 game.gold = 100000
states.map.unlocked = True states.map.unlocked = True
states.sna.unlocked = True states.sna.unlocked = True

View File

@ -154,7 +154,7 @@ init -1 python:
word_list = {"tonks": "friendship", "astoria": "affection", "susan": "confidence", "luna": "corruption", "cho": "recklessness", "hermione": "whoring"} word_list = {"tonks": "friendship", "astoria": "affection", "susan": "confidence", "luna": "corruption", "cho": "recklessness", "hermione": "whoring"}
word = word_list.get(states.active_girl, "whoring") word = word_list.get(states.active_girl, "whoring")
if game.cheats or states.env.difficulty <= 2: if states.env.cheats or states.env.difficulty <= 2:
renpy.show_screen("blktone") renpy.show_screen("blktone")
renpy.with_statement(d3) renpy.with_statement(d3)
renpy.say(None, "{size=+6}> Try again at "+word+" level {color=#7a0000}"+str(value)+"{/color}.{/size}") renpy.say(None, "{size=+6}> Try again at "+word+" level {color=#7a0000}"+str(value)+"{/color}.{/size}")