mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-12-03 08:28:29 +01:00
* Add enum for hit check result Co-authored-by: innerthunder <brandonerickson98@gmail.com> * Refactor parameter list for pokemon#getBaseDamage and pokemon#getAttackDamage * Rewrite move phase Co-authored-by: innerthunder <brandonerickson98@gmail.com> * Update tests to reflect move effect phase changes Co-authored-by: innerthunder <brandonerickson98@gmail.com> * Fix pluck / bug bite Co-authored-by: innerthunder <brandonerickson98@gmail.com> * Fix reviver seed ohko, remove leftover dead code Co-authored-by: innerthunder <brandonerickson98@gmail.com> * Cleanup jsdoc comments * Remove hitsSubstitute check from postDefend abilities * Fix improper i18nkey in moveEffectPhase#applyToTargets * Cleanup comments * Fix type issue with substitute test * Move MYSTERY_ENCOUNTER_WAVES to constants.ts * Update linkcode in damageparams to use proper tsdoc syntax --------- Co-authored-by: innerthunder <brandonerickson98@gmail.com>
21 lines
490 B
TypeScript
21 lines
490 B
TypeScript
import { MoveTarget } from "#enums/MoveTarget";
|
|
import type Move from "./move";
|
|
|
|
/**
|
|
* Return whether the move targets the field
|
|
*
|
|
* Examples include
|
|
* - Hazard moves like spikes
|
|
* - Weather moves like rain dance
|
|
* - User side moves like reflect and safeguard
|
|
*/
|
|
export function isFieldTargeted(move: Move): boolean {
|
|
switch (move.moveTarget) {
|
|
case MoveTarget.BOTH_SIDES:
|
|
case MoveTarget.USER_SIDE:
|
|
case MoveTarget.ENEMY_SIDE:
|
|
return true;
|
|
}
|
|
return false;
|
|
}
|