mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-07-04 15:32:18 +02:00
Merge branch 'beta' into is-player
This commit is contained in:
commit
d12ac48b04
@ -42,9 +42,6 @@
|
|||||||
// TODO: Remove if we ever get down to 0 circular imports
|
// TODO: Remove if we ever get down to 0 circular imports
|
||||||
"organizeImports": { "enabled": false },
|
"organizeImports": { "enabled": false },
|
||||||
"linter": {
|
"linter": {
|
||||||
"ignore": [
|
|
||||||
"src/phases/move-effect-phase.ts" // TODO: unignore after move-effect-phase refactor
|
|
||||||
],
|
|
||||||
"enabled": true,
|
"enabled": true,
|
||||||
"rules": {
|
"rules": {
|
||||||
"recommended": true,
|
"recommended": true,
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
/**
|
export interface DexData {
|
||||||
* Dex entry for a single Pokemon Species
|
[key: number]: DexEntry;
|
||||||
*/
|
}
|
||||||
|
|
||||||
export interface DexEntry {
|
export interface DexEntry {
|
||||||
seenAttr: bigint;
|
seenAttr: bigint;
|
||||||
caughtAttr: bigint;
|
caughtAttr: bigint;
|
||||||
@ -10,7 +11,3 @@ export interface DexEntry {
|
|||||||
hatchedCount: number;
|
hatchedCount: number;
|
||||||
ivs: number[];
|
ivs: number[];
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface DexData {
|
|
||||||
[key: number]: DexEntry;
|
|
||||||
}
|
|
@ -2,9 +2,6 @@ export interface Localizable {
|
|||||||
localize(): void;
|
localize(): void;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface TranslationEntries {
|
|
||||||
[key: string]: string | { [key: string]: string };
|
|
||||||
}
|
|
||||||
export interface SimpleTranslationEntries {
|
export interface SimpleTranslationEntries {
|
||||||
[key: string]: string;
|
[key: string]: string;
|
||||||
}
|
}
|
@ -2,8 +2,8 @@ import type { EnemyPokemon } from "#app/field/pokemon";
|
|||||||
import type { PersistentModifier } from "#app/modifier/modifier";
|
import type { PersistentModifier } from "#app/modifier/modifier";
|
||||||
import type { PartyMemberStrength } from "#enums/party-member-strength";
|
import type { PartyMemberStrength } from "#enums/party-member-strength";
|
||||||
import type { SpeciesId } from "#enums/species-id";
|
import type { SpeciesId } from "#enums/species-id";
|
||||||
import type { TrainerConfig } from "./trainer-config";
|
import type { TrainerConfig } from "../data/trainers/trainer-config";
|
||||||
import type { TrainerPartyTemplate } from "./TrainerPartyTemplate";
|
import type { TrainerPartyTemplate } from "../data/trainers/TrainerPartyTemplate";
|
||||||
|
|
||||||
export type PartyTemplateFunc = () => TrainerPartyTemplate;
|
export type PartyTemplateFunc = () => TrainerPartyTemplate;
|
||||||
export type PartyMemberFunc = (level: number, strength: PartyMemberStrength) => EnemyPokemon;
|
export type PartyMemberFunc = (level: number, strength: PartyMemberStrength) => EnemyPokemon;
|
@ -120,7 +120,7 @@ import { SceneBase } from "#app/scene-base";
|
|||||||
import CandyBar from "#app/ui/candy-bar";
|
import CandyBar from "#app/ui/candy-bar";
|
||||||
import type { Variant } from "#app/sprites/variant";
|
import type { Variant } from "#app/sprites/variant";
|
||||||
import { variantData, clearVariantData } from "#app/sprites/variant";
|
import { variantData, clearVariantData } from "#app/sprites/variant";
|
||||||
import type { Localizable } from "#app/interfaces/locales";
|
import type { Localizable } from "#app/@types/locales";
|
||||||
import Overrides from "#app/overrides";
|
import Overrides from "#app/overrides";
|
||||||
import { InputsController } from "#app/inputs-controller";
|
import { InputsController } from "#app/inputs-controller";
|
||||||
import { UiInputs } from "#app/ui-inputs";
|
import { UiInputs } from "#app/ui-inputs";
|
||||||
@ -169,7 +169,7 @@ import {
|
|||||||
import { MysteryEncounterSaveData } from "#app/data/mystery-encounters/mystery-encounter-save-data";
|
import { MysteryEncounterSaveData } from "#app/data/mystery-encounters/mystery-encounter-save-data";
|
||||||
import { MysteryEncounterType } from "#enums/mystery-encounter-type";
|
import { MysteryEncounterType } from "#enums/mystery-encounter-type";
|
||||||
import { MysteryEncounterTier } from "#enums/mystery-encounter-tier";
|
import { MysteryEncounterTier } from "#enums/mystery-encounter-tier";
|
||||||
import type HeldModifierConfig from "#app/interfaces/held-modifier-config";
|
import type HeldModifierConfig from "#app/@types/held-modifier-config";
|
||||||
import { ExpPhase } from "#app/phases/exp-phase";
|
import { ExpPhase } from "#app/phases/exp-phase";
|
||||||
import { ShowPartyExpBarPhase } from "#app/phases/show-party-exp-bar-phase";
|
import { ShowPartyExpBarPhase } from "#app/phases/show-party-exp-bar-phase";
|
||||||
import { MysteryEncounterMode } from "#enums/mystery-encounter-mode";
|
import { MysteryEncounterMode } from "#enums/mystery-encounter-mode";
|
||||||
|
@ -2,7 +2,7 @@ import { AbilityId } from "#enums/ability-id";
|
|||||||
import type { AbAttrCondition } from "#app/@types/ability-types";
|
import type { AbAttrCondition } from "#app/@types/ability-types";
|
||||||
import type { AbAttr } from "#app/data/abilities/ab-attrs/ab-attr";
|
import type { AbAttr } from "#app/data/abilities/ab-attrs/ab-attr";
|
||||||
import i18next from "i18next";
|
import i18next from "i18next";
|
||||||
import type { Localizable } from "#app/interfaces/locales";
|
import type { Localizable } from "#app/@types/locales";
|
||||||
import type { Constructor } from "#app/utils/common";
|
import type { Constructor } from "#app/utils/common";
|
||||||
|
|
||||||
export class Ability implements Localizable {
|
export class Ability implements Localizable {
|
||||||
|
@ -4438,6 +4438,7 @@ export class PostDancingMoveAbAttr extends PostMoveUsedAbAttr {
|
|||||||
simulated: boolean,
|
simulated: boolean,
|
||||||
args: any[]): void {
|
args: any[]): void {
|
||||||
if (!simulated) {
|
if (!simulated) {
|
||||||
|
dancer.turnData.extraTurns++;
|
||||||
// If the move is an AttackMove or a StatusMove the Dancer must replicate the move on the source of the Dance
|
// If the move is an AttackMove or a StatusMove the Dancer must replicate the move on the source of the Dance
|
||||||
if (move.getMove() instanceof AttackMove || move.getMove() instanceof StatusMove) {
|
if (move.getMove() instanceof AttackMove || move.getMove() instanceof StatusMove) {
|
||||||
const target = this.getTarget(dancer, source, targets);
|
const target = this.getTarget(dancer, source, targets);
|
||||||
|
@ -649,20 +649,14 @@ class NoRetreatTag extends TrappedTag {
|
|||||||
*/
|
*/
|
||||||
export class FlinchedTag extends BattlerTag {
|
export class FlinchedTag extends BattlerTag {
|
||||||
constructor(sourceMove: MoveId) {
|
constructor(sourceMove: MoveId) {
|
||||||
super(BattlerTagType.FLINCHED, [BattlerTagLapseType.PRE_MOVE, BattlerTagLapseType.TURN_END], 0, sourceMove);
|
super(BattlerTagType.FLINCHED, [BattlerTagLapseType.PRE_MOVE, BattlerTagLapseType.TURN_END], 1, sourceMove);
|
||||||
}
|
|
||||||
|
|
||||||
onAdd(pokemon: Pokemon): void {
|
|
||||||
super.onAdd(pokemon);
|
|
||||||
|
|
||||||
applyAbAttrs(FlinchEffectAbAttr, pokemon, null);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Cancels the Pokemon's next Move on the turn this tag is applied
|
* Cancels the flinched Pokemon's currently used move this turn if called mid-execution, or removes the tag at end of turn.
|
||||||
* @param pokemon The {@linkcode Pokemon} with this tag
|
* @param pokemon - The {@linkcode Pokemon} with this tag.
|
||||||
* @param lapseType The {@linkcode BattlerTagLapseType lapse type} used for this function call
|
* @param lapseType - The {@linkcode BattlerTagLapseType | lapse type} used for this function call.
|
||||||
* @returns `false` (This tag is always removed after applying its effects)
|
* @returns Whether the tag should remain active.
|
||||||
*/
|
*/
|
||||||
lapse(pokemon: Pokemon, lapseType: BattlerTagLapseType): boolean {
|
lapse(pokemon: Pokemon, lapseType: BattlerTagLapseType): boolean {
|
||||||
if (lapseType === BattlerTagLapseType.PRE_MOVE) {
|
if (lapseType === BattlerTagLapseType.PRE_MOVE) {
|
||||||
@ -672,6 +666,8 @@ export class FlinchedTag extends BattlerTag {
|
|||||||
pokemonNameWithAffix: getPokemonNameWithAffix(pokemon),
|
pokemonNameWithAffix: getPokemonNameWithAffix(pokemon),
|
||||||
}),
|
}),
|
||||||
);
|
);
|
||||||
|
applyAbAttrs(FlinchEffectAbAttr, pokemon, null);
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
return super.lapse(pokemon, lapseType);
|
return super.lapse(pokemon, lapseType);
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
import { globalScene } from "#app/global-scene";
|
import { globalScene } from "#app/global-scene";
|
||||||
import type { PlayerPokemon } from "#app/field/pokemon";
|
import type { PlayerPokemon } from "#app/field/pokemon";
|
||||||
import type { DexEntry, StarterDataEntry } from "#app/system/game-data";
|
import type { StarterDataEntry } from "#app/system/game-data";
|
||||||
|
import type { DexEntry } from "#app/@types/dex-data";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Stores data associated with a specific egg and the hatched pokemon
|
* Stores data associated with a specific egg and the hatched pokemon
|
||||||
|
@ -81,7 +81,7 @@ import { TerrainType } from "../terrain";
|
|||||||
import { ModifierPoolType } from "#app/modifier/modifier-type";
|
import { ModifierPoolType } from "#app/modifier/modifier-type";
|
||||||
import { Command } from "../../ui/command-ui-handler";
|
import { Command } from "../../ui/command-ui-handler";
|
||||||
import i18next from "i18next";
|
import i18next from "i18next";
|
||||||
import type { Localizable } from "#app/interfaces/locales";
|
import type { Localizable } from "#app/@types/locales";
|
||||||
import { getBerryEffectFunc } from "../berry";
|
import { getBerryEffectFunc } from "../berry";
|
||||||
import { AbilityId } from "#enums/ability-id";
|
import { AbilityId } from "#enums/ability-id";
|
||||||
import { ArenaTagType } from "#enums/arena-tag-type";
|
import { ArenaTagType } from "#enums/arena-tag-type";
|
||||||
|
@ -33,7 +33,7 @@ import {
|
|||||||
} from "#app/data/mystery-encounters/utils/encounter-pokemon-utils";
|
} from "#app/data/mystery-encounters/utils/encounter-pokemon-utils";
|
||||||
import { TrainerSlot } from "#enums/trainer-slot";
|
import { TrainerSlot } from "#enums/trainer-slot";
|
||||||
import { PokeballType } from "#enums/pokeball";
|
import { PokeballType } from "#enums/pokeball";
|
||||||
import type HeldModifierConfig from "#app/interfaces/held-modifier-config";
|
import type HeldModifierConfig from "#app/@types/held-modifier-config";
|
||||||
import type { BerryType } from "#enums/berry-type";
|
import type { BerryType } from "#enums/berry-type";
|
||||||
import { StatStageChangePhase } from "#app/phases/stat-stage-change-phase";
|
import { StatStageChangePhase } from "#app/phases/stat-stage-change-phase";
|
||||||
import { Stat } from "#enums/stat";
|
import { Stat } from "#enums/stat";
|
||||||
|
@ -25,7 +25,7 @@ import { MysteryEncounterOptionBuilder } from "#app/data/mystery-encounters/myst
|
|||||||
import { queueEncounterMessage, showEncounterText } from "#app/data/mystery-encounters/utils/encounter-dialogue-utils";
|
import { queueEncounterMessage, showEncounterText } from "#app/data/mystery-encounters/utils/encounter-dialogue-utils";
|
||||||
import { MysteryEncounterTier } from "#enums/mystery-encounter-tier";
|
import { MysteryEncounterTier } from "#enums/mystery-encounter-tier";
|
||||||
import { MysteryEncounterOptionMode } from "#enums/mystery-encounter-option-mode";
|
import { MysteryEncounterOptionMode } from "#enums/mystery-encounter-option-mode";
|
||||||
import type HeldModifierConfig from "#app/interfaces/held-modifier-config";
|
import type HeldModifierConfig from "#app/@types/held-modifier-config";
|
||||||
import i18next from "i18next";
|
import i18next from "i18next";
|
||||||
import { getStatKey } from "#enums/stat";
|
import { getStatKey } from "#enums/stat";
|
||||||
import { CLASSIC_MODE_MYSTERY_ENCOUNTER_WAVES } from "#app/constants";
|
import { CLASSIC_MODE_MYSTERY_ENCOUNTER_WAVES } from "#app/constants";
|
||||||
|
@ -39,7 +39,7 @@ import { PlayerGender } from "#enums/player-gender";
|
|||||||
import { TrainerType } from "#enums/trainer-type";
|
import { TrainerType } from "#enums/trainer-type";
|
||||||
import PokemonData from "#app/system/pokemon-data";
|
import PokemonData from "#app/system/pokemon-data";
|
||||||
import { Nature } from "#enums/nature";
|
import { Nature } from "#enums/nature";
|
||||||
import type HeldModifierConfig from "#app/interfaces/held-modifier-config";
|
import type HeldModifierConfig from "#app/@types/held-modifier-config";
|
||||||
import { trainerConfigs } from "#app/data/trainers/trainer-config";
|
import { trainerConfigs } from "#app/data/trainers/trainer-config";
|
||||||
import { TrainerPartyTemplate } from "#app/data/trainers/TrainerPartyTemplate";
|
import { TrainerPartyTemplate } from "#app/data/trainers/TrainerPartyTemplate";
|
||||||
import { PartyMemberStrength } from "#enums/party-member-strength";
|
import { PartyMemberStrength } from "#enums/party-member-strength";
|
||||||
|
@ -50,7 +50,7 @@ import type PokemonSpecies from "#app/data/pokemon-species";
|
|||||||
import type { IEggOptions } from "#app/data/egg";
|
import type { IEggOptions } from "#app/data/egg";
|
||||||
import { Egg } from "#app/data/egg";
|
import { Egg } from "#app/data/egg";
|
||||||
import type { CustomPokemonData } from "#app/data/custom-pokemon-data";
|
import type { CustomPokemonData } from "#app/data/custom-pokemon-data";
|
||||||
import type HeldModifierConfig from "#app/interfaces/held-modifier-config";
|
import type HeldModifierConfig from "#app/@types/held-modifier-config";
|
||||||
import { MovePhase } from "#app/phases/move-phase";
|
import { MovePhase } from "#app/phases/move-phase";
|
||||||
import { EggLapsePhase } from "#app/phases/egg-lapse-phase";
|
import { EggLapsePhase } from "#app/phases/egg-lapse-phase";
|
||||||
import { TrainerVictoryPhase } from "#app/phases/trainer-victory-phase";
|
import { TrainerVictoryPhase } from "#app/phases/trainer-victory-phase";
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import type { Localizable } from "#app/interfaces/locales";
|
import type { Localizable } from "#app/@types/locales";
|
||||||
import { AbilityId } from "#enums/ability-id";
|
import { AbilityId } from "#enums/ability-id";
|
||||||
import { PartyMemberStrength } from "#enums/party-member-strength";
|
import { PartyMemberStrength } from "#enums/party-member-strength";
|
||||||
import { SpeciesId } from "#enums/species-id";
|
import { SpeciesId } from "#enums/species-id";
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import type { TrainerTierPools } from "#app/data/trainers/typedefs";
|
import type { TrainerTierPools } from "#app/@types/trainer-funcs";
|
||||||
import { TrainerPoolTier } from "#enums/trainer-pool-tier";
|
import { TrainerPoolTier } from "#enums/trainer-pool-tier";
|
||||||
import { SpeciesId } from "#enums/species-id";
|
import { SpeciesId } from "#enums/species-id";
|
||||||
|
|
||||||
|
@ -48,7 +48,7 @@ import type {
|
|||||||
TrainerTierPools,
|
TrainerTierPools,
|
||||||
TrainerConfigs,
|
TrainerConfigs,
|
||||||
PartyMemberFuncs,
|
PartyMemberFuncs,
|
||||||
} from "./typedefs";
|
} from "../../@types/trainer-funcs";
|
||||||
|
|
||||||
/** Minimum BST for Pokemon generated onto the Elite Four's teams */
|
/** Minimum BST for Pokemon generated onto the Elite Four's teams */
|
||||||
const ELITE_FOUR_MINIMUM_BST = 460;
|
const ELITE_FOUR_MINIMUM_BST = 460;
|
||||||
|
17
src/debug.js
17
src/debug.js
@ -1,17 +0,0 @@
|
|||||||
export function getData() {
|
|
||||||
const dataStr = localStorage.getItem("data");
|
|
||||||
if (!dataStr) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
return JSON.parse(atob(dataStr), (k, v) =>
|
|
||||||
k.endsWith("Attr") && !["natureAttr", "abilityAttr", "passiveAttr"].includes(k) ? BigInt(v) : v,
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
export function getSession() {
|
|
||||||
const sessionStr = localStorage.getItem("sessionData");
|
|
||||||
if (!sessionStr) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
return JSON.parse(atob(sessionStr));
|
|
||||||
}
|
|
@ -1,4 +1,3 @@
|
|||||||
export const starterColors: StarterColors = {};
|
export const starterColors: {
|
||||||
interface StarterColors {
|
|
||||||
[key: string]: [string, string];
|
[key: string]: [string, string];
|
||||||
}
|
} = {};
|
||||||
|
@ -219,6 +219,7 @@ export class MoveEffectPhase extends PokemonPhase {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
// biome-ignore lint/suspicious/noFallthroughSwitchClause: The fallthrough is intentional
|
||||||
case HitCheckResult.NO_EFFECT:
|
case HitCheckResult.NO_EFFECT:
|
||||||
globalScene.queueMessage(
|
globalScene.queueMessage(
|
||||||
i18next.t(this.move.id === MoveId.SHEER_COLD ? "battle:hitResultImmune" : "battle:hitResultNoEffect", {
|
i18next.t(this.move.id === MoveId.SHEER_COLD ? "battle:hitResultImmune" : "battle:hitResultNoEffect", {
|
||||||
@ -294,7 +295,8 @@ export class MoveEffectPhase extends PokemonPhase {
|
|||||||
|
|
||||||
// If other effects were overriden, stop this phase before they can be applied
|
// If other effects were overriden, stop this phase before they can be applied
|
||||||
if (overridden.value) {
|
if (overridden.value) {
|
||||||
return this.end();
|
this.end();
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Lapse `MOVE_EFFECT` effects (i.e. semi-invulnerability) when applicable
|
// Lapse `MOVE_EFFECT` effects (i.e. semi-invulnerability) when applicable
|
||||||
@ -743,7 +745,7 @@ export class MoveEffectPhase extends PokemonPhase {
|
|||||||
firstTarget?: boolean | null,
|
firstTarget?: boolean | null,
|
||||||
selfTarget?: boolean,
|
selfTarget?: boolean,
|
||||||
): void {
|
): void {
|
||||||
return applyFilteredMoveAttrs(
|
applyFilteredMoveAttrs(
|
||||||
(attr: MoveAttr) =>
|
(attr: MoveAttr) =>
|
||||||
attr instanceof MoveEffectAttr &&
|
attr instanceof MoveEffectAttr &&
|
||||||
attr.trigger === triggerType &&
|
attr.trigger === triggerType &&
|
||||||
|
@ -1,4 +0,0 @@
|
|||||||
export const starterColors: StarterColors = {};
|
|
||||||
interface StarterColors {
|
|
||||||
[key: string]: [string, string];
|
|
||||||
}
|
|
@ -62,6 +62,7 @@ import { pokerogueApi } from "#app/plugins/api/pokerogue-api";
|
|||||||
import { ArenaTrapTag } from "#app/data/arena-tag";
|
import { ArenaTrapTag } from "#app/data/arena-tag";
|
||||||
import { pokemonFormChanges } from "#app/data/pokemon-forms";
|
import { pokemonFormChanges } from "#app/data/pokemon-forms";
|
||||||
import type { PokemonType } from "#enums/pokemon-type";
|
import type { PokemonType } from "#enums/pokemon-type";
|
||||||
|
import type { DexData, DexEntry } from "../@types/dex-data";
|
||||||
|
|
||||||
export const defaultStarterSpecies: SpeciesId[] = [
|
export const defaultStarterSpecies: SpeciesId[] = [
|
||||||
SpeciesId.BULBASAUR,
|
SpeciesId.BULBASAUR,
|
||||||
@ -131,6 +132,7 @@ export function decrypt(data: string, bypassLogin: boolean): string {
|
|||||||
)(data);
|
)(data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO: Move all these exported interfaces to @types
|
||||||
export interface SystemSaveData {
|
export interface SystemSaveData {
|
||||||
trainerId: number;
|
trainerId: number;
|
||||||
secretId: number;
|
secretId: number;
|
||||||
@ -191,20 +193,6 @@ export interface VoucherCounts {
|
|||||||
[type: string]: number;
|
[type: string]: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface DexData {
|
|
||||||
[key: number]: DexEntry;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface DexEntry {
|
|
||||||
seenAttr: bigint;
|
|
||||||
caughtAttr: bigint;
|
|
||||||
natureAttr: number;
|
|
||||||
seenCount: number;
|
|
||||||
caughtCount: number;
|
|
||||||
hatchedCount: number;
|
|
||||||
ivs: number[];
|
|
||||||
}
|
|
||||||
|
|
||||||
export type StarterMoveset = [MoveId] | [MoveId, MoveId] | [MoveId, MoveId, MoveId] | [MoveId, MoveId, MoveId, MoveId];
|
export type StarterMoveset = [MoveId] | [MoveId, MoveId] | [MoveId, MoveId, MoveId] | [MoveId, MoveId, MoveId, MoveId];
|
||||||
|
|
||||||
export interface StarterFormMoveData {
|
export interface StarterFormMoveData {
|
||||||
|
@ -1,22 +0,0 @@
|
|||||||
import type { GameModes } from "../game-mode";
|
|
||||||
import type PokemonData from "./pokemon-data";
|
|
||||||
import type PersistentModifierData from "./modifier-data";
|
|
||||||
|
|
||||||
export enum SessionHistoryResult {
|
|
||||||
ACTIVE,
|
|
||||||
WIN,
|
|
||||||
LOSS,
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface SessionHistory {
|
|
||||||
seed: string;
|
|
||||||
playTime: number;
|
|
||||||
result: SessionHistoryResult;
|
|
||||||
gameMode: GameModes;
|
|
||||||
party: PokemonData[];
|
|
||||||
modifiers: PersistentModifierData[];
|
|
||||||
money: number;
|
|
||||||
waveIndex: number;
|
|
||||||
gameVersion: string;
|
|
||||||
timestamp: number;
|
|
||||||
}
|
|
@ -20,7 +20,8 @@ import { allSpecies, getPokemonSpecies, getPokemonSpeciesForm, normalForm } from
|
|||||||
import { getStarterValueFriendshipCap, speciesStarterCosts } from "#app/data/balance/starters";
|
import { getStarterValueFriendshipCap, speciesStarterCosts } from "#app/data/balance/starters";
|
||||||
import { starterPassiveAbilities } from "#app/data/balance/passives";
|
import { starterPassiveAbilities } from "#app/data/balance/passives";
|
||||||
import { PokemonType } from "#enums/pokemon-type";
|
import { PokemonType } from "#enums/pokemon-type";
|
||||||
import type { DexEntry, StarterAttributes } from "#app/system/game-data";
|
import type { StarterAttributes } from "#app/system/game-data";
|
||||||
|
import type { DexEntry } from "#app/@types/dex-data";
|
||||||
import { AbilityAttr, DexAttr } from "#app/system/game-data";
|
import { AbilityAttr, DexAttr } from "#app/system/game-data";
|
||||||
import type { OptionSelectItem } from "#app/ui/abstact-option-select-ui-handler";
|
import type { OptionSelectItem } from "#app/ui/abstact-option-select-ui-handler";
|
||||||
import MessageUiHandler from "#app/ui/message-ui-handler";
|
import MessageUiHandler from "#app/ui/message-ui-handler";
|
||||||
|
@ -11,7 +11,8 @@ import { allSpecies, getPokemonSpeciesForm, getPokerusStarters, normalForm } fro
|
|||||||
import { getStarterValueFriendshipCap, speciesStarterCosts, POKERUS_STARTER_COUNT } from "#app/data/balance/starters";
|
import { getStarterValueFriendshipCap, speciesStarterCosts, POKERUS_STARTER_COUNT } from "#app/data/balance/starters";
|
||||||
import { catchableSpecies } from "#app/data/balance/biomes";
|
import { catchableSpecies } from "#app/data/balance/biomes";
|
||||||
import { PokemonType } from "#enums/pokemon-type";
|
import { PokemonType } from "#enums/pokemon-type";
|
||||||
import type { DexAttrProps, DexEntry, StarterAttributes, StarterPreferences } from "#app/system/game-data";
|
import type { DexAttrProps, StarterAttributes, StarterPreferences } from "#app/system/game-data";
|
||||||
|
import type { DexEntry } from "#app/@types/dex-data";
|
||||||
import { AbilityAttr, DexAttr, loadStarterPreferences } from "#app/system/game-data";
|
import { AbilityAttr, DexAttr, loadStarterPreferences } from "#app/system/game-data";
|
||||||
import MessageUiHandler from "#app/ui/message-ui-handler";
|
import MessageUiHandler from "#app/ui/message-ui-handler";
|
||||||
import PokemonIconAnimHandler, { PokemonIconAnimMode } from "#app/ui/pokemon-icon-anim-handler";
|
import PokemonIconAnimHandler, { PokemonIconAnimMode } from "#app/ui/pokemon-icon-anim-handler";
|
||||||
|
@ -6,7 +6,8 @@ import { getNatureName } from "../data/nature";
|
|||||||
import { PokemonType } from "#enums/pokemon-type";
|
import { PokemonType } from "#enums/pokemon-type";
|
||||||
import type Pokemon from "../field/pokemon";
|
import type Pokemon from "../field/pokemon";
|
||||||
import i18next from "i18next";
|
import i18next from "i18next";
|
||||||
import type { DexEntry, StarterDataEntry } from "../system/game-data";
|
import type { StarterDataEntry } from "../system/game-data";
|
||||||
|
import type { DexEntry } from "#app/@types/dex-data";
|
||||||
import { DexAttr } from "../system/game-data";
|
import { DexAttr } from "../system/game-data";
|
||||||
import { fixedInt, getShinyDescriptor } from "#app/utils/common";
|
import { fixedInt, getShinyDescriptor } from "#app/utils/common";
|
||||||
import ConfirmUiHandler from "./confirm-ui-handler";
|
import ConfirmUiHandler from "./confirm-ui-handler";
|
||||||
|
@ -23,13 +23,8 @@ import { allSpecies, getPokemonSpeciesForm, getPokerusStarters } from "#app/data
|
|||||||
import { getStarterValueFriendshipCap, speciesStarterCosts, POKERUS_STARTER_COUNT } from "#app/data/balance/starters";
|
import { getStarterValueFriendshipCap, speciesStarterCosts, POKERUS_STARTER_COUNT } from "#app/data/balance/starters";
|
||||||
import { PokemonType } from "#enums/pokemon-type";
|
import { PokemonType } from "#enums/pokemon-type";
|
||||||
import { GameModes } from "#app/game-mode";
|
import { GameModes } from "#app/game-mode";
|
||||||
import type {
|
import type { DexAttrProps, StarterMoveset, StarterAttributes, StarterPreferences } from "#app/system/game-data";
|
||||||
DexAttrProps,
|
import type { DexEntry } from "#app/@types/dex-data";
|
||||||
DexEntry,
|
|
||||||
StarterMoveset,
|
|
||||||
StarterAttributes,
|
|
||||||
StarterPreferences,
|
|
||||||
} from "#app/system/game-data";
|
|
||||||
import { AbilityAttr, DexAttr, loadStarterPreferences, saveStarterPreferences } from "#app/system/game-data";
|
import { AbilityAttr, DexAttr, loadStarterPreferences, saveStarterPreferences } from "#app/system/game-data";
|
||||||
import { Tutorial, handleTutorial } from "#app/tutorial";
|
import { Tutorial, handleTutorial } from "#app/tutorial";
|
||||||
import type { OptionSelectItem } from "#app/ui/abstact-option-select-ui-handler";
|
import type { OptionSelectItem } from "#app/ui/abstact-option-select-ui-handler";
|
||||||
|
@ -1,8 +1,10 @@
|
|||||||
import { BattlerIndex } from "#app/battle";
|
import { BattlerIndex } from "#app/battle";
|
||||||
|
import { MoveResult } from "#app/field/pokemon";
|
||||||
import type { MovePhase } from "#app/phases/move-phase";
|
import type { MovePhase } from "#app/phases/move-phase";
|
||||||
import { AbilityId } from "#enums/ability-id";
|
import { AbilityId } from "#enums/ability-id";
|
||||||
import { MoveId } from "#enums/move-id";
|
import { MoveId } from "#enums/move-id";
|
||||||
import { SpeciesId } from "#enums/species-id";
|
import { SpeciesId } from "#enums/species-id";
|
||||||
|
import { Stat } from "#enums/stat";
|
||||||
import GameManager from "#test/testUtils/gameManager";
|
import GameManager from "#test/testUtils/gameManager";
|
||||||
import Phaser from "phaser";
|
import Phaser from "phaser";
|
||||||
import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest";
|
import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest";
|
||||||
@ -99,4 +101,43 @@ describe("Abilities - Dancer", () => {
|
|||||||
expect(currentPhase.pokemon).toBe(oricorio);
|
expect(currentPhase.pokemon).toBe(oricorio);
|
||||||
expect(currentPhase.move.moveId).toBe(MoveId.REVELATION_DANCE);
|
expect(currentPhase.move.moveId).toBe(MoveId.REVELATION_DANCE);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it("should not break subsequent last hit only moves", async () => {
|
||||||
|
game.override.battleStyle("single");
|
||||||
|
await game.classicMode.startBattle([SpeciesId.ORICORIO, SpeciesId.FEEBAS]);
|
||||||
|
|
||||||
|
const [oricorio, feebas] = game.scene.getPlayerParty();
|
||||||
|
|
||||||
|
game.move.use(MoveId.BATON_PASS);
|
||||||
|
game.doSelectPartyPokemon(1);
|
||||||
|
await game.move.forceEnemyMove(MoveId.SWORDS_DANCE);
|
||||||
|
await game.setTurnOrder([BattlerIndex.ENEMY, BattlerIndex.PLAYER]);
|
||||||
|
await game.phaseInterceptor.to("TurnEndPhase");
|
||||||
|
|
||||||
|
expect(game.phaseInterceptor.log).toContain("SwitchSummonPhase");
|
||||||
|
expect(game.field.getPlayerPokemon()).toBe(feebas);
|
||||||
|
expect(feebas.getStatStage(Stat.ATK)).toBe(2);
|
||||||
|
expect(oricorio.isOnField()).toBe(false);
|
||||||
|
expect(oricorio.visible).toBe(false);
|
||||||
|
});
|
||||||
|
|
||||||
|
it("should not trigger while flinched", async () => {
|
||||||
|
game.override.battleStyle("double").moveset(MoveId.SPLASH).enemyMoveset([MoveId.SWORDS_DANCE, MoveId.FAKE_OUT]);
|
||||||
|
await game.classicMode.startBattle([SpeciesId.ORICORIO]);
|
||||||
|
|
||||||
|
const oricorio = game.scene.getPlayerPokemon()!;
|
||||||
|
expect(oricorio).toBeDefined();
|
||||||
|
|
||||||
|
// get faked out and copy swords dance
|
||||||
|
game.move.select(MoveId.SPLASH);
|
||||||
|
await game.move.forceEnemyMove(MoveId.SWORDS_DANCE);
|
||||||
|
await game.move.forceEnemyMove(MoveId.FAKE_OUT, BattlerIndex.PLAYER);
|
||||||
|
await game.phaseInterceptor.to("TurnEndPhase");
|
||||||
|
|
||||||
|
expect(oricorio.getLastXMoves(-1)[0]).toMatchObject({
|
||||||
|
move: MoveId.NONE,
|
||||||
|
result: MoveResult.FAIL,
|
||||||
|
});
|
||||||
|
expect(oricorio.getStatStage(Stat.ATK)).toBe(0);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
@ -1,13 +1,15 @@
|
|||||||
import { BattlerIndex } from "#app/battle";
|
import { BattlerIndex } from "#app/battle";
|
||||||
|
import { allMoves } from "#app/data/data-lists";
|
||||||
import type Pokemon from "#app/field/pokemon";
|
import type Pokemon from "#app/field/pokemon";
|
||||||
import { MoveResult } from "#app/field/pokemon";
|
import { MoveResult } from "#app/field/pokemon";
|
||||||
import type { MovePhase } from "#app/phases/move-phase";
|
import type { MovePhase } from "#app/phases/move-phase";
|
||||||
import { AbilityId } from "#enums/ability-id";
|
import { AbilityId } from "#enums/ability-id";
|
||||||
import { MoveId } from "#enums/move-id";
|
import { MoveId } from "#enums/move-id";
|
||||||
import { SpeciesId } from "#enums/species-id";
|
import { SpeciesId } from "#enums/species-id";
|
||||||
|
import { Stat } from "#enums/stat";
|
||||||
import GameManager from "#test/testUtils/gameManager";
|
import GameManager from "#test/testUtils/gameManager";
|
||||||
import Phaser from "phaser";
|
import Phaser from "phaser";
|
||||||
import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest";
|
import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest";
|
||||||
|
|
||||||
describe("Moves - Instruct", () => {
|
describe("Moves - Instruct", () => {
|
||||||
let phaserGame: Phaser.Game;
|
let phaserGame: Phaser.Game;
|
||||||
@ -34,7 +36,8 @@ describe("Moves - Instruct", () => {
|
|||||||
game.override
|
game.override
|
||||||
.battleStyle("single")
|
.battleStyle("single")
|
||||||
.enemySpecies(SpeciesId.SHUCKLE)
|
.enemySpecies(SpeciesId.SHUCKLE)
|
||||||
.enemyAbility(AbilityId.NO_GUARD)
|
.enemyAbility(AbilityId.BALL_FETCH)
|
||||||
|
.passiveAbility(AbilityId.NO_GUARD)
|
||||||
.enemyLevel(100)
|
.enemyLevel(100)
|
||||||
.startingLevel(100)
|
.startingLevel(100)
|
||||||
.disableCrits();
|
.disableCrits();
|
||||||
@ -536,4 +539,27 @@ describe("Moves - Instruct", () => {
|
|||||||
|
|
||||||
expect(ivysaur.turnData.attacksReceived.length).toBe(15);
|
expect(ivysaur.turnData.attacksReceived.length).toBe(15);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it("should respect prior flinches and trigger Steadfast", async () => {
|
||||||
|
game.override.battleStyle("double");
|
||||||
|
vi.spyOn(allMoves[MoveId.AIR_SLASH], "chance", "get").mockReturnValue(100);
|
||||||
|
await game.classicMode.startBattle([SpeciesId.AUDINO, SpeciesId.ABRA]);
|
||||||
|
|
||||||
|
// Fake enemy 1 having attacked prior
|
||||||
|
const [, player2, enemy1, enemy2] = game.scene.getField();
|
||||||
|
enemy1.pushMoveHistory({ move: MoveId.ABSORB, targets: [BattlerIndex.PLAYER] });
|
||||||
|
game.field.mockAbility(enemy1, AbilityId.STEADFAST);
|
||||||
|
|
||||||
|
game.move.use(MoveId.AIR_SLASH, BattlerIndex.PLAYER, BattlerIndex.ENEMY);
|
||||||
|
game.move.use(MoveId.INSTRUCT, BattlerIndex.PLAYER_2, BattlerIndex.ENEMY);
|
||||||
|
await game.move.forceEnemyMove(MoveId.ABSORB);
|
||||||
|
await game.move.forceEnemyMove(MoveId.INSTRUCT, BattlerIndex.ENEMY);
|
||||||
|
await game.setTurnOrder([BattlerIndex.PLAYER, BattlerIndex.ENEMY, BattlerIndex.PLAYER_2, BattlerIndex.ENEMY_2]);
|
||||||
|
await game.toEndOfTurn();
|
||||||
|
|
||||||
|
expect(enemy1.getLastXMoves(-1).map(m => m.move)).toEqual([MoveId.NONE, MoveId.NONE, MoveId.NONE, MoveId.ABSORB]);
|
||||||
|
expect(enemy1.getStatStage(Stat.SPD)).toBe(3);
|
||||||
|
expect(player2.getLastXMoves()[0].result).toBe(MoveResult.SUCCESS);
|
||||||
|
expect(enemy2.getLastXMoves()[0].result).toBe(MoveResult.SUCCESS);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user