From a1d1de2c0dae60ba25292685642833a815fe9e4c Mon Sep 17 00:00:00 2001 From: ImperialSympathizer Date: Tue, 24 Sep 2024 13:41:00 -0400 Subject: [PATCH] more ME dialogue cleanup --- .../an-offer-you-cant-refuse-encounter.ts | 13 +++++++++---- .../encounters/department-store-sale-encounter.ts | 2 +- .../encounters/safari-zone-encounter.ts | 8 +++++++- .../dancing-lessons-dialogue.json | 2 +- .../en/mystery-encounters/safari-zone-dialogue.json | 2 +- .../the-expert-pokemon-breeder-dialogue.json | 2 +- .../the-strong-stuff-dialogue.json | 2 +- .../the-winstrate-challenge-dialogue.json | 4 ++-- .../department-store-sale-encounter.test.ts | 2 +- 9 files changed, 24 insertions(+), 13 deletions(-) diff --git a/src/data/mystery-encounters/encounters/an-offer-you-cant-refuse-encounter.ts b/src/data/mystery-encounters/encounters/an-offer-you-cant-refuse-encounter.ts index 013feb6e5a4..919cd1df5ca 100644 --- a/src/data/mystery-encounters/encounters/an-offer-you-cant-refuse-encounter.ts +++ b/src/data/mystery-encounters/encounters/an-offer-you-cant-refuse-encounter.ts @@ -17,6 +17,14 @@ import { CLASSIC_MODE_MYSTERY_ENCOUNTER_WAVES } from "#app/game-mode"; /** the i18n namespace for this encounter */ const namespace = "mysteryEncounter:offerYouCantRefuse"; +/** + * Money offered starts at base value of Relic Gold, increasing linearly up to 3x Relic Gold based on the starter tier of the Pokemon being purchased + * Starter value 1-3 -> Relic Gold + * Starter value 10 -> 3 * Relic Gold + */ +const MONEY_MINIMUM_MULTIPLIER = 10; +const MONEY_MAXIMUM_MULTIPLIER = 30; + /** * An Offer You Can't Refuse encounter. * @see {@link https://github.com/pagefaultgames/pokerogue/issues/3808 | GitHub Issue #3808} @@ -62,12 +70,9 @@ export const AnOfferYouCantRefuseEncounter: MysteryEncounter = const encounter = scene.currentBattle.mysteryEncounter!; const pokemon = getHighestStatTotalPlayerPokemon(scene, true, true); - // Base value of Relic Gold, increased linearly up to 3x Relic Gold based on the starter tier of the Pokemon being purchased - // Starter value 1-3 -> 10x - // Starter value 10 -> 30x const baseSpecies = pokemon.getSpeciesForm().getRootSpeciesId(true); const starterValue: number = speciesStarters[baseSpecies] ?? 1; - const multiplier = Math.max(3 * starterValue, 10); + const multiplier = Math.max(MONEY_MAXIMUM_MULTIPLIER / 10 * starterValue, MONEY_MINIMUM_MULTIPLIER); const price = scene.getWaveMoneyAmount(multiplier); encounter.setDialogueToken("strongestPokemon", pokemon.getNameToRender()); diff --git a/src/data/mystery-encounters/encounters/department-store-sale-encounter.ts b/src/data/mystery-encounters/encounters/department-store-sale-encounter.ts index 88101752eda..52890f0ffed 100644 --- a/src/data/mystery-encounters/encounters/department-store-sale-encounter.ts +++ b/src/data/mystery-encounters/encounters/department-store-sale-encounter.ts @@ -63,7 +63,7 @@ export const DepartmentStoreSaleEncounter: MysteryEncounter = // Choose TMs const modifiers: ModifierTypeFunc[] = []; let i = 0; - while (i < 6) { + while (i < 5) { // 2/2/1 weight on TM rarity const roll = randSeedInt(5); if (roll < 2) { diff --git a/src/data/mystery-encounters/encounters/safari-zone-encounter.ts b/src/data/mystery-encounters/encounters/safari-zone-encounter.ts index 97aedc4f826..8b8fc5f73be 100644 --- a/src/data/mystery-encounters/encounters/safari-zone-encounter.ts +++ b/src/data/mystery-encounters/encounters/safari-zone-encounter.ts @@ -27,6 +27,8 @@ const TRAINER_THROW_ANIMATION_TIMES = [512, 184, 768]; const SAFARI_MONEY_MULTIPLIER = 2; +const NUM_SAFARI_ENCOUNTERS = 3; + /** * Safari Zone encounter. * @see {@link https://github.com/pagefaultgames/pokerogue/issues/3800 | GitHub Issue #3800} @@ -55,6 +57,10 @@ export const SafariZoneEncounter: MysteryEncounter = .withTitle(`${namespace}.title`) .withDescription(`${namespace}.description`) .withQuery(`${namespace}.query`) + .withOnInit((scene: BattleScene) => { + scene.currentBattle.mysteryEncounter?.setDialogueToken("numEncounters", NUM_SAFARI_ENCOUNTERS.toString()); + return true; + }) .withOption(MysteryEncounterOptionBuilder .newOptionWithMode(MysteryEncounterOptionMode.DISABLED_OR_DEFAULT) .withSceneRequirement(new MoneyRequirement(0, SAFARI_MONEY_MULTIPLIER)) // Cost equal to 1 Max Revive @@ -72,7 +78,7 @@ export const SafariZoneEncounter: MysteryEncounter = const encounter = scene.currentBattle.mysteryEncounter!; encounter.continuousEncounter = true; encounter.misc = { - safariPokemonRemaining: 3 + safariPokemonRemaining: NUM_SAFARI_ENCOUNTERS }; updatePlayerMoney(scene, -(encounter.options[0].requirements[0] as MoneyRequirement).requiredMoney); // Load bait/mud assets diff --git a/src/locales/en/mystery-encounters/dancing-lessons-dialogue.json b/src/locales/en/mystery-encounters/dancing-lessons-dialogue.json index 065c4e0c06c..20b01708be0 100644 --- a/src/locales/en/mystery-encounters/dancing-lessons-dialogue.json +++ b/src/locales/en/mystery-encounters/dancing-lessons-dialogue.json @@ -1,7 +1,7 @@ { "intro": "An {{oricorioName}} dances sadly alone, without a partner.", "title": "Dancing Lessons", - "description": "The {{oricorioName}} doesn't seem aggressive, if anything it seems sad.\n\nMaybe it just wants someone to dance with...", + "description": "The {{oricorioName}} doesn't seem aggressive, if anything it seems despondent.\n\nPerhaps it just wants someone to dance with...", "query": "What will you do?", "option": { "1": { diff --git a/src/locales/en/mystery-encounters/safari-zone-dialogue.json b/src/locales/en/mystery-encounters/safari-zone-dialogue.json index 8869f2055e5..b96e3b5beb8 100644 --- a/src/locales/en/mystery-encounters/safari-zone-dialogue.json +++ b/src/locales/en/mystery-encounters/safari-zone-dialogue.json @@ -1,7 +1,7 @@ { "intro": "It's a safari zone!", "title": "The Safari Zone", - "description": "There are all kinds of rare and special Pokémon that can be found here!\nIf you choose to enter, you'll have a time limit of 3 wild encounters where you can try to catch these special Pokémon.\n\nBeware, though. These Pokémon may flee before you're able to catch them!", + "description": "There are all kinds of rare and special Pokémon that can be found here!\nIf you choose to enter, you'll have a time limit of @[TOOLTIP_TITLE]{{{numEncounters}} wild encounters} where you can try to catch these special Pokémon.\n\nBeware, though. These Pokémon may flee before you're able to catch them!", "query": "Would you like to enter?", "option": { "1": { diff --git a/src/locales/en/mystery-encounters/the-expert-pokemon-breeder-dialogue.json b/src/locales/en/mystery-encounters/the-expert-pokemon-breeder-dialogue.json index 3c74c7b2726..5f1eece528b 100644 --- a/src/locales/en/mystery-encounters/the-expert-pokemon-breeder-dialogue.json +++ b/src/locales/en/mystery-encounters/the-expert-pokemon-breeder-dialogue.json @@ -25,7 +25,7 @@ "outro": "Look how happy your {{chosenPokemon}} is now!$Here, you can have these as well.", "outro_failed": "How disappointing...$It looks like you still have a long way\nto go to earn your Pokémon's trust!", "gained_eggs": "@s{item_fanfare}You received {{numEggs}}!", - "eggs_tooltip": "\n(+) Earn {{eggs}}", + "eggs_tooltip": "\n(+) Earn @[TOOLTIP_TITLE]{{{eggs}}}", "numEggs_one": "{{count}} {{rarity}} Egg", "numEggs_other": "{{count}} {{rarity}} Eggs" } \ No newline at end of file diff --git a/src/locales/en/mystery-encounters/the-strong-stuff-dialogue.json b/src/locales/en/mystery-encounters/the-strong-stuff-dialogue.json index b5403616c9b..ec557eb8cea 100644 --- a/src/locales/en/mystery-encounters/the-strong-stuff-dialogue.json +++ b/src/locales/en/mystery-encounters/the-strong-stuff-dialogue.json @@ -1,7 +1,7 @@ { "intro": "It's a massive {{shuckleName}} and what appears\nto be a large stash of... juice?", "title": "The Strong Stuff", - "description": "The {{shuckleName}} that blocks your path looks incredibly strong. Meanwhile, the juice next to it is emanating power of some kind.\n\nThe {{shuckleName}} extends its feelers in your direction. It seems like it wants to do something...", + "description": "The {{shuckleName}} that blocks your path looks formidable. Meanwhile, the juice next to it emanates power of some kind.\n\nThe {{shuckleName}} extends its feelers in your direction. It seems like it wants to do something...", "query": "What will you do?", "option": { "1": { diff --git a/src/locales/en/mystery-encounters/the-winstrate-challenge-dialogue.json b/src/locales/en/mystery-encounters/the-winstrate-challenge-dialogue.json index 37807a91667..e2963b98d61 100644 --- a/src/locales/en/mystery-encounters/the-winstrate-challenge-dialogue.json +++ b/src/locales/en/mystery-encounters/the-winstrate-challenge-dialogue.json @@ -3,12 +3,12 @@ "speaker": "The Winstrates", "intro_dialogue": "We're the Winstrates!$What do you say to taking on our family in a series of Pokémon battles?", "title": "The Winstrate Challenge", - "description": "The Winstrates are a family of 5 trainers, and they want to battle! If you beat all of them back-to-back, they'll give you a grand prize. But can you handle the heat?", + "description": "The Winstrates are a family of @[TOOLTIP_TITLE]{5 trainers}, and they want to battle! If you beat all of them back-to-back, they'll give you a grand prize. But can you handle the heat?", "query": "What will you do?", "option": { "1": { "label": "Accept the Challenge", - "tooltip": "(-) Brutal Battle\n(+) Special Item Reward", + "tooltip": "(-) Brutal Battle Against 5 Trainers\n(+) Special Item Reward", "selected": "Let the challenge begin!" }, "2": { diff --git a/src/test/mystery-encounter/encounters/department-store-sale-encounter.test.ts b/src/test/mystery-encounter/encounters/department-store-sale-encounter.test.ts index 0b2d66db20b..f91e1a5a13c 100644 --- a/src/test/mystery-encounter/encounters/department-store-sale-encounter.test.ts +++ b/src/test/mystery-encounter/encounters/department-store-sale-encounter.test.ts @@ -98,7 +98,7 @@ describe("Department Store Sale - Mystery Encounter", () => { expect(scene.ui.getMode()).to.equal(Mode.MODIFIER_SELECT); const modifierSelectHandler = scene.ui.handlers.find(h => h instanceof ModifierSelectUiHandler) as ModifierSelectUiHandler; - expect(modifierSelectHandler.options.length).toEqual(4); + expect(modifierSelectHandler.options.length).toEqual(5); for (const option of modifierSelectHandler.options) { expect(option.modifierTypeOption.type.id).toContain("TM_"); }