pokerogue/src/phases/field-phase.ts

12 lines
357 B
TypeScript
Raw Normal View History

2024-08-19 03:23:52 +01:00
import { BattlePhase } from "./battle-phase";
[Refactor] Improvements on getOrder() (#3547) * Moved getOrder() into TurnStartPhase * Cleaned up bypass speed checks * Revert "Cleaned up bypass speed checks" This reverts commit 11150254f568b8575211693919c9c5deeb3d8dcd. * Added comments. * Fixed up some inconsistencies * changed isSameBracket check * changed isSameBracket check p2 * changed isSameBracket check p3 * changed isSameBracket check p3 * Fixed up conditionals + stall/M.m * Seems OK * Update battle-spec.ts * Updated tests to use new functions introduced. Less intuitive, but faster. * Update src/phases.ts Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com> * Moved getOrder() into TurnStartPhase * Cleaned up bypass speed checks * Revert "Cleaned up bypass speed checks" This reverts commit 11150254f568b8575211693919c9c5deeb3d8dcd. * Added comments. * Fixed up some inconsistencies * changed isSameBracket check * changed isSameBracket check p2 * changed isSameBracket check p3 * changed isSameBracket check p3 * Fixed up conditionals + stall/M.m * Seems OK * Update battle-spec.ts * Updated tests to use new functions introduced. Less intuitive, but faster. * Removed import * i hate git * Moved getOrder() into TurnStartPhase * Seems OK * missing import * Added Snooze's review * Added test fixes and removed unwanted edit. * fixed dynamax cannon test * typedocs fixes * Updating battle-order.test.ts * merge fixes * ughhh * Update src/test/abilities/mycelium_might.test.ts Co-authored-by: innerthunder <168692175+innerthunder@users.noreply.github.com> * Apply suggestions from code review Co-authored-by: innerthunder <168692175+innerthunder@users.noreply.github.com> * tsdocs :) * Fixed tests * Update src/phases/turn-start-phase.ts Co-authored-by: innerthunder <168692175+innerthunder@users.noreply.github.com> * Update src/phases/turn-start-phase.ts Co-authored-by: innerthunder <168692175+innerthunder@users.noreply.github.com> * innerthunder's fixes * commas * Mocked stats instead of directly changing them --------- Co-authored-by: Frutescens <info@laptop> Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com> Co-authored-by: innerthunder <168692175+innerthunder@users.noreply.github.com>
2024-09-01 15:23:25 -07:00
import Pokemon from "#app/field/pokemon";
2024-08-19 03:23:52 +01:00
type PokemonFunc = (pokemon: Pokemon) => void;
export abstract class FieldPhase extends BattlePhase {
executeForAll(func: PokemonFunc): void {
const field = this.scene.getField(true).filter(p => p.summonData);
field.forEach(pokemon => func(pokemon));
}
}