mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-01-22 00:41:05 +00:00
lost-at-sea-encounter: remove fainted msg code
this is automatically handled in the encounter-phase-utils now
This commit is contained in:
parent
35ede48153
commit
ada6eee884
@ -1,10 +1,8 @@
|
|||||||
import { Moves } from "#app/enums/moves";
|
import { Moves } from "#app/enums/moves";
|
||||||
import { getPokemonNameWithAffix } from "#app/messages";
|
|
||||||
import { MysteryEncounterType } from "#enums/mystery-encounter-type";
|
import { MysteryEncounterType } from "#enums/mystery-encounter-type";
|
||||||
import BattleScene from "../../../battle-scene";
|
import BattleScene from "../../../battle-scene";
|
||||||
import MysteryEncounter, { MysteryEncounterBuilder, MysteryEncounterTier } from "../mystery-encounter";
|
import MysteryEncounter, { MysteryEncounterBuilder, MysteryEncounterTier } from "../mystery-encounter";
|
||||||
import { EncounterOptionMode, MysteryEncounterOptionBuilder } from "../mystery-encounter-option";
|
import { EncounterOptionMode, MysteryEncounterOptionBuilder } from "../mystery-encounter-option";
|
||||||
import { showEncounterText } from "../utils/encounter-dialogue-utils";
|
|
||||||
import { applyDamageToPokemon, leaveEncounterWithoutBattle, setEncounterExp } from "../utils/encounter-phase-utils";
|
import { applyDamageToPokemon, leaveEncounterWithoutBattle, setEncounterExp } from "../utils/encounter-phase-utils";
|
||||||
|
|
||||||
const OPTION_1_REQUIRED_MOVE = Moves.SURF;
|
const OPTION_1_REQUIRED_MOVE = Moves.SURF;
|
||||||
@ -98,18 +96,12 @@ export const LostAtSeaEncounter: MysteryEncounter = MysteryEncounterBuilder.with
|
|||||||
],
|
],
|
||||||
},
|
},
|
||||||
async (scene: BattleScene) => {
|
async (scene: BattleScene) => {
|
||||||
const { mysteryEncounter } = scene.currentBattle;
|
|
||||||
const allowedPokemon = scene.getParty().filter((p) => p.isAllowedInBattle());
|
const allowedPokemon = scene.getParty().filter((p) => p.isAllowedInBattle());
|
||||||
|
|
||||||
for (const pkm of allowedPokemon) {
|
for (const pkm of allowedPokemon) {
|
||||||
const percentage = DAMAGE_PERCENTAGE / 100;
|
const percentage = DAMAGE_PERCENTAGE / 100;
|
||||||
const damage = Math.floor(pkm.getMaxHp() * percentage);
|
const damage = Math.floor(pkm.getMaxHp() * percentage);
|
||||||
applyDamageToPokemon(pkm, damage);
|
applyDamageToPokemon(scene, pkm, damage);
|
||||||
|
|
||||||
if (pkm.isFainted()) {
|
|
||||||
mysteryEncounter.setDialogueToken("pokemonNameWithAffix", getPokemonNameWithAffix(pkm));
|
|
||||||
await showEncounterText(scene, "battle:fainted");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
leaveEncounterWithoutBattle(scene);
|
leaveEncounterWithoutBattle(scene);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user