lost-at-sea-encounter: remove fainted msg code

this is automatically handled in the encounter-phase-utils now
This commit is contained in:
Felix Staud 2024-07-17 14:45:49 -07:00
parent 35ede48153
commit ada6eee884
1 changed files with 1 additions and 9 deletions

View File

@ -1,10 +1,8 @@
import { Moves } from "#app/enums/moves";
import { getPokemonNameWithAffix } from "#app/messages";
import { MysteryEncounterType } from "#enums/mystery-encounter-type";
import BattleScene from "../../../battle-scene";
import MysteryEncounter, { MysteryEncounterBuilder, MysteryEncounterTier } from "../mystery-encounter";
import { EncounterOptionMode, MysteryEncounterOptionBuilder } from "../mystery-encounter-option";
import { showEncounterText } from "../utils/encounter-dialogue-utils";
import { applyDamageToPokemon, leaveEncounterWithoutBattle, setEncounterExp } from "../utils/encounter-phase-utils";
const OPTION_1_REQUIRED_MOVE = Moves.SURF;
@ -98,18 +96,12 @@ export const LostAtSeaEncounter: MysteryEncounter = MysteryEncounterBuilder.with
],
},
async (scene: BattleScene) => {
const { mysteryEncounter } = scene.currentBattle;
const allowedPokemon = scene.getParty().filter((p) => p.isAllowedInBattle());
for (const pkm of allowedPokemon) {
const percentage = DAMAGE_PERCENTAGE / 100;
const damage = Math.floor(pkm.getMaxHp() * percentage);
applyDamageToPokemon(pkm, damage);
if (pkm.isFainted()) {
mysteryEncounter.setDialogueToken("pokemonNameWithAffix", getPokemonNameWithAffix(pkm));
await showEncounterText(scene, "battle:fainted");
}
applyDamageToPokemon(scene, pkm, damage);
}
leaveEncounterWithoutBattle(scene);