Refactoring gold checks

This commit is contained in:
LoafyLemon 2024-04-25 20:12:50 +01:00
parent b56d84a301
commit ec991ccd22
30 changed files with 77 additions and 77 deletions

View File

@ -80,7 +80,7 @@ label cc_pf_strip_T2_intro_E1:
$ cho.equip(cho_outfit_default)
$ cho.set_pose("default")
$ cho.animation = None
$ game.gold = 1984
$ states.env.gold = 1984
$ game.day = 123
call room("main_room")

View File

@ -57,7 +57,7 @@ label cc_pf_blowjob_T3_intro_E1:
$ cho.equip(cho_outfit_default)
$ cho.set_pose("default")
$ cho.animation = None
$ game.gold = 1984
$ states.env.gold = 1984
$ game.day = 124
call room("main_room")

View File

@ -578,7 +578,7 @@ label ss_he_cho_E1:
sna "That's barely worth it." ("snape_04")
sna "How about two thousand gold?" ("snape_13")
if game.gold < 2000:
if states.env.gold < 2000:
gen "I don't have that much gold." ("base", xpos="far_left", ypos="head")
sna "Well, you have plenty of time to gather that amount." ("snape_22")
else:

View File

@ -124,7 +124,7 @@ label gryffindor_match:
show screen blkfade
with d5
$ game.gold = 1984
$ states.env.gold = 1984
$ game.day = 665
$ states.env.daytime = True
$ game.weather = "clear"
@ -586,7 +586,7 @@ label gryffindor_match:
if _in_replay:
$ cho.equip(cho_outfit_quidditch_gryffindor)
$ game.gold = 1984
$ states.env.gold = 1984
$ game.day = 667
$ states.env.daytime = True
$ game.weather = "clear"
@ -728,7 +728,7 @@ label gryffindor_match:
with d5
$ cho.equip(cho_outfit_quidditch_gryffindor)
$ game.gold = 1984
$ states.env.gold = 1984
$ game.day = 667
$ states.env.daytime = True
$ game.weather = "clear"
@ -934,7 +934,7 @@ label gryffindor_match:
$ cho.equip(cho_outfit_quidditch_gryffindor)
$ cho.set_pose("broom")
$ cho.animation = sprite_fly_idle
$ game.gold = 1984
$ states.env.gold = 1984
$ game.day = 667
call room("quidditch_stands2")
call quidditch_stands2(weather="sun_low", crowd=crowd_full)
@ -958,7 +958,7 @@ label gryffindor_match:
$ cho.equip(cho_outfit_quidditch_gryffindor)
$ cho.set_pose("broom")
$ cho.animation = sprite_fly_idle
$ game.gold = 1984
$ states.env.gold = 1984
$ game.day = 667
call room("quidditch_stands2")
call quidditch_stands2(weather="sun_low", crowd=crowd_full)
@ -2150,7 +2150,7 @@ label gryffindor_match_return:
call sna_walk(xpos="desk", speed=1.5)
play sound "sounds/money_thud.ogg"
$ game.gold += 2000
$ states.env.gold += 2000
sna "Here, now shut...{w=0.2} Up!" ("snape_17", xpos=200, ypos="base", trans=d3, flip=False)
call sna_walk(action="leave", speed=1.5)

View File

@ -73,7 +73,7 @@ label cc_gt_return:
gen "How expensive could a broom be--" ("base", xpos="far_left", ypos="head")
# This will always display player gold + 1000, because why not.
$ _gold = game.gold + 4000
$ _gold = states.env.gold + 4000
$ _gold = num_to_word(_gold)
cho "[_gold]!" ("clench", "closed", "base", "mid")
@ -102,7 +102,7 @@ label cc_gt_return:
with d5
$ cho.equip(cho_outfit_quidditch_gryffindor)
$ game.gold = 1984
$ states.env.gold = 1984
$ game.day = 665
$ states.env.daytime = False
$ game.weather = "clear"

View File

@ -1506,7 +1506,7 @@ label cho_quid_E12:
$ hooch.equip(hoo_outfit_default)
$ hooch.equip(hoo_accessory_broom_dildo)
$ cho.equip(cho_outfit_quidditch_gryffindor)
$ game.gold = 1984
$ states.env.gold = 1984
$ game.day = 666
$ states.env.daytime = True
$ game.weather = "clear"

View File

@ -559,14 +559,14 @@ label slytherin_match:
her "" ("open", "base", "angry", "up")
sna "Well, some of us bet quite a fortune on the outcome." ("snape_09")
if game.gold >= 2000:
if states.env.gold >= 2000:
gen "Fuck{w=0.3}, I forgot he was here..." ("angry", xpos="far_left", ypos="head")
else:
gen "Oh shit{w=0.3}, the bet..." ("angry", xpos="far_left", ypos="head")
sna "You aren't going to chicken out now, are you?" ("snape_03")
gen "No... of course not..." ("base", xpos="far_left", ypos="head")
if game.gold >= 2000:
if states.env.gold >= 2000:
gen "(Why did I bet so much gold on this?!)" ("angry", xpos="far_left", ypos="head")
else:
gen "(How in the hell would I get two thousand gold?!)" ("angry", xpos="far_left", ypos="head")

View File

@ -56,7 +56,7 @@ label barmaid_responses:
her "Thank you, [name_genie_hermione]."
$ gryffindor+= 20
$ game.gold += payment
$ states.env.gold += payment
call her_walk(action="leave")
@ -197,7 +197,7 @@ label gryffindor_cheer_responses:
her "Thank you, [name_genie_hermione]." ("base", "happyCl", "base", "mid")
nar "You receive [payment] gold coins."
$ gryffindor+= 20
$ game.gold += payment
$ states.env.gold += payment
call her_walk(action="leave")
@ -339,7 +339,7 @@ label slytherin_cheer_responses:
her "Thank you, [name_genie_hermione]." ("base", "narrow", "base", "mid_soft")
nar "You receive [payment] gold coins."
$ gryffindor+= 30
$ game.gold += payment
$ states.env.gold += payment
label end_her_working_no_payment:

View File

@ -311,7 +311,7 @@ label her_maid_job_return:
nar "You receive {number=payment} gold coins."
$ gryffindor+= 10
$ game.gold += payment
$ states.env.gold += payment
call her_walk(action="leave")

View File

@ -102,7 +102,7 @@ label her_promoter_job_return:
her "Here's your payment." ("open", "base", "base", "mid")
call give_reward("You have received twenty gold", "interface/icons/gold.webp")
$ game.gold += 20
$ states.env.gold += 20
gen "Well done [name_hermione_genie], fifteen points to Gryffindor." ("base", xpos="far_left", ypos="head")
$ gryffindor += 15
@ -131,7 +131,7 @@ label her_promoter_job_return:
her "Here's your payment." ("open", "base", "base", "mid")
call give_reward("You have received twenty gold", "interface/icons/gold.webp")
$ game.gold += 20
$ states.env.gold += 20
gen "Well done [name_hermione_genie], twenty points to Gryffindor." ("base", xpos="far_left", ypos="head")
$ gryffindor += 20
@ -172,7 +172,7 @@ label her_promoter_job_return:
her "Here's your payment." ("open", "base", "base", "mid")
call give_reward("You have received twenty gold", "interface/icons/gold.webp")
$ game.gold += 20
$ states.env.gold += 20
gen "Well done [name_hermione_genie], twenty points to Gryffindor." ("base", xpos="far_left", ypos="head")
$ gryffindor += 20
@ -209,7 +209,7 @@ label her_promoter_job_return:
her "Here's your payment." ("open", "base", "base", "mid")
call give_reward("You have received twenty gold", "interface/icons/gold.webp")
$ game.gold += 20
$ states.env.gold += 20
gen "Well done [name_hermione_genie], twenty points to Gryffindor." ("base", xpos="far_left", ypos="head")
$ gryffindor += 20
@ -240,7 +240,7 @@ label her_promoter_job_return:
her "Here's your payment." ("open", "base", "base", "mid")
call give_reward("You have received twenty gold", "interface/icons/gold.webp")
$ game.gold += 20
$ states.env.gold += 20
gen "Well done [name_hermione_genie], twenty-five points to Gryffindor." ("base", xpos="far_left", ypos="head")
$ gryffindor += 25

View File

@ -115,11 +115,11 @@ label upgrades_menu(xx=150, yy=90):
if __choice[1] != current_subcategory:
$ current_subcategory = __choice[1]
elif __choice[0] == "buy":
if game.gold >= __choice[1] and ton_friendship >= __choice[3]*25:
if states.env.gold >= __choice[1] and ton_friendship >= __choice[3]*25:
python:
renpy.play('sounds/money.ogg')
game.gold -= __choice[1]
states.env.gold -= __choice[1]
_list = __choice[2]
_iter = __choice[3]
@ -217,7 +217,7 @@ screen upgrades_menuitem(xx, yy):
spacing 5
pos (18, 70)
add "interface/icons/small/gold.webp"
text str(game.gold) size 15 ypos 4
text str(states.env.gold) size 15 ypos 4
add "interface/icons/small/tonks.webp"
text str(ton_friendship) size 15 ypos 4
@ -254,7 +254,7 @@ screen upgrades_menuitem(xx, yy):
xysize (95, 130)
xpos 10
if x < len(i):
add Flatten(i[x].get_image()) align (1.0, 1.0) zoom 0.125 alpha (1.0 if ((game.gold >= actual_price and ton_friendship >= favor_req) or i[x].unlocked) else 0.5)
add Flatten(i[x].get_image()) align (1.0, 1.0) zoom 0.125 alpha (1.0 if ((states.env.gold >= actual_price and ton_friendship >= favor_req) or i[x].unlocked) else 0.5)
if i[x].unlocked:
add "interface/topbar/icon_check.webp" zoom 0.5 align (0.85, 1.0)
else:
@ -268,6 +268,6 @@ screen upgrades_menuitem(xx, yy):
xysize (50, 50)
yalign 0.5
text ("" if (linear_price <= 0) else str(favor_req+25)+"{unicode}\u2764{/unicode}") color ("#b20000" if (ton_friendship < favor_req+25) else "#402313") size 14 align (0.5, 0.25)
text (str(linear_price)+"g" if linear_price > 0 else "Sold!") color ("#b20000" if (0 < linear_price > game.gold) else "#402313") size 14 align (0.5, 0.7)
text (str(linear_price)+"g" if linear_price > 0 else "Sold!") color ("#b20000" if (0 < linear_price > states.env.gold) else "#402313") size 14 align (0.5, 0.7)
text "{unicode}\u0362{/unicode}" size 65 align (1.0, 0.5) xoffset 5
add gui.format("interface/achievements/{}/spacer.webp") yalign 1.0 xpos 274 xanchor 0.5

View File

@ -69,13 +69,13 @@ label tonks_summon_setup:
gen "Alright then... Let's see, how much are you worth to me..." ("base", xpos="far_left", ypos="head")
menu:
"-Zero gold-" if game.gold <= 0:
"-Zero gold-" if states.env.gold <= 0:
gen "Zero gold." ("base", xpos="far_left", ypos="head")
ton @ cheeks heavy_blush hair horny "Seriously?" ("soft", "narrow", "raised", "mid")
gen "Yes, I'm a cheap bastard." ("base", xpos="far_left", ypos="head")
ton @ cheeks heavy_blush hair horny "Clearly..." ("upset", "narrow", "base", "mid")
"-One gold-" if game.gold > 0:
"-One gold-" if states.env.gold > 0:
gen "A single gold coin, if anything..." ("base", xpos="far_left", ypos="head")
ton @ cheeks heavy_blush hair horny "(Bastard... How humiliating.)" ("soft", "narrow", "worried", "up")
gen "Well?" ("base", xpos="far_left", ypos="head")
@ -83,16 +83,16 @@ label tonks_summon_setup:
gen "Shouldn't you be thanking me for this generous valuation?" ("base", xpos="far_left", ypos="head")
ton @ cheeks heavy_blush hair horny "Oh... Thank you so much, [name_genie_tonks]." ("annoyed", "narrow", "base", "stare")
gen "Don't mention it, [name_tonks_genie]." ("base", xpos="far_left", ypos="head")
$ game.gold -= 1
$ states.env.gold -= 1
"-Twenty gold-" if game.gold >= 20:
"-Twenty gold-" if states.env.gold >= 20:
gen "How does twenty gold sound?" ("base", xpos="far_left", ypos="head")
ton @ cheeks heavy_blush hair horny "(*Hmm*... I kind of expected more.)" ("annoyed", "narrow", "raised", "downR")
ton @ cheeks heavy_blush hair horny "Thank you, [name_genie_tonks]." ("soft", "narrow", "base", "mid")
gen "No, [name_tonks_genie]... Thank you." ("grin", xpos="far_left", ypos="head")
$ game.gold -= 20
$ states.env.gold -= 20
"-A hundred gold-" if game.gold >= 100:
"-A hundred gold-" if states.env.gold >= 100:
gen "Does one hundred gold sound nice to you?" ("base", xpos="far_left", ypos="head")
gen "With a body like that, you could earn a fortune at a strip club!" ("grin", xpos="far_left", ypos="head")
ton @ cheeks heavy_blush hair horny "Really..." ("horny", "narrow", "shocked", "mid")
@ -102,7 +102,7 @@ label tonks_summon_setup:
ton @ cheeks heavy_blush hair horny "Maybe the duelling stage could find some extra use..." ("base", "narrow", "shocked", "stare")
ton @ cheeks heavy_blush hair horny "Perhaps some extra curricular activities for a couple of my favourite students could be arranged..." ("horny", "narrow", "raised", "up")
gen "I'm sure they would all love to watch their perverted teacher strip!" ("grin", xpos="far_left", ypos="head")
$ game.gold -= 100
$ states.env.gold -= 100
gen "Now..." ("base", xpos="far_left", ypos="head")

View File

@ -81,27 +81,27 @@ label tonks_summon_setup:
ton "How much am I worth to you, [ton_genie_name]?" ("base", "base", "raised", "mid")
menu:
"-Zero gold-" if game.gold <= 0:
"-Zero gold-" if states.env.gold <= 0:
gen "Zero gold." ("base", xpos="far_left", ypos="head")
ton "Seriously?" ("angry", "base", "raised", "mid")
gen "Yes, I'm a cheap bastard." ("base", xpos="far_left", ypos="head")
ton "I can see that..." ("upset", "base", "base", "mid")
"-One gold-" if game.gold > 0:
"-One gold-" if states.env.gold > 0:
gen "A single gold coin, if anything..." ("base", xpos="far_left", ypos="head")
ton "(Bastard... How humiliating.)" ("base", "base", "raised", "ahegao")
ton "Thank you so much, [ton_genie_name]." ("base", "base", "base", "mid")
gen "Don't mention it, [tonks_name]." ("base", xpos="far_left", ypos="head")
$ game.gold -= 1
$ states.env.gold -= 1
"-Twenty gold-" if game.gold >= 20:
"-Twenty gold-" if states.env.gold >= 20:
gen "How does twenty gold sound?" ("base", xpos="far_left", ypos="head")
ton "(*Hmm*... I kind of expected more.)" ("base", "base", "base", "R")
ton "Thank you, [ton_genie_name]." ("base", "base", "base", "mid")
gen "No, [tonks_name]... Thank you." ("grin", xpos="far_left", ypos="head")
$ game.gold -= 20
$ states.env.gold -= 20
"-A hundred gold-" if game.gold >= 100:
"-A hundred gold-" if states.env.gold >= 100:
gen "Does one hundred gold sound nice to you?" ("base", xpos="far_left", ypos="head")
gen "With a body like that, you could earn a fortune at a strip club!" ("grin", xpos="far_left", ypos="head")
ton "Really..." ("horny", "base", "raised", "mid")
@ -111,7 +111,7 @@ label tonks_summon_setup:
ton "Maybe the duelling stage could find some extra use..." ("base", "base", "base", "R")
ton "Perhaps some extra curricular activities for a couple of my favourite students could be arranged..." ("open", "base", "raised", "mid")
gen "I'm sure they would all love to watch their perverted teacher strip!" ("grin", xpos="far_left", ypos="head")
$ game.gold -= 100
$ states.env.gold -= 100
gen "Now..." ("base", xpos="far_left", ypos="head")

View File

@ -24,7 +24,7 @@ label start_wt:
menu:
"NEW GAME+" "Would you like to carry over your hard earned gold from your previous playthrough?"
"-Yes please-":
$ game.gold += (persistent.gold or 0)
$ states.env.gold += (persistent.gold or 0)
nar "[persistent.gold] gold has been added to your funds."
"-No need-":

View File

@ -2876,7 +2876,7 @@ Farewell, my little [word_03].{/size}
$ states.her.ev.yule_ball.complete = True
$ persistent.game_complete = True
$ persistent.gold = game.gold
$ persistent.gold = states.env.gold
if "public" in states.her.ev.yule_ball.variant:
$ persistent.ending_02 = True

View File

@ -15,7 +15,7 @@ label cheats:
"-Inventory-":
menu .general:
"-Add 500 Gold-" (icon="interface/icons/small/gold.webp"):
$ game.gold += 500
$ states.env.gold += 500
jump cheats.general
"-Get all gifts-" (icon="interface/icons/small/gift.webp"):
python:

View File

@ -268,7 +268,7 @@ screen inventory_menu(xx, yy):
# Gold & Tokens
null height 16
text "{color=#daa520}Gold{/color} {outlinecolor=#ffffff00}[game.gold]{/outlinecolor}" size 12 outlines [ (2, "#000", 0, 0) ] xpos 0.1 xanchor 0
text "{color=#daa520}Gold{/color} {outlinecolor=#ffffff00}[states.env.gold]{/outlinecolor}" size 12 outlines [ (2, "#000", 0, 0) ] xpos 0.1 xanchor 0
add gui.format("interface/achievements/{}/spacer_left.webp")
text "{color=#2055da}Tokens{/color} {outlinecolor=#ffffff00}[tokens]{/outlinecolor}" size 12 outlines [ (2, "#000", 0, 0) ] xpos 0.1 xanchor 0
add gui.format("interface/achievements/{}/spacer_left.webp")

View File

@ -56,7 +56,7 @@ init python:
label letter_work_report:
python:
game.gold += reports_gold
states.env.gold += reports_gold
# Reset
states.paperwork_reports = 0

View File

@ -177,7 +177,7 @@ screen ui_stats():
hbox:
xpos 140 ypos 11
# Display tokens in token shop
text "{size=-4}[game.gold]{/size}"
text "{size=-4}[states.env.gold]{/size}"
style light_ui_stats_text:
color "#000"

View File

@ -120,7 +120,7 @@ label twins_random_duel:
gen "Finished?" ("base", xpos="far_left", ypos="head")
ger "Just a second..."
ger "Done!"
if game.gold < 10:
if states.env.gold < 10:
ger "Unfortunately we will have to refuse."
gen "Why?" ("angry", xpos="far_left", ypos="head")
fre "{size=-2}The further extension to fractional values of your current income in the first instance on the establishment of a method of algebraical evolution which bears the same relation to arithmetical evolution that algebraical division bears to arithmetical division gives unsatisfactory results.{/size}"
@ -154,7 +154,7 @@ label twins_random_duel:
gen "Okay then... If you two win, then I'll give you ten gold." ("base", xpos="far_left", ypos="head")
ger "One second, professor."
nar "George takes out a calculator and starts calculating something."
if game.gold < 10:
if states.env.gold < 10:
ger "We have to refuse."
gen "Why?" ("base", xpos="far_left", ypos="head")
fre "Long explanation or short?"
@ -238,7 +238,7 @@ label twins_duel_lost:
gen "It would appear that I may have lost this one..." ("base", xpos="far_left", ypos="head")
twi "It appears so."
gen "Well then, here's your reward..." ("base", xpos="far_left", ypos="head")
$ game.gold -= 10
$ states.env.gold -= 10
menu:
"-Rematch-":

Some files were not shown because too many files have changed in this diff Show More