Refactoring weather checks

This commit is contained in:
LoafyLemon 2024-04-25 20:15:36 +01:00
parent 333fdfed51
commit 085a4d8e9c
43 changed files with 82 additions and 82 deletions

View File

@ -641,7 +641,7 @@ label ag_st_imperio_E2:
play sound "sounds/thunder_2.ogg"
pause .5
if game.weather in {"clear", "cloudy"}:
if states.env.weather in {"clear", "cloudy"}:
gen "Where the hell did that thunder come from?" ("base", xpos="far_left", ypos="head")
else:
gen "What the--" ("base", xpos="far_left", ypos="head")

View File

@ -78,11 +78,11 @@ label start_gryffindor_match:
gen "Go-go Ravenclaw!" ("base", xpos="far_left", ypos="head")
cho "Right..." ("disgust", "base", "base", "mid")
if game.weather in {"rain", "storm"}:
if states.env.weather in {"rain", "storm"}:
cho "Let's just hope it stops raining before then." ("soft", "base", "base", "R")
elif game.weather in {"snow", "blizzard"}:
elif states.env.weather in {"snow", "blizzard"}:
cho "Let's just hope it stops snowing before then." ("soft", "base", "base", "R")
elif game.weather == "overcast":
elif states.env.weather == "overcast":
cho "Let's just hope the weather doesn't get worse." ("soft", "base", "base", "R")
else:
cho "Let's hope the weather stays like it is." ("soft", "base", "base", "R")
@ -127,7 +127,7 @@ label gryffindor_match:
$ states.env.gold = 1984
$ states.env.day = 665
$ states.env.daytime = True
$ game.weather = "clear"
$ states.env.weather = "clear"
call room("main_room")
hide screen blkfade
@ -589,7 +589,7 @@ label gryffindor_match:
$ states.env.gold = 1984
$ states.env.day = 667
$ states.env.daytime = True
$ game.weather = "clear"
$ states.env.weather = "clear"
$ snape_chibi.zorder = 3
$ tonks_chibi.zorder = 4
call room("quidditch_stands",)
@ -731,7 +731,7 @@ label gryffindor_match:
$ states.env.gold = 1984
$ states.env.day = 667
$ states.env.daytime = True
$ game.weather = "clear"
$ states.env.weather = "clear"
$ snape_chibi.zorder = 3
$ tonks_chibi.zorder = 4
call room("quidditch_stands",)

View File

@ -105,7 +105,7 @@ label cc_gt_return:
$ states.env.gold = 1984
$ states.env.day = 665
$ states.env.daytime = False
$ game.weather = "clear"
$ states.env.weather = "clear"
call room("main_room")
call cho_chibi(xpos="mid", ypos="base")

View File

@ -14,11 +14,11 @@ label start_hufflepuff_match:
cho "Yes, [name_genie_cho]." ("base", "base", "base", "mid")
gen "Well then, tomorrow it is!" ("grin", xpos="far_left", ypos="head")
if game.weather in {"rain", "storm"}:
if states.env.weather in {"rain", "storm"}:
cho "Sounds great, [name_genie_cho]. I just hope it stops raining before then." ("soft", "base", "base", "R")
elif game.weather in {"snow", "blizzard"}:
elif states.env.weather in {"snow", "blizzard"}:
cho "Sounds great, [name_genie_cho]. I just hope it stops snowing before then." ("soft", "base", "base", "R")
elif game.weather == "overcast":
elif states.env.weather == "overcast":
cho "Sounds great, [name_genie_cho]. I just hope the weather doesn't get worse." ("soft", "base", "base", "R")
else:
cho "Sounds great, [name_genie_cho]. I just hope the weather stays like it is." ("soft", "base", "base", "R")

View File

@ -9,7 +9,7 @@ label cc_ht_start:
# First Hufflepuff match.
gen "Ready to show off your panties to those badgering badgers?" ("base", xpos="far_left", ypos="head")
if game.weather in ("blizzard", "storm", "snow", "rain"):
if states.env.weather in ("blizzard", "storm", "snow", "rain"):
cho "In this weather? But I'll freeze my legs off if I'm to wear a skirt..." ("clench", "base", "base", "R")
cho "I'd rather not catch a cold during practice..." ("open", "base", "worried", "mid")
gen "Alright." ("base", xpos="far_left", ypos="head")

View File

@ -1113,7 +1113,7 @@ label cho_quid_E12:
# Genie visits cho during her training as requested
$ game.weather = "clear"
$ states.env.weather = "clear"
gen "*Yawn*..." ("base", xpos="far_left", ypos="head")
gen "I can't believe she made me wake up this early..." ("base", xpos="far_left", ypos="head")
@ -1509,7 +1509,7 @@ label cho_quid_E12:
$ states.env.gold = 1984
$ states.env.day = 666
$ states.env.daytime = True
$ game.weather = "clear"
$ states.env.weather = "clear"
$ hooch_chibi.zoom = 0.38
$ hooch_chibi.zorder = 4
call room("quidditch_pitch")
@ -1767,7 +1767,7 @@ label cho_quid_E14:
with d5
stop weather fadeout 4
$ game.weather = "clear"
$ states.env.weather = "clear"
play sound "sounds/cloth_sound3.ogg"

View File

@ -76,7 +76,7 @@ label start_slytherin_match:
label slytherin_match:
# Quidditch match: Ravenclaw vs. Slytherin
$ game.weather = "clear"
$ states.env.weather = "clear"
$ cho_outfit_last.save()
$ her_outfit_last.save()
@ -363,7 +363,7 @@ label slytherin_match:
call quidditch_stands(weather="overcast", tree_fire=True, rain=True, puddles=True)
with flashbulb
play weather "sounds/storm.ogg" fadeout 1.0 fadein 3.0
$ game.weather = "rain"
$ states.env.weather = "rain"
pause 1.0
sna "Indeed!" ("snape_02", ypos="head")
@ -685,7 +685,7 @@ label slytherin_match:
call gen_chibi("stand_alt", 155, 420) #,210,40+250)
with d3
$ game.weather = "overcast"
$ states.env.weather = "overcast"
play background "sounds/wind_long_loop.ogg" fadein 5 fadeout 2
call weather_sound
play music "music/machinations-by-kevin-macleod.ogg" fadein 1 fadeout 1 if_changed

View File

@ -394,7 +394,7 @@ label cc_pr_manipulate_girls_T3_angelina:
cho @ cheeks blush "" ("normal", "narrow", "base", "down", xpos="mid", ypos="base", trans=fade)
if game.weather == "rain":
if states.env.weather == "rain":
gen "Whoa, you're soaking!" ("angry", xpos="far_left", ypos="head")
cho @ cheeks blush "Oh, yes... I guess my clothes ended up a little wet..." ("base", "narrow", "base", "down") #Blushing
else:

View File

@ -275,7 +275,7 @@ label hermione_chitchat:
her "I am thankful that you keep on buying favours from me, [name_genie_hermione]..." ("open", "base", "worried", "R")
her "" ("soft", "base", "base", "R")
block if game.weather in {"snow", "blizzard"}:
block if states.env.weather in {"snow", "blizzard"}:
her "It's quite cold outside today, isn't it?" ("open", "base", "base", "mid")
her "" ("soft", "base", "base", "mid")
@ -470,7 +470,7 @@ label hermione_chitchat:
her "Sadly, the ones I've bought are already gone..." ("annoyed", "happyCl", "worried", "mid",emote="sweat")
her "" ("base", "base", "base", "R")
block if game.weather in {"rain", "storm", "overcast"}:
block if states.env.weather in {"rain", "storm", "overcast"}:
her "It certainly is chilly outside..." ("open", "base", "base", "mid")
her "I hope it's going to start snowing soon..." ("base", "base", "base", "mid")
her "You will let me wear a coat at least, right?" ("angry", "happyCl", "worried", "mid",emote="sweat")

View File

@ -8,7 +8,7 @@ label hermione_summon_setup:
#
# TODO: Remove obsolete variables and fix the code after clothes have been added.
#
# if game.weather == "clear":
# if states.env.weather == "clear":
# if states.her.tier >= 3 and states.env.daytime and not hg_muggle_hot_ITEM.unlocked:
# $ hg_muggle_hot_ITEM.unlocked = True
@ -57,7 +57,7 @@ label hermione_summon_setup:
# call unlock_clothing(text = "New clothing items for Hermione have been unlocked!", item = hg_muggle_hot_ITEM)
# if game.weather == "overcast":
# if states.env.weather == "overcast":
# #One time event.
# if not hg_accs_wool_g_ITEM.unlocked:
@ -120,7 +120,7 @@ label hermione_summon_setup:
# # Raining
# if game.weather == "rain":
# if states.env.weather == "rain":
# if states.her.tier >= 2 and not hg_muggle_rainy_ITEM.unlocked:
# $ hg_muggle_rainy_ITEM.unlocked = True
@ -185,7 +185,7 @@ label hermione_summon_setup:
# pause.5 #Shows Hermione with robe for a bit.
# # Snow
# if game.weather in ("snow", "blizzard"):
# if states.env.weather in ("snow", "blizzard"):
# if states.her.tier >= 2 and not hg_muggle_cold_ITEM.unlocked:
# $ hg_muggle_cold_ITEM.unlocked = True

View File

@ -490,7 +490,7 @@ label hermione_change:
gen "I said mass flood!" ("angry", xpos="far_left", ypos="head")
her "Mass flood?" ("soft", "base", "base", "mid")
gen "Are you deaf or something?" ("base", xpos="far_left", ypos="head")
if game.weather == "rain":
if states.env.weather == "rain":
her "I was pretty sure you said--" ("open", "base", "base", "mid")
her "" ("normal", "base", "base", "R")
gen "Look outside the window, it's raining is it not?" ("base", xpos="far_left", ypos="head")

View File

@ -841,7 +841,7 @@ label ll_pf_blowjob_T4_E3_intro:
lun "Of course!" ("angry", "base", "base", "mid")
"-Humour her-":
if states.env.daytime:
if game.weather == "clear": #Sunny
if states.env.weather == "clear": #Sunny
gen "Right..." ("base", xpos="far_left", ypos="head")
lun "Can't you see the radiant joy on Mister Sun's face?" ("grin", "base", "base", "L")
gen "Looks like the same burning ball of fire to me." ("base", xpos="far_left", ypos="head")

View File

@ -29,7 +29,7 @@ label snape_chitchat:
sna "Do you think you can break the girl?" ("snape_25")
block:
if game.weather in ("rain", "blizzard"):
if states.env.weather in ("rain", "blizzard"):
sna "Isn't the weather lovely today?" ("snape_02")
sna "I wish it would stay like this forever." ("snape_06")
else:

View File

@ -70,7 +70,7 @@ label snape_hangout:
label end_snape_hangout_points:
if states.sna.level < 100:
if game.weather in {"rain", "storm"}:
if states.env.weather in {"rain", "storm"}:
# Rain puts him in a good mood.
$ states.sna.level += 1

View File

@ -5,7 +5,7 @@
# First time genie meets snape
label snape_intro_E1:
$ game.weather = "clear"
$ states.env.weather = "clear"
call weather_sound
pause 1

View File

@ -586,13 +586,13 @@ init python:
for o in self.outfits:
if o.unlocked and o.schedule["day" if states.env.daytime else "night"]:
if game.weather == "overcast" and o.schedule["cloudy"]:
if states.env.weather == "overcast" and o.schedule["cloudy"]:
schedule.append(o)
elif game.weather in {"storm", "rain"} and o.schedule["rainy"]:
elif states.env.weather in {"storm", "rain"} and o.schedule["rainy"]:
schedule.append(o)
elif game.weather in {"snow", "blizzard"} and o.schedule["snowy"]:
elif states.env.weather in {"snow", "blizzard"} and o.schedule["snowy"]:
schedule.append(o)
elif game.weather in {"clear", "cloudy"} and not (o.schedule["cloudy"] or o.schedule["rainy"] or o.schedule["snowy"]):
elif states.env.weather in {"clear", "cloudy"} and not (o.schedule["cloudy"] or o.schedule["rainy"] or o.schedule["snowy"]):
schedule.append(o)
return schedule

View File

@ -81,7 +81,7 @@ label day_start:
# Game flags
states.env.day += 1
game.weather = "random"
states.env.weather = "random"
states.env.daytime = True
cupboard_OBJ.foreground = Transform(Text(str((states.env.day % 30) + 1), color="#fff", outlines=[(1, "#000", 0, 0)]), pos=(40, 100))
@ -193,7 +193,7 @@ label night_start:
states.sus.busy = bool(sb_summon_pause)
# Game flags
game.weather = "random"
states.env.weather = "random"
states.env.daytime = False
# Randomisers

View File

@ -47,7 +47,7 @@ label start_wt:
jump genie_intro_E1
label genie_intro_E1:
$ game.weather = "clear"
$ states.env.weather = "clear"
$ states.env.daytime = False
$ states.env.day = 0
call send_letters
@ -74,7 +74,7 @@ label genie_intro_E1:
dum1 "*Sounds of an old man sleeping like a baby*"
pause 1
play sound "sounds/thunder_2.ogg"
$ game.weather = "storm"
$ states.env.weather = "storm"
call weather_sound
with flashbulb
dum3 "Oh my!"
@ -98,7 +98,7 @@ label genie_intro_E1:
play sound "sounds/magic4.ogg"
$ desk_OBJ.idle = "ch_gen sit_behind_desk"
$ game.weather = "rain"
$ states.env.weather = "rain"
call weather_sound
with flash

View File

@ -2724,7 +2724,7 @@ label ball_ending_E2:
hide screen notes
hide screen bld1
$ game.weather = "random"
$ states.env.weather = "random"
call weather_sound
show screen main_room

View File

@ -136,17 +136,17 @@ label quests:
jump cho_intro_E1
if states.cho.ev.quidditch.hufflepuff_stage == "start":
$ game.weather = "clear"
$ states.env.weather = "clear"
stop weather
$ states.cho.ev.quidditch.hufflepuff_stage = "return"
jump hufflepuff_match
elif states.cho.ev.quidditch.slytherin_stage == "start":
$ game.weather = "clear"
$ states.env.weather = "clear"
stop weather
$ states.cho.ev.quidditch.slytherin_stage = "return"
jump slytherin_match
elif states.cho.ev.quidditch.gryffindor_stage == "start":
$ game.weather = "clear"
$ states.env.weather = "clear"
stop weather
$ states.cho.ev.quidditch.gryffindor_stage = "return"
jump gryffindor_match

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