mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-06-21 09:02:47 +02:00
Moved DamageResult
into new file
This commit is contained in:
parent
e7b6ec93df
commit
d5ea58b4bb
@ -1,5 +1,5 @@
|
||||
import type { BattlerIndex } from "#enums/battler-index";
|
||||
import type { DamageResult } from "#app/field/pokemon";
|
||||
import type { DamageResult } from "#app/@types/damage-result";
|
||||
import type { MoveId } from "#enums/move-id";
|
||||
|
||||
export interface AttackMoveResult {
|
||||
|
21
src/@types/damage-result.ts
Normal file
21
src/@types/damage-result.ts
Normal file
@ -0,0 +1,21 @@
|
||||
import type { HitResult } from "#enums/hit-result";
|
||||
|
||||
/** Union type containing all damage-dealing {@linkcode HitResult}s. */
|
||||
export type DamageResult =
|
||||
| HitResult.EFFECTIVE
|
||||
| HitResult.SUPER_EFFECTIVE
|
||||
| HitResult.NOT_VERY_EFFECTIVE
|
||||
| HitResult.ONE_HIT_KO
|
||||
| HitResult.CONFUSION
|
||||
| HitResult.INDIRECT_KO
|
||||
| HitResult.INDIRECT;
|
||||
|
||||
/** Interface containing the results of a damage calculation for a given move. */
|
||||
export interface DamageCalculationResult {
|
||||
/** `true` if the move was cancelled (thus suppressing "No Effect" messages) */
|
||||
cancelled: boolean;
|
||||
/** The effectiveness of the move */
|
||||
result: HitResult;
|
||||
/** The damage dealt by the move */
|
||||
damage: number;
|
||||
}
|
@ -1,5 +1,5 @@
|
||||
import { TextStyle, addTextObject } from "../ui/text";
|
||||
import type { DamageResult } from "./pokemon";
|
||||
import type { DamageResult } from "../@types/damage-result";
|
||||
import type Pokemon from "./pokemon";
|
||||
import { HitResult } from "#enums/hit-result";
|
||||
import { formatStat, fixedInt } from "#app/utils/common";
|
||||
|
@ -169,7 +169,14 @@ import { getPokemonNameWithAffix } from "#app/messages";
|
||||
import { Challenges } from "#enums/challenges";
|
||||
import { PokemonAnimType } from "#enums/pokemon-anim-type";
|
||||
import { PLAYER_PARTY_MAX_SIZE } from "#app/constants";
|
||||
import { CustomPokemonData, PokemonBattleData, PokemonSummonData, PokemonTempSummonData, PokemonTurnData, PokemonWaveData } from "#app/data/pokemon/pokemon-data";
|
||||
import {
|
||||
CustomPokemonData,
|
||||
PokemonBattleData,
|
||||
PokemonSummonData,
|
||||
PokemonTempSummonData,
|
||||
PokemonTurnData,
|
||||
PokemonWaveData,
|
||||
} from "#app/data/pokemon/pokemon-data";
|
||||
import { SwitchType } from "#enums/switch-type";
|
||||
import { SpeciesFormKey } from "#enums/species-form-key";
|
||||
import { getStatusEffectOverlapText } from "#app/data/status-effect";
|
||||
@ -193,6 +200,7 @@ import { PokemonMove } from "#app/data/moves/pokemon-move";
|
||||
import type { AbAttrMap, AbAttrString } from "#app/@types/ability-types";
|
||||
import type { IllusionData } from "#app/@types/illusion-data";
|
||||
import type { TurnMove } from "#app/@types/turn-move";
|
||||
import type { DamageCalculationResult, DamageResult } from "#app/@types/damage-result";
|
||||
|
||||
/** Base typeclass for damage parameter methods, used for DRY */
|
||||
type damageParams = {
|
||||
@ -6690,22 +6698,3 @@ export class EnemyPokemon extends Pokemon {
|
||||
this.battleInfo.toggleFlyout(visible);
|
||||
}
|
||||
}
|
||||
|
||||
export type DamageResult =
|
||||
| HitResult.EFFECTIVE
|
||||
| HitResult.SUPER_EFFECTIVE
|
||||
| HitResult.NOT_VERY_EFFECTIVE
|
||||
| HitResult.ONE_HIT_KO
|
||||
| HitResult.CONFUSION
|
||||
| HitResult.INDIRECT_KO
|
||||
| HitResult.INDIRECT;
|
||||
|
||||
/** Interface containing the results of a damage calculation for a given move */
|
||||
export interface DamageCalculationResult {
|
||||
/** `true` if the move was cancelled (thus suppressing "No Effect" messages) */
|
||||
cancelled: boolean;
|
||||
/** The effectiveness of the move */
|
||||
result: HitResult;
|
||||
/** The damage dealt by the move */
|
||||
damage: number;
|
||||
}
|
||||
|
@ -1,7 +1,7 @@
|
||||
import { globalScene } from "#app/global-scene";
|
||||
import type { BattlerIndex } from "#enums/battler-index";
|
||||
import { BattleSpec } from "#enums/battle-spec";
|
||||
import type { DamageResult } from "#app/field/pokemon";
|
||||
import type { DamageResult } from "#app/@types/damage-result";
|
||||
import { HitResult } from "#enums/hit-result";
|
||||
import { fixedInt } from "#app/utils/common";
|
||||
import { PokemonPhase } from "#app/phases/pokemon-phase";
|
||||
|
@ -27,7 +27,7 @@ import { MoveTarget } from "#enums/MoveTarget";
|
||||
import { MoveCategory } from "#enums/MoveCategory";
|
||||
import { SpeciesFormChangePostMoveTrigger } from "#app/data/pokemon-forms/form-change-triggers";
|
||||
import { PokemonType } from "#enums/pokemon-type";
|
||||
import type { DamageResult } from "#app/field/pokemon";
|
||||
import type { DamageResult } from "#app/@types/damage-result";
|
||||
import type { TurnMove } from "#app/@types/turn-move";
|
||||
import { PokemonMove } from "#app/data/moves/pokemon-move";
|
||||
import type Pokemon from "#app/field/pokemon";
|
||||
|
@ -1,7 +1,7 @@
|
||||
import { BattlerIndex } from "#enums/battler-index";
|
||||
import { allMoves } from "#app/data/data-lists";
|
||||
import { BattlerTagType } from "#app/enums/battler-tag-type";
|
||||
import type { DamageCalculationResult } from "#app/field/pokemon";
|
||||
import type { DamageCalculationResult } from "#app/@types/damage-result";
|
||||
import { AbilityId } from "#enums/ability-id";
|
||||
import { MoveId } from "#enums/move-id";
|
||||
import { SpeciesId } from "#enums/species-id";
|
||||
|
Loading…
Reference in New Issue
Block a user