From 7b55811b84ae294a226d4119cab70a5af79b11c0 Mon Sep 17 00:00:00 2001 From: Felix Staud Date: Fri, 12 Jul 2024 14:55:52 -0700 Subject: [PATCH] apply surf & fly condition (not water & flying) --- .../encounters/lost-at-sea-encounter.ts | 17 +++++++++---- .../en/mystery-encounters/lost-at-sea.ts | 24 +++++++++---------- 2 files changed, 24 insertions(+), 17 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 f3af2e79c0e..e3e3ff5bc16 100644 --- a/src/data/mystery-encounters/encounters/lost-at-sea-encounter.ts +++ b/src/data/mystery-encounters/encounters/lost-at-sea-encounter.ts @@ -1,4 +1,3 @@ -import { Type } from "#app/data/type.js"; import { Moves } from "#app/enums/moves.js"; import { Species } from "#app/enums/species.js"; import { PlayerPokemon } from "#app/field/pokemon.js"; @@ -8,6 +7,8 @@ import MysteryEncounter, { MysteryEncounterBuilder, MysteryEncounterTier } from import { EncounterOptionMode, MysteryEncounterOptionBuilder } from "../mystery-encounter-option"; import { applyDamageToPokemon, leaveEncounterWithoutBattle, setEncounterExp } from "../mystery-encounter-utils"; +const OPTION_1_REQUIRED_MOVE = Moves.SURF; +const OPTION_2_REQUIRED_MOVE = Moves.FLY; /** * Damage percentage taken when wandering aimlessly. * Can be a number between `0` - `100`. @@ -46,6 +47,8 @@ export const LostAtSeaEncounter: MysteryEncounter = MysteryEncounterBuilder.with const { mysteryEncounter } = scene.currentBattle; mysteryEncounter.setDialogueToken("damagePercentage", String(DAMAGE_PERCENTAGE)); + mysteryEncounter.setDialogueToken("option1RequiredMove", Moves[OPTION_1_REQUIRED_MOVE]); + mysteryEncounter.setDialogueToken("option2RequiredMove", Moves[OPTION_2_REQUIRED_MOVE]); // check for water pokemon // surfablePkm = findPokemonThatCanLearnMove(allowedPokemon, Type.WATER); @@ -62,15 +65,17 @@ export const LostAtSeaEncounter: MysteryEncounter = MysteryEncounterBuilder.with .withQuery(`${namepsace}:query`) .withOption( /** - * Option 1: Use a (non fainted) water pokemon to guide you back. + * Option 1: Use a (non fainted) pokemon that can learn Surf to guide you back. * Receives EXP similar to defeating a Lapras */ new MysteryEncounterOptionBuilder() - .withPokemonCanLearnMoveRequirement(Moves.SURF) + .withPokemonCanLearnMoveRequirement(OPTION_1_REQUIRED_MOVE) .withOptionMode(EncounterOptionMode.DISABLED_OR_DEFAULT) .withDialogue({ buttonLabel: `${namepsace}:option:1:label`, + disabledButtonLabel: `${namepsace}:option:1:label_disabled`, buttonTooltip: `${namepsace}:option:1:tooltip`, + disabledButtonTooltip: `${namepsace}:option:1:tooltip_disabled`, selected: [ { text: `${namepsace}:option:1:selected`, @@ -82,15 +87,17 @@ export const LostAtSeaEncounter: MysteryEncounter = MysteryEncounterBuilder.with ) .withOption( /** - * Option 2: Use a (non fainted) flying pokemon to guide you back. + * Option 2: Use a (non fainted) pokemon that can learn fly to guide you back. * Receives EXP similar to defeating a Lapras */ new MysteryEncounterOptionBuilder() - .withPokemonTypeRequirement(Type.FLYING, true, 1) + .withPokemonCanLearnMoveRequirement(OPTION_2_REQUIRED_MOVE) .withOptionMode(EncounterOptionMode.DISABLED_OR_DEFAULT) .withDialogue({ buttonLabel: `${namepsace}:option:2:label`, + disabledButtonLabel: `${namepsace}:option:2:label_disabled`, buttonTooltip: `${namepsace}:option:2:tooltip`, + disabledButtonTooltip: `${namepsace}:option:2:tooltip_disabled`, selected: [ { text: `${namepsace}:option:2:selected`, diff --git a/src/locales/en/mystery-encounters/lost-at-sea.ts b/src/locales/en/mystery-encounters/lost-at-sea.ts index f3485c723af..d5413a48ffc 100644 --- a/src/locales/en/mystery-encounters/lost-at-sea.ts +++ b/src/locales/en/mystery-encounters/lost-at-sea.ts @@ -6,23 +6,23 @@ export const lostAtSea = { query: "What will you do?", option: { 1: { - label: "Use {{pokemonCanLearnMove}}", // pkm has to be of type water - tooltip: - "Use {{pokemonCanLearnMove}} to guide you back. {{pokemonCanLearnMove}} earns EXP as if having defeated a Lapras.", - selected: "{{pokemonCanLearnMove}} guides you back and earns EXP.", + label: "Use {{option1PrimaryName}}", + label_disabled: "Can't {{option1RequiredMove}}", + tooltip: "Use {{option1PrimaryName}} to guide you back. {{option1PrimaryName}} earns EXP as if having defeated a Lapras.", + tooltip_disabled: "You have no Pokémon that could learn {{option1RequiredMove}}", + selected: "{{option1PrimaryName}} guides you back and earns EXP.", }, 2: { - label: "Use {{flyingPkm}}", // pkm has to be of type flying - tooltip: - "Use {{flyingPkm}} to guide you back. {{flyingPkm}} earns EXP as if having defeated a Lapras.", - selected: "{{flyingPkm}} guides you back and earns EXP.", + label: "Use {{option2PrimaryName}}", + label_disabled: "Can't {{option2RequiredMove}}", + tooltip: "Use {{option2PrimaryName}} to guide you back. {{option2PrimaryName}} earns EXP as if having defeated a Lapras.", + tooltip_disabled: "You have no Pokémon that could learn {{option2RequiredMove}}", + selected: "{{option2PrimaryName}} guides you back and earns EXP.", }, 3: { label: "Wander aimlessly", - tooltip: - "Wander aimlessly until you're back. All your Pokémon lose {{damagePercentage}}% of their HP. Any below that are KO'd.", - selected: - "You wander aimlessly around. After hours of wandering, you find your way back. You and your team take the toll.", + tooltip: "Wander aimlessly until you're back. All your Pokémon lose {{damagePercentage}}% of their HP. Any below that are KO'd.", + selected: "You wander aimlessly around. After hours of wandering, you find your way back. You and your team take the toll.", }, }, };