lapse endure tag as well

This commit is contained in:
ImperialSympathizer 2024-09-27 21:30:27 -04:00
parent 14e2992868
commit 64f568e39a

View File

@ -219,11 +219,14 @@ export class MysteryEncounterBattleStartCleanupPhase extends Phase {
start() {
super.start();
// Lapse any residual flinches but ignore all other turn-end battle tags
// 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);
field.forEach(pokemon => {
const tags = pokemon.summonData.tags;
tags.filter(t => t.tagType === BattlerTagType.FLINCHED && !(t.lapse(pokemon, BattlerTagLapseType.TURN_END))).forEach(t => {
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);
});