Merge c0ce255f58
into 81f424dc71
This commit is contained in:
commit
3f77b67744
|
@ -66,7 +66,8 @@ import {
|
|||
PostItemLostAbAttr,
|
||||
} from "#app/data/ability";
|
||||
import type { FixedBattleConfig } from "#app/battle";
|
||||
import Battle, { BattleType } from "#app/battle";
|
||||
import Battle from "#app/battle";
|
||||
import { BattleType } from "#enums/battle-type";
|
||||
import type { GameMode } from "#app/game-mode";
|
||||
import { GameModes, getGameMode } from "#app/game-mode";
|
||||
import FieldSpritePipeline from "#app/pipelines/field-sprite";
|
||||
|
@ -1327,22 +1328,27 @@ export default class BattleScene extends SceneBase {
|
|||
} else {
|
||||
if (
|
||||
!this.gameMode.hasTrainers ||
|
||||
Overrides.BATTLE_TYPE_OVERRIDE === BattleType.WILD ||
|
||||
(Overrides.DISABLE_STANDARD_TRAINERS_OVERRIDE && isNullOrUndefined(trainerData))
|
||||
) {
|
||||
newBattleType = BattleType.WILD;
|
||||
} else if (battleType === undefined) {
|
||||
newBattleType = this.gameMode.isWaveTrainer(newWaveIndex, this.arena) ? BattleType.TRAINER : BattleType.WILD;
|
||||
} else {
|
||||
newBattleType = battleType;
|
||||
newBattleType =
|
||||
Overrides.BATTLE_TYPE_OVERRIDE ??
|
||||
battleType ??
|
||||
(this.gameMode.isWaveTrainer(newWaveIndex, this.arena) ? BattleType.TRAINER : BattleType.WILD);
|
||||
}
|
||||
|
||||
if (newBattleType === BattleType.TRAINER) {
|
||||
const trainerType = this.arena.randomTrainerType(newWaveIndex);
|
||||
const trainerType =
|
||||
Overrides.RANDOM_TRAINER_OVERRIDE?.trainerType ?? this.arena.randomTrainerType(newWaveIndex);
|
||||
let doubleTrainer = false;
|
||||
if (trainerConfigs[trainerType].doubleOnly) {
|
||||
doubleTrainer = true;
|
||||
} else if (trainerConfigs[trainerType].hasDouble) {
|
||||
doubleTrainer = !Utils.randSeedInt(this.getDoubleBattleChance(newWaveIndex, playerField));
|
||||
doubleTrainer =
|
||||
Overrides.RANDOM_TRAINER_OVERRIDE?.alwaysDouble ||
|
||||
!Utils.randSeedInt(this.getDoubleBattleChance(newWaveIndex, playerField));
|
||||
// Add a check that special trainers can't be double except for tate and liza - they should use the normal double chance
|
||||
if (
|
||||
trainerConfigs[trainerType].trainerTypeDouble &&
|
||||
|
@ -1362,7 +1368,10 @@ export default class BattleScene extends SceneBase {
|
|||
|
||||
// Check for mystery encounter
|
||||
// Can only occur in place of a standard (non-boss) wild battle, waves 10-180
|
||||
if (this.isWaveMysteryEncounter(newBattleType, newWaveIndex) || newBattleType === BattleType.MYSTERY_ENCOUNTER) {
|
||||
if (
|
||||
!Overrides.BATTLE_TYPE_OVERRIDE &&
|
||||
(this.isWaveMysteryEncounter(newBattleType, newWaveIndex) || newBattleType === BattleType.MYSTERY_ENCOUNTER)
|
||||
) {
|
||||
newBattleType = BattleType.MYSTERY_ENCOUNTER;
|
||||
// Reset to base spawn weight
|
||||
this.mysteryEncounterSaveData.encounterSpawnChance = BASE_MYSTERY_ENCOUNTER_SPAWN_WEIGHT;
|
||||
|
@ -1372,9 +1381,9 @@ export default class BattleScene extends SceneBase {
|
|||
if (double === undefined && newWaveIndex > 1) {
|
||||
if (newBattleType === BattleType.WILD && !this.gameMode.isWaveFinal(newWaveIndex)) {
|
||||
newDouble = !Utils.randSeedInt(this.getDoubleBattleChance(newWaveIndex, playerField));
|
||||
} else if (newBattleType === BattleType.TRAINER) {
|
||||
newDouble = newTrainer?.variant === TrainerVariant.DOUBLE;
|
||||
}
|
||||
} else if (double === undefined && newBattleType === BattleType.TRAINER) {
|
||||
newDouble = newTrainer?.variant === TrainerVariant.DOUBLE;
|
||||
} else if (!battleConfig) {
|
||||
newDouble = !!double;
|
||||
}
|
||||
|
@ -1384,10 +1393,10 @@ export default class BattleScene extends SceneBase {
|
|||
newDouble = false;
|
||||
}
|
||||
|
||||
if (!isNullOrUndefined(Overrides.BATTLE_TYPE_OVERRIDE)) {
|
||||
if (!isNullOrUndefined(Overrides.BATTLE_STYLE_OVERRIDE)) {
|
||||
let doubleOverrideForWave: "single" | "double" | null = null;
|
||||
|
||||
switch (Overrides.BATTLE_TYPE_OVERRIDE) {
|
||||
switch (Overrides.BATTLE_STYLE_OVERRIDE) {
|
||||
case "double":
|
||||
doubleOverrideForWave = "double";
|
||||
break;
|
||||
|
@ -1407,7 +1416,7 @@ export default class BattleScene extends SceneBase {
|
|||
}
|
||||
/**
|
||||
* Override battles into single only if not fighting with trainers.
|
||||
* @see {@link https://github.com/pagefaultgames/pokerogue/issues/1948 | GitHub Issue #1948}
|
||||
* @see {@link https://github.com/pagefaultgames/pokerogue/issues/1948 GitHub Issue #1948}
|
||||
*/
|
||||
if (newBattleType !== BattleType.TRAINER && doubleOverrideForWave === "single") {
|
||||
newDouble = false;
|
||||
|
|
|
@ -22,6 +22,7 @@ import { MysteryEncounterMode } from "#enums/mystery-encounter-mode";
|
|||
import type { CustomModifierSettings } from "#app/modifier/modifier-type";
|
||||
import { ModifierTier } from "#app/modifier/modifier-tier";
|
||||
import type { MysteryEncounterType } from "#enums/mystery-encounter-type";
|
||||
import { BattleType } from "#enums/battle-type";
|
||||
|
||||
export enum ClassicFixedBossWaves {
|
||||
TOWN_YOUNGSTER = 5,
|
||||
|
@ -46,13 +47,6 @@ export enum ClassicFixedBossWaves {
|
|||
RIVAL_6 = 195,
|
||||
}
|
||||
|
||||
export enum BattleType {
|
||||
WILD,
|
||||
TRAINER,
|
||||
CLEAR,
|
||||
MYSTERY_ENCOUNTER,
|
||||
}
|
||||
|
||||
export enum BattlerIndex {
|
||||
ATTACKER = -1,
|
||||
PLAYER,
|
||||
|
|
|
@ -26,7 +26,7 @@ import { Command } from "../ui/command-ui-handler";
|
|||
import { BerryModifierType } from "#app/modifier/modifier-type";
|
||||
import { getPokeballName } from "./pokeball";
|
||||
import type { BattlerIndex } from "#app/battle";
|
||||
import { BattleType } from "#app/battle";
|
||||
import { BattleType } from "#enums/battle-type";
|
||||
import { Abilities } from "#enums/abilities";
|
||||
import { ArenaTagType } from "#enums/arena-tag-type";
|
||||
import { BattlerTagType } from "#enums/battler-tag-type";
|
||||
|
@ -47,6 +47,7 @@ import { PokemonAnimType } from "#enums/pokemon-anim-type";
|
|||
import { StatusEffect } from "#enums/status-effect";
|
||||
import { WeatherType } from "#enums/weather-type";
|
||||
import { PokemonTransformPhase } from "#app/phases/pokemon-transform-phase";
|
||||
import { TrainerVariant } from "#app/field/trainer";
|
||||
|
||||
export class Ability implements Localizable {
|
||||
public id: Abilities;
|
||||
|
@ -5573,8 +5574,8 @@ class ForceSwitchOutHelper {
|
|||
|
||||
const party = player ? globalScene.getPlayerParty() : globalScene.getEnemyParty();
|
||||
return (!player && globalScene.currentBattle.battleType === BattleType.WILD)
|
||||
|| party.filter(p => p.isAllowedInBattle()
|
||||
&& (player || (p as EnemyPokemon).trainerSlot === (switchOutTarget as EnemyPokemon).trainerSlot)).length > globalScene.currentBattle.getBattlerCount();
|
||||
|| party.filter(p => p.isAllowedInBattle() && !p.isOnField()
|
||||
&& (player || (p as EnemyPokemon).trainerSlot === (switchOutTarget as EnemyPokemon).trainerSlot)).length > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -8,7 +8,8 @@ import { speciesStarterCosts } from "#app/data/balance/starters";
|
|||
import type Pokemon from "#app/field/pokemon";
|
||||
import { PokemonMove } from "#app/field/pokemon";
|
||||
import type { FixedBattleConfig } from "#app/battle";
|
||||
import { ClassicFixedBossWaves, BattleType, getRandomTrainerFunc } from "#app/battle";
|
||||
import { ClassicFixedBossWaves, getRandomTrainerFunc } from "#app/battle";
|
||||
import { BattleType } from "#enums/battle-type";
|
||||
import Trainer, { TrainerVariant } from "#app/field/trainer";
|
||||
import { PokemonType } from "#enums/pokemon-type";
|
||||
import { Challenges } from "#enums/challenges";
|
||||
|
|
|
@ -77,7 +77,7 @@ import {
|
|||
PreserveBerryModifier,
|
||||
} from "../../modifier/modifier";
|
||||
import type { BattlerIndex } from "../../battle";
|
||||
import { BattleType } from "../../battle";
|
||||
import { BattleType } from "#enums/battle-type";
|
||||
import { TerrainType } from "../terrain";
|
||||
import { ModifierPoolType } from "#app/modifier/modifier-type";
|
||||
import { Command } from "../../ui/command-ui-handler";
|
||||
|
@ -123,6 +123,7 @@ import { MoveFlags } from "#enums/MoveFlags";
|
|||
import { MoveEffectTrigger } from "#enums/MoveEffectTrigger";
|
||||
import { MultiHitType } from "#enums/MultiHitType";
|
||||
import { invalidAssistMoves, invalidCopycatMoves, invalidMetronomeMoves, invalidMirrorMoveMoves, invalidSleepTalkMoves } from "./invalid-moves";
|
||||
import { TrainerVariant } from "#app/field/trainer";
|
||||
|
||||
type MoveConditionFunc = (user: Pokemon, target: Pokemon, move: Move) => boolean;
|
||||
type UserMoveConditionFunc = (user: Pokemon, move: Move) => boolean;
|
||||
|
@ -6298,9 +6299,10 @@ export class ForceSwitchOutAttr extends MoveEffectAttr {
|
|||
return false;
|
||||
} else if (globalScene.currentBattle.battleType !== BattleType.WILD) { // Switch out logic for enemy trainers
|
||||
// Find indices of off-field Pokemon that are eligible to be switched into
|
||||
const isPartnerTrainer = globalScene.currentBattle.trainer?.isPartner();
|
||||
const eligibleNewIndices: number[] = [];
|
||||
globalScene.getEnemyParty().forEach((pokemon, index) => {
|
||||
if (pokemon.isAllowedInBattle() && !pokemon.isOnField()) {
|
||||
if (pokemon.isAllowedInBattle() && !pokemon.isOnField() && (!isPartnerTrainer || pokemon.trainerSlot === (switchOutTarget as EnemyPokemon).trainerSlot)) {
|
||||
eligibleNewIndices.push(index);
|
||||
}
|
||||
});
|
||||
|
@ -6350,15 +6352,6 @@ export class ForceSwitchOutAttr extends MoveEffectAttr {
|
|||
}
|
||||
}
|
||||
|
||||
if (globalScene.currentBattle.waveIndex % 10 === 0) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Don't allow wild mons to flee with U-turn et al.
|
||||
if (this.selfSwitch && !user.isPlayer() && move.category !== MoveCategory.STATUS) {
|
||||
return false;
|
||||
}
|
||||
|
||||
const allyPokemon = switchOutTarget.getAlly();
|
||||
|
||||
if (switchOutTarget.hp > 0) {
|
||||
|
@ -6371,13 +6364,12 @@ export class ForceSwitchOutAttr extends MoveEffectAttr {
|
|||
}
|
||||
}
|
||||
|
||||
if (!allyPokemon?.isActive(true)) {
|
||||
globalScene.clearEnemyHeldItemModifiers();
|
||||
// clear out enemy held item modifiers of the switch out target
|
||||
globalScene.clearEnemyHeldItemModifiers(switchOutTarget);
|
||||
|
||||
if (switchOutTarget.hp) {
|
||||
if (!allyPokemon?.isActive(true) && switchOutTarget.hp) {
|
||||
globalScene.pushPhase(new BattleEndPhase(false));
|
||||
globalScene.pushPhase(new NewBattlePhase());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -6396,6 +6388,7 @@ export class ForceSwitchOutAttr extends MoveEffectAttr {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
getSwitchOutCondition(): MoveConditionFunc {
|
||||
return (user, target, move) => {
|
||||
const switchOutTarget = (this.selfSwitch ? user : target);
|
||||
|
@ -6419,23 +6412,23 @@ export class ForceSwitchOutAttr extends MoveEffectAttr {
|
|||
|
||||
const blockedByAbility = new Utils.BooleanHolder(false);
|
||||
applyAbAttrs(ForceSwitchOutImmunityAbAttr, target, blockedByAbility);
|
||||
return !blockedByAbility.value;
|
||||
if (blockedByAbility.value) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (!player && globalScene.currentBattle.battleType === BattleType.WILD) {
|
||||
if (this.isBatonPass()) {
|
||||
return false;
|
||||
}
|
||||
// Don't allow wild opponents to flee on the boss stage since it can ruin a run early on
|
||||
if (globalScene.currentBattle.waveIndex % 10 === 0) {
|
||||
return false;
|
||||
}
|
||||
// wild pokemon cannot switch out with baton pass.
|
||||
return !this.isBatonPass()
|
||||
&& globalScene.currentBattle.waveIndex % 10 !== 0
|
||||
// Don't allow wild mons to flee with U-turn et al.
|
||||
&& !(this.selfSwitch && MoveCategory.STATUS !== move.category);
|
||||
}
|
||||
|
||||
const party = player ? globalScene.getPlayerParty() : globalScene.getEnemyParty();
|
||||
return (!player && !globalScene.currentBattle.battleType)
|
||||
|| party.filter(p => p.isAllowedInBattle()
|
||||
&& (player || (p as EnemyPokemon).trainerSlot === (switchOutTarget as EnemyPokemon).trainerSlot)).length > globalScene.currentBattle.getBattlerCount();
|
||||
return party.filter(p => p.isAllowedInBattle() && !p.isOnField()
|
||||
&& (player || (p as EnemyPokemon).trainerSlot === (switchOutTarget as EnemyPokemon).trainerSlot)).length > 0;
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
import type Battle from "#app/battle";
|
||||
import { BattlerIndex, BattleType } from "#app/battle";
|
||||
import { BattlerIndex } from "#app/battle";
|
||||
import { BattleType } from "#enums/battle-type";
|
||||
import { biomeLinks, BiomePoolTier } from "#app/data/balance/biomes";
|
||||
import type MysteryEncounterOption from "#app/data/mystery-encounters/mystery-encounter-option";
|
||||
import {
|
||||
|
|
|
@ -0,0 +1,6 @@
|
|||
export enum BattleType {
|
||||
WILD,
|
||||
TRAINER,
|
||||
CLEAR,
|
||||
MYSTERY_ENCOUNTER
|
||||
}
|
|
@ -225,6 +225,13 @@ export default class Trainer extends Phaser.GameObjects.Container {
|
|||
return this.config.doubleOnly || this.variant === TrainerVariant.DOUBLE;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return whether the trainer is a duo, like Tate & Liza
|
||||
*/
|
||||
isPartner(): boolean {
|
||||
return this.variant === TrainerVariant.DOUBLE;
|
||||
}
|
||||
|
||||
getMixedBattleBgm(): string {
|
||||
return this.config.mixedBattleBgm;
|
||||
}
|
||||
|
|
|
@ -15,11 +15,13 @@ import { MysteryEncounterType } from "#enums/mystery-encounter-type";
|
|||
import { PokeballType } from "#enums/pokeball";
|
||||
import { PokemonType } from "#enums/pokemon-type";
|
||||
import { Species } from "#enums/species";
|
||||
import { Stat } from "#enums/stat";
|
||||
import { BATTLE_STATS, Stat } from "#enums/stat";
|
||||
import { StatusEffect } from "#enums/status-effect";
|
||||
import { TimeOfDay } from "#enums/time-of-day";
|
||||
import { VariantTier } from "#enums/variant-tier";
|
||||
import { WeatherType } from "#enums/weather-type";
|
||||
import { TrainerType } from "#enums/trainer-type";
|
||||
import { BattleType } from "#enums/battle-type";
|
||||
|
||||
/**
|
||||
* This comment block exists to prevent IDEs from automatically removing unused imports
|
||||
|
@ -41,7 +43,7 @@ import { WeatherType } from "#enums/weather-type";
|
|||
* }
|
||||
* ```
|
||||
*/
|
||||
const overrides = {} satisfies Partial<InstanceType<typeof DefaultOverrides>>;
|
||||
const overrides = {} satisfies Partial<InstanceType<OverridesType>>;
|
||||
|
||||
/**
|
||||
* If you need to add Overrides values for local testing do that inside {@linkcode overrides}
|
||||
|
@ -69,7 +71,7 @@ class DefaultOverrides {
|
|||
*
|
||||
* If `"odd-doubles"`, follow the `"double"` rule on odd wave numbers, and follow the `"single"` rule on even wave numbers.
|
||||
*/
|
||||
readonly BATTLE_TYPE_OVERRIDE: BattleStyle | null = null;
|
||||
readonly BATTLE_STYLE_OVERRIDE: BattleStyle | null = null;
|
||||
readonly STARTING_WAVE_OVERRIDE: number = 0;
|
||||
readonly STARTING_BIOME_OVERRIDE: Biome = Biome.TOWN;
|
||||
readonly ARENA_TINT_OVERRIDE: TimeOfDay | null = null;
|
||||
|
@ -259,6 +261,16 @@ class DefaultOverrides {
|
|||
* If `true`, disable all non-scripted opponent trainer encounters.
|
||||
*/
|
||||
readonly DISABLE_STANDARD_TRAINERS_OVERRIDE: boolean = false;
|
||||
|
||||
/**
|
||||
* Set all non-scripted waves to use the selected battle type.
|
||||
*
|
||||
* Ignored if set to {@linkcode BattleType.TRAINER} and `DISABLE_STANDARD_TRAINERS_OVERRIDE` is `true`.
|
||||
*/
|
||||
readonly BATTLE_TYPE_OVERRIDE: Exclude<BattleType, BattleType.CLEAR> | null = null;
|
||||
|
||||
/** Force all random trainer types to be the provided type. */
|
||||
readonly RANDOM_TRAINER_OVERRIDE: RandomTrainerOverride | null = null;
|
||||
}
|
||||
|
||||
export const defaultOverrides = new DefaultOverrides();
|
||||
|
@ -269,3 +281,13 @@ export default {
|
|||
} satisfies InstanceType<typeof DefaultOverrides>;
|
||||
|
||||
export type BattleStyle = "double" | "single" | "even-doubles" | "odd-doubles";
|
||||
|
||||
export type RandomTrainerOverride = {
|
||||
/** The Type of trainer to force */
|
||||
trainerType: Exclude<TrainerType, TrainerType.UNKNOWN>,
|
||||
/* If the selected trainer type has a double version, it will always use its double version. */
|
||||
alwaysDouble?: boolean
|
||||
}
|
||||
|
||||
/** The type of the {@linkcode DefaultOverrides} class */
|
||||
export type OverridesType = typeof DefaultOverrides;
|
|
@ -1,6 +1,6 @@
|
|||
import { globalScene } from "#app/global-scene";
|
||||
import type { TurnCommand } from "#app/battle";
|
||||
import { BattleType } from "#app/battle";
|
||||
import { BattleType } from "#enums/battle-type";
|
||||
import type { EncoreTag } from "#app/data/battler-tags";
|
||||
import { TrappedTag } from "#app/data/battler-tags";
|
||||
import type { MoveTargetSet } from "#app/data/moves/move";
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
import { BattlerIndex, BattleType } from "#app/battle";
|
||||
import { BattlerIndex } from "#app/battle";
|
||||
import { BattleType } from "#enums/battle-type";
|
||||
import { globalScene } from "#app/global-scene";
|
||||
import { PLAYER_PARTY_MAX_SIZE } from "#app/constants";
|
||||
import { applyAbAttrs, SyncEncounterNatureAbAttr } from "#app/data/ability";
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import type { BattlerIndex } from "#app/battle";
|
||||
import { BattleType } from "#app/battle";
|
||||
import { BattleType } from "#enums/battle-type";
|
||||
import { globalScene } from "#app/global-scene";
|
||||
import {
|
||||
applyPostFaintAbAttrs,
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import { clientSessionId } from "#app/account";
|
||||
import { BattleType } from "#app/battle";
|
||||
import { BattleType } from "#enums/battle-type";
|
||||
import { globalScene } from "#app/global-scene";
|
||||
import { pokemonEvolutions } from "#app/data/balance/pokemon-evolutions";
|
||||
import { getCharVariantFromDialogue } from "#app/data/dialogue";
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import { BattleType } from "#app/battle";
|
||||
import { BattleType } from "#enums/battle-type";
|
||||
import { getPokeballAtlasKey, getPokeballTintColor } from "#app/data/pokeball";
|
||||
import { SpeciesFormChangeActiveTrigger } from "#app/data/pokemon-forms";
|
||||
import { TrainerSlot } from "#enums/trainer-slot";
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import { loggedInUser } from "#app/account";
|
||||
import { BattleType } from "#app/battle";
|
||||
import { BattleType } from "#enums/battle-type";
|
||||
import { fetchDailyRunSeed, getDailyRunStarters } from "#app/data/daily-run";
|
||||
import { Gender } from "#app/data/gender";
|
||||
import { getBiomeKey } from "#app/field/arena";
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
import type { BattlerIndex } from "#app/battle";
|
||||
import { BattleType, ClassicFixedBossWaves } from "#app/battle";
|
||||
import { ClassicFixedBossWaves } from "#app/battle";
|
||||
import { BattleType } from "#enums/battle-type";
|
||||
import type { CustomModifierSettings } from "#app/modifier/modifier-type";
|
||||
import { modifierTypes } from "#app/modifier/modifier-type";
|
||||
import { BattleEndPhase } from "./battle-end-phase";
|
||||
|
|
|
@ -15,7 +15,7 @@ import PersistentModifierData from "#app/system/modifier-data";
|
|||
import ArenaData from "#app/system/arena-data";
|
||||
import { Unlockables } from "#app/system/unlockables";
|
||||
import { GameModes, getGameMode } from "#app/game-mode";
|
||||
import { BattleType } from "#app/battle";
|
||||
import { BattleType } from "#enums/battle-type";
|
||||
import TrainerData from "#app/system/trainer-data";
|
||||
import { trainerConfigs } from "#app/data/trainers/trainer-config";
|
||||
import { resetSettings, setSetting, SettingKeys } from "#app/system/settings/settings";
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import { BattleType } from "../battle";
|
||||
import { BattleType } from "#enums/battle-type";
|
||||
import { globalScene } from "#app/global-scene";
|
||||
import type { Gender } from "../data/gender";
|
||||
import type { Nature } from "#enums/nature";
|
||||
|
|
|
@ -14,7 +14,7 @@ import type { PokemonMove } from "#app/field/pokemon";
|
|||
import type Pokemon from "#app/field/pokemon";
|
||||
import type { CommandPhase } from "#app/phases/command-phase";
|
||||
import MoveInfoOverlay from "./move-info-overlay";
|
||||
import { BattleType } from "#app/battle";
|
||||
import { BattleType } from "#enums/battle-type";
|
||||
|
||||
export default class FightUiHandler extends UiHandler implements InfoToggle {
|
||||
public static readonly MOVES_CONTAINER_NAME = "moves";
|
||||
|
|
|
@ -8,7 +8,7 @@ import type PokemonData from "../system/pokemon-data";
|
|||
import MessageUiHandler from "./message-ui-handler";
|
||||
import i18next from "i18next";
|
||||
import { Button } from "../enums/buttons";
|
||||
import { BattleType } from "../battle";
|
||||
import { BattleType } from "#enums/battle-type";
|
||||
import type { RunEntry } from "../system/game-data";
|
||||
import { PlayerGender } from "#enums/player-gender";
|
||||
import { TrainerVariant } from "../field/trainer";
|
||||
|
|
|
@ -9,7 +9,7 @@ import * as Utils from "../utils";
|
|||
import type PokemonData from "../system/pokemon-data";
|
||||
import i18next from "i18next";
|
||||
import { Button } from "../enums/buttons";
|
||||
import { BattleType } from "../battle";
|
||||
import { BattleType } from "#enums/battle-type";
|
||||
import { TrainerVariant } from "../field/trainer";
|
||||
import { Challenges } from "#enums/challenges";
|
||||
import { getLuckString, getLuckTextTint } from "../modifier/modifier-type";
|
||||
|
|
|
@ -24,7 +24,7 @@ describe("Ability Duplication", () => {
|
|||
game = new GameManager(phaserGame);
|
||||
game.override
|
||||
.moveset([Moves.SPLASH])
|
||||
.battleType("single")
|
||||
.battleStyle("single")
|
||||
.ability(Abilities.HUGE_POWER)
|
||||
.enemyAbility(Abilities.BALL_FETCH)
|
||||
.enemyMoveset(Moves.SPLASH);
|
||||
|
|
|
@ -27,7 +27,7 @@ describe("Ability Timing", () => {
|
|||
game = new GameManager(phaserGame);
|
||||
|
||||
game.override
|
||||
.battleType("single")
|
||||
.battleStyle("single")
|
||||
.enemySpecies(Species.MAGIKARP)
|
||||
.enemyAbility(Abilities.INTIMIDATE)
|
||||
.ability(Abilities.BALL_FETCH);
|
||||
|
|
|
@ -26,7 +26,7 @@ describe("Abilities - Analytic", () => {
|
|||
game.override
|
||||
.moveset([Moves.SPLASH, Moves.TACKLE])
|
||||
.ability(Abilities.ANALYTIC)
|
||||
.battleType("single")
|
||||
.battleStyle("single")
|
||||
.disableCrits()
|
||||
.startingLevel(200)
|
||||
.enemyLevel(200)
|
||||
|
@ -53,7 +53,7 @@ describe("Abilities - Analytic", () => {
|
|||
});
|
||||
|
||||
it("should increase damage only if the user moves last in doubles", async () => {
|
||||
game.override.battleType("double");
|
||||
game.override.battleStyle("double");
|
||||
await game.classicMode.startBattle([Species.GENGAR, Species.SHUCKLE]);
|
||||
|
||||
const [enemy] = game.scene.getEnemyField();
|
||||
|
|
|
@ -32,7 +32,7 @@ describe("Abilities - Arena Trap", () => {
|
|||
|
||||
// TODO: Enable test when Issue #935 is addressed
|
||||
it.todo("should not allow grounded Pokémon to flee", async () => {
|
||||
game.override.battleType("single");
|
||||
game.override.battleStyle("single");
|
||||
|
||||
await game.classicMode.startBattle();
|
||||
|
||||
|
@ -61,7 +61,7 @@ describe("Abilities - Arena Trap", () => {
|
|||
*/
|
||||
it("should lift if pokemon with this ability leaves the field", async () => {
|
||||
game.override
|
||||
.battleType("double")
|
||||
.battleStyle("double")
|
||||
.enemyMoveset(Moves.SPLASH)
|
||||
.moveset([Moves.ROAR, Moves.SPLASH])
|
||||
.ability(Abilities.BALL_FETCH);
|
||||
|
|
|
@ -25,7 +25,7 @@ describe("Moves - Aroma Veil", () => {
|
|||
beforeEach(() => {
|
||||
game = new GameManager(phaserGame);
|
||||
game.override
|
||||
.battleType("double")
|
||||
.battleStyle("double")
|
||||
.enemyAbility(Abilities.BALL_FETCH)
|
||||
.enemyMoveset([Moves.HEAL_BLOCK, Moves.IMPRISON, Moves.SPLASH])
|
||||
.enemySpecies(Species.SHUCKLE)
|
||||
|
|
|
@ -24,7 +24,7 @@ describe("Abilities - Aura Break", () => {
|
|||
|
||||
beforeEach(() => {
|
||||
game = new GameManager(phaserGame);
|
||||
game.override.battleType("single");
|
||||
game.override.battleStyle("single");
|
||||
game.override.moveset([Moves.MOONBLAST, Moves.DARK_PULSE, Moves.MOONBLAST, Moves.DARK_PULSE]);
|
||||
game.override.enemyMoveset(Moves.SPLASH);
|
||||
game.override.enemyAbility(Abilities.AURA_BREAK);
|
||||
|
|
|
@ -26,7 +26,7 @@ describe("Abilities - Battery", () => {
|
|||
|
||||
beforeEach(() => {
|
||||
game = new GameManager(phaserGame);
|
||||
game.override.battleType("double");
|
||||
game.override.battleStyle("double");
|
||||
game.override.enemySpecies(Species.SHUCKLE);
|
||||
game.override.enemyAbility(Abilities.BALL_FETCH);
|
||||
game.override.moveset([Moves.TACKLE, Moves.BREAKING_SWIPE, Moves.SPLASH, Moves.DAZZLING_GLEAM]);
|
||||
|
|
|
@ -28,7 +28,7 @@ describe("Abilities - BATTLE BOND", () => {
|
|||
beforeEach(() => {
|
||||
game = new GameManager(phaserGame);
|
||||
game.override
|
||||
.battleType("single")
|
||||
.battleStyle("single")
|
||||
.startingWave(4) // Leads to arena reset on Wave 5 trainer battle
|
||||
.ability(Abilities.BATTLE_BOND)
|
||||
.starterForms({ [Species.GRENINJA]: ashForm })
|
||||
|
|
|
@ -24,7 +24,7 @@ describe("Abilities - Beast Boost", () => {
|
|||
beforeEach(() => {
|
||||
game = new GameManager(phaserGame);
|
||||
game.override
|
||||
.battleType("single")
|
||||
.battleStyle("single")
|
||||
.enemySpecies(Species.BULBASAUR)
|
||||
.enemyAbility(Abilities.BEAST_BOOST)
|
||||
.ability(Abilities.BEAST_BOOST)
|
||||
|
|
|
@ -34,7 +34,7 @@ describe("Abilities - Commander", () => {
|
|||
.enemyLevel(100)
|
||||
.moveset([Moves.LIQUIDATION, Moves.MEMENTO, Moves.SPLASH, Moves.FLIP_TURN])
|
||||
.ability(Abilities.COMMANDER)
|
||||
.battleType("double")
|
||||
.battleStyle("double")
|
||||
.disableCrits()
|
||||
.enemySpecies(Species.SNORLAX)
|
||||
.enemyAbility(Abilities.BALL_FETCH)
|
||||
|
|
|
@ -25,7 +25,7 @@ describe("Abilities - Competitive", () => {
|
|||
game = new GameManager(phaserGame);
|
||||
|
||||
game.override
|
||||
.battleType("single")
|
||||
.battleStyle("single")
|
||||
.enemySpecies(Species.BEEDRILL)
|
||||
.enemyMoveset(Moves.TICKLE)
|
||||
.startingLevel(1)
|
||||
|
|
|
@ -23,7 +23,7 @@ describe("Abilities - Contrary", () => {
|
|||
beforeEach(() => {
|
||||
game = new GameManager(phaserGame);
|
||||
game.override
|
||||
.battleType("single")
|
||||
.battleStyle("single")
|
||||
.enemySpecies(Species.BULBASAUR)
|
||||
.enemyAbility(Abilities.CONTRARY)
|
||||
.ability(Abilities.INTIMIDATE)
|
||||
|
|
|
@ -23,7 +23,7 @@ describe("Abilities - Corrosion", () => {
|
|||
game = new GameManager(phaserGame);
|
||||
game.override
|
||||
.moveset([Moves.SPLASH])
|
||||
.battleType("single")
|
||||
.battleStyle("single")
|
||||
.disableCrits()
|
||||
.enemySpecies(Species.GRIMER)
|
||||
.enemyAbility(Abilities.CORROSION)
|
||||
|
|
|
@ -24,7 +24,7 @@ describe("Abilities - COSTAR", () => {
|
|||
|
||||
beforeEach(() => {
|
||||
game = new GameManager(phaserGame);
|
||||
game.override.battleType("double");
|
||||
game.override.battleStyle("double");
|
||||
game.override.ability(Abilities.COSTAR);
|
||||
game.override.moveset([Moves.SPLASH, Moves.NASTY_PLOT]);
|
||||
game.override.enemyMoveset(Moves.SPLASH);
|
||||
|
|
|
@ -23,7 +23,7 @@ describe("Abilities - Dancer", () => {
|
|||
|
||||
beforeEach(() => {
|
||||
game = new GameManager(phaserGame);
|
||||
game.override.battleType("double");
|
||||
game.override.battleStyle("double");
|
||||
});
|
||||
|
||||
// Reference Link: https://bulbapedia.bulbagarden.net/wiki/Dancer_(Ability)
|
||||
|
|
|
@ -25,7 +25,7 @@ describe("Abilities - Defiant", () => {
|
|||
game = new GameManager(phaserGame);
|
||||
|
||||
game.override
|
||||
.battleType("single")
|
||||
.battleStyle("single")
|
||||
.enemySpecies(Species.BEEDRILL)
|
||||
.enemyMoveset(Moves.TICKLE)
|
||||
.startingLevel(1)
|
||||
|
|
|
@ -38,7 +38,7 @@ describe("Abilities - Desolate Land", () => {
|
|||
* is forcefully moved out of the field from moves such as Roar {@linkcode Moves.ROAR}
|
||||
*/
|
||||
it("should lift only when all pokemon with this ability leave the field", async () => {
|
||||
game.override.battleType("double").enemyMoveset([Moves.SPLASH, Moves.ROAR]);
|
||||
game.override.battleStyle("double").enemyMoveset([Moves.SPLASH, Moves.ROAR]);
|
||||
await game.classicMode.startBattle([Species.MAGCARGO, Species.MAGCARGO, Species.MAGIKARP, Species.MAGIKARP]);
|
||||
|
||||
expect(game.scene.arena.weather?.weatherType).toBe(WeatherType.HARSH_SUN);
|
||||
|
@ -76,7 +76,7 @@ describe("Abilities - Desolate Land", () => {
|
|||
|
||||
it("should lift when enemy faints", async () => {
|
||||
game.override
|
||||
.battleType("single")
|
||||
.battleStyle("single")
|
||||
.moveset([Moves.SHEER_COLD])
|
||||
.ability(Abilities.NO_GUARD)
|
||||
.startingLevel(100)
|
||||
|
@ -96,7 +96,7 @@ describe("Abilities - Desolate Land", () => {
|
|||
});
|
||||
|
||||
it("should lift when pokemon returns upon switching from double to single battle", async () => {
|
||||
game.override.battleType("even-doubles").enemyMoveset([Moves.SPLASH, Moves.MEMENTO]).startingWave(12);
|
||||
game.override.battleStyle("even-doubles").enemyMoveset([Moves.SPLASH, Moves.MEMENTO]).startingWave(12);
|
||||
await game.classicMode.startBattle([Species.MAGIKARP, Species.MAGCARGO]);
|
||||
|
||||
expect(game.scene.arena.weather?.weatherType).toBe(WeatherType.HARSH_SUN);
|
||||
|
@ -117,7 +117,7 @@ describe("Abilities - Desolate Land", () => {
|
|||
|
||||
it("should lift when enemy is captured", async () => {
|
||||
game.override
|
||||
.battleType("single")
|
||||
.battleStyle("single")
|
||||
.enemyMoveset([Moves.SPLASH])
|
||||
.enemySpecies(Species.MAGCARGO)
|
||||
.enemyHasPassiveAbility(true);
|
||||
|
|
|
@ -27,7 +27,7 @@ describe("Abilities - Disguise", () => {
|
|||
beforeEach(() => {
|
||||
game = new GameManager(phaserGame);
|
||||
game.override
|
||||
.battleType("single")
|
||||
.battleStyle("single")
|
||||
.enemySpecies(Species.MIMIKYU)
|
||||
.enemyMoveset(Moves.SPLASH)
|
||||
.starterSpecies(Species.REGIELEKI)
|
||||
|
|
|
@ -22,7 +22,7 @@ describe("Abilities - Dry Skin", () => {
|
|||
beforeEach(() => {
|
||||
game = new GameManager(phaserGame);
|
||||
game.override
|
||||
.battleType("single")
|
||||
.battleStyle("single")
|
||||
.disableCrits()
|
||||
.enemyAbility(Abilities.DRY_SKIN)
|
||||
.enemyMoveset(Moves.SPLASH)
|
||||
|
|
|
@ -27,7 +27,7 @@ describe("Abilities - Early Bird", () => {
|
|||
game.override
|
||||
.moveset([Moves.REST, Moves.BELLY_DRUM, Moves.SPLASH])
|
||||
.ability(Abilities.EARLY_BIRD)
|
||||
.battleType("single")
|
||||
.battleStyle("single")
|
||||
.disableCrits()
|
||||
.enemySpecies(Species.MAGIKARP)
|
||||
.enemyAbility(Abilities.BALL_FETCH)
|
||||
|
|
|
@ -27,7 +27,7 @@ describe("Abilities - Flash Fire", () => {
|
|||
beforeEach(() => {
|
||||
game = new GameManager(phaserGame);
|
||||
game.override
|
||||
.battleType("single")
|
||||
.battleStyle("single")
|
||||
.ability(Abilities.FLASH_FIRE)
|
||||
.enemyAbility(Abilities.BALL_FETCH)
|
||||
.startingLevel(20)
|
||||
|
|
|
@ -47,7 +47,7 @@ describe("Abilities - Flower Gift", () => {
|
|||
allyAbility = Abilities.BALL_FETCH,
|
||||
enemyAbility = Abilities.BALL_FETCH,
|
||||
): Promise<[number, number]> => {
|
||||
game.override.battleType("double");
|
||||
game.override.battleStyle("double");
|
||||
game.override.moveset([Moves.SPLASH, Moves.SUNNY_DAY, move, Moves.HEAL_PULSE]);
|
||||
game.override.enemyMoveset([Moves.SPLASH, Moves.HEAL_PULSE]);
|
||||
const target_index = allyAttacker ? BattlerIndex.ENEMY : BattlerIndex.PLAYER_2;
|
||||
|
@ -110,7 +110,7 @@ describe("Abilities - Flower Gift", () => {
|
|||
});
|
||||
|
||||
it("increases the ATK and SPDEF stat stages of the Pokémon with this Ability and its allies by 1.5× during Harsh Sunlight", async () => {
|
||||
game.override.battleType("double");
|
||||
game.override.battleStyle("double");
|
||||
await game.classicMode.startBattle([Species.CHERRIM, Species.MAGIKARP]);
|
||||
|
||||
const [cherrim, magikarp] = game.scene.getPlayerField();
|
||||
|
|
|
@ -31,7 +31,7 @@ describe("Abilities - Flower Veil", () => {
|
|||
.moveset([Moves.SPLASH])
|
||||
.enemySpecies(Species.BULBASAUR)
|
||||
.ability(Abilities.FLOWER_VEIL)
|
||||
.battleType("single")
|
||||
.battleStyle("single")
|
||||
.disableCrits()
|
||||
.enemySpecies(Species.MAGIKARP)
|
||||
.enemyAbility(Abilities.BALL_FETCH)
|
||||
|
@ -63,7 +63,7 @@ describe("Abilities - Flower Veil", () => {
|
|||
});
|
||||
|
||||
it("should prevent drowsiness from yawn for a grass user and its grass allies", async () => {
|
||||
game.override.enemyMoveset([Moves.YAWN]).moveset([Moves.SPLASH]).battleType("double");
|
||||
game.override.enemyMoveset([Moves.YAWN]).moveset([Moves.SPLASH]).battleStyle("double");
|
||||
await game.classicMode.startBattle([Species.BULBASAUR, Species.BULBASAUR]);
|
||||
|
||||
// Clear the ability of the ally to isolate the test
|
||||
|
@ -81,7 +81,7 @@ describe("Abilities - Flower Veil", () => {
|
|||
});
|
||||
|
||||
it("should prevent status conditions from moves like Thunder Wave for a grass user and its grass allies", async () => {
|
||||
game.override.enemyMoveset([Moves.THUNDER_WAVE]).moveset([Moves.SPLASH]).battleType("double");
|
||||
game.override.enemyMoveset([Moves.THUNDER_WAVE]).moveset([Moves.SPLASH]).battleStyle("double");
|
||||
vi.spyOn(allMoves[Moves.THUNDER_WAVE], "accuracy", "get").mockReturnValue(100);
|
||||
await game.classicMode.startBattle([Species.BULBASAUR]);
|
||||
|
||||
|
@ -93,7 +93,7 @@ describe("Abilities - Flower Veil", () => {
|
|||
});
|
||||
|
||||
it("should not prevent status conditions for a non-grass user and its non-grass allies", async () => {
|
||||
game.override.enemyMoveset([Moves.THUNDER_WAVE]).moveset([Moves.SPLASH]).battleType("double");
|
||||
game.override.enemyMoveset([Moves.THUNDER_WAVE]).moveset([Moves.SPLASH]).battleStyle("double");
|
||||
await game.classicMode.startBattle([Species.MAGIKARP, Species.MAGIKARP]);
|
||||
const [user, ally] = game.scene.getPlayerField();
|
||||
vi.spyOn(allMoves[Moves.THUNDER_WAVE], "accuracy", "get").mockReturnValue(100);
|
||||
|
@ -113,7 +113,7 @@ describe("Abilities - Flower Veil", () => {
|
|||
*******************************************/
|
||||
|
||||
it("should prevent the status drops from enemies for the a grass user and its grass allies", async () => {
|
||||
game.override.enemyMoveset([Moves.GROWL]).moveset([Moves.SPLASH]).battleType("double");
|
||||
game.override.enemyMoveset([Moves.GROWL]).moveset([Moves.SPLASH]).battleStyle("double");
|
||||
await game.classicMode.startBattle([Species.BULBASAUR, Species.BULBASAUR]);
|
||||
const [user, ally] = game.scene.getPlayerField();
|
||||
// Clear the ally ability to isolate the test
|
||||
|
@ -126,7 +126,7 @@ describe("Abilities - Flower Veil", () => {
|
|||
});
|
||||
|
||||
it("should not prevent status drops for a non-grass user and its non-grass allies", async () => {
|
||||
game.override.enemyMoveset([Moves.GROWL]).moveset([Moves.SPLASH]).battleType("double");
|
||||
game.override.enemyMoveset([Moves.GROWL]).moveset([Moves.SPLASH]).battleStyle("double");
|
||||
await game.classicMode.startBattle([Species.MAGIKARP, Species.MAGIKARP]);
|
||||
const [user, ally] = game.scene.getPlayerField();
|
||||
// Clear the ally ability to isolate the test
|
||||
|
@ -139,7 +139,7 @@ describe("Abilities - Flower Veil", () => {
|
|||
});
|
||||
|
||||
it("should not prevent self-inflicted stat drops from moves like Close Combat for a user or its allies", async () => {
|
||||
game.override.moveset([Moves.CLOSE_COMBAT]).battleType("double");
|
||||
game.override.moveset([Moves.CLOSE_COMBAT]).battleStyle("double");
|
||||
await game.classicMode.startBattle([Species.BULBASAUR, Species.BULBASAUR]);
|
||||
const [user, ally] = game.scene.getPlayerField();
|
||||
// Clear the ally ability to isolate the test
|
||||
|
|
|
@ -75,7 +75,7 @@ describe("Abilities - Forecast", () => {
|
|||
async () => {
|
||||
game.override
|
||||
.moveset([Moves.RAIN_DANCE, Moves.SUNNY_DAY, Moves.SNOWSCAPE, Moves.SPLASH])
|
||||
.battleType("double")
|
||||
.battleStyle("double")
|
||||
.starterForms({
|
||||
[Species.KYOGRE]: 1,
|
||||
[Species.GROUDON]: 1,
|
||||
|
|
|
@ -26,7 +26,7 @@ describe("Moves - Friend Guard", () => {
|
|||
beforeEach(() => {
|
||||
game = new GameManager(phaserGame);
|
||||
game.override
|
||||
.battleType("double")
|
||||
.battleStyle("double")
|
||||
.enemyAbility(Abilities.BALL_FETCH)
|
||||
.enemyMoveset([Moves.TACKLE, Moves.SPLASH, Moves.DRAGON_RAGE])
|
||||
.enemySpecies(Species.SHUCKLE)
|
||||
|
|
|
@ -27,7 +27,7 @@ describe("Abilities - Galvanize", () => {
|
|||
game = new GameManager(phaserGame);
|
||||
|
||||
game.override
|
||||
.battleType("single")
|
||||
.battleStyle("single")
|
||||
.startingLevel(100)
|
||||
.ability(Abilities.GALVANIZE)
|
||||
.moveset([Moves.TACKLE, Moves.REVELATION_DANCE, Moves.FURY_SWIPES])
|
||||
|
|
|
@ -32,7 +32,7 @@ describe("Abilities - Good As Gold", () => {
|
|||
game.override
|
||||
.moveset([Moves.SPLASH])
|
||||
.ability(Abilities.GOOD_AS_GOLD)
|
||||
.battleType("single")
|
||||
.battleStyle("single")
|
||||
.disableCrits()
|
||||
.enemySpecies(Species.MAGIKARP)
|
||||
.enemyAbility(Abilities.BALL_FETCH)
|
||||
|
@ -63,7 +63,7 @@ describe("Abilities - Good As Gold", () => {
|
|||
});
|
||||
|
||||
it("should not block any status moves that target the field, one side, or all pokemon", async () => {
|
||||
game.override.battleType("double");
|
||||
game.override.battleStyle("double");
|
||||
game.override.enemyMoveset([Moves.STEALTH_ROCK, Moves.HAZE]);
|
||||
game.override.moveset([Moves.SWORDS_DANCE, Moves.SAFEGUARD]);
|
||||
await game.classicMode.startBattle([Species.MAGIKARP, Species.FEEBAS]);
|
||||
|
@ -85,7 +85,7 @@ describe("Abilities - Good As Gold", () => {
|
|||
});
|
||||
|
||||
it("should not block field targeted effects in singles", async () => {
|
||||
game.override.battleType("single");
|
||||
game.override.battleStyle("single");
|
||||
game.override.enemyMoveset([Moves.SPIKES]);
|
||||
await game.classicMode.startBattle([Species.MAGIKARP]);
|
||||
|
||||
|
@ -96,7 +96,7 @@ describe("Abilities - Good As Gold", () => {
|
|||
});
|
||||
|
||||
it("should block the ally's helping hand", async () => {
|
||||
game.override.battleType("double");
|
||||
game.override.battleStyle("double");
|
||||
game.override.moveset([Moves.HELPING_HAND, Moves.TACKLE]);
|
||||
await game.classicMode.startBattle([Species.MAGIKARP, Species.FEEBAS]);
|
||||
|
||||
|
@ -108,7 +108,7 @@ describe("Abilities - Good As Gold", () => {
|
|||
});
|
||||
|
||||
it("should block the ally's heal bell, but only if the good as gold user is on the field", async () => {
|
||||
game.override.battleType("double");
|
||||
game.override.battleStyle("double");
|
||||
game.override.moveset([Moves.HEAL_BELL, Moves.SPLASH]);
|
||||
game.override.statusEffect(StatusEffect.BURN);
|
||||
await game.classicMode.startBattle([Species.MAGIKARP, Species.FEEBAS, Species.ABRA]);
|
||||
|
@ -130,7 +130,7 @@ describe("Abilities - Good As Gold", () => {
|
|||
});
|
||||
|
||||
it("should not block field targeted effects like rain dance", async () => {
|
||||
game.override.battleType("single");
|
||||
game.override.battleStyle("single");
|
||||
game.override.enemyMoveset([Moves.RAIN_DANCE]);
|
||||
game.override.weather(WeatherType.NONE);
|
||||
await game.classicMode.startBattle([Species.MAGIKARP]);
|
||||
|
|
|
@ -23,7 +23,7 @@ describe("Abilities - Gorilla Tactics", () => {
|
|||
beforeEach(() => {
|
||||
game = new GameManager(phaserGame);
|
||||
game.override
|
||||
.battleType("single")
|
||||
.battleStyle("single")
|
||||
.enemyAbility(Abilities.BALL_FETCH)
|
||||
.enemyMoveset([Moves.SPLASH, Moves.DISABLE])
|
||||
.enemySpecies(Species.MAGIKARP)
|
||||
|
|
|
@ -42,7 +42,7 @@ describe("Abilities - Gulp Missile", () => {
|
|||
game = new GameManager(phaserGame);
|
||||
game.override
|
||||
.disableCrits()
|
||||
.battleType("single")
|
||||
.battleStyle("single")
|
||||
.moveset([Moves.SURF, Moves.DIVE, Moves.SPLASH, Moves.SUBSTITUTE])
|
||||
.enemySpecies(Species.SNORLAX)
|
||||
.enemyAbility(Abilities.BALL_FETCH)
|
||||
|
|
|
@ -25,7 +25,7 @@ describe("Abilities - Heatproof", () => {
|
|||
beforeEach(() => {
|
||||
game = new GameManager(phaserGame);
|
||||
game.override
|
||||
.battleType("single")
|
||||
.battleStyle("single")
|
||||
.disableCrits()
|
||||
.enemySpecies(Species.CHARMANDER)
|
||||
.enemyAbility(Abilities.HEATPROOF)
|
||||
|
|
|
@ -28,7 +28,7 @@ describe("Abilities - Honey Gather", () => {
|
|||
.startingLevel(100)
|
||||
.ability(Abilities.HONEY_GATHER)
|
||||
.passiveAbility(Abilities.RUN_AWAY)
|
||||
.battleType("single")
|
||||
.battleStyle("single")
|
||||
.disableCrits()
|
||||
.enemySpecies(Species.MAGIKARP)
|
||||
.enemyAbility(Abilities.BALL_FETCH)
|
||||
|
|
|
@ -27,7 +27,7 @@ describe("Abilities - Hustle", () => {
|
|||
.ability(Abilities.HUSTLE)
|
||||
.moveset([Moves.TACKLE, Moves.GIGA_DRAIN, Moves.FISSURE])
|
||||
.disableCrits()
|
||||
.battleType("single")
|
||||
.battleStyle("single")
|
||||
.enemyMoveset(Moves.SPLASH)
|
||||
.enemySpecies(Species.SHUCKLE)
|
||||
.enemyAbility(Abilities.BALL_FETCH);
|
||||
|
|
|
@ -23,7 +23,7 @@ describe("Abilities - Hyper Cutter", () => {
|
|||
beforeEach(() => {
|
||||
game = new GameManager(phaserGame);
|
||||
game.override
|
||||
.battleType("single")
|
||||
.battleStyle("single")
|
||||
.moveset([Moves.SAND_ATTACK, Moves.NOBLE_ROAR, Moves.DEFOG, Moves.OCTOLOCK])
|
||||
.ability(Abilities.BALL_FETCH)
|
||||
.enemySpecies(Species.SHUCKLE)
|
||||
|
|
|
@ -30,7 +30,7 @@ describe("Abilities - Ice Face", () => {
|
|||
|
||||
beforeEach(() => {
|
||||
game = new GameManager(phaserGame);
|
||||
game.override.battleType("single");
|
||||
game.override.battleStyle("single");
|
||||
game.override.enemySpecies(Species.EISCUE);
|
||||
game.override.enemyAbility(Abilities.ICE_FACE);
|
||||
game.override.moveset([Moves.TACKLE, Moves.ICE_BEAM, Moves.TOXIC_THREAD, Moves.HAIL]);
|
||||
|
|
|
@ -29,7 +29,7 @@ describe("Abilities - Illuminate", () => {
|
|||
});
|
||||
|
||||
it("should prevent ACC stat stage from being lowered", async () => {
|
||||
game.override.battleType("single");
|
||||
game.override.battleStyle("single");
|
||||
|
||||
await game.classicMode.startBattle();
|
||||
|
||||
|
|
|
@ -23,9 +23,9 @@ describe("Abilities - Immunity", () => {
|
|||
beforeEach(() => {
|
||||
game = new GameManager(phaserGame);
|
||||
game.override
|
||||
.moveset([ Moves.SPLASH ])
|
||||
.moveset([Moves.SPLASH])
|
||||
.ability(Abilities.BALL_FETCH)
|
||||
.battleType("single")
|
||||
.battleStyle("single")
|
||||
.disableCrits()
|
||||
.enemySpecies(Species.MAGIKARP)
|
||||
.enemyAbility(Abilities.BALL_FETCH)
|
||||
|
@ -33,12 +33,12 @@ describe("Abilities - Immunity", () => {
|
|||
});
|
||||
|
||||
it("should remove poison when gained", async () => {
|
||||
game.override.ability(Abilities.IMMUNITY)
|
||||
game.override
|
||||
.ability(Abilities.IMMUNITY)
|
||||
.enemyAbility(Abilities.BALL_FETCH)
|
||||
.moveset(Moves.SKILL_SWAP)
|
||||
.enemyMoveset(Moves.SPLASH),
|
||||
|
||||
await game.classicMode.startBattle([ Species.FEEBAS ]);
|
||||
.enemyMoveset(Moves.SPLASH);
|
||||
await game.classicMode.startBattle([Species.FEEBAS]);
|
||||
const enemy = game.scene.getEnemyPokemon();
|
||||
enemy?.trySetStatus(StatusEffect.POISON);
|
||||
expect(enemy?.status?.effect).toBe(StatusEffect.POISON);
|
||||
|
|
|
@ -25,7 +25,7 @@ describe("Abilities - Imposter", () => {
|
|||
beforeEach(() => {
|
||||
game = new GameManager(phaserGame);
|
||||
game.override
|
||||
.battleType("single")
|
||||
.battleStyle("single")
|
||||
.enemySpecies(Species.MEW)
|
||||
.enemyLevel(200)
|
||||
.enemyAbility(Abilities.BEAST_BOOST)
|
||||
|
|
|
@ -30,7 +30,7 @@ describe("Abilities - Infiltrator", () => {
|
|||
game.override
|
||||
.moveset([Moves.TACKLE, Moves.WATER_GUN, Moves.SPORE, Moves.BABY_DOLL_EYES])
|
||||
.ability(Abilities.INFILTRATOR)
|
||||
.battleType("single")
|
||||
.battleStyle("single")
|
||||
.disableCrits()
|
||||
.enemySpecies(Species.SNORLAX)
|
||||
.enemyAbility(Abilities.BALL_FETCH)
|
||||
|
|
|
@ -23,9 +23,9 @@ describe("Abilities - Insomnia", () => {
|
|||
beforeEach(() => {
|
||||
game = new GameManager(phaserGame);
|
||||
game.override
|
||||
.moveset([ Moves.SPLASH ])
|
||||
.moveset([Moves.SPLASH])
|
||||
.ability(Abilities.BALL_FETCH)
|
||||
.battleType("single")
|
||||
.battleStyle("single")
|
||||
.disableCrits()
|
||||
.enemySpecies(Species.MAGIKARP)
|
||||
.enemyAbility(Abilities.BALL_FETCH)
|
||||
|
@ -33,12 +33,12 @@ describe("Abilities - Insomnia", () => {
|
|||
});
|
||||
|
||||
it("should remove sleep when gained", async () => {
|
||||
game.override.ability(Abilities.INSOMNIA)
|
||||
game.override
|
||||
.ability(Abilities.INSOMNIA)
|
||||
.enemyAbility(Abilities.BALL_FETCH)
|
||||
.moveset(Moves.SKILL_SWAP)
|
||||
.enemyMoveset(Moves.SPLASH),
|
||||
|
||||
await game.classicMode.startBattle([ Species.FEEBAS ]);
|
||||
.enemyMoveset(Moves.SPLASH);
|
||||
await game.classicMode.startBattle([Species.FEEBAS]);
|
||||
const enemy = game.scene.getEnemyPokemon();
|
||||
enemy?.trySetStatus(StatusEffect.SLEEP);
|
||||
expect(enemy?.status?.effect).toBe(StatusEffect.SLEEP);
|
||||
|
|
|
@ -25,7 +25,7 @@ describe("Abilities - Intimidate", () => {
|
|||
beforeEach(() => {
|
||||
game = new GameManager(phaserGame);
|
||||
game.override
|
||||
.battleType("single")
|
||||
.battleStyle("single")
|
||||
.enemySpecies(Species.RATTATA)
|
||||
.enemyAbility(Abilities.INTIMIDATE)
|
||||
.enemyPassiveAbility(Abilities.HYDRATION)
|
||||
|
@ -65,7 +65,7 @@ describe("Abilities - Intimidate", () => {
|
|||
}, 20000);
|
||||
|
||||
it("should lower ATK stat stage by 1 for every enemy Pokemon in a double battle on entry", async () => {
|
||||
game.override.battleType("double").startingWave(3);
|
||||
game.override.battleStyle("double").startingWave(3);
|
||||
await game.classicMode.runToSummon([Species.MIGHTYENA, Species.POOCHYENA]);
|
||||
game.onNextPrompt(
|
||||
"CheckSwitchPhase",
|
||||
|
|
|
@ -22,7 +22,7 @@ describe("Abilities - Intrepid Sword", () => {
|
|||
|
||||
beforeEach(() => {
|
||||
game = new GameManager(phaserGame);
|
||||
game.override.battleType("single");
|
||||
game.override.battleStyle("single");
|
||||
game.override.enemySpecies(Species.ZACIAN);
|
||||
game.override.enemyAbility(Abilities.INTREPID_SWORD);
|
||||
game.override.ability(Abilities.INTREPID_SWORD);
|
||||
|
|
|
@ -29,7 +29,7 @@ describe("Abilities - Libero", () => {
|
|||
|
||||
beforeEach(() => {
|
||||
game = new GameManager(phaserGame);
|
||||
game.override.battleType("single");
|
||||
game.override.battleStyle("single");
|
||||
game.override.ability(Abilities.LIBERO);
|
||||
game.override.startingLevel(100);
|
||||
game.override.enemySpecies(Species.RATTATA);
|
||||
|
|
|
@ -26,7 +26,7 @@ describe("Abilities - Lightningrod", () => {
|
|||
game.override
|
||||
.moveset([Moves.SPLASH, Moves.SHOCK_WAVE])
|
||||
.ability(Abilities.BALL_FETCH)
|
||||
.battleType("double")
|
||||
.battleStyle("double")
|
||||
.disableCrits()
|
||||
.enemySpecies(Species.MAGIKARP)
|
||||
.enemyAbility(Abilities.BALL_FETCH)
|
||||
|
|
|
@ -23,9 +23,9 @@ describe("Abilities - Limber", () => {
|
|||
beforeEach(() => {
|
||||
game = new GameManager(phaserGame);
|
||||
game.override
|
||||
.moveset([ Moves.SPLASH ])
|
||||
.moveset([Moves.SPLASH])
|
||||
.ability(Abilities.BALL_FETCH)
|
||||
.battleType("single")
|
||||
.battleStyle("single")
|
||||
.disableCrits()
|
||||
.enemySpecies(Species.MAGIKARP)
|
||||
.enemyAbility(Abilities.BALL_FETCH)
|
||||
|
@ -33,12 +33,12 @@ describe("Abilities - Limber", () => {
|
|||
});
|
||||
|
||||
it("should remove paralysis when gained", async () => {
|
||||
game.override.ability(Abilities.LIMBER)
|
||||
game.override
|
||||
.ability(Abilities.LIMBER)
|
||||
.enemyAbility(Abilities.BALL_FETCH)
|
||||
.moveset(Moves.SKILL_SWAP)
|
||||
.enemyMoveset(Moves.SPLASH),
|
||||
|
||||
await game.classicMode.startBattle([ Species.FEEBAS ]);
|
||||
.enemyMoveset(Moves.SPLASH);
|
||||
await game.classicMode.startBattle([Species.FEEBAS]);
|
||||
const enemy = game.scene.getEnemyPokemon();
|
||||
enemy?.trySetStatus(StatusEffect.PARALYSIS);
|
||||
expect(enemy?.status?.effect).toBe(StatusEffect.PARALYSIS);
|
||||
|
|
|
@ -30,7 +30,7 @@ describe("Abilities - Magic Bounce", () => {
|
|||
game = new GameManager(phaserGame);
|
||||
game.override
|
||||
.ability(Abilities.BALL_FETCH)
|
||||
.battleType("single")
|
||||
.battleStyle("single")
|
||||
.moveset([Moves.GROWL, Moves.SPLASH])
|
||||
.disableCrits()
|
||||
.enemySpecies(Species.MAGIKARP)
|
||||
|
@ -60,7 +60,7 @@ describe("Abilities - Magic Bounce", () => {
|
|||
});
|
||||
|
||||
it("should individually bounce back multi-target moves", async () => {
|
||||
game.override.battleType("double");
|
||||
game.override.battleStyle("double");
|
||||
game.override.moveset([Moves.GROWL, Moves.SPLASH]);
|
||||
await game.classicMode.startBattle([Species.MAGIKARP, Species.MAGIKARP]);
|
||||
|
||||
|
@ -114,7 +114,7 @@ describe("Abilities - Magic Bounce", () => {
|
|||
});
|
||||
|
||||
it("should bounce back a spread status move against both pokemon", async () => {
|
||||
game.override.battleType("double");
|
||||
game.override.battleStyle("double");
|
||||
game.override.moveset([Moves.GROWL, Moves.SPLASH]);
|
||||
game.override.enemyMoveset([Moves.SPLASH]);
|
||||
await game.classicMode.startBattle([Species.MAGIKARP, Species.MAGIKARP]);
|
||||
|
@ -127,7 +127,7 @@ describe("Abilities - Magic Bounce", () => {
|
|||
});
|
||||
|
||||
it("should only bounce spikes back once in doubles when both targets have magic bounce", async () => {
|
||||
game.override.battleType("double");
|
||||
game.override.battleStyle("double");
|
||||
await game.classicMode.startBattle([Species.MAGIKARP]);
|
||||
game.override.moveset([Moves.SPIKES]);
|
||||
|
||||
|
@ -227,7 +227,7 @@ describe("Abilities - Magic Bounce", () => {
|
|||
|
||||
// TODO: stomping tantrum should consider moves that were bounced.
|
||||
it.todo("should cause stomping tantrum to double in power when the last move was bounced", async () => {
|
||||
game.override.battleType("single");
|
||||
game.override.battleStyle("single");
|
||||
await game.classicMode.startBattle([Species.MAGIKARP]);
|
||||
game.override.moveset([Moves.STOMPING_TANTRUM, Moves.CHARM]);
|
||||
|
||||
|
@ -309,7 +309,7 @@ describe("Abilities - Magic Bounce", () => {
|
|||
});
|
||||
|
||||
it("should always apply the leftmost available target's magic bounce when bouncing moves like sticky webs in doubles", async () => {
|
||||
game.override.battleType("double");
|
||||
game.override.battleStyle("double");
|
||||
game.override.moveset([Moves.STICKY_WEB, Moves.SPLASH, Moves.TRICK_ROOM]);
|
||||
|
||||
await game.classicMode.startBattle([Species.MAGIKARP, Species.MAGIKARP]);
|
||||
|
|
|
@ -23,9 +23,9 @@ describe("Abilities - Magma Armor", () => {
|
|||
beforeEach(() => {
|
||||
game = new GameManager(phaserGame);
|
||||
game.override
|
||||
.moveset([ Moves.SPLASH ])
|
||||
.moveset([Moves.SPLASH])
|
||||
.ability(Abilities.BALL_FETCH)
|
||||
.battleType("single")
|
||||
.battleStyle("single")
|
||||
.disableCrits()
|
||||
.enemySpecies(Species.MAGIKARP)
|
||||
.enemyAbility(Abilities.BALL_FETCH)
|
||||
|
@ -33,12 +33,12 @@ describe("Abilities - Magma Armor", () => {
|
|||
});
|
||||
|
||||
it("should remove freeze when gained", async () => {
|
||||
game.override.ability(Abilities.MAGMA_ARMOR)
|
||||
game.override
|
||||
.ability(Abilities.MAGMA_ARMOR)
|
||||
.enemyAbility(Abilities.BALL_FETCH)
|
||||
.moveset(Moves.SKILL_SWAP)
|
||||
.enemyMoveset(Moves.SPLASH),
|
||||
|
||||
await game.classicMode.startBattle([ Species.FEEBAS ]);
|
||||
.enemyMoveset(Moves.SPLASH);
|
||||
await game.classicMode.startBattle([Species.FEEBAS]);
|
||||
const enemy = game.scene.getEnemyPokemon();
|
||||
enemy?.trySetStatus(StatusEffect.FREEZE);
|
||||
expect(enemy?.status?.effect).toBe(StatusEffect.FREEZE);
|
||||
|
|
|
@ -25,7 +25,7 @@ describe("Abilities - Mimicry", () => {
|
|||
game.override
|
||||
.moveset([Moves.SPLASH])
|
||||
.ability(Abilities.MIMICRY)
|
||||
.battleType("single")
|
||||
.battleStyle("single")
|
||||
.disableCrits()
|
||||
.enemySpecies(Species.MAGIKARP)
|
||||
.enemyMoveset(Moves.SPLASH);
|
||||
|
|
|
@ -27,7 +27,7 @@ describe("Ability - Mirror Armor", () => {
|
|||
game = new GameManager(phaserGame);
|
||||
|
||||
game.override
|
||||
.battleType("single")
|
||||
.battleStyle("single")
|
||||
.enemySpecies(Species.RATTATA)
|
||||
.enemyMoveset([Moves.SPLASH, Moves.STICKY_WEB, Moves.TICKLE, Moves.OCTOLOCK])
|
||||
.enemyAbility(Abilities.BALL_FETCH)
|
||||
|
@ -71,7 +71,7 @@ describe("Ability - Mirror Armor", () => {
|
|||
});
|
||||
|
||||
it("Player side + double battle Intimidate - opponents each lose -2 atk", async () => {
|
||||
game.override.battleType("double");
|
||||
game.override.battleStyle("double");
|
||||
game.override.ability(Abilities.MIRROR_ARMOR);
|
||||
game.override.enemyAbility(Abilities.INTIMIDATE);
|
||||
await game.classicMode.startBattle([Species.BULBASAUR, Species.CHARMANDER]);
|
||||
|
@ -93,7 +93,7 @@ describe("Ability - Mirror Armor", () => {
|
|||
});
|
||||
|
||||
it("Enemy side + double battle Intimidate - players each lose -2 atk", async () => {
|
||||
game.override.battleType("double");
|
||||
game.override.battleStyle("double");
|
||||
game.override.enemyAbility(Abilities.MIRROR_ARMOR);
|
||||
game.override.ability(Abilities.INTIMIDATE);
|
||||
await game.classicMode.startBattle([Species.BULBASAUR, Species.CHARMANDER]);
|
||||
|
@ -134,7 +134,7 @@ describe("Ability - Mirror Armor", () => {
|
|||
});
|
||||
|
||||
it("Player side + double battle Intimidate + Tickle - opponents each lose -3 atk, -1 def", async () => {
|
||||
game.override.battleType("double");
|
||||
game.override.battleStyle("double");
|
||||
game.override.ability(Abilities.MIRROR_ARMOR);
|
||||
game.override.enemyAbility(Abilities.INTIMIDATE);
|
||||
await game.classicMode.startBattle([Species.BULBASAUR, Species.CHARMANDER]);
|
||||
|
@ -288,7 +288,7 @@ describe("Ability - Mirror Armor", () => {
|
|||
});
|
||||
|
||||
it("Double battle + sticky web applied player side - player switches out and enemy 1 should lose -1 speed", async () => {
|
||||
game.override.battleType("double");
|
||||
game.override.battleStyle("double");
|
||||
game.override.ability(Abilities.MIRROR_ARMOR);
|
||||
await game.classicMode.startBattle([Species.BULBASAUR, Species.CHARMANDER, Species.SQUIRTLE]);
|
||||
|
||||
|
|
|
@ -24,9 +24,9 @@ describe("Abilities - Mold Breaker", () => {
|
|||
beforeEach(() => {
|
||||
game = new GameManager(phaserGame);
|
||||
game.override
|
||||
.moveset([ Moves.SPLASH ])
|
||||
.moveset([Moves.SPLASH])
|
||||
.ability(Abilities.MOLD_BREAKER)
|
||||
.battleType("single")
|
||||
.battleStyle("single")
|
||||
.disableCrits()
|
||||
.enemySpecies(Species.MAGIKARP)
|
||||
.enemyAbility(Abilities.BALL_FETCH)
|
||||
|
@ -34,17 +34,18 @@ describe("Abilities - Mold Breaker", () => {
|
|||
});
|
||||
|
||||
it("should turn off the ignore abilities arena variable after the user's move", async () => {
|
||||
game.override.enemyMoveset(Moves.SPLASH)
|
||||
game.override
|
||||
.enemyMoveset(Moves.SPLASH)
|
||||
.ability(Abilities.MOLD_BREAKER)
|
||||
.moveset([ Moves.ERUPTION ])
|
||||
.moveset([Moves.ERUPTION])
|
||||
.startingLevel(100)
|
||||
.enemyLevel(2);
|
||||
await game.classicMode.startBattle([ Species.MAGIKARP ]);
|
||||
await game.classicMode.startBattle([Species.MAGIKARP]);
|
||||
const enemy = game.scene.getEnemyPokemon()!;
|
||||
|
||||
expect(enemy.isFainted()).toBe(false);
|
||||
game.move.select(Moves.SPLASH);
|
||||
await game.setTurnOrder([ BattlerIndex.PLAYER, BattlerIndex.ENEMY ]);
|
||||
await game.setTurnOrder([BattlerIndex.PLAYER, BattlerIndex.ENEMY]);
|
||||
await game.phaseInterceptor.to("MoveEndPhase", true);
|
||||
expect(globalScene.arena.ignoreAbilities).toBe(false);
|
||||
});
|
||||
|
|
|
@ -24,7 +24,7 @@ describe("Abilities - Moody", () => {
|
|||
game = new GameManager(phaserGame);
|
||||
|
||||
game.override
|
||||
.battleType("single")
|
||||
.battleStyle("single")
|
||||
.enemySpecies(Species.RATTATA)
|
||||
.enemyAbility(Abilities.BALL_FETCH)
|
||||
.ability(Abilities.MOODY)
|
||||
|
|
|
@ -27,7 +27,7 @@ describe("Abilities - Moxie", () => {
|
|||
beforeEach(() => {
|
||||
game = new GameManager(phaserGame);
|
||||
const moveToUse = Moves.AERIAL_ACE;
|
||||
game.override.battleType("single");
|
||||
game.override.battleStyle("single");
|
||||
game.override.enemySpecies(Species.RATTATA);
|
||||
game.override.enemyAbility(Abilities.MOXIE);
|
||||
game.override.ability(Abilities.MOXIE);
|
||||
|
@ -54,7 +54,7 @@ describe("Abilities - Moxie", () => {
|
|||
it.todo(
|
||||
"should raise ATK stat stage by 1 when defeating an ally Pokemon",
|
||||
async () => {
|
||||
game.override.battleType("double");
|
||||
game.override.battleStyle("double");
|
||||
const moveToUse = Moves.AERIAL_ACE;
|
||||
await game.startBattle([Species.MIGHTYENA, Species.MIGHTYENA]);
|
||||
|
||||
|
|
|
@ -24,7 +24,7 @@ describe("Abilities - Mummy", () => {
|
|||
game.override
|
||||
.moveset([Moves.SPLASH])
|
||||
.ability(Abilities.MUMMY)
|
||||
.battleType("single")
|
||||
.battleStyle("single")
|
||||
.disableCrits()
|
||||
.enemySpecies(Species.MAGIKARP)
|
||||
.enemyAbility(Abilities.BALL_FETCH)
|
||||
|
|
|
@ -24,7 +24,7 @@ describe("Abilities - Mycelium Might", () => {
|
|||
|
||||
beforeEach(() => {
|
||||
game = new GameManager(phaserGame);
|
||||
game.override.battleType("single");
|
||||
game.override.battleStyle("single");
|
||||
game.override.disableCrits();
|
||||
game.override.enemySpecies(Species.SHUCKLE);
|
||||
game.override.enemyAbility(Abilities.CLEAR_BODY);
|
||||
|
|
|
@ -31,7 +31,7 @@ describe("Abilities - Neutralizing Gas", () => {
|
|||
game.override
|
||||
.moveset([Moves.SPLASH])
|
||||
.ability(Abilities.NEUTRALIZING_GAS)
|
||||
.battleType("single")
|
||||
.battleStyle("single")
|
||||
.disableCrits()
|
||||
.enemySpecies(Species.MAGIKARP)
|
||||
.enemyAbility(Abilities.BALL_FETCH)
|
||||
|
@ -105,7 +105,7 @@ describe("Abilities - Neutralizing Gas", () => {
|
|||
});
|
||||
|
||||
it("should only deactivate when all setters are off the field", async () => {
|
||||
game.override.enemyMoveset([Moves.ENTRAINMENT, Moves.SPLASH]).battleType("double");
|
||||
game.override.enemyMoveset([Moves.ENTRAINMENT, Moves.SPLASH]).battleStyle("double");
|
||||
|
||||
await game.classicMode.startBattle([Species.ACCELGOR, Species.ACCELGOR]);
|
||||
game.move.select(Moves.SPLASH, 0);
|
||||
|
@ -148,7 +148,7 @@ describe("Abilities - Neutralizing Gas", () => {
|
|||
});
|
||||
|
||||
it("should deactivate upon catching a wild pokemon", async () => {
|
||||
game.override.battleType("single").enemyAbility(Abilities.NEUTRALIZING_GAS).ability(Abilities.BALL_FETCH);
|
||||
game.override.battleStyle("single").enemyAbility(Abilities.NEUTRALIZING_GAS).ability(Abilities.BALL_FETCH);
|
||||
await game.classicMode.startBattle([Species.MAGIKARP]);
|
||||
expect(game.scene.arena.getTag(ArenaTagType.NEUTRALIZING_GAS)).toBeDefined();
|
||||
|
||||
|
@ -174,7 +174,7 @@ describe("Abilities - Neutralizing Gas", () => {
|
|||
});
|
||||
|
||||
it("should not activate abilities of pokemon no longer on the field", async () => {
|
||||
game.override.battleType("single").ability(Abilities.NEUTRALIZING_GAS).enemyAbility(Abilities.DELTA_STREAM);
|
||||
game.override.battleStyle("single").ability(Abilities.NEUTRALIZING_GAS).enemyAbility(Abilities.DELTA_STREAM);
|
||||
await game.classicMode.startBattle([Species.MAGIKARP]);
|
||||
|
||||
const enemy = game.scene.getEnemyPokemon()!;
|
||||
|
|
|
@ -33,7 +33,7 @@ describe("Abilities - No Guard", () => {
|
|||
});
|
||||
|
||||
it("should make moves always hit regardless of move accuracy", async () => {
|
||||
game.override.battleType("single");
|
||||
game.override.battleStyle("single");
|
||||
|
||||
await game.classicMode.startBattle([Species.REGIELEKI]);
|
||||
|
||||
|
|
|
@ -23,9 +23,9 @@ describe("Abilities - Oblivious", () => {
|
|||
beforeEach(() => {
|
||||
game = new GameManager(phaserGame);
|
||||
game.override
|
||||
.moveset([ Moves.SPLASH ])
|
||||
.moveset([Moves.SPLASH])
|
||||
.ability(Abilities.BALL_FETCH)
|
||||
.battleType("single")
|
||||
.battleStyle("single")
|
||||
.disableCrits()
|
||||
.enemySpecies(Species.MAGIKARP)
|
||||
.enemyAbility(Abilities.BALL_FETCH)
|
||||
|
@ -33,12 +33,12 @@ describe("Abilities - Oblivious", () => {
|
|||
});
|
||||
|
||||
it("should remove taunt when gained", async () => {
|
||||
game.override.ability(Abilities.OBLIVIOUS)
|
||||
game.override
|
||||
.ability(Abilities.OBLIVIOUS)
|
||||
.enemyAbility(Abilities.BALL_FETCH)
|
||||
.moveset(Moves.SKILL_SWAP)
|
||||
.enemyMoveset(Moves.SPLASH),
|
||||
|
||||
await game.classicMode.startBattle([ Species.FEEBAS ]);
|
||||
.enemyMoveset(Moves.SPLASH);
|
||||
await game.classicMode.startBattle([Species.FEEBAS]);
|
||||
const enemy = game.scene.getEnemyPokemon();
|
||||
enemy?.addTag(BattlerTagType.TAUNT);
|
||||
expect(enemy?.getTag(BattlerTagType.TAUNT)).toBeTruthy();
|
||||
|
@ -50,12 +50,12 @@ describe("Abilities - Oblivious", () => {
|
|||
});
|
||||
|
||||
it("should remove infatuation when gained", async () => {
|
||||
game.override.ability(Abilities.OBLIVIOUS)
|
||||
game.override
|
||||
.ability(Abilities.OBLIVIOUS)
|
||||
.enemyAbility(Abilities.BALL_FETCH)
|
||||
.moveset(Moves.SKILL_SWAP)
|
||||
.enemyMoveset(Moves.SPLASH),
|
||||
|
||||
await game.classicMode.startBattle([ Species.FEEBAS ]);
|
||||
.enemyMoveset(Moves.SPLASH);
|
||||
await game.classicMode.startBattle([Species.FEEBAS]);
|
||||
const enemy = game.scene.getEnemyPokemon();
|
||||
vi.spyOn(enemy!, "isOppositeGender").mockReturnValue(true);
|
||||
enemy?.addTag(BattlerTagType.INFATUATED, 5, Moves.JUDGMENT, game.scene.getPlayerPokemon()?.id); // sourceID needs to be defined
|
||||
|
|
|
@ -23,9 +23,9 @@ describe("Abilities - Own Tempo", () => {
|
|||
beforeEach(() => {
|
||||
game = new GameManager(phaserGame);
|
||||
game.override
|
||||
.moveset([ Moves.SPLASH ])
|
||||
.moveset([Moves.SPLASH])
|
||||
.ability(Abilities.BALL_FETCH)
|
||||
.battleType("single")
|
||||
.battleStyle("single")
|
||||
.disableCrits()
|
||||
.enemySpecies(Species.MAGIKARP)
|
||||
.enemyAbility(Abilities.BALL_FETCH)
|
||||
|
@ -33,12 +33,12 @@ describe("Abilities - Own Tempo", () => {
|
|||
});
|
||||
|
||||
it("should remove confusion when gained", async () => {
|
||||
game.override.ability(Abilities.OWN_TEMPO)
|
||||
game.override
|
||||
.ability(Abilities.OWN_TEMPO)
|
||||
.enemyAbility(Abilities.BALL_FETCH)
|
||||
.moveset(Moves.SKILL_SWAP)
|
||||
.enemyMoveset(Moves.SPLASH),
|
||||
|
||||
await game.classicMode.startBattle([ Species.FEEBAS ]);
|
||||
.enemyMoveset(Moves.SPLASH);
|
||||
await game.classicMode.startBattle([Species.FEEBAS]);
|
||||
const enemy = game.scene.getEnemyPokemon();
|
||||
enemy?.addTag(BattlerTagType.CONFUSED);
|
||||
expect(enemy?.getTag(BattlerTagType.CONFUSED)).toBeTruthy();
|
||||
|
|
|
@ -26,7 +26,7 @@ describe("Abilities - Parental Bond", () => {
|
|||
|
||||
beforeEach(() => {
|
||||
game = new GameManager(phaserGame);
|
||||
game.override.battleType("single");
|
||||
game.override.battleStyle("single");
|
||||
game.override.disableCrits();
|
||||
game.override.ability(Abilities.PARENTAL_BOND);
|
||||
game.override.enemySpecies(Species.SNORLAX);
|
||||
|
@ -167,7 +167,7 @@ describe("Abilities - Parental Bond", () => {
|
|||
});
|
||||
|
||||
it("should not apply to multi-target moves", async () => {
|
||||
game.override.battleType("double");
|
||||
game.override.battleStyle("double");
|
||||
game.override.moveset([Moves.EARTHQUAKE]);
|
||||
game.override.passiveAbility(Abilities.LEVITATE);
|
||||
|
||||
|
|
|
@ -26,7 +26,7 @@ describe("Abilities - Pastel Veil", () => {
|
|||
beforeEach(() => {
|
||||
game = new GameManager(phaserGame);
|
||||
game.override
|
||||
.battleType("double")
|
||||
.battleStyle("double")
|
||||
.moveset([Moves.TOXIC_THREAD, Moves.SPLASH])
|
||||
.enemyAbility(Abilities.BALL_FETCH)
|
||||
.enemySpecies(Species.SUNKERN)
|
||||
|
|
|
@ -21,7 +21,7 @@ describe("Abilities - Perish Song", () => {
|
|||
|
||||
beforeEach(() => {
|
||||
game = new GameManager(phaserGame);
|
||||
game.override.battleType("single");
|
||||
game.override.battleStyle("single");
|
||||
game.override.disableCrits();
|
||||
|
||||
game.override.enemySpecies(Species.MAGIKARP);
|
||||
|
|
|
@ -25,7 +25,7 @@ describe("Abilities - POWER CONSTRUCT", () => {
|
|||
beforeEach(() => {
|
||||
game = new GameManager(phaserGame);
|
||||
const moveToUse = Moves.SPLASH;
|
||||
game.override.battleType("single");
|
||||
game.override.battleStyle("single");
|
||||
game.override.ability(Abilities.POWER_CONSTRUCT);
|
||||
game.override.moveset([moveToUse]);
|
||||
game.override.enemyMoveset([Moves.TACKLE, Moves.TACKLE, Moves.TACKLE, Moves.TACKLE]);
|
||||
|
|
|
@ -26,7 +26,7 @@ describe("Abilities - Power Spot", () => {
|
|||
|
||||
beforeEach(() => {
|
||||
game = new GameManager(phaserGame);
|
||||
game.override.battleType("double");
|
||||
game.override.battleStyle("double");
|
||||
game.override.moveset([Moves.TACKLE, Moves.BREAKING_SWIPE, Moves.SPLASH, Moves.DAZZLING_GLEAM]);
|
||||
game.override.enemyMoveset(Moves.SPLASH);
|
||||
game.override.enemySpecies(Species.SHUCKLE);
|
||||
|
|
|
@ -29,7 +29,7 @@ describe("Abilities - Protean", () => {
|
|||
|
||||
beforeEach(() => {
|
||||
game = new GameManager(phaserGame);
|
||||
game.override.battleType("single");
|
||||
game.override.battleStyle("single");
|
||||
game.override.ability(Abilities.PROTEAN);
|
||||
game.override.startingLevel(100);
|
||||
game.override.enemySpecies(Species.RATTATA);
|
||||
|
|
|
@ -27,7 +27,7 @@ describe("Abilities - Protosynthesis", () => {
|
|||
game.override
|
||||
.moveset([Moves.SPLASH, Moves.TACKLE])
|
||||
.ability(Abilities.PROTOSYNTHESIS)
|
||||
.battleType("single")
|
||||
.battleStyle("single")
|
||||
.disableCrits()
|
||||
.enemySpecies(Species.MAGIKARP)
|
||||
.enemyAbility(Abilities.BALL_FETCH)
|
||||
|
|
|
@ -23,7 +23,7 @@ describe("Abilities - Quick Draw", () => {
|
|||
|
||||
beforeEach(() => {
|
||||
game = new GameManager(phaserGame);
|
||||
game.override.battleType("single");
|
||||
game.override.battleStyle("single");
|
||||
|
||||
game.override.starterSpecies(Species.MAGIKARP);
|
||||
game.override.ability(Abilities.QUICK_DRAW);
|
||||
|
|
|
@ -22,7 +22,7 @@ describe("Abilities - Sand Spit", () => {
|
|||
|
||||
beforeEach(() => {
|
||||
game = new GameManager(phaserGame);
|
||||
game.override.battleType("single");
|
||||
game.override.battleStyle("single");
|
||||
game.override.disableCrits();
|
||||
|
||||
game.override.enemySpecies(Species.MAGIKARP);
|
||||
|
|
|
@ -33,7 +33,7 @@ describe("Abilities - Sand Veil", () => {
|
|||
game.override.enemyMoveset([Moves.TWISTER, Moves.TWISTER, Moves.TWISTER, Moves.TWISTER]);
|
||||
game.override.startingLevel(100);
|
||||
game.override.enemyLevel(100);
|
||||
game.override.weather(WeatherType.SANDSTORM).battleType("double");
|
||||
game.override.weather(WeatherType.SANDSTORM).battleStyle("double");
|
||||
});
|
||||
|
||||
test("ability should increase the evasiveness of the source", async () => {
|
||||
|
|
|
@ -29,7 +29,7 @@ describe("Abilities - Sap Sipper", () => {
|
|||
beforeEach(() => {
|
||||
game = new GameManager(phaserGame);
|
||||
game.override
|
||||
.battleType("single")
|
||||
.battleStyle("single")
|
||||
.disableCrits()
|
||||
.ability(Abilities.SAP_SIPPER)
|
||||
.enemySpecies(Species.RATTATA)
|
||||
|
|
|
@ -25,7 +25,7 @@ describe("Abilities - SCHOOLING", () => {
|
|||
beforeEach(() => {
|
||||
game = new GameManager(phaserGame);
|
||||
const moveToUse = Moves.SPLASH;
|
||||
game.override.battleType("single");
|
||||
game.override.battleStyle("single");
|
||||
game.override.ability(Abilities.SCHOOLING);
|
||||
game.override.moveset([moveToUse]);
|
||||
game.override.enemyMoveset([Moves.TACKLE, Moves.TACKLE, Moves.TACKLE, Moves.TACKLE]);
|
||||
|
|
|
@ -24,7 +24,7 @@ describe("Abilities - Screen Cleaner", () => {
|
|||
|
||||
beforeEach(() => {
|
||||
game = new GameManager(phaserGame);
|
||||
game.override.battleType("single");
|
||||
game.override.battleStyle("single");
|
||||
game.override.ability(Abilities.SCREEN_CLEANER);
|
||||
game.override.enemySpecies(Species.SHUCKLE);
|
||||
});
|
||||
|
|
|
@ -22,7 +22,7 @@ describe("Abilities - Seed Sower", () => {
|
|||
|
||||
beforeEach(() => {
|
||||
game = new GameManager(phaserGame);
|
||||
game.override.battleType("single");
|
||||
game.override.battleStyle("single");
|
||||
game.override.disableCrits();
|
||||
|
||||
game.override.enemySpecies(Species.MAGIKARP);
|
||||
|
|
|
@ -26,7 +26,7 @@ describe("Abilities - Serene Grace", () => {
|
|||
game = new GameManager(phaserGame);
|
||||
game.override
|
||||
.disableCrits()
|
||||
.battleType("single")
|
||||
.battleStyle("single")
|
||||
.ability(Abilities.SERENE_GRACE)
|
||||
.moveset([Moves.AIR_SLASH])
|
||||
.enemySpecies(Species.ALOLA_GEODUDE)
|
||||
|
|
|
@ -26,7 +26,7 @@ describe("Abilities - Sheer Force", () => {
|
|||
beforeEach(() => {
|
||||
game = new GameManager(phaserGame);
|
||||
game.override
|
||||
.battleType("single")
|
||||
.battleStyle("single")
|
||||
.ability(Abilities.SHEER_FORCE)
|
||||
.enemySpecies(Species.ONIX)
|
||||
.enemyAbility(Abilities.BALL_FETCH)
|
||||
|
|
|
@ -31,7 +31,7 @@ describe("Abilities - Shield Dust", () => {
|
|||
|
||||
beforeEach(() => {
|
||||
game = new GameManager(phaserGame);
|
||||
game.override.battleType("single");
|
||||
game.override.battleStyle("single");
|
||||
game.override.enemySpecies(Species.ONIX);
|
||||
game.override.enemyAbility(Abilities.SHIELD_DUST);
|
||||
game.override.startingLevel(100);
|
||||
|
|
|
@ -26,7 +26,7 @@ describe("Abilities - SHIELDS DOWN", () => {
|
|||
beforeEach(() => {
|
||||
game = new GameManager(phaserGame);
|
||||
const moveToUse = Moves.SPLASH;
|
||||
game.override.battleType("single");
|
||||
game.override.battleStyle("single");
|
||||
game.override.ability(Abilities.SHIELDS_DOWN);
|
||||
game.override.moveset([moveToUse]);
|
||||
game.override.enemyMoveset([Moves.TACKLE]);
|
||||
|
|
|
@ -23,7 +23,7 @@ describe("Abilities - Simple", () => {
|
|||
beforeEach(() => {
|
||||
game = new GameManager(phaserGame);
|
||||
game.override
|
||||
.battleType("single")
|
||||
.battleStyle("single")
|
||||
.enemySpecies(Species.BULBASAUR)
|
||||
.enemyAbility(Abilities.SIMPLE)
|
||||
.ability(Abilities.INTIMIDATE)
|
||||
|
|
|
@ -27,7 +27,7 @@ describe("Abilities - Speed Boost", () => {
|
|||
game = new GameManager(phaserGame);
|
||||
|
||||
game.override
|
||||
.battleType("single")
|
||||
.battleStyle("single")
|
||||
.enemySpecies(Species.SHUCKLE)
|
||||
.enemyAbility(Abilities.BALL_FETCH)
|
||||
.enemyLevel(100)
|
||||
|
|
|
@ -26,7 +26,7 @@ describe("Abilities - Stakeout", () => {
|
|||
game.override
|
||||
.moveset([Moves.SPLASH, Moves.SURF])
|
||||
.ability(Abilities.STAKEOUT)
|
||||
.battleType("single")
|
||||
.battleStyle("single")
|
||||
.disableCrits()
|
||||
.startingLevel(100)
|
||||
.enemyLevel(100)
|
||||
|
|
|
@ -22,7 +22,7 @@ describe("Abilities - Stall", () => {
|
|||
|
||||
beforeEach(() => {
|
||||
game = new GameManager(phaserGame);
|
||||
game.override.battleType("single");
|
||||
game.override.battleStyle("single");
|
||||
game.override.disableCrits();
|
||||
game.override.enemySpecies(Species.REGIELEKI);
|
||||
game.override.enemyAbility(Abilities.STALL);
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue