Refactor variables - Part 3

This commit is contained in:
LoafyLemon 2023-04-03 01:30:15 +01:00
parent 670e7d82fb
commit be1fecbc11
12 changed files with 68 additions and 71 deletions

View File

@ -0,0 +1,11 @@
# Event flags
default states.twi.ev.cardgame.known = False
default states.twi.ev.cardgame.stage = 0
default states.twi.ev.cardgame.first_random = True
default states.twi.ev.cardgame.delay = 7
default states.twi.ev.cardgame.stocked = False
default states.twi.ev.cardgame.stock_talk = False
default states.twi.ev.cardgame.interest = False
default states.twi.ev.cardgame.profit = 1.0

View File

@ -85,7 +85,7 @@ label summon_hermione:
call wardrobe
jump hermione_requests
"-Let's Duel-" (icon="interface/icons/small/cards.webp") if snape_second_win:
"-Let's Duel-" (icon="interface/icons/small/cards.webp") if states.sna.ev.cardgame.stage > 2:
jump hermione_cardgame_menu
"-Give Item-" (icon="interface/icons/small/gift.webp") if states.her.favors_unlocked:

View File

@ -32,3 +32,6 @@ default states.sna.ev.hangouts.tonks_e2 = False
default states.sna.ev.hangouts.tonks_e3 = False
default states.sna.ev.hangouts.cho_e1 = False
default states.sna.ev.hangouts.cho_e2 = False
default states.sna.ev.cardgame.stage = 0
default states.sna.ev.cardgame.wagers = False
default states.sna.ev.cardgame.known = False

View File

@ -93,8 +93,8 @@ label day_start:
if game.day % 7 == 0:
if states.paperwork_reports >= 1:
letter_work_report.send()
if not first_random_twins:
twins_interest = True
if not states.twi.ev.cardgame.first_random:
states.twi.ev.cardgame.interest = True
# Pass time
mailbox.tick()

View File

@ -120,12 +120,12 @@ label quests:
# CARDGAME - EVENTS
#
if game.day >= twins_cards_delay:
if states.cardgame.unlocked and twins_first_win and not twins_cards_stocked:
if game.day >= states.twi.ev.cardgame.delay:
if states.cardgame.unlocked and states.twi.ev.cardgame.stage >= 1 and not states.twi.ev.cardgame.stocked:
if not game.daytime:
$ letter_cards_store.send()
if geniecard_level < 2 and snape_third_win and states.her.ev.cardgame.stage >= 3 and twins_second_win:
if geniecard_level < 2 and states.sna.ev.cardgame.stage >= 3 and states.her.ev.cardgame.stage >= 3 and states.twi.ev.cardgame.stage >= 2:
if not game.daytime:
$ letter_cards_tier2.send()

View File

@ -116,7 +116,7 @@ default letter_cards_store = Letter(
)
label letter_cards_store:
$ twins_cards_stocked = True
$ states.twi.ev.cardgame.stocked = True
$ poker_outfit_ITEM.unlocked = True
$ lootbox_ITEM.unlocked = True
gen "Great, let's see how they're doing." ("base", xpos="far_left", ypos="head")

View File

@ -431,24 +431,6 @@ default card_item_wine = Card( imagepath="images/cardgame/t1/other/wine_v1.webp"
default enemy_deck = []
default snape_know_cards = False
default snape_first_win = False
default snape_second_win = False
default snape_third_win = False
default snape_wager_talk = False
default random_snape_win = False
default twins_know_cards = False
default twins_first_win = False
default twins_second_win = False
default twins_cards_delay = 7
default twins_cards_stocked = False
default twins_cards_stocked_talk = False
default twins_interest = False
default first_random_twins = True
default twins_random_win = True
default twins_profit = 1.0
default card_rand_realm = renpy.random.choice([card_iris, card_jasmine, card_azalea])
default card_rand_girl = renpy.random.choice([card_her_schoolgirl, card_sus_schoolgirl, card_cho_schoolgirl, card_lun_schoolgirl])
default card_rand_item1 = renpy.random.choice([card_item_desk, card_item_bird])

View File

@ -248,7 +248,7 @@ label deck_builder_guide:
$ deck_guide_page = 5
nar "The player with the most cards of their colour by the end wins the game."
if not snape_know_cards:
if not states.sna.ev.cardgame.known:
gen "(Seems simple enough....)" ("base", xpos="far_left", ypos="head")
gen "(Wait... who the fuck do I play against?)" ("angry", xpos="far_left", ypos="head")
gen "(Maybe I should ask my good ole pal Snape if he has any cards...)" ("grin", xpos="far_left", ypos="head")

View File

@ -34,15 +34,15 @@ label hermione_cardgame_menu:
$ states.her.ev.cardgame.known = True
jump hermione_requests
elif states.her.ev.cardgame.known and twins_know_cards == False:
elif states.her.ev.cardgame.known and states.twi.ev.cardgame.known == False:
gen "(I should talk to Fred and George about wizard cards first.)" ("base", xpos="far_left", ypos="head")
jump hermione_requests
elif states.her.ev.cardgame.known and twins_know_cards and not twins_cards_stocked:
elif states.her.ev.cardgame.known and states.twi.ev.cardgame.known and not states.twi.ev.cardgame.stocked:
gen "(I have to convince Fred and George to start stocking up cards in their shop first.)" ("base", xpos="far_left", ypos="head")
jump hermione_requests
elif twins_cards_stocked_talk and not states.her.ev.cardgame.has_cards:
elif states.twi.ev.cardgame.stock_talk and not states.her.ev.cardgame.has_cards:
gen "Hello again [name_hermione_genie]." ("base", xpos="far_left", ypos="head")
her "Hello [name_genie_hermione]." ("base","base")
gen "I wanted to thank you for mentioning the Weasley shop." ("base", xpos="far_left", ypos="head")

File diff suppressed because it is too large Load Diff

View File

@ -11,7 +11,7 @@ label twins_first_duel:
hide screen blkfade
stop music fadeout 1
if not twins_first_win:
if states.twi.ev.cardgame.stage < 1:
twi "No way!"
ger "You must've been cheating."
gen "It's all in the cards boys." ("base", xpos="far_left", ypos="head")
@ -28,8 +28,8 @@ label twins_first_duel:
fre "So you better get ready for a rematch!"
twi "Because we'll win next time!"
gen "We'll see about that... I can't have students going around showing up to their headmaster can I?" ("base", xpos="far_left", ypos="head")
$ twins_first_win = True
$ twins_cards_delay = twins_cards_delay+game.day
$ states.twi.ev.cardgame.stage = 1
$ states.twi.ev.cardgame.delay = states.twi.ev.cardgame.delay+game.day
pass
else:
twi "Not again.."
@ -43,7 +43,7 @@ label twins_first_duel:
jump main_room
label twins_second_duel:
if twins_cards_stocked == False:
if states.twi.ev.cardgame.stocked == False:
gen "(I need to wait for an owl from them before we can duel again)" ("base", xpos="far_left", ypos="head")
jump twins_duel_menu
@ -75,7 +75,7 @@ label twins_second_duel:
hide screen blkfade
stop music fadeout 1
if not twins_second_win:
if states.twi.ev.cardgame.stage < 2:
fre "I feel like we should have foreseen this."
ger "I blame Trelawney on this, she said that luck would be on our side today..."
fre "Well... A promise is a promise."
@ -85,7 +85,7 @@ label twins_second_duel:
$ card_rand_twins = renpy.random.choice([[card_fred, "fred"], [card_george, "george"]])
$ unlocked_cards += [card_rand_twins[0]]
call give_reward("You have received a special card!", "images/cardgame/t1/special/%s_v1.webp" % str(card_rand_twins[1]))
$ twins_second_win = True
$ states.twi.ev.cardgame.stage = 2
$ tokens += 3
else:
twi "Not again.."
@ -96,8 +96,8 @@ label twins_second_duel:
jump main_room
label twins_random_duel:
if first_random_twins:
$ first_random_twins = False
if states.twi.ev.cardgame.first_random:
$ states.twi.ev.cardgame.first_random = False
gen "How about another game?" ("base", xpos="far_left", ypos="head")
twi "Sure, why not?"
fre "But let's make it a bit interesting."
@ -134,7 +134,7 @@ label twins_random_duel:
gen "Obviously..." ("base", xpos="far_left", ypos="head")
fre "Just making sure that we have all grounds covered."
gen "Let's begin then..." ("base", xpos="far_left", ypos="head")
elif twins_profit == 0.2:
elif states.twi.ev.cardgame.profit == 0.2:
gen "Ready for another wager?" ("base", xpos="far_left", ypos="head")
ger "No, I think we've had quite enough of a dent in our profit margin..."
fre "We're almost half way to where we were before we introduced the card game."
@ -185,7 +185,7 @@ label twins_random_duel:
hide screen blkfade
stop music fadeout 1
if twins_random_win:
if states.twi.ev.cardgame.stage < 3:
twi "Impossible!"
ger "How did you even do that? we weighed these packs for a reason..."
gen "You did what, sorry?" ("base", xpos="far_left", ypos="head")
@ -213,10 +213,10 @@ label twins_random_duel:
ger "We'll think about it..."
call give_reward("You have received 5%% of the twins profits!", "interface/icons/cards.webp")
$ twins_profit += 0.05
$ twins_random_win = False
$ states.twi.ev.cardgame.profit += 0.05
$ states.twi.ev.cardgame.stage = 3
$ tokens += 3
elif twins_profit >= 1.2:
elif states.twi.ev.cardgame.profit >= 1.2:
fre "Nice job but you've reached the cap I'm afraid."
ger "Yeah, don't want to go minus do we?"
$ tokens += 1
@ -225,7 +225,7 @@ label twins_random_duel:
gen "Time to pay up, boys." ("base", xpos="far_left", ypos="head")
ger "Fine... We'll up your profits by 1%%..."
$ tokens += 1
$ twins_profit += 0.01
$ states.twi.ev.cardgame.profit += 0.01
"You return to your office."
jump main_room

View File

@ -40,8 +40,8 @@ label item_store:
gen "What sort of items are you \"not selling\"?" ("base", xpos="far_left", ypos="head")
ger "We have books, treats, and knick-knacks for sale."
fre "Take a look."
elif twins_interest:
$ twins_interest = False
elif states.twi.ev.cardgame.interest:
$ states.twi.ev.cardgame.interest = False
twi "Greetings Dumbledore, sir!"
gen "Hello boys." ("base", xpos="far_left", ypos="head")
@ -56,9 +56,9 @@ label item_store:
$ shop_profit = renpy.random.randint(50+her_help, 300)
ger "Here, your weekly cut."
call give_reward("You've received "+str(int(shop_profit*twins_profit))+" gold.", "interface/icons/gold.webp")
call give_reward("You've received "+str(int(shop_profit*states.twi.ev.cardgame.profit))+" gold.", "interface/icons/gold.webp")
$ game.gold += int(shop_profit*twins_profit)
$ game.gold += int(shop_profit*states.twi.ev.cardgame.profit)
ger "..."
twi "Did you need anything else?"
else:
@ -127,7 +127,7 @@ label item_store:
gen "Right..." ("base", xpos="far_left", ypos="head")
ger "We've put the book in \"Quest Items\" section, can't miss it."
elif states.cardgame.unlocked and states.her.ev.cardgame.known and not twins_know_cards:
elif states.cardgame.unlocked and states.her.ev.cardgame.known and not states.twi.ev.cardgame.known:
gen "Let's see..." ("base", xpos="far_left", ypos="head")
twi "Looking for something in particular, sir?"
gen "I'm looking to acquire some Wizard cards." ("base", xpos="far_left", ypos="head")
@ -145,10 +145,10 @@ label item_store:
gen "So..." ("base", xpos="far_left", ypos="head")
ger "If you beat us we'll do a trial run and stock some cards for the students."
twi "(There's no way this\nold man would ever beat us.)"
$ twins_know_cards = True
$ states.twi.ev.cardgame.known = True
jump twins_duel_menu
elif twins_cards_stocked and not twins_second_win and not twins_cards_stocked_talk:
elif states.twi.ev.cardgame.stocked and states.twi.ev.cardgame.stage < 2 and not states.twi.ev.cardgame.stock_talk:
gen "Well, well... Looking good as always boys!" ("base", xpos="far_left", ypos="head")
twi "..."
gen "In a professional sense that is... Don't you worry." ("base", xpos="far_left", ypos="head")
@ -180,7 +180,7 @@ label item_store:
gen "That's it? Sounds a bit out of character for you guys to make it this easy." ("base", xpos="far_left", ypos="head")
fre "Let's call it an insurance so that we can continue our business."
ger "There's no way you'll beat us again anyway."
$ twins_cards_stocked_talk = True
$ states.twi.ev.cardgame.stock_talk = True
jump twins_duel_menu
elif states.lun.unlocked and not states.lun.ev.spectrespecs.e1_complete:
@ -191,7 +191,7 @@ label item_store:
jump main_room
elif states.lun.ev.quibbler.stocked and not states.lun.ev.spectrespecs.e2_complete:
call spectrespecs_E2
elif twins_know_cards:
elif states.twi.ev.cardgame.known:
twi "Perhaps a game of cards?"
label twins_menu:
menu:
@ -203,9 +203,9 @@ label item_store:
menu:
"-First Duel-":
jump twins_first_duel
"-Challenge-" if twins_first_win:
"-Challenge-" if states.twi.ev.cardgame.stage > 1:
jump twins_second_duel
"-You need to beat the first duel-" (style="disabled") if not twins_first_win:
"-You need to beat the first duel-" (style="disabled") if states.twi.ev.cardgame.stage < 1:
jump twins_duel_menu
"-Never mind-":
twi "Your loss professor."