From cd1bed3ab1b4a496cb75a815297131371d272e3f Mon Sep 17 00:00:00 2001 From: Felix Staud Date: Wed, 17 Jul 2024 08:52:43 -0700 Subject: [PATCH] lost at sea enc.: add outro. add fainted msgs --- .../encounters/lost-at-sea-encounter.ts | 28 ++++++++++--------- .../en/mystery-encounters/lost-at-sea.ts | 13 +++++---- 2 files changed, 23 insertions(+), 18 deletions(-) diff --git a/src/data/mystery-encounters/encounters/lost-at-sea-encounter.ts b/src/data/mystery-encounters/encounters/lost-at-sea-encounter.ts index 9ee35bb6e31..d32d9025346 100644 --- a/src/data/mystery-encounters/encounters/lost-at-sea-encounter.ts +++ b/src/data/mystery-encounters/encounters/lost-at-sea-encounter.ts @@ -12,7 +12,7 @@ const OPTION_2_REQUIRED_MOVE = Moves.FLY; * Can be a number between `0` - `100`. * The higher the more damage taken (100% = instant KO). */ -const DAMAGE_PERCENTAGE: number = 25; // 0 - 100 +const DAMAGE_PERCENTAGE: number = 25; /** The i18n namespace for the encounter */ const namepsace = "mysteryEncounter:lostAtSea"; @@ -47,10 +47,7 @@ export const LostAtSeaEncounter: MysteryEncounter = MysteryEncounterBuilder.with .withDescription(`${namepsace}:description`) .withQuery(`${namepsace}:query`) .withOption( - /** - * Option 1: Use a (non fainted) pokemon that can learn Surf to guide you back. - * Receives EXP similar to defeating a Lapras - */ + // Option 1: Use a (non fainted) pokemon that can learn Surf to guide you back/ new MysteryEncounterOptionBuilder() .withPokemonCanLearnMoveRequirement(OPTION_1_REQUIRED_MOVE) .withOptionMode(EncounterOptionMode.DISABLED_OR_DEFAULT) @@ -69,10 +66,7 @@ export const LostAtSeaEncounter: MysteryEncounter = MysteryEncounterBuilder.with .build() ) .withOption( - /** - * Option 2: Use a (non fainted) pokemon that can learn fly to guide you back. - * Receives EXP similar to defeating a Lapras - */ + //Option 2: Use a (non fainted) pokemon that can learn fly to guide you back. new MysteryEncounterOptionBuilder() .withPokemonCanLearnMoveRequirement(OPTION_2_REQUIRED_MOVE) .withOptionMode(EncounterOptionMode.DISABLED_OR_DEFAULT) @@ -91,9 +85,7 @@ export const LostAtSeaEncounter: MysteryEncounter = MysteryEncounterBuilder.with .build() ) .withSimpleOption( - /** - * Option 3: Wander aimlessly. All pokemons lose {@linkcode DAMAGE_PERCENTAGE}}% of their HP (or KO on 0 HP). - */ + // Option 3: Wander aimlessly { buttonLabel: `${namepsace}:option:3:label`, buttonTooltip: `${namepsace}:option:3:tooltip`, @@ -109,13 +101,23 @@ export const LostAtSeaEncounter: MysteryEncounter = MysteryEncounterBuilder.with allowedPokemon.forEach((pkm) => { const percentage = DAMAGE_PERCENTAGE / 100; const damage = Math.floor(pkm.getMaxHp() * percentage); - return applyDamageToPokemon(pkm, damage); + applyDamageToPokemon(pkm, damage); + if (pkm.isFainted()) { + scene.currentBattle.mysteryEncounter.dialogue.outro.push({ + text: `${pkm.name} fainted!`, + }); + } }); leaveEncounterWithoutBattle(scene); return true; } ) + .withOutroDialogue([ + { + text: `${namepsace}:outro`, + }, + ]) .build(); /** diff --git a/src/locales/en/mystery-encounters/lost-at-sea.ts b/src/locales/en/mystery-encounters/lost-at-sea.ts index 9b156f261ec..35d86e44d04 100644 --- a/src/locales/en/mystery-encounters/lost-at-sea.ts +++ b/src/locales/en/mystery-encounters/lost-at-sea.ts @@ -1,8 +1,7 @@ export const lostAtSea = { intro: "Wandering aimlessly, you effectively get nowhere.", title: "Lost at sea", - description: - "The sea is turbulent in this area and you seem to be running out of fuel as well.\nThis is bad. Is there a way out of the situation?", + description: "The sea is turbulent in this area and you seem to be running out of fuel as well.\nThis is bad. Is there a way out of the situation?", query: "What will you do?", option: { 1: { @@ -10,19 +9,23 @@ export const lostAtSea = { label_disabled: "Can't {{option1RequiredMove}}", tooltip: "{{option1PrimaryName}} saves you.\n{{option1PrimaryName}} gains some EXP.", tooltip_disabled: "You have no Pokémon to {{option1RequiredMove}} on", - selected: "{{option1PrimaryName}} swims ahead, guiding you back on track.\n{{option1PrimaryName}} seems to also have gotten stronger in this time of need.", + selected: + "{{option1PrimaryName}} swims ahead, guiding you back on track.\n{{option1PrimaryName}} seems to also have gotten stronger in this time of need.", }, 2: { label: "{{option2PrimaryName}} can help", label_disabled: "Can't {{option2RequiredMove}}", tooltip: "{{option2PrimaryName}} saves you.\n{{option2PrimaryName}} gains some EXP.", tooltip_disabled: "You have no Pokémon to {{option2RequiredMove}} with", - selected: "{{option2PrimaryName}} flies ahead of your boat, guiding you back on track.\n{{option2PrimaryName}} seems to also have gotten stronger in this time of need.", + selected: + "{{option2PrimaryName}} flies ahead of your boat, guiding you back on track.\n{{option2PrimaryName}} seems to also have gotten stronger in this time of need.", }, 3: { label: "Wander aimlessly", tooltip: "(-) Each of your Pokémon lose {{damagePercentage}}% of their total HP.", - selected: "You float about in the boat, steering it aimlessly until you finally get back on track. You and your Pokémon get very fatigued during the whole ordeal", + selected: `You float about in the boat, steering it aimlessly until you finally get back on track. + $You and your Pokémon get very fatigued during the whole ordeal`, }, }, + outro: "You are back on track." };