[Hotfix] Fix ME lapsing non flinch or endure battler tags (#4479)
* Fix tag lapsing on battle start in MEs with free enemy moves * lapse endure tag as well --------- Co-authored-by: ImperialSympathizer <imperialsympathizer@gmail.com>
This commit is contained in:
parent
c9664b66d3
commit
1b6593d242
|
@ -25,6 +25,7 @@ import { GameOverPhase } from "#app/phases/game-over-phase";
|
||||||
import { SwitchPhase } from "#app/phases/switch-phase";
|
import { SwitchPhase } from "#app/phases/switch-phase";
|
||||||
import { SeenEncounterData } from "#app/data/mystery-encounters/mystery-encounter-save-data";
|
import { SeenEncounterData } from "#app/data/mystery-encounters/mystery-encounter-save-data";
|
||||||
import { SwitchType } from "#enums/switch-type";
|
import { SwitchType } from "#enums/switch-type";
|
||||||
|
import { BattlerTagType } from "#enums/battler-tag-type";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Will handle (in order):
|
* Will handle (in order):
|
||||||
|
@ -218,9 +219,17 @@ export class MysteryEncounterBattleStartCleanupPhase extends Phase {
|
||||||
start() {
|
start() {
|
||||||
super.start();
|
super.start();
|
||||||
|
|
||||||
|
// Lapse any residual flinches/endures but ignore all other turn-end battle tags
|
||||||
|
const includedLapseTags = [BattlerTagType.FLINCHED, BattlerTagType.ENDURING];
|
||||||
const field = this.scene.getField(true).filter(p => p.summonData);
|
const field = this.scene.getField(true).filter(p => p.summonData);
|
||||||
field.forEach(pokemon => {
|
field.forEach(pokemon => {
|
||||||
pokemon.lapseTags(BattlerTagLapseType.TURN_END);
|
const tags = pokemon.summonData.tags;
|
||||||
|
tags.filter(t => includedLapseTags.includes(t.tagType)
|
||||||
|
&& t.lapseTypes.includes(BattlerTagLapseType.TURN_END)
|
||||||
|
&& !(t.lapse(pokemon, BattlerTagLapseType.TURN_END))).forEach(t => {
|
||||||
|
t.onRemove(pokemon);
|
||||||
|
tags.splice(tags.indexOf(t), 1);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
// Remove any status tick phases
|
// Remove any status tick phases
|
||||||
|
|
Loading…
Reference in New Issue