mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-06-21 00:52:47 +02:00
Moved AttackMoveResult
and TurnMove
to own files
This commit is contained in:
parent
06b6beab02
commit
70dbabe281
12
src/@types/attack-move-result.ts
Normal file
12
src/@types/attack-move-result.ts
Normal file
@ -0,0 +1,12 @@
|
||||
import type { BattlerIndex } from "#app/battle";
|
||||
import type { Moves } from "#enums/moves";
|
||||
import type { DamageResult } from "#app/field/pokemon";
|
||||
|
||||
export interface AttackMoveResult {
|
||||
move: Moves;
|
||||
result: DamageResult;
|
||||
damage: number;
|
||||
critical: boolean;
|
||||
sourceId: number;
|
||||
sourceBattlerIndex: BattlerIndex;
|
||||
}
|
@ -11,7 +11,9 @@ import type { Moves } from "#enums/moves";
|
||||
import type { PokeballType } from "#enums/pokeball";
|
||||
import type { PokemonType } from "#enums/pokemon-type";
|
||||
import type { Species } from "#enums/species";
|
||||
import { type TurnMove, PokemonMove, type AttackMoveResult } from "#app/field/pokemon";
|
||||
import { PokemonMove } from "#app/field/pokemon";
|
||||
import type { TurnMove } from "#app/@types/turn-move";
|
||||
import type { AttackMoveResult } from "#app/@types/attack-move-result";
|
||||
|
||||
/**
|
||||
* Persistent in-battle data for a {@linkcode Pokemon}.
|
||||
|
12
src/@types/turn-move.ts
Normal file
12
src/@types/turn-move.ts
Normal file
@ -0,0 +1,12 @@
|
||||
import type { BattlerIndex } from "#app/battle";
|
||||
import type { Moves } from "#enums/moves";
|
||||
import type { MoveResult } from "#app/field/pokemon";
|
||||
|
||||
export interface TurnMove {
|
||||
move: Moves;
|
||||
targets: BattlerIndex[];
|
||||
result?: MoveResult;
|
||||
virtual?: boolean;
|
||||
turn?: number;
|
||||
ignorePP?: boolean;
|
||||
}
|
@ -15,7 +15,8 @@ import { MoneyMultiplierModifier, PokemonHeldItemModifier } from "./modifier/mod
|
||||
import type { PokeballType } from "#enums/pokeball";
|
||||
import { trainerConfigs } from "#app/data/trainers/trainer-config";
|
||||
import { SpeciesFormKey } from "#enums/species-form-key";
|
||||
import type { EnemyPokemon, PlayerPokemon, TurnMove } from "#app/field/pokemon";
|
||||
import type { EnemyPokemon, PlayerPokemon } from "#app/field/pokemon";
|
||||
import type { TurnMove } from "./@types/turn-move";
|
||||
import type Pokemon from "#app/field/pokemon";
|
||||
import { ArenaTagType } from "#enums/arena-tag-type";
|
||||
import { BattleSpec } from "#enums/battle-spec";
|
||||
|
@ -12,7 +12,8 @@ import {
|
||||
TypeBoostTag,
|
||||
} from "../battler-tags";
|
||||
import { getPokemonNameWithAffix } from "../../messages";
|
||||
import type { AttackMoveResult, TurnMove } from "../../field/pokemon";
|
||||
import type { TurnMove } from "#app/@types/turn-move";
|
||||
import type { AttackMoveResult } from "#app/@types/attack-move-result";
|
||||
import type Pokemon from "../../field/pokemon";
|
||||
import {
|
||||
EnemyPokemon,
|
||||
|
@ -260,6 +260,7 @@ import { timedEventManager } from "#app/global-event-manager";
|
||||
import { loadMoveAnimations } from "#app/sprites/pokemon-asset-loader";
|
||||
import { ResetStatusPhase } from "#app/phases/reset-status-phase";
|
||||
import { PokemonBattleData, PokemonSummonData, PokemonTempSummonData, PokemonWaveData, PokemonTurnData, type IllusionData } from "../@types/pokemon-data";
|
||||
import type { TurnMove } from "../@types/turn-move";
|
||||
|
||||
export enum LearnMoveSituation {
|
||||
MISC,
|
||||
@ -7756,24 +7757,6 @@ export class EnemyPokemon extends Pokemon {
|
||||
}
|
||||
}
|
||||
|
||||
export interface TurnMove {
|
||||
move: Moves;
|
||||
targets: BattlerIndex[];
|
||||
result?: MoveResult;
|
||||
virtual?: boolean;
|
||||
turn?: number;
|
||||
ignorePP?: boolean;
|
||||
}
|
||||
|
||||
export interface AttackMoveResult {
|
||||
move: Moves;
|
||||
result: DamageResult;
|
||||
damage: number;
|
||||
critical: boolean;
|
||||
sourceId: number;
|
||||
sourceBattlerIndex: BattlerIndex;
|
||||
}
|
||||
|
||||
export enum AiType {
|
||||
RANDOM,
|
||||
SMART_RANDOM,
|
||||
|
@ -11,7 +11,8 @@ import { BattlerTagType } from "#app/enums/battler-tag-type";
|
||||
import { Biome } from "#app/enums/biome";
|
||||
import { Moves } from "#app/enums/moves";
|
||||
import { PokeballType } from "#enums/pokeball";
|
||||
import type { PlayerPokemon, TurnMove } from "#app/field/pokemon";
|
||||
import type { PlayerPokemon } from "#app/field/pokemon";
|
||||
import type { TurnMove } from "#app/@types/turn-move";
|
||||
import { FieldPosition } from "#app/field/pokemon";
|
||||
import { getPokemonNameWithAffix } from "#app/messages";
|
||||
import { Command } from "#app/ui/command-ui-handler";
|
||||
|
@ -48,7 +48,8 @@ import { MoveTarget } from "#enums/MoveTarget";
|
||||
import { MoveCategory } from "#enums/MoveCategory";
|
||||
import { SpeciesFormChangePostMoveTrigger } from "#app/data/pokemon-forms";
|
||||
import { PokemonType } from "#enums/pokemon-type";
|
||||
import { DamageResult, PokemonMove, type TurnMove } from "#app/field/pokemon";
|
||||
import { type DamageResult, PokemonMove } from "#app/field/pokemon";
|
||||
import type { TurnMove } from "#app/@types/turn-move";
|
||||
import type Pokemon from "#app/field/pokemon";
|
||||
import { HitResult, MoveResult } from "#app/field/pokemon";
|
||||
import { getPokemonNameWithAffix } from "#app/messages";
|
||||
@ -72,7 +73,7 @@ import { ShowAbilityPhase } from "./show-ability-phase";
|
||||
import { MovePhase } from "./move-phase";
|
||||
import { MoveEndPhase } from "./move-end-phase";
|
||||
import { HideAbilityPhase } from "#app/phases/hide-ability-phase";
|
||||
import { TypeDamageMultiplier } from "#app/data/type";
|
||||
import type { TypeDamageMultiplier } from "#app/data/type";
|
||||
import { HitCheckResult } from "#enums/hit-check-result";
|
||||
import type Move from "#app/data/moves/move";
|
||||
import { isFieldTargeted } from "#app/data/moves/move-utils";
|
||||
@ -809,7 +810,7 @@ export class MoveEffectPhase extends PokemonPhase {
|
||||
*/
|
||||
applyMoveAttrs(StatChangeBeforeDmgCalcAttr, user, target, this.move);
|
||||
|
||||
const { result: result, damage: dmg } = target.getAttackDamage({
|
||||
const { result, damage: dmg } = target.getAttackDamage({
|
||||
source: user,
|
||||
move: this.move,
|
||||
ignoreAbility: false,
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest";
|
||||
import type { TurnMove } from "#app/field/pokemon";
|
||||
import type { TurnMove } from "#app/@types/turn-move";
|
||||
import type { PokemonTurnData } from "#app/@types/pokemon-data";
|
||||
import type Pokemon from "#app/field/pokemon";
|
||||
import { MoveResult } from "#app/field/pokemon";
|
||||
|
@ -2,7 +2,7 @@ import { Stat } from "#enums/stat";
|
||||
import { StockpilingTag } from "#app/data/battler-tags";
|
||||
import { allMoves } from "#app/data/data-lists";
|
||||
import { BattlerTagType } from "#app/enums/battler-tag-type";
|
||||
import type { TurnMove } from "#app/field/pokemon";
|
||||
import type { TurnMove } from "#app/@types/turn-move";
|
||||
import { MoveResult } from "#app/field/pokemon";
|
||||
import GameManager from "#test/testUtils/gameManager";
|
||||
import { Abilities } from "#enums/abilities";
|
||||
|
@ -1,6 +1,6 @@
|
||||
import { Stat } from "#enums/stat";
|
||||
import { StockpilingTag } from "#app/data/battler-tags";
|
||||
import type { TurnMove } from "#app/field/pokemon";
|
||||
import type { TurnMove } from "#app/@types/turn-move";
|
||||
import { MoveResult } from "#app/field/pokemon";
|
||||
import { CommandPhase } from "#app/phases/command-phase";
|
||||
import { TurnInitPhase } from "#app/phases/turn-init-phase";
|
||||
|
@ -1,7 +1,7 @@
|
||||
import { Stat } from "#enums/stat";
|
||||
import { StockpilingTag } from "#app/data/battler-tags";
|
||||
import { BattlerTagType } from "#app/enums/battler-tag-type";
|
||||
import type { TurnMove } from "#app/field/pokemon";
|
||||
import type { TurnMove } from "#app/@types/turn-move";
|
||||
import { MoveResult } from "#app/field/pokemon";
|
||||
import { MovePhase } from "#app/phases/move-phase";
|
||||
import { TurnInitPhase } from "#app/phases/turn-init-phase";
|
||||
|
Loading…
Reference in New Issue
Block a user