From 6e93d8628fe3a6a3fdde81d894f5e24e52b4947e Mon Sep 17 00:00:00 2001 From: LoafyLemon Date: Sat, 8 Jul 2023 21:44:35 +0100 Subject: [PATCH] Bug fixes and improvements * Added dev skip for cardgame for testing purposes (I swear!) * Fixed missing achievement triggers for 'Mad Hatter' and 'Poster Boy' * Fixed cardgame twins challenge being inaccessible * Fixed colour picker invoking non-existing image outside wardrobe scope * Disabled cardgame easter egg (broken, requires refactoring) * Improved cardgame hints * Improved cardgame event handling * Fixed grammar --- .../characters/hermione/events/tutoring.rpy | 2 +- game/scripts/characters/twins/vars.rpy | 1 - game/scripts/events/quests.rpy | 5 ----- game/scripts/interface/color_picker.rpy | 3 --- game/scripts/interface/letter.rpy | 3 ++- game/scripts/interface/tutorials.rpy | 2 +- .../minigames/cardgame/_card_game_.rpy | 22 +++++++++++++++++++ .../minigames/cardgame/_deck_builder_.rpy | 14 ++++++------ .../minigames/cardgame/_twins_card_game_.rpy | 3 ++- game/scripts/shops/item/chitchats.rpy | 15 +++++++++++++ game/scripts/shops/item/room.rpy | 8 +++++-- game/scripts/utility/updater.rpy | 9 ++++++++ 12 files changed, 65 insertions(+), 22 deletions(-) diff --git a/game/scripts/characters/hermione/events/tutoring.rpy b/game/scripts/characters/hermione/events/tutoring.rpy index 6947a6ee..2b59f962 100644 --- a/game/scripts/characters/hermione/events/tutoring.rpy +++ b/game/scripts/characters/hermione/events/tutoring.rpy @@ -162,7 +162,7 @@ label hg_tutor_E1: call her_walk("door", "base") - her @ cheeks blush "{size=-4}(I'm glad professor agreed to tutor me!){/size}" ("base", "happyCl", "worried", "mid", xpos="base", ypos="head", flip=False, trans=d3) + her @ cheeks blush "{size=-4}(I'm glad the professor agreed to tutor me!){/size}" ("base", "happyCl", "worried", "mid", xpos="base", ypos="head", flip=False, trans=d3) her "{size=-4}(But pleasure and pain? I don't understand where this is going...){/size}" ("annoyed", "base", "base", "R") her "{size=-4}(And what other students is he tutoring?){/size}" ("annoyed", "base", "worried", "L") diff --git a/game/scripts/characters/twins/vars.rpy b/game/scripts/characters/twins/vars.rpy index 45daa285..4d1b1caf 100644 --- a/game/scripts/characters/twins/vars.rpy +++ b/game/scripts/characters/twins/vars.rpy @@ -4,7 +4,6 @@ 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 diff --git a/game/scripts/events/quests.rpy b/game/scripts/events/quests.rpy index 5f8e063a..44f1123d 100644 --- a/game/scripts/events/quests.rpy +++ b/game/scripts/events/quests.rpy @@ -120,11 +120,6 @@ label quests: # CARDGAME - EVENTS # - 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 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() diff --git a/game/scripts/interface/color_picker.rpy b/game/scripts/interface/color_picker.rpy index 4aa3a681..c75bbfb9 100644 --- a/game/scripts/interface/color_picker.rpy +++ b/game/scripts/interface/color_picker.rpy @@ -36,9 +36,6 @@ screen color_picker(color, alpha, title, pos_xy, color_default): # Set HSVA variables based on RGBA when screen shows on "show" action Function(color_picker_update_hsva) - if not renpy.get_screen("wardrobe"): - add "confirm_fade" - frame: style_prefix gui.theme() if pos_xy and False: diff --git a/game/scripts/interface/letter.rpy b/game/scripts/interface/letter.rpy index dcf3d186..9890c47c 100644 --- a/game/scripts/interface/letter.rpy +++ b/game/scripts/interface/letter.rpy @@ -112,7 +112,8 @@ label letter_cards_unlock: default letter_cards_store = Letter( text = "{size=-7}Weasley's Wizard Wheezes shop emporium is now officially partnering with Wizard cards.\nVisit our shop for the best deals on card packs in all of Hogwarts!{/size}", - label = "letter_cards_store" + label = "letter_cards_store", + wait = 7 ) label letter_cards_store: diff --git a/game/scripts/interface/tutorials.rpy b/game/scripts/interface/tutorials.rpy index 295b0b96..2bf395f3 100644 --- a/game/scripts/interface/tutorials.rpy +++ b/game/scripts/interface/tutorials.rpy @@ -8,7 +8,7 @@ default tutorial_dict = { "points": ["House Points", "House points are awarded to students for excelling in their assignments. You can manipulate the points system directly by awarding points to students for completing their tasks, or by befriending the teachers.\n\nSome characters may care about house points more than others so keep that in mind.", False], "map": ["Navigation", "The map allows you to traverse the castle by clicking on one of the icons. Highlighted areas indicate a new event on that location. You can access the map from within the desk menu.", False], "time": ["Passing Time", "There are many activities you may do at Hogwarts, but occasionally there might not be much to do.\nIf this is the case then you can pass time by clicking on the {color=#204997}{b}pass time button{/b}{/color} located in the top-right corner.\n\n{size=-2}Or you could always rub one out for old time's sake. The choice is yours.{/size}", False], - "mail": ["Mail", "Owls will occasionally bring you letters or parcels. Click on the owl or parcel to interact with it.\n\nUnlike mail pidgeons, owls are tidy creatures and won't shit all over your floors. Theorethically...", False], + "mail": ["Mail", "Owls will occasionally bring you letters or parcels. Click on the owl or parcel to interact with it.\n\nUnlike mail pidgeons, owls are tidy creatures and won't shit all over your floors. Theoretically...", False], "brewing": ["Potions Brewing", "Brewing potions wasn't always an easy task, but thanks to Magic Cauldron incorporated (TM), the entire process became automated. Once you have the required ingredients in your inventory, simply click on the {color=#204997}{b}cauldron{/b}{/color} to make the desired potion.", False], "milestones": ["Relationship milestones", "Every milestone is a chance to level up your bond with your virtual companion, leaving your real love life in the dust. Instead of boring old XP, you'll earn a boatload of (s)ass. Now that's what I call an upgrade! No need to go through any awkward first date chat, just advance to the next level.\n\nChoosing this option will progress their story and unlock more favours and events.\n\nBut beware, once you commit, old favours become inaccessible and are replaced with new ones. You may wish to postpone it until you exhaust all content you wish to see on the current level. So choose wisely, my friend.", False], } diff --git a/game/scripts/minigames/cardgame/_card_game_.rpy b/game/scripts/minigames/cardgame/_card_game_.rpy index 059afade..d21c58b6 100644 --- a/game/scripts/minigames/cardgame/_card_game_.rpy +++ b/game/scripts/minigames/cardgame/_card_game_.rpy @@ -99,6 +99,23 @@ init python: selectenemycard = -1 return "NewTurn" + elif _return == "skip_win": + renpy.show_screen("card_end_message", "You win!") + renpy.sound.play("sounds/card_win.ogg") + renpy.pause(3.0) # Pause before end + renpy.hide_screen("card_end_message") + renpy.hide_screen("card_battle") + renpy.transition(dissolve) + return "win" + + elif _return == "skip_lost": + renpy.show_screen("card_end_message", "You lost...") + renpy.pause(3.0) # Pause before end + renpy.hide_screen("card_end_message") + renpy.hide_screen("card_battle") + renpy.transition(dissolve) + return "lost" + else: if not selectcard == -1: renpy.sound.play("sounds/card.ogg") @@ -248,6 +265,11 @@ screen card_battle(l_playerdeck, l_enemydeck, shown_cards): if not selectenemycard == -1: use cardrender(l_enemydeck[selectenemycard], 860,17+80*selectenemycard, backside= shown_cards[selectenemycard]) + if config.developer: + vbox: + textbutton "Dev skip (win)" action Return("skip_win") + textbutton "Dev skip (lose)" action Return("skip_lost") + use close_button transform cardrender_move(xpos_card, ypos_card, start_xy): diff --git a/game/scripts/minigames/cardgame/_deck_builder_.rpy b/game/scripts/minigames/cardgame/_deck_builder_.rpy index 93adc0bd..79a8101a 100644 --- a/game/scripts/minigames/cardgame/_deck_builder_.rpy +++ b/game/scripts/minigames/cardgame/_deck_builder_.rpy @@ -139,13 +139,13 @@ screen deck_builder_screen(): keysym "game_menu" #Easter egg - hbox: - xpos 1020 - ypos 296 - xsize 40 - ysize 40 - button action Jump("color_change") background "#ffffff00" - #add Solid(get_hex_string(playercolor_rgb)) + # hbox: + # xpos 1020 + # ypos 296 + # xsize 40 + # ysize 40 + # button action Jump("color_change") background "#ffffff00" + # #add Solid(get_hex_string(playercolor_rgb)) screen deck_builder_gallery(): zorder 8 diff --git a/game/scripts/minigames/cardgame/_twins_card_game_.rpy b/game/scripts/minigames/cardgame/_twins_card_game_.rpy index 9de51189..c441f87b 100644 --- a/game/scripts/minigames/cardgame/_twins_card_game_.rpy +++ b/game/scripts/minigames/cardgame/_twins_card_game_.rpy @@ -28,8 +28,9 @@ 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") + $ states.twi.ev.cardgame.stage = 1 - $ states.twi.ev.cardgame.delay = states.twi.ev.cardgame.delay+game.day + $ letter_cards_store.send() pass else: twi "Not again..." diff --git a/game/scripts/shops/item/chitchats.rpy b/game/scripts/shops/item/chitchats.rpy index 3ce54a8c..c16251c9 100644 --- a/game/scripts/shops/item/chitchats.rpy +++ b/game/scripts/shops/item/chitchats.rpy @@ -90,4 +90,19 @@ label purchase_item(item): $ game.gold -= item.price $ item.owned += 1 + $ item_store_achievements() + return + +init python: + def item_store_achievements(): + # We require a function because lambdas aren't pickleable + if isinstance(item, Decoration): + _posters = filter(lambda x: (x.type == "decoration" and x.placement == poster_OBJ), inventory.items) + _hats = filter(lambda x: (x.type == "decoration" and "hat" in x.name.lower()), inventory.items) + + if all(i.owned > 0 for i in _posters): + achievements.unlock("postman") + + if all(i.owned > 0 for i in _hats): + achievements.unlock("hats") \ No newline at end of file diff --git a/game/scripts/shops/item/room.rpy b/game/scripts/shops/item/room.rpy index f1713fe8..9654e4dc 100644 --- a/game/scripts/shops/item/room.rpy +++ b/game/scripts/shops/item/room.rpy @@ -203,9 +203,13 @@ label item_store: menu: "-First Duel-": jump twins_first_duel - "-Challenge-" if states.twi.ev.cardgame.stage > 1: + "-Challenge-" if states.twi.ev.cardgame.stock_talk: jump twins_second_duel - "-You need to beat the first duel-" (style="disabled") if states.twi.ev.cardgame.stage < 1: + "-You need to beat the first duel-" (style="disabled") if not states.twi.ev.cardgame.stock_talk: + if states.twi.ev.cardgame.stage < 1: + gen "(I should beat them at their own game at least once before I try this again...)" + elif not states.twi.ev.cardgame.stock_talk: + gen "(I need to wait for a letter from them before we can continue...)" jump twins_duel_menu "-Never mind-": twi "Your loss professor." diff --git a/game/scripts/utility/updater.rpy b/game/scripts/utility/updater.rpy index ec394a9f..1c8b915b 100644 --- a/game/scripts/utility/updater.rpy +++ b/game/scripts/utility/updater.rpy @@ -113,6 +113,15 @@ init python: j.group = objects j.is_stale() + # Fix cardgame events + delattr(states.twi.ev.cardgame, "delay") + + if states.twi.ev.cardgame.stage == 1 and not states.twi.ev.cardgame.stock_talk and not letter_cards_store in mailbox.letters: + # In case the player already started the event chain, send the letter early. + letter_cards_store.send() + + getattr(store, "letter_cards_store").wait = 7 + if current > latest: raise Exception("Loaded save file is incompatible. (Save Version: {}, Game Version: {})".format(current, latest))