From f128b47db5dcd279ce76143c6c2d008f5f9fa04e Mon Sep 17 00:00:00 2001 From: ImperialSympathizer Date: Thu, 11 Jul 2024 14:37:29 -0400 Subject: [PATCH] update encounter biome mapping and option coloring/disablement with requirements --- .../mystery-encounters/mad_scientist_m.json | 10 +- .../mystery-encounters/mad_scientist_m.png | Bin 13992 -> 920 bytes public/images/mystery-encounters/teacher.json | 2 +- src/battle-scene.ts | 2 +- .../encounters/fight-or-flight.ts | 96 ++++---- .../encounters/sleeping-snorlax.ts | 4 +- .../mystery-encounters/mystery-encounters.ts | 218 ++++++++++++++---- .../requirements/requirement-groups.ts | 42 ++++ src/locales/en/mystery-encounter.ts | 4 +- src/ui/mystery-encounter-ui-handler.ts | 10 +- 10 files changed, 276 insertions(+), 112 deletions(-) create mode 100644 src/data/mystery-encounters/requirements/requirement-groups.ts diff --git a/public/images/mystery-encounters/mad_scientist_m.json b/public/images/mystery-encounters/mad_scientist_m.json index 0cb3f904cb0..10aa3d6f42a 100644 --- a/public/images/mystery-encounters/mad_scientist_m.json +++ b/public/images/mystery-encounters/mad_scientist_m.json @@ -4,8 +4,8 @@ "image": "mad_scientist_m.png", "format": "RGBA8888", "size": { - "w": 44, - "h": 74 + "w": 46, + "h": 76 }, "scale": 1, "frames": [ @@ -24,8 +24,8 @@ "h": 74 }, "frame": { - "x": 0, - "y": 0, + "x": 1, + "y": 1, "w": 44, "h": 74 } @@ -36,6 +36,6 @@ "meta": { "app": "https://www.codeandweb.com/texturepacker", "version": "3.0", - "smartupdate": "$TexturePacker:SmartUpdate:895f0a79b89fa0fb44167f4584fd9a22:357b46953b7e17c6b2f43a62d52855d8:cc1ed0e4f90aaa9dcf1b39a0af1283b0$" + "smartupdate": "$TexturePacker:SmartUpdate:a7f8ff2bbb362868f51125c254eb6681:cf76e61ddd31a8f46af67ced168c44a2:4fc09abe16c0608828269e5da81d0744$" } } diff --git a/public/images/mystery-encounters/mad_scientist_m.png b/public/images/mystery-encounters/mad_scientist_m.png index 84349b46c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bLMMg zKw|Ewm7$FRE*lT&4UpVxosm{>qG`Z_P?}+PwkpqZ*2Nkpqt%oYh)F?AngK39>%sTG z0H)NcoMs((hV7ay&{H~YtpHZk(WC@j27VnKZ*2mswm74n$uTwop|n=Ry2->*Q76ov zcIH#Va$KXzTObO~UqNp`D%t};4~gCOt=S+6mM!_k*UfNng~H4Rp;Gs@hewXRl| z0V@|&)^Us05)q$yT)T-Zrga_7NP@9RAq7)v;j^|hwd~Ltmtf`d!HsEn)&D>EezzbK zO0A5YrJc6eXtlQN2m&ANwvnl;5B7Ieuefd#x}FPYjLL#2AG8uUrB(rSYg5zD8LKRK z2&L*F&i~@WlvH0fvRX&Y@r5>AXWY z`cj)=BaPC=Q*~8CAVKE$8Tk2zm}|NCH{PwE5U`R$S(ETHGF)&a9q)f 0) { - // Use first valid pokemon to execute the theivery - const pokemon = validPokemon[0]; - encounter.setDialogueToken("thiefPokemon", pokemon.name); - encounter.setDialogueToken(...moveRequirement.getDialogueToken(scene, pokemon)); + encounter.options[1].meetsRequirements(scene); + const primaryPokemon = encounter.options[1].primaryPokemon; + if (primaryPokemon) { + // Use primaryPokemon to execute the thievery encounter.dialogue.encounterOptionsDialogue.options[1].buttonTooltip = "mysteryEncounter:fight_or_flight_option_2_steal_tooltip"; encounter.dialogue.encounterOptionsDialogue.options[1].style = TextStyle.SUMMARY_GREEN; } else { @@ -104,44 +92,44 @@ export const FightOrFlightEncounter: MysteryEncounter = MysteryEncounterBuilder setEncounterRewards(scene, { guaranteedModifierTypeOptions: [item], fillRemaining: false }); await initBattleWithEnemyConfig(scene, scene.currentBattle.mysteryEncounter.enemyPartyConfigs[0]); }) - .withOptionPhase(async (scene: BattleScene) => { - // Pick steal - const encounter = scene.currentBattle.mysteryEncounter; - const item = scene.currentBattle.mysteryEncounter.misc as ModifierTypeOption; - setEncounterRewards(scene, { guaranteedModifierTypeOptions: [item], fillRemaining: false }); + .withOption(new MysteryEncounterOptionBuilder() + .withPrimaryPokemonRequirement(new MoveRequirement(STEALING_MOVES)) // Will set option2PrimaryName and option2PrimaryMove dialogue tokens automatically + .withDisabledOnRequirementsNotMet(false) + .withOptionPhase(async (scene: BattleScene) => { + // Pick steal + const encounter = scene.currentBattle.mysteryEncounter; + const item = scene.currentBattle.mysteryEncounter.misc as ModifierTypeOption; + setEncounterRewards(scene, { guaranteedModifierTypeOptions: [item], fillRemaining: false }); - // If player has a stealing move, they succeed automatically - const moveRequirement = new MoveRequirement(validMovesForSteal); - const validPokemon = moveRequirement.queryParty(scene.getParty()); - if (validPokemon?.length > 0) { - // Use first valid pokemon to execute the theivery - const pokemon = validPokemon[0]; - encounter.setDialogueToken("thiefPokemon", pokemon.name); - encounter.setDialogueToken(...moveRequirement.getDialogueToken(scene, pokemon)); - await showEncounterText(scene, "mysteryEncounter:fight_or_flight_option_2_steal_result"); - leaveEncounterWithoutBattle(scene); - return; - } + // If player has a stealing move, they succeed automatically + const primaryPokemon = encounter.options[1].primaryPokemon; + if (primaryPokemon) { + // Use primaryPokemon to execute the thievery + await showEncounterText(scene, "mysteryEncounter:fight_or_flight_option_2_steal_result"); + leaveEncounterWithoutBattle(scene); + return; + } - const roll = randSeedInt(16); - if (roll > 6) { - // Noticed and attacked by boss, gets +1 to all stats at start of fight (62.5%) - const config = scene.currentBattle.mysteryEncounter.enemyPartyConfigs[0]; - config.pokemonConfigs[0].tags = [BattlerTagType.MYSTERY_ENCOUNTER_POST_SUMMON]; - config.pokemonConfigs[0].mysteryEncounterBattleEffects = (pokemon: Pokemon) => { - pokemon.scene.currentBattle.mysteryEncounter.setDialogueToken("enemyPokemon", pokemon.name); - queueEncounterMessage(pokemon.scene, "mysteryEncounter:fight_or_flight_boss_enraged"); - pokemon.scene.unshiftPhase(new StatChangePhase(pokemon.scene, pokemon.getBattlerIndex(), true, [BattleStat.ATK, BattleStat.DEF, BattleStat.SPATK, BattleStat.SPDEF, BattleStat.SPD], 1)); - }; - await showEncounterText(scene, "mysteryEncounter:fight_or_flight_option_2_bad_result"); - await initBattleWithEnemyConfig(scene, config); - } else { - // Steal item (37.5%) - // Display result message then proceed to rewards - await showEncounterText(scene, "mysteryEncounter:fight_or_flight_option_2_good_result"); - leaveEncounterWithoutBattle(scene); - } - }) + const roll = randSeedInt(16); + if (roll > 6) { + // Noticed and attacked by boss, gets +1 to all stats at start of fight (62.5%) + const config = scene.currentBattle.mysteryEncounter.enemyPartyConfigs[0]; + config.pokemonConfigs[0].tags = [BattlerTagType.MYSTERY_ENCOUNTER_POST_SUMMON]; + config.pokemonConfigs[0].mysteryEncounterBattleEffects = (pokemon: Pokemon) => { + pokemon.scene.currentBattle.mysteryEncounter.setDialogueToken("enemyPokemon", pokemon.name); + queueEncounterMessage(pokemon.scene, "mysteryEncounter:fight_or_flight_boss_enraged"); + pokemon.scene.unshiftPhase(new StatChangePhase(pokemon.scene, pokemon.getBattlerIndex(), true, [BattleStat.ATK, BattleStat.DEF, BattleStat.SPATK, BattleStat.SPDEF, BattleStat.SPD], 1)); + }; + await showEncounterText(scene, "mysteryEncounter:fight_or_flight_option_2_bad_result"); + await initBattleWithEnemyConfig(scene, config); + } else { + // Steal item (37.5%) + // Display result message then proceed to rewards + await showEncounterText(scene, "mysteryEncounter:fight_or_flight_option_2_good_result"); + leaveEncounterWithoutBattle(scene); + } + }) + .build()) .withOptionPhase(async (scene: BattleScene) => { // Leave encounter with no rewards or exp leaveEncounterWithoutBattle(scene, true); diff --git a/src/data/mystery-encounters/encounters/sleeping-snorlax.ts b/src/data/mystery-encounters/encounters/sleeping-snorlax.ts index cb2029272ef..444ce5a6581 100644 --- a/src/data/mystery-encounters/encounters/sleeping-snorlax.ts +++ b/src/data/mystery-encounters/encounters/sleeping-snorlax.ts @@ -2,7 +2,6 @@ import { modifierTypes } from "#app/modifier/modifier-type"; import { BerryType } from "#enums/berry-type"; -import { Moves } from "#enums/moves"; import { MysteryEncounterType } from "#enums/mystery-encounter-type"; import { Species } from "#enums/species"; import BattleScene from "../../../battle-scene"; @@ -19,6 +18,7 @@ import { leaveEncounterWithoutBattle, queueEncounterMessage, setEncounterExp, setEncounterRewards } from "../mystery-encounter-utils"; +import { STEALING_MOVES } from "#app/data/mystery-encounters/requirements/requirement-groups"; export const SleepingSnorlaxEncounter: MysteryEncounter = MysteryEncounterBuilder .withEncounterType(MysteryEncounterType.SLEEPING_SNORLAX) @@ -98,7 +98,7 @@ export const SleepingSnorlaxEncounter: MysteryEncounter = MysteryEncounterBuilde } }) .withOption(new MysteryEncounterOptionBuilder() - .withPrimaryPokemonRequirement(new MoveRequirement([Moves.PLUCK, Moves.COVET, Moves.KNOCK_OFF, Moves.THIEF, Moves.TRICK, Moves.SWITCHEROO])) + .withPrimaryPokemonRequirement(new MoveRequirement(STEALING_MOVES)) .withOptionPhase(async (scene: BattleScene) => { // Steal the Snorlax's Leftovers const instance = scene.currentBattle.mysteryEncounter; diff --git a/src/data/mystery-encounters/mystery-encounters.ts b/src/data/mystery-encounters/mystery-encounters.ts index a1f8a73192e..0244281be26 100644 --- a/src/data/mystery-encounters/mystery-encounters.ts +++ b/src/data/mystery-encounters/mystery-encounters.ts @@ -16,36 +16,148 @@ export const BASE_MYSTERY_ENCOUNTER_SPAWN_WEIGHT = 1; export const WIGHT_INCREMENT_ON_SPAWN_MISS = 5; export const AVERAGE_ENCOUNTERS_PER_RUN_TARGET = 15; +export const EXTREME_ENCOUNTER_BIOMES = [ + Biome.SEA, + Biome.SEABED, + Biome.BADLANDS, + Biome.DESERT, + Biome.ICE_CAVE, + Biome.VOLCANO, + Biome.WASTELAND, + Biome.ABYSS, + Biome.SPACE, + Biome.END +]; + +export const NON_EXTREME_ENCOUNTER_BIOMES = [ + Biome.TOWN, + Biome.PLAINS, + Biome.GRASS, + Biome.TALL_GRASS, + Biome.METROPOLIS, + Biome.FOREST, + Biome.SWAMP, + Biome.BEACH, + Biome.LAKE, + Biome.MOUNTAIN, + Biome.CAVE, + Biome.MEADOW, + Biome.POWER_PLANT, + Biome.GRAVEYARD, + Biome.DOJO, + Biome.FACTORY, + Biome.RUINS, + Biome.CONSTRUCTION_SITE, + Biome.JUNGLE, + Biome.FAIRY_CAVE, + Biome.TEMPLE, + Biome.SLUM, + Biome.SNOWY_FOREST, + Biome.ISLAND, + Biome.LABORATORY +]; + +/** + * Places where you could very reasonably expect to encounter a single human + * + * Diff from NON_EXTREME_ENCOUNTER_BIOMES: + * + BADLANDS + * + DESERT + * + ICE_CAVE + */ +export const HUMAN_TRANSITABLE_BIOMES = [ + Biome.TOWN, + Biome.PLAINS, + Biome.GRASS, + Biome.TALL_GRASS, + Biome.METROPOLIS, + Biome.FOREST, + Biome.SWAMP, + Biome.BEACH, + Biome.LAKE, + Biome.MOUNTAIN, + Biome.BADLANDS, + Biome.CAVE, + Biome.DESERT, + Biome.ICE_CAVE, + Biome.MEADOW, + Biome.POWER_PLANT, + Biome.GRAVEYARD, + Biome.DOJO, + Biome.FACTORY, + Biome.RUINS, + Biome.CONSTRUCTION_SITE, + Biome.JUNGLE, + Biome.FAIRY_CAVE, + Biome.TEMPLE, + Biome.SLUM, + Biome.SNOWY_FOREST, + Biome.ISLAND, + Biome.LABORATORY +]; + +/** + * Places where you could expect a town or city, some form of large civilization + */ +export const CIVILIZATION_ENCOUNTER_BIOMES = [ + Biome.TOWN, + Biome.PLAINS, + Biome.GRASS, + Biome.TALL_GRASS, + Biome.METROPOLIS, + Biome.BEACH, + Biome.LAKE, + Biome.MEADOW, + Biome.POWER_PLANT, + Biome.GRAVEYARD, + Biome.DOJO, + Biome.FACTORY, + Biome.CONSTRUCTION_SITE, + Biome.SLUM, + Biome.ISLAND +]; + export const allMysteryEncounters: { [encounterType: number]: MysteryEncounter } = {}; +// TO ENABLE AN ENCOUNTER IN ALL BIOMES, DO NOT SPECIFY IN ANY OF THESE LISTS/MAPS + +const extremeBiomeEncounters: MysteryEncounterType[] = []; + +const nonExtremeBiomeEncounters: MysteryEncounterType[] = [ + MysteryEncounterType.FIELD_TRIP +]; + +const humanTransitableBiomeEncounters: MysteryEncounterType[] = [ + MysteryEncounterType.MYSTERIOUS_CHALLENGERS, + MysteryEncounterType.SHADY_VITAMIN_DEALER +]; + +const civilizationBiomeEncounters: MysteryEncounterType[] = [ + MysteryEncounterType.DEPARTMENT_STORE_SALE +]; + +const anyBiomeEncounters: MysteryEncounterType[] = [ + MysteryEncounterType.FIGHT_OR_FLIGHT, + MysteryEncounterType.DARK_DEAL, + MysteryEncounterType.MYSTERIOUS_CHEST, + MysteryEncounterType.TRAINING_SESSION +]; + // Add MysteryEncounterType to biomes to enable it exclusively for those biomes -// To enable an encounter in all biomes, do not add to this map export const mysteryEncountersByBiome = new Map([ - [Biome.TOWN, [ - MysteryEncounterType.DEPARTMENT_STORE_SALE - ]], - [Biome.PLAINS, [ - MysteryEncounterType.DEPARTMENT_STORE_SALE - ]], + [Biome.TOWN, []], + [Biome.PLAINS, []], [Biome.GRASS, [ MysteryEncounterType.SLEEPING_SNORLAX, - MysteryEncounterType.DEPARTMENT_STORE_SALE - ]], - [Biome.TALL_GRASS, [ - MysteryEncounterType.DEPARTMENT_STORE_SALE - ]], - [Biome.METROPOLIS, [ - MysteryEncounterType.DEPARTMENT_STORE_SALE ]], + [Biome.TALL_GRASS, []], + [Biome.METROPOLIS, []], [Biome.FOREST, [ MysteryEncounterType.SLEEPING_SNORLAX ]], - [Biome.SEA, []], [Biome.SWAMP, []], - [Biome.BEACH, [ - MysteryEncounterType.DEPARTMENT_STORE_SALE - ]], + [Biome.BEACH, []], [Biome.LAKE, []], [Biome.SEABED, []], [Biome.MOUNTAIN, [ @@ -57,31 +169,21 @@ export const mysteryEncountersByBiome = new Map([ ]], [Biome.DESERT, []], [Biome.ICE_CAVE, []], - [Biome.MEADOW, [ - MysteryEncounterType.DEPARTMENT_STORE_SALE - ]], - [Biome.POWER_PLANT, [ - MysteryEncounterType.DEPARTMENT_STORE_SALE - ]], + [Biome.MEADOW, []], + [Biome.POWER_PLANT, []], [Biome.VOLCANO, []], [Biome.GRAVEYARD, []], [Biome.DOJO, []], - [Biome.FACTORY, [ - MysteryEncounterType.DEPARTMENT_STORE_SALE - ]], + [Biome.FACTORY, []], [Biome.RUINS, []], [Biome.WASTELAND, []], [Biome.ABYSS, []], [Biome.SPACE, []], - [Biome.CONSTRUCTION_SITE, [ - MysteryEncounterType.DEPARTMENT_STORE_SALE - ]], + [Biome.CONSTRUCTION_SITE, []], [Biome.JUNGLE, []], [Biome.FAIRY_CAVE, []], [Biome.TEMPLE, []], - [Biome.SLUM, [ - MysteryEncounterType.DEPARTMENT_STORE_SALE - ]], + [Biome.SLUM, []], [Biome.SNOWY_FOREST, []], [Biome.ISLAND, []], [Biome.LABORATORY, []] @@ -90,7 +192,7 @@ export const mysteryEncountersByBiome = new Map([ export function initMysteryEncounters() { allMysteryEncounters[MysteryEncounterType.MYSTERIOUS_CHALLENGERS] = MysteriousChallengersEncounter; allMysteryEncounters[MysteryEncounterType.MYSTERIOUS_CHEST] = MysteriousChestEncounter; - allMysteryEncounters[MysteryEncounterType.DARK_DEAL] = DarkDealEncounter; + allMysteryEncounters[MysteryEncounterType.DARK_DEAL] = DarkDealEncounter; // TODO: move to HUMAN if we add an ANY biome ROGUE tier encounter allMysteryEncounters[MysteryEncounterType.FIGHT_OR_FLIGHT] = FightOrFlightEncounter; allMysteryEncounters[MysteryEncounterType.TRAINING_SESSION] = TrainingSessionEncounter; allMysteryEncounters[MysteryEncounterType.SLEEPING_SNORLAX] = SleepingSnorlaxEncounter; @@ -98,15 +200,49 @@ export function initMysteryEncounters() { allMysteryEncounters[MysteryEncounterType.SHADY_VITAMIN_DEALER] = ShadyVitaminDealerEncounter; allMysteryEncounters[MysteryEncounterType.FIELD_TRIP] = FieldTripEncounter; - // Append encounters that can occur in any biome to biome map - const anyBiomeEncounters: MysteryEncounterType[] = Object.keys(MysteryEncounterType).filter(e => !isNaN(Number(e))).map(k => Number(k) as MysteryEncounterType); - mysteryEncountersByBiome.forEach(biomeEncounters => { - biomeEncounters.forEach(e => { - if (anyBiomeEncounters.includes(e)) { - anyBiomeEncounters.splice(anyBiomeEncounters.indexOf(e), 1); + // Add extreme encounters to biome map + extremeBiomeEncounters.forEach(encounter => { + EXTREME_ENCOUNTER_BIOMES.forEach(biome => { + const encountersForBiome = mysteryEncountersByBiome.get(biome); + if (!encountersForBiome.includes(encounter)) { + encountersForBiome.push(encounter); + } + }); + }); + // Add non-extreme encounters to biome map + nonExtremeBiomeEncounters.forEach(encounter => { + NON_EXTREME_ENCOUNTER_BIOMES.forEach(biome => { + const encountersForBiome = mysteryEncountersByBiome.get(biome); + if (!encountersForBiome.includes(encounter)) { + encountersForBiome.push(encounter); + } + }); + }); + // Add human encounters to biome map + humanTransitableBiomeEncounters.forEach(encounter => { + HUMAN_TRANSITABLE_BIOMES.forEach(biome => { + const encountersForBiome = mysteryEncountersByBiome.get(biome); + if (!encountersForBiome.includes(encounter)) { + encountersForBiome.push(encounter); + } + }); + }); + // Add civilization encounters to biome map + civilizationBiomeEncounters.forEach(encounter => { + CIVILIZATION_ENCOUNTER_BIOMES.forEach(biome => { + const encountersForBiome = mysteryEncountersByBiome.get(biome); + if (!encountersForBiome.includes(encounter)) { + encountersForBiome.push(encounter); } }); }); - mysteryEncountersByBiome.forEach(biomeEncounters => biomeEncounters.push(...anyBiomeEncounters)); + // Add ANY biome encounters to biome map + mysteryEncountersByBiome.forEach(biomeEncounters => { + anyBiomeEncounters.forEach(encounter => { + if (!biomeEncounters.includes(encounter)) { + biomeEncounters.push(encounter); + } + }); + }); } diff --git a/src/data/mystery-encounters/requirements/requirement-groups.ts b/src/data/mystery-encounters/requirements/requirement-groups.ts new file mode 100644 index 00000000000..3281129e63e --- /dev/null +++ b/src/data/mystery-encounters/requirements/requirement-groups.ts @@ -0,0 +1,42 @@ +import { Moves } from "#enums/moves"; + +export const STEALING_MOVES = [ + Moves.PLUCK, + Moves.COVET, + Moves.KNOCK_OFF, + Moves.FAKE_OUT, + Moves.THIEF, + Moves.TRICK, + Moves.SWITCHEROO +]; + +export const DISTRACTION_MOVES = [ + Moves.FAKE_OUT, + Moves.FOLLOW_ME, + Moves.TAUNT, + Moves.ROAR, + Moves.TELEPORT, + Moves.CHARM, + Moves.FAKE_TEARS, + Moves.TICKLE, + Moves.CAPTIVATE, + Moves.RAGE_POWDER, + Moves.SUBSTITUTE, + Moves.SHED_TAIL +]; + +export const PROTECTING_MOVES = [ + Moves.PROTECT, + Moves.WIDE_GUARD, + Moves.MAX_GUARD, + Moves.SAFEGUARD, + Moves.REFLECT, + Moves.BARRIER, + Moves.QUICK_GUARD, + Moves.FLOWER_SHIELD, + Moves.KINGS_SHIELD, + Moves.CRAFTY_SHIELD, + Moves.SPIKY_SHIELD, + Moves.OBSTRUCT, + Moves.DETECT +]; diff --git a/src/locales/en/mystery-encounter.ts b/src/locales/en/mystery-encounter.ts index 59fcf6940c2..b07e22f7a9a 100644 --- a/src/locales/en/mystery-encounter.ts +++ b/src/locales/en/mystery-encounter.ts @@ -43,14 +43,14 @@ export const mysteryEncounter: SimpleTranslationEntries = { "fight_or_flight_option_1_tooltip": "(-) Hard Battle\n(+) New Item", "fight_or_flight_option_2_label": "Steal the item", "fight_or_flight_option_2_tooltip": "@[SUMMARY_GREEN]{(35%) Steal Item}\n@[SUMMARY_BLUE]{(65%) Harder Battle}", - "fight_or_flight_option_2_steal_tooltip": "@[SUMMARY_GREEN]{(?) Use a Pokémon Move}", + "fight_or_flight_option_2_steal_tooltip": "(+) @ec{option2PrimaryName} uses @ec{option2PrimaryMove}", "fight_or_flight_option_3_label": "Leave", "fight_or_flight_option_3_tooltip": "(-) No Rewards", "fight_or_flight_option_1_selected_message": "You approach the\nPokémon without fear.", "fight_or_flight_option_2_good_result": `.@d{32}.@d{32}.@d{32} $You manage to sneak your way\npast and grab the item!`, "fight_or_flight_option_2_steal_result": `.@d{32}.@d{32}.@d{32} - $Your @ec{thiefPokemon} helps you out and uses @ec{move}! + $Your @ec{option2PrimaryName} helps you out and uses @ec{option2PrimaryMove}! $ You nabbed the item!`, "fight_or_flight_option_2_bad_result": `.@d{32}.@d{32}.@d{32} $The Pokémon catches you\nas you try to sneak around!`, diff --git a/src/ui/mystery-encounter-ui-handler.ts b/src/ui/mystery-encounter-ui-handler.ts index 8be862b965d..306fb01c575 100644 --- a/src/ui/mystery-encounter-ui-handler.ts +++ b/src/ui/mystery-encounter-ui-handler.ts @@ -110,7 +110,7 @@ export default class MysteryEncounterUiHandler extends UiHandler { this.unblockInput(); }, 300); }); - } else if (this.blockInput || !this.optionsMeetsReqs[cursor]) { + } else if (this.blockInput || (!this.optionsMeetsReqs[cursor] && this.filteredEncounterOptions[cursor].isDisabledOnRequirementsNotMet)) { success = false; } else { const selected = this.filteredEncounterOptions[cursor]; @@ -253,7 +253,7 @@ export default class MysteryEncounterUiHandler extends UiHandler { if (this.blockInput) { this.blockInput = false; for (let i = 0; i < this.optionsContainer.length - 1; i++) { - if (!this.optionsMeetsReqs[i]) { + if (!this.optionsMeetsReqs[i] && this.filteredEncounterOptions[i].isDisabledOnRequirementsNotMet) { continue; } (this.optionsContainer.getAt(i) as Phaser.GameObjects.Text).setAlpha(1); @@ -334,9 +334,7 @@ export default class MysteryEncounterUiHandler extends UiHandler { optionText.setText(text); } - - - if (!this.optionsMeetsReqs[i]) { + if (!this.optionsMeetsReqs[i] && this.filteredEncounterOptions[i].isDisabledOnRequirementsNotMet) { optionText.setAlpha(0.5); } if (this.blockInput) { @@ -424,7 +422,7 @@ export default class MysteryEncounterUiHandler extends UiHandler { const mysteryEncounter = this.scene.currentBattle.mysteryEncounter; let text; const option = mysteryEncounter.dialogue.encounterOptionsDialogue.options[cursor]; - if (!this.optionsMeetsReqs[cursor] && option.disabledTooltip) { + if (!this.optionsMeetsReqs[cursor] && this.filteredEncounterOptions[cursor].isDisabledOnRequirementsNotMet && option.disabledTooltip) { text = getEncounterText(this.scene, option.disabledTooltip, TextStyle.TOOLTIP_CONTENT); } else { text = getEncounterText(this.scene, option.buttonTooltip, TextStyle.TOOLTIP_CONTENT);