mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-12-16 14:55:22 +01:00
* Grabbed matchers from other branch * Cleaned up entry hazard arena tags; merged tests into 1 file * Marked test as TODO because IDK how to make it pass * Re-added test file + ran biome * Sort imports in `vitest.d.ts` * Fix Stealth Rocks test * Renamed arena traps to entry hazards fr fr * fixed matcher to have default value * Fixed errors * Update arena-tag.ts Co-authored-by: Wlowscha <54003515+Wlowscha@users.noreply.github.com> --------- Co-authored-by: Sirz Benjie <142067137+SirzBenjie@users.noreply.github.com> Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com> Co-authored-by: Wlowscha <54003515+Wlowscha@users.noreply.github.com>
41 lines
1.3 KiB
TypeScript
41 lines
1.3 KiB
TypeScript
import { applyAbAttrs } from "#abilities/apply-ab-attrs";
|
|
import { globalScene } from "#app/global-scene";
|
|
import { EntryHazardTag } from "#data/arena-tag";
|
|
import { MysteryEncounterPostSummonTag } from "#data/battler-tags";
|
|
import { BattlerTagType } from "#enums/battler-tag-type";
|
|
import { StatusEffect } from "#enums/status-effect";
|
|
import { PokemonPhase } from "#phases/pokemon-phase";
|
|
|
|
export class PostSummonPhase extends PokemonPhase {
|
|
public readonly phaseName = "PostSummonPhase";
|
|
start() {
|
|
super.start();
|
|
|
|
const pokemon = this.getPokemon();
|
|
|
|
if (pokemon.status?.effect === StatusEffect.TOXIC) {
|
|
pokemon.status.toxicTurnCount = 0;
|
|
}
|
|
globalScene.arena.applyTags(EntryHazardTag, false, pokemon);
|
|
|
|
// If this is mystery encounter and has post summon phase tag, apply post summon effects
|
|
if (
|
|
globalScene.currentBattle.isBattleMysteryEncounter() &&
|
|
pokemon.findTags(t => t instanceof MysteryEncounterPostSummonTag).length > 0
|
|
) {
|
|
pokemon.lapseTag(BattlerTagType.MYSTERY_ENCOUNTER_POST_SUMMON);
|
|
}
|
|
|
|
const field = pokemon.isPlayer() ? globalScene.getPlayerField() : globalScene.getEnemyField();
|
|
for (const p of field) {
|
|
applyAbAttrs("CommanderAbAttr", { pokemon: p });
|
|
}
|
|
|
|
this.end();
|
|
}
|
|
|
|
public getPriority() {
|
|
return 0;
|
|
}
|
|
}
|