mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-08-27 17:59:28 +02:00
Merge branch 'pagefaultgames:beta' into beta
This commit is contained in:
commit
2277d9212f
@ -20,54 +20,58 @@ const type = args[0]; // "move" or "ability"
|
||||
let fileName = args[1]; // The file name
|
||||
|
||||
if (!type || !fileName) {
|
||||
console.error('Please provide both a type ("move", "ability", or "item") and a file name.');
|
||||
process.exit(1);
|
||||
console.error('Please provide a type ("move", "ability", or "item") and a file name.');
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
// Convert fileName from to snake_case if camelCase is given
|
||||
fileName = fileName.replace(/([a-z])([A-Z])/g, '$1_$2').toLowerCase();
|
||||
// Convert fileName from kebab-case or camelCase to snake_case
|
||||
fileName = fileName
|
||||
.replace(/-+/g, '_') // Convert kebab-case (dashes) to underscores
|
||||
.replace(/([a-z])([A-Z])/g, '$1_$2') // Convert camelCase to snake_case
|
||||
.toLowerCase(); // Ensure all lowercase
|
||||
|
||||
// Format the description for the test case
|
||||
const formattedName = fileName
|
||||
.replace(/_/g, ' ')
|
||||
.replace(/\b\w/g, char => char.toUpperCase());
|
||||
.replace(/_/g, ' ')
|
||||
.replace(/\b\w/g, char => char.toUpperCase());
|
||||
|
||||
// Determine the directory based on the type
|
||||
let dir;
|
||||
let description;
|
||||
if (type === 'move') {
|
||||
dir = path.join(__dirname, 'src', 'test', 'moves');
|
||||
description = `Moves - ${formattedName}`;
|
||||
dir = path.join(__dirname, 'src', 'test', 'moves');
|
||||
description = `Moves - ${formattedName}`;
|
||||
} else if (type === 'ability') {
|
||||
dir = path.join(__dirname, 'src', 'test', 'abilities');
|
||||
description = `Abilities - ${formattedName}`;
|
||||
dir = path.join(__dirname, 'src', 'test', 'abilities');
|
||||
description = `Abilities - ${formattedName}`;
|
||||
} else if (type === "item") {
|
||||
dir = path.join(__dirname, 'src', 'test', 'items');
|
||||
description = `Items - ${formattedName}`;
|
||||
dir = path.join(__dirname, 'src', 'test', 'items');
|
||||
description = `Items - ${formattedName}`;
|
||||
} else {
|
||||
console.error('Invalid type. Please use "move", "ability", or "item".');
|
||||
process.exit(1);
|
||||
console.error('Invalid type. Please use "move", "ability", or "item".');
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
// Ensure the directory exists
|
||||
if (!fs.existsSync(dir)) {
|
||||
fs.mkdirSync(dir, { recursive: true });
|
||||
fs.mkdirSync(dir, { recursive: true });
|
||||
}
|
||||
|
||||
// Create the file with the given name
|
||||
const filePath = path.join(dir, `${fileName}.test.ts`);
|
||||
|
||||
if (fs.existsSync(filePath)) {
|
||||
console.error(`File "${fileName}.test.ts" already exists.`);
|
||||
process.exit(1);
|
||||
console.error(`File "${fileName}.test.ts" already exists.`);
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
// Define the content template
|
||||
const content = `import { Abilities } from "#enums/abilities";
|
||||
import { Moves } from "#enums/moves";
|
||||
import { Species } from "#enums/species";
|
||||
import GameManager from "#test/utils/gameManager";
|
||||
import { SPLASH_ONLY } from "#test/utils/testUtils";
|
||||
import Phaser from "phaser";
|
||||
import { afterEach, beforeAll, beforeEach, describe, it } from "vitest";
|
||||
import { afterEach, beforeAll, beforeEach, describe, it, expect } from "vitest";
|
||||
|
||||
describe("${description}", () => {
|
||||
let phaserGame: Phaser.Game;
|
||||
@ -87,14 +91,15 @@ describe("${description}", () => {
|
||||
beforeEach(() => {
|
||||
game = new GameManager(phaserGame);
|
||||
game.override
|
||||
.moveset([Moves.SPLASH])
|
||||
.battleType("single")
|
||||
.enemyAbility(Abilities.BALL_FETCH)
|
||||
.enemyMoveset(SPLASH_ONLY);
|
||||
.enemyMoveset(Moves.SPLASH);
|
||||
});
|
||||
|
||||
it("test case", async () => {
|
||||
// await game.classicMode.startBattle();
|
||||
// game.move.select();
|
||||
// await game.classicMode.startBattle([Species.MAGIKARP]);
|
||||
// game.move.select(Moves.SPLASH);
|
||||
}, TIMEOUT);
|
||||
});
|
||||
`;
|
||||
|
Binary file not shown.
Before Width: | Height: | Size: 799 B |
Binary file not shown.
Before Width: | Height: | Size: 807 B |
Binary file not shown.
Before Width: | Height: | Size: 1.7 KiB |
Binary file not shown.
Before Width: | Height: | Size: 799 B |
Binary file not shown.
Before Width: | Height: | Size: 800 B |
Binary file not shown.
Before Width: | Height: | Size: 799 B |
@ -2193,8 +2193,14 @@ export default class BattleScene extends SceneBase {
|
||||
return true;
|
||||
}
|
||||
|
||||
findPhase(phaseFilter: (phase: Phase) => boolean): Phase | undefined {
|
||||
return this.phaseQueue.find(phaseFilter);
|
||||
/**
|
||||
* Find a specific {@linkcode Phase} in the phase queue.
|
||||
*
|
||||
* @param phaseFilter filter function to use to find the wanted phase
|
||||
* @returns the found phase or undefined if none found
|
||||
*/
|
||||
findPhase<P extends Phase = Phase>(phaseFilter: (phase: P) => boolean): P | undefined {
|
||||
return this.phaseQueue.find(phaseFilter) as P;
|
||||
}
|
||||
|
||||
tryReplacePhase(phaseFilter: (phase: Phase) => boolean, phase: Phase): boolean {
|
||||
|
@ -1595,8 +1595,8 @@ export class PostAttackAbAttr extends AbAttr {
|
||||
private attackCondition: PokemonAttackCondition;
|
||||
|
||||
/** The default attackCondition requires that the selected move is a damaging move */
|
||||
constructor(attackCondition: PokemonAttackCondition = (user, target, move) => (move.category !== MoveCategory.STATUS)) {
|
||||
super();
|
||||
constructor(attackCondition: PokemonAttackCondition = (user, target, move) => (move.category !== MoveCategory.STATUS), showAbility: boolean = true) {
|
||||
super(showAbility);
|
||||
|
||||
this.attackCondition = attackCondition;
|
||||
}
|
||||
@ -1624,6 +1624,40 @@ export class PostAttackAbAttr extends AbAttr {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Ability attribute for Gorilla Tactics
|
||||
* @extends PostAttackAbAttr
|
||||
*/
|
||||
export class GorillaTacticsAbAttr extends PostAttackAbAttr {
|
||||
constructor() {
|
||||
super((user, target, move) => true, false);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param {Pokemon} pokemon the {@linkcode Pokemon} with this ability
|
||||
* @param passive n/a
|
||||
* @param simulated whether the ability is being simulated
|
||||
* @param defender n/a
|
||||
* @param move n/a
|
||||
* @param hitResult n/a
|
||||
* @param args n/a
|
||||
* @returns `true` if the ability is applied
|
||||
*/
|
||||
applyPostAttackAfterMoveTypeCheck(pokemon: Pokemon, passive: boolean, simulated: boolean, defender: Pokemon, move: Move, hitResult: HitResult | null, args: any[]): boolean | Promise<boolean> {
|
||||
if (simulated) {
|
||||
return simulated;
|
||||
}
|
||||
|
||||
if (pokemon.getTag(BattlerTagType.GORILLA_TACTICS)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
pokemon.addTag(BattlerTagType.GORILLA_TACTICS);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
export class PostAttackStealHeldItemAbAttr extends PostAttackAbAttr {
|
||||
private stealCondition: PokemonAttackCondition | null;
|
||||
|
||||
@ -3923,7 +3957,7 @@ export class PostBattleLootAbAttr extends PostBattleAbAttr {
|
||||
}
|
||||
|
||||
export class PostFaintAbAttr extends AbAttr {
|
||||
applyPostFaint(pokemon: Pokemon, passive: boolean, simulated: boolean, attacker: Pokemon, move: Move, hitResult: HitResult, args: any[]): boolean {
|
||||
applyPostFaint(pokemon: Pokemon, passive: boolean, simulated: boolean, attacker?: Pokemon, move?: Move, hitResult?: HitResult, ...args: any[]): boolean {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@ -3974,7 +4008,7 @@ export class PostFaintClearWeatherAbAttr extends PostFaintAbAttr {
|
||||
* @param args N/A
|
||||
* @returns {boolean} Returns true if the weather clears, otherwise false.
|
||||
*/
|
||||
applyPostFaint(pokemon: Pokemon, passive: boolean, simulated: boolean, attacker: Pokemon, move: Move, hitResult: HitResult, args: any[]): boolean {
|
||||
applyPostFaint(pokemon: Pokemon, passive: boolean, simulated: boolean, attacker?: Pokemon, move?: Move, hitResult?: HitResult, ...args: any[]): boolean {
|
||||
const weatherType = pokemon.scene.arena.weather?.weatherType;
|
||||
let turnOffWeather = false;
|
||||
|
||||
@ -4022,8 +4056,8 @@ export class PostFaintContactDamageAbAttr extends PostFaintAbAttr {
|
||||
this.damageRatio = damageRatio;
|
||||
}
|
||||
|
||||
applyPostFaint(pokemon: Pokemon, passive: boolean, simulated: boolean, attacker: Pokemon, move: Move, hitResult: HitResult, args: any[]): boolean {
|
||||
if (move.checkFlag(MoveFlags.MAKES_CONTACT, attacker, pokemon)) {
|
||||
applyPostFaint(pokemon: Pokemon, passive: boolean, simulated: boolean, attacker?: Pokemon, move?: Move, hitResult?: HitResult, ...args: any[]): boolean {
|
||||
if (move !== undefined && attacker !== undefined && move.checkFlag(MoveFlags.MAKES_CONTACT, attacker, pokemon)) { //If the mon didn't die to indirect damage
|
||||
const cancelled = new Utils.BooleanHolder(false);
|
||||
pokemon.scene.getField(true).map(p => applyAbAttrs(FieldPreventExplosiveMovesAbAttr, p, cancelled, simulated));
|
||||
if (cancelled.value || attacker.hasAbilityWithAttr(BlockNonDirectDamageAbAttr)) {
|
||||
@ -4052,8 +4086,8 @@ export class PostFaintHPDamageAbAttr extends PostFaintAbAttr {
|
||||
super ();
|
||||
}
|
||||
|
||||
applyPostFaint(pokemon: Pokemon, passive: boolean, simulated: boolean, attacker: Pokemon, move: Move, hitResult: HitResult, args: any[]): boolean {
|
||||
if (!simulated) {
|
||||
applyPostFaint(pokemon: Pokemon, passive: boolean, simulated: boolean, attacker?: Pokemon, move?: Move, hitResult?: HitResult, ...args: any[]): boolean {
|
||||
if (move !== undefined && attacker !== undefined && !simulated) { //If the mon didn't die to indirect damage
|
||||
const damage = pokemon.turnData.attacksReceived[0].damage;
|
||||
attacker.damageAndUpdate((damage), HitResult.OTHER);
|
||||
attacker.turnData.damageTaken += damage;
|
||||
@ -4711,7 +4745,7 @@ export function applyPostBattleAbAttrs(attrType: Constructor<PostBattleAbAttr>,
|
||||
}
|
||||
|
||||
export function applyPostFaintAbAttrs(attrType: Constructor<PostFaintAbAttr>,
|
||||
pokemon: Pokemon, attacker: Pokemon, move: Move, hitResult: HitResult, simulated: boolean = false, ...args: any[]): Promise<void> {
|
||||
pokemon: Pokemon, attacker?: Pokemon, move?: Move, hitResult?: HitResult, simulated: boolean = false, ...args: any[]): Promise<void> {
|
||||
return applyAbAttrsInternal<PostFaintAbAttr>(attrType, pokemon, (attr, passive) => attr.applyPostFaint(pokemon, passive, simulated, attacker, move, hitResult, args), args, false, simulated);
|
||||
}
|
||||
|
||||
@ -5597,7 +5631,7 @@ export function initAbilities() {
|
||||
.bypassFaint()
|
||||
.partial(),
|
||||
new Ability(Abilities.GORILLA_TACTICS, 8)
|
||||
.unimplemented(),
|
||||
.attr(GorillaTacticsAbAttr),
|
||||
new Ability(Abilities.NEUTRALIZING_GAS, 8)
|
||||
.attr(SuppressFieldAbilitiesAbAttr)
|
||||
.attr(UncopiableAbilityAbAttr)
|
||||
|
@ -107,8 +107,8 @@ export interface TerrainBattlerTag {
|
||||
* to select restricted moves.
|
||||
*/
|
||||
export abstract class MoveRestrictionBattlerTag extends BattlerTag {
|
||||
constructor(tagType: BattlerTagType, turnCount: integer, sourceMove?: Moves, sourceId?: integer) {
|
||||
super(tagType, [ BattlerTagLapseType.PRE_MOVE, BattlerTagLapseType.TURN_END ], turnCount, sourceMove, sourceId);
|
||||
constructor(tagType: BattlerTagType, lapseType: BattlerTagLapseType | BattlerTagLapseType[], turnCount: integer, sourceMove?: Moves, sourceId?: integer) {
|
||||
super(tagType, lapseType, turnCount, sourceMove, sourceId);
|
||||
}
|
||||
|
||||
/** @override */
|
||||
@ -119,7 +119,9 @@ export abstract class MoveRestrictionBattlerTag extends BattlerTag {
|
||||
const move = phase.move;
|
||||
|
||||
if (this.isMoveRestricted(move.moveId)) {
|
||||
pokemon.scene.queueMessage(this.interruptedText(pokemon, move.moveId));
|
||||
if (this.interruptedText(pokemon, move.moveId)) {
|
||||
pokemon.scene.queueMessage(this.interruptedText(pokemon, move.moveId));
|
||||
}
|
||||
phase.cancel();
|
||||
}
|
||||
|
||||
@ -155,7 +157,52 @@ export abstract class MoveRestrictionBattlerTag extends BattlerTag {
|
||||
* @param {Moves} move {@linkcode Moves} ID of the move being interrupted
|
||||
* @returns {string} text to display when the move is interrupted
|
||||
*/
|
||||
abstract interruptedText(pokemon: Pokemon, move: Moves): string;
|
||||
interruptedText(pokemon: Pokemon, move: Moves): string {
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Tag representing the "Throat Chop" effect. Pokemon with this tag cannot use sound-based moves.
|
||||
* @see {@link https://bulbapedia.bulbagarden.net/wiki/Throat_Chop_(move) | Throat Chop}
|
||||
* @extends MoveRestrictionBattlerTag
|
||||
*/
|
||||
export class ThroatChoppedTag extends MoveRestrictionBattlerTag {
|
||||
constructor() {
|
||||
super(BattlerTagType.THROAT_CHOPPED, [ BattlerTagLapseType.TURN_END, BattlerTagLapseType.PRE_MOVE ], 2, Moves.THROAT_CHOP);
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if a {@linkcode Moves | move} is restricted by Throat Chop.
|
||||
* @override
|
||||
* @param {Moves} move the {@linkcode Moves | move} to check for sound-based restriction
|
||||
* @returns true if the move is sound-based
|
||||
*/
|
||||
override isMoveRestricted(move: Moves): boolean {
|
||||
return allMoves[move].hasFlag(MoveFlags.SOUND_BASED);
|
||||
}
|
||||
|
||||
/**
|
||||
* Shows a message when the player attempts to select a move that is restricted by Throat Chop.
|
||||
* @override
|
||||
* @param {Pokemon} pokemon the {@linkcode Pokemon} that is attempting to select the restricted move
|
||||
* @param {Moves} move the {@linkcode Moves | move} that is being restricted
|
||||
* @returns the message to display when the player attempts to select the restricted move
|
||||
*/
|
||||
override selectionDeniedText(pokemon: Pokemon, move: Moves): string {
|
||||
return i18next.t("battle:moveCannotBeSelected", { moveName: allMoves[move].name });
|
||||
}
|
||||
|
||||
/**
|
||||
* Shows a message when a move is interrupted by Throat Chop.
|
||||
* @override
|
||||
* @param {Pokemon} pokemon the interrupted {@linkcode Pokemon}
|
||||
* @param {Moves} move the {@linkcode Moves | move} that was interrupted
|
||||
* @returns the message to display when the move is interrupted
|
||||
*/
|
||||
override interruptedText(pokemon: Pokemon, move: Moves): string {
|
||||
return i18next.t("battle:throatChopInterruptedMove", { pokemonName: getPokemonNameWithAffix(pokemon) });
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@ -167,7 +214,7 @@ export class DisabledTag extends MoveRestrictionBattlerTag {
|
||||
private moveId: Moves = Moves.NONE;
|
||||
|
||||
constructor(sourceId: number) {
|
||||
super(BattlerTagType.DISABLED, 4, Moves.DISABLE, sourceId);
|
||||
super(BattlerTagType.DISABLED, [ BattlerTagLapseType.PRE_MOVE, BattlerTagLapseType.TURN_END ], 4, Moves.DISABLE, sourceId);
|
||||
}
|
||||
|
||||
/** @override */
|
||||
@ -178,7 +225,7 @@ export class DisabledTag extends MoveRestrictionBattlerTag {
|
||||
/**
|
||||
* @override
|
||||
*
|
||||
* Ensures that move history exists on `pokemon` and has a valid move. If so, sets the {@link moveId} and shows a message.
|
||||
* Ensures that move history exists on `pokemon` and has a valid move. If so, sets the {@linkcode moveId} and shows a message.
|
||||
* Otherwise the move ID will not get assigned and this tag will get removed next turn.
|
||||
*/
|
||||
override onAdd(pokemon: Pokemon): void {
|
||||
@ -207,7 +254,12 @@ export class DisabledTag extends MoveRestrictionBattlerTag {
|
||||
return i18next.t("battle:moveDisabled", { moveName: allMoves[move].name });
|
||||
}
|
||||
|
||||
/** @override */
|
||||
/**
|
||||
* @override
|
||||
* @param {Pokemon} pokemon {@linkcode Pokemon} attempting to use the restricted move
|
||||
* @param {Moves} move {@linkcode Moves} ID of the move being interrupted
|
||||
* @returns {string} text to display when the move is interrupted
|
||||
*/
|
||||
override interruptedText(pokemon: Pokemon, move: Moves): string {
|
||||
return i18next.t("battle:disableInterruptedMove", { pokemonNameWithAffix: getPokemonNameWithAffix(pokemon), moveName: allMoves[move].name });
|
||||
}
|
||||
@ -219,6 +271,72 @@ export class DisabledTag extends MoveRestrictionBattlerTag {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Tag used by Gorilla Tactics to restrict the user to using only one move.
|
||||
* @extends MoveRestrictionBattlerTag
|
||||
*/
|
||||
export class GorillaTacticsTag extends MoveRestrictionBattlerTag {
|
||||
private moveId = Moves.NONE;
|
||||
|
||||
constructor() {
|
||||
super(BattlerTagType.GORILLA_TACTICS, BattlerTagLapseType.CUSTOM, 0);
|
||||
}
|
||||
|
||||
/** @override */
|
||||
override isMoveRestricted(move: Moves): boolean {
|
||||
return move !== this.moveId;
|
||||
}
|
||||
|
||||
/**
|
||||
* @override
|
||||
* @param {Pokemon} pokemon the {@linkcode Pokemon} to check if the tag can be added
|
||||
* @returns `true` if the pokemon has a valid move and no existing {@linkcode GorillaTacticsTag}; `false` otherwise
|
||||
*/
|
||||
override canAdd(pokemon: Pokemon): boolean {
|
||||
return (this.getLastValidMove(pokemon) !== undefined) && !pokemon.getTag(GorillaTacticsTag);
|
||||
}
|
||||
|
||||
/**
|
||||
* Ensures that move history exists on {@linkcode Pokemon} and has a valid move.
|
||||
* If so, sets the {@linkcode moveId} and increases the user's Attack by 50%.
|
||||
* @override
|
||||
* @param {Pokemon} pokemon the {@linkcode Pokemon} to add the tag to
|
||||
*/
|
||||
override onAdd(pokemon: Pokemon): void {
|
||||
const lastValidMove = this.getLastValidMove(pokemon);
|
||||
|
||||
if (!lastValidMove) {
|
||||
return;
|
||||
}
|
||||
|
||||
this.moveId = lastValidMove;
|
||||
pokemon.setStat(Stat.ATK, pokemon.getStat(Stat.ATK, false) * 1.5, false);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @override
|
||||
* @param {Pokemon} pokemon n/a
|
||||
* @param {Moves} move {@linkcode Moves} ID of the move being denied
|
||||
* @returns {string} text to display when the move is denied
|
||||
*/
|
||||
override selectionDeniedText(pokemon: Pokemon, move: Moves): string {
|
||||
return i18next.t("battle:canOnlyUseMove", { moveName: allMoves[this.moveId].name, pokemonName: getPokemonNameWithAffix(pokemon) });
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the last valid move from the pokemon's move history.
|
||||
* @param {Pokemon} pokemon {@linkcode Pokemon} to get the last valid move from
|
||||
* @returns {Moves | undefined} the last valid move from the pokemon's move history
|
||||
*/
|
||||
getLastValidMove(pokemon: Pokemon): Moves | undefined {
|
||||
const move = pokemon.getLastXMoves()
|
||||
.find(m => m.move !== Moves.NONE && m.move !== Moves.STRUGGLE && !m.virtual);
|
||||
|
||||
return move?.move;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* BattlerTag that represents the "recharge" effects of moves like Hyper Beam.
|
||||
*/
|
||||
@ -2158,6 +2276,10 @@ export function getBattlerTag(tagType: BattlerTagType, turnCount: number, source
|
||||
return new GulpMissileTag(tagType, sourceMove);
|
||||
case BattlerTagType.TAR_SHOT:
|
||||
return new TarShotTag();
|
||||
case BattlerTagType.THROAT_CHOPPED:
|
||||
return new ThroatChoppedTag();
|
||||
case BattlerTagType.GORILLA_TACTICS:
|
||||
return new GorillaTacticsTag();
|
||||
case BattlerTagType.NONE:
|
||||
default:
|
||||
return new BattlerTag(tagType, BattlerTagLapseType.CUSTOM, turnCount, sourceMove, sourceId);
|
||||
|
101
src/data/move.ts
101
src/data/move.ts
@ -5987,9 +5987,8 @@ export class SwapStatAttr extends MoveEffectAttr {
|
||||
}
|
||||
|
||||
/**
|
||||
* Takes the average of the user's and target's corresponding current
|
||||
* {@linkcode stat} values and sets that stat to the average for both
|
||||
* temporarily.
|
||||
* Swaps the user's and target's corresponding current
|
||||
* {@linkcode EffectiveStat | stat} values
|
||||
* @param user the {@linkcode Pokemon} that used the move
|
||||
* @param target the {@linkcode Pokemon} that the move was used on
|
||||
* @param move N/A
|
||||
@ -6013,6 +6012,62 @@ export class SwapStatAttr extends MoveEffectAttr {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Attribute used to switch the user's own stats.
|
||||
* Used by Power Shift.
|
||||
* @extends MoveEffectAttr
|
||||
*/
|
||||
export class ShiftStatAttr extends MoveEffectAttr {
|
||||
private statToSwitch: EffectiveStat;
|
||||
private statToSwitchWith: EffectiveStat;
|
||||
|
||||
constructor(statToSwitch: EffectiveStat, statToSwitchWith: EffectiveStat) {
|
||||
super();
|
||||
|
||||
this.statToSwitch = statToSwitch;
|
||||
this.statToSwitchWith = statToSwitchWith;
|
||||
}
|
||||
|
||||
/**
|
||||
* Switches the user's stats based on the {@linkcode statToSwitch} and {@linkcode statToSwitchWith} attributes.
|
||||
* @param {Pokemon} user the {@linkcode Pokemon} that used the move
|
||||
* @param target n/a
|
||||
* @param move n/a
|
||||
* @param args n/a
|
||||
* @returns whether the effect was applied
|
||||
*/
|
||||
override apply(user: Pokemon, target: Pokemon, move: Move, args: any[]): boolean {
|
||||
if (!super.apply(user, target, move, args)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
const firstStat = user.getStat(this.statToSwitch, false);
|
||||
const secondStat = user.getStat(this.statToSwitchWith, false);
|
||||
|
||||
user.setStat(this.statToSwitch, secondStat, false);
|
||||
user.setStat(this.statToSwitchWith, firstStat, false);
|
||||
|
||||
user.scene.queueMessage(i18next.t("moveTriggers:shiftedStats", {
|
||||
pokemonName: getPokemonNameWithAffix(user),
|
||||
statToSwitch: i18next.t(getStatKey(this.statToSwitch)),
|
||||
statToSwitchWith: i18next.t(getStatKey(this.statToSwitchWith))
|
||||
}));
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Encourages the user to use the move if the stat to switch with is greater than the stat to switch.
|
||||
* @param {Pokemon} user the {@linkcode Pokemon} that used the move
|
||||
* @param target n/a
|
||||
* @param move n/a
|
||||
* @returns number of points to add to the user's benefit score
|
||||
*/
|
||||
override getUserBenefitScore(user: Pokemon, target: Pokemon, move: Move): integer {
|
||||
return user.getStat(this.statToSwitchWith, false) > user.getStat(this.statToSwitch, false) ? 10 : 0;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Attribute used for status moves, namely Power Split and Guard Split,
|
||||
* that take the average of a user's and target's corresponding
|
||||
@ -6217,12 +6272,42 @@ export class VariableTargetAttr extends MoveAttr {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Attribute for {@linkcode Moves.AFTER_YOU}
|
||||
*
|
||||
* [After You - Move | Bulbapedia](https://bulbapedia.bulbagarden.net/wiki/After_You_(move))
|
||||
*/
|
||||
export class AfterYouAttr extends MoveEffectAttr {
|
||||
/**
|
||||
* Allows the target of this move to act right after the user.
|
||||
*
|
||||
* @param user {@linkcode Pokemon} that is using the move.
|
||||
* @param target {@linkcode Pokemon} that will move right after this move is used.
|
||||
* @param move {@linkcode Move} {@linkcode Moves.AFTER_YOU}
|
||||
* @param _args N/A
|
||||
* @returns true
|
||||
*/
|
||||
override apply(user: Pokemon, target: Pokemon, _move: Move, _args: any[]): boolean {
|
||||
user.scene.queueMessage(i18next.t("moveTriggers:afterYou", {targetName: getPokemonNameWithAffix(target)}));
|
||||
|
||||
//Will find next acting phase of the targeted pokémon, delete it and queue it next on successful delete.
|
||||
const nextAttackPhase = target.scene.findPhase<MovePhase>((phase) => phase.pokemon === target);
|
||||
if (nextAttackPhase && target.scene.tryRemovePhase((phase: MovePhase) => phase.pokemon === target)) {
|
||||
target.scene.prependToPhase(new MovePhase(target.scene, target, [...nextAttackPhase.targets], nextAttackPhase.move), MovePhase);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
const failOnGravityCondition: MoveConditionFunc = (user, target, move) => !user.scene.arena.getTag(ArenaTagType.GRAVITY);
|
||||
|
||||
const failOnBossCondition: MoveConditionFunc = (user, target, move) => !target.isBossImmune();
|
||||
|
||||
const failOnMaxCondition: MoveConditionFunc = (user, target, move) => !target.isMax();
|
||||
|
||||
const failIfSingleBattle: MoveConditionFunc = (user, target, move) => user.scene.currentBattle.double;
|
||||
|
||||
const failIfDampCondition: MoveConditionFunc = (user, target, move) => {
|
||||
const cancelled = new Utils.BooleanHolder(false);
|
||||
user.scene.getField(true).map(p=>applyAbAttrs(FieldPreventExplosiveMovesAbAttr, p, cancelled));
|
||||
@ -7870,7 +7955,10 @@ export function initMoves() {
|
||||
.attr(AbilityGiveAttr),
|
||||
new StatusMove(Moves.AFTER_YOU, Type.NORMAL, -1, 15, -1, 0, 5)
|
||||
.ignoresProtect()
|
||||
.unimplemented(),
|
||||
.target(MoveTarget.NEAR_OTHER)
|
||||
.condition(failIfSingleBattle)
|
||||
.condition((user, target, move) => !target.turnData.acted)
|
||||
.attr(AfterYouAttr),
|
||||
new AttackMove(Moves.ROUND, Type.NORMAL, MoveCategory.SPECIAL, 60, 100, 15, -1, 0, 5)
|
||||
.soundBased()
|
||||
.partial(),
|
||||
@ -8404,7 +8492,7 @@ export function initMoves() {
|
||||
.target(MoveTarget.USER_AND_ALLIES)
|
||||
.condition((user, target, move) => !![ user, user.getAlly() ].filter(p => p?.isActive()).find(p => !![ Abilities.PLUS, Abilities.MINUS].find(a => p.hasAbility(a, false)))),
|
||||
new AttackMove(Moves.THROAT_CHOP, Type.DARK, MoveCategory.PHYSICAL, 80, 100, 15, 100, 0, 7)
|
||||
.partial(),
|
||||
.attr(AddBattlerTagAttr, BattlerTagType.THROAT_CHOPPED),
|
||||
new AttackMove(Moves.POLLEN_PUFF, Type.BUG, MoveCategory.SPECIAL, 90, 100, 15, -1, 0, 7)
|
||||
.attr(StatusCategoryOnAllyAttr)
|
||||
.attr(HealOnAllyAttr, 0.5, true, false)
|
||||
@ -8894,7 +8982,8 @@ export function initMoves() {
|
||||
new AttackMove(Moves.PSYSHIELD_BASH, Type.PSYCHIC, MoveCategory.PHYSICAL, 70, 90, 10, 100, 0, 8)
|
||||
.attr(StatStageChangeAttr, [ Stat.DEF ], 1, true),
|
||||
new SelfStatusMove(Moves.POWER_SHIFT, Type.NORMAL, -1, 10, -1, 0, 8)
|
||||
.unimplemented(),
|
||||
.target(MoveTarget.USER)
|
||||
.attr(ShiftStatAttr, Stat.ATK, Stat.DEF),
|
||||
new AttackMove(Moves.STONE_AXE, Type.ROCK, MoveCategory.PHYSICAL, 65, 90, 15, 100, 0, 8)
|
||||
.attr(AddArenaTrapTagHitAttr, ArenaTagType.STEALTH_ROCK)
|
||||
.slicingMove(),
|
||||
|
@ -73,5 +73,7 @@ export enum BattlerTagType {
|
||||
SHELL_TRAP = "SHELL_TRAP",
|
||||
DRAGON_CHEER = "DRAGON_CHEER",
|
||||
NO_RETREAT = "NO_RETREAT",
|
||||
GORILLA_TACTICS = "GORILLA_TACTICS",
|
||||
THROAT_CHOPPED = "THROAT_CHOPPED",
|
||||
TAR_SHOT = "TAR_SHOT",
|
||||
}
|
||||
|
@ -984,10 +984,16 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
|
||||
: this.moveset;
|
||||
|
||||
// Overrides moveset based on arrays specified in overrides.ts
|
||||
const overrideArray: Array<Moves> = this.isPlayer() ? Overrides.MOVESET_OVERRIDE : Overrides.OPP_MOVESET_OVERRIDE;
|
||||
let overrideArray: Moves | Array<Moves> = this.isPlayer() ? Overrides.MOVESET_OVERRIDE : Overrides.OPP_MOVESET_OVERRIDE;
|
||||
if (!Array.isArray(overrideArray)) {
|
||||
overrideArray = [overrideArray];
|
||||
}
|
||||
if (overrideArray.length > 0) {
|
||||
if (!this.isPlayer()) {
|
||||
this.moveset = [];
|
||||
}
|
||||
overrideArray.forEach((move: Moves, index: number) => {
|
||||
const ppUsed = this.moveset[index]?.ppUsed || 0;
|
||||
const ppUsed = this.moveset[index]?.ppUsed ?? 0;
|
||||
this.moveset[index] = new PokemonMove(move, Math.min(ppUsed, allMoves[move].pp));
|
||||
});
|
||||
}
|
||||
|
@ -3,5 +3,6 @@
|
||||
"power": "Stärke",
|
||||
"accuracy": "Genauigkeit",
|
||||
"abilityFlyInText": "{{passive}}{{abilityName}} von {{pokemonName}} wirkt!",
|
||||
"passive": "Passive Fähigkeit "
|
||||
"passive": "Passive Fähigkeit ",
|
||||
"teraHover": "Tera-Typ {{type}}"
|
||||
}
|
@ -66,5 +66,6 @@
|
||||
"revivalBlessing": "{{pokemonName}} ist wieder fit und kampfbereit!",
|
||||
"swapArenaTags": "{{pokemonName}} hat die Effekte, die auf den beiden Seiten des Kampffeldes wirken, miteinander getauscht!",
|
||||
"exposedMove": "{{pokemonName}} erkennt {{targetPokemonName}}!",
|
||||
"safeguard": "{{targetName}} wird durch Bodyguard geschützt!"
|
||||
"safeguard": "{{targetName}} wird durch Bodyguard geschützt!",
|
||||
"afterYou": "{{targetName}} lässt sich auf Galanterie ein!"
|
||||
}
|
||||
|
@ -44,7 +44,10 @@
|
||||
"moveNotImplemented": "{{moveName}} is not yet implemented and cannot be selected.",
|
||||
"moveNoPP": "There's no PP left for\nthis move!",
|
||||
"moveDisabled": "{{moveName}} is disabled!",
|
||||
"canOnlyUseMove": "{{pokemonName}} can only use {{moveName}}!",
|
||||
"moveCannotBeSelected": "{{moveName}} cannot be selected!",
|
||||
"disableInterruptedMove": "{{pokemonNameWithAffix}}'s {{moveName}}\nis disabled!",
|
||||
"throatChopInterruptedMove": "The effects of Throat Chop prevent\n{{pokemonName}} from using certain moves!",
|
||||
"noPokeballForce": "An unseen force\nprevents using Poké Balls.",
|
||||
"noPokeballTrainer": "You can't catch\nanother trainer's Pokémon!",
|
||||
"noPokeballMulti": "You can only throw a Poké Ball\nwhen there is one Pokémon remaining!",
|
||||
|
@ -3,5 +3,6 @@
|
||||
"power": "Power",
|
||||
"accuracy": "Accuracy",
|
||||
"abilityFlyInText": " {{pokemonName}}'s {{passive}}{{abilityName}}",
|
||||
"passive": "Passive "
|
||||
"passive": "Passive ",
|
||||
"teraHover": "{{type}} Terastallized"
|
||||
}
|
@ -7,6 +7,7 @@
|
||||
"switchedStat": "{{pokemonName}} switched {{stat}} with its target!",
|
||||
"sharedGuard": "{{pokemonName}} shared its guard with the target!",
|
||||
"sharedPower": "{{pokemonName}} shared its power with the target!",
|
||||
"shiftedStats": "{{pokemonName}} switched its {{statToSwitch}} and {{statToSwitchWith}}!",
|
||||
"goingAllOutForAttack": "{{pokemonName}} is going all out for this attack!",
|
||||
"regainedHealth": "{{pokemonName}} regained\nhealth!",
|
||||
"keptGoingAndCrashed": "{{pokemonName}} kept going\nand crashed!",
|
||||
@ -66,5 +67,6 @@
|
||||
"revivalBlessing": "{{pokemonName}} was revived!",
|
||||
"swapArenaTags": "{{pokemonName}} swapped the battle effects affecting each side of the field!",
|
||||
"exposedMove": "{{pokemonName}} identified\n{{targetPokemonName}}!",
|
||||
"safeguard": "{{targetName}} is protected by Safeguard!"
|
||||
}
|
||||
"safeguard": "{{targetName}} is protected by Safeguard!",
|
||||
"afterYou": "{{pokemonName}} took the kind offer!"
|
||||
}
|
||||
|
@ -12,6 +12,7 @@
|
||||
"blockItemTheft": "{{abilityName}} de {{pokemonNameWithAffix}}\nprevine o roubo de itens!",
|
||||
"typeImmunityHeal": "{{abilityName}} de {{pokemonNameWithAffix}}\nrestaurou um pouco de PS!",
|
||||
"nonSuperEffectiveImmunity": "{{pokemonNameWithAffix}} evitou dano\ncom {{abilityName}}!",
|
||||
"fullHpResistType": "{{pokemonNameWithAffix}} fez seu casco brilhar!\nEstá distorcendo o confronte de tipos!",
|
||||
"moveImmunity": "Isso não afeta {{pokemonNameWithAffix}}!",
|
||||
"reverseDrain": "{{pokemonNameWithAffix}} absorveu a gosma líquida!",
|
||||
"postDefendTypeChange": "{{abilityName}} de {{pokemonNameWithAffix}}\ntransformou-o no tipo {{typeName}}!",
|
||||
|
@ -44,6 +44,7 @@
|
||||
"moveNotImplemented": "{{moveName}} ainda não foi implementado e não pode ser usado.",
|
||||
"moveNoPP": "Não há mais PP\npara esse movimento!",
|
||||
"moveDisabled": "Não se pode usar {{moveName}} porque foi desabilitado!",
|
||||
"disableInterruptedMove": "{{moveName}} de {{pokemonNameWithAffix}}\nestá desabilitado!",
|
||||
"noPokeballForce": "Uma força misteriosa\nte impede de usar Poké Bolas.",
|
||||
"noPokeballTrainer": "Não se pode capturar\nPokémon dos outros!",
|
||||
"noPokeballMulti": "Não se pode lançar Poké Bolas\nquando há mais de um Pokémon!",
|
||||
@ -61,6 +62,7 @@
|
||||
"skipItemQuestion": "Tem certeza de que não quer escolher um item?",
|
||||
"itemStackFull": "O estoque de {{fullItemName}} está cheio.\nVocê receberá {{itemName}} no lugar.",
|
||||
"eggHatching": "Opa?",
|
||||
"eggSkipPrompt": "Pular para súmario de ovos?",
|
||||
"ivScannerUseQuestion": "Quer usar o Scanner de IVs em {{pokemonName}}?",
|
||||
"wildPokemonWithAffix": "{{pokemonName}} selvagem",
|
||||
"foePokemonWithAffix": "{{pokemonName}} adversário",
|
||||
@ -89,7 +91,7 @@
|
||||
"statSeverelyFell_other": "{{stats}} de {{pokemonNameWithAffix}} diminuíram severamente!",
|
||||
"statWontGoAnyLower_one": "{{stats}} de {{pokemonNameWithAffix}} não vai mais diminuir!",
|
||||
"statWontGoAnyLower_other": "{{stats}} de {{pokemonNameWithAffix}} não vão mais diminuir!",
|
||||
"transformedIntoType": "{{pokemonName}} transformed\ninto the {{type}} type!",
|
||||
"transformedIntoType": "{{pokemonName}} se transformou\nno tipo {{type}}!",
|
||||
"ppReduced": "O PP do movimento {{moveName}} de\n{{targetName}} foi reduzido em {{reduction}}!",
|
||||
"retryBattle": "Você gostaria de tentar novamente desde o início da batalha?",
|
||||
"unlockedSomething": "{{unlockedThing}}\nfoi desbloqueado.",
|
||||
|
@ -67,5 +67,7 @@
|
||||
"saltCuredLapse": "{{pokemonNameWithAffix}} foi ferido pelo {{moveName}}!",
|
||||
"cursedOnAdd": "{{pokemonNameWithAffix}} cortou seus PS pela metade e amaldiçoou {{pokemonName}}!",
|
||||
"cursedLapse": "{{pokemonNameWithAffix}} foi ferido pelo Curse!",
|
||||
"stockpilingOnAdd": "{{pokemonNameWithAffix}} estocou {{stockpiledCount}}!"
|
||||
"stockpilingOnAdd": "{{pokemonNameWithAffix}} estocou {{stockpiledCount}}!",
|
||||
"disabledOnAdd": "{{moveName}} de {{pokemonNameWithAffix}}\nfoi desabilitado!",
|
||||
"disabledLapse": "{{moveName}} de {{pokemonNameWithAffix}}\nnão está mais desabilitado."
|
||||
}
|
||||
|
@ -1,6 +1,7 @@
|
||||
{
|
||||
"title": "Desafios",
|
||||
"illegalEvolution": "{{pokemon}} não pode ser escolhido\nnesse desafio!",
|
||||
"noneSelected": "Nada Selecionado",
|
||||
"singleGeneration": {
|
||||
"name": "Geração Única",
|
||||
"desc": "Você só pode user Pokémon da {{gen}} geração.",
|
||||
@ -33,4 +34,4 @@
|
||||
"value.0": "Desligado",
|
||||
"value.1": "Ligado"
|
||||
}
|
||||
}
|
||||
}
|
@ -98,7 +98,7 @@ class DefaultOverrides {
|
||||
readonly PASSIVE_ABILITY_OVERRIDE: Abilities = Abilities.NONE;
|
||||
readonly STATUS_OVERRIDE: StatusEffect = StatusEffect.NONE;
|
||||
readonly GENDER_OVERRIDE: Gender | null = null;
|
||||
readonly MOVESET_OVERRIDE: Array<Moves> = [];
|
||||
readonly MOVESET_OVERRIDE: Moves | Array<Moves> = [];
|
||||
readonly SHINY_OVERRIDE: boolean = false;
|
||||
readonly VARIANT_OVERRIDE: Variant = 0;
|
||||
|
||||
@ -111,7 +111,7 @@ class DefaultOverrides {
|
||||
readonly OPP_PASSIVE_ABILITY_OVERRIDE: Abilities = Abilities.NONE;
|
||||
readonly OPP_STATUS_OVERRIDE: StatusEffect = StatusEffect.NONE;
|
||||
readonly OPP_GENDER_OVERRIDE: Gender | null = null;
|
||||
readonly OPP_MOVESET_OVERRIDE: Array<Moves> = [];
|
||||
readonly OPP_MOVESET_OVERRIDE: Moves | Array<Moves> = [];
|
||||
readonly OPP_SHINY_OVERRIDE: boolean = false;
|
||||
readonly OPP_VARIANT_OVERRIDE: Variant = 0;
|
||||
readonly OPP_IVS_OVERRIDE: number | number[] = [];
|
||||
|
@ -65,6 +65,8 @@ export class FaintPhase extends PokemonPhase {
|
||||
if (pokemon.turnData?.attacksReceived?.length) {
|
||||
const lastAttack = pokemon.turnData.attacksReceived[0];
|
||||
applyPostFaintAbAttrs(PostFaintAbAttr, pokemon, this.scene.getPokemonById(lastAttack.sourceId)!, new PokemonMove(lastAttack.move).getMove(), lastAttack.result); // TODO: is this bang correct?
|
||||
} else { //If killed by indirect damage, apply post-faint abilities without providing a last move
|
||||
applyPostFaintAbAttrs(PostFaintAbAttr, pokemon);
|
||||
}
|
||||
|
||||
const alivePlayField = this.scene.getField(true);
|
||||
|
@ -1,6 +1,6 @@
|
||||
import BattleScene from "#app/battle-scene";
|
||||
import { initMoveAnim, loadMoveAnimAssets } from "#app/data/battle-anims";
|
||||
import { allMoves } from "#app/data/move";
|
||||
import Move, { allMoves } from "#app/data/move";
|
||||
import { SpeciesFormChangeMoveLearnedTrigger } from "#app/data/pokemon-forms";
|
||||
import { Moves } from "#app/enums/moves";
|
||||
import { getPokemonNameWithAffix } from "#app/messages";
|
||||
@ -9,14 +9,15 @@ import { SummaryUiMode } from "#app/ui/summary-ui-handler";
|
||||
import { Mode } from "#app/ui/ui";
|
||||
import i18next from "i18next";
|
||||
import { PlayerPartyMemberPokemonPhase } from "./player-party-member-pokemon-phase";
|
||||
import Pokemon from "#app/field/pokemon";
|
||||
|
||||
export class LearnMovePhase extends PlayerPartyMemberPokemonPhase {
|
||||
private moveId: Moves;
|
||||
private messageMode: Mode;
|
||||
private fromTM: boolean;
|
||||
|
||||
constructor(scene: BattleScene, partyMemberIndex: integer, moveId: Moves, fromTM?: boolean) {
|
||||
super(scene, partyMemberIndex);
|
||||
|
||||
this.moveId = moveId;
|
||||
this.fromTM = fromTM ?? false;
|
||||
}
|
||||
@ -26,87 +27,128 @@ export class LearnMovePhase extends PlayerPartyMemberPokemonPhase {
|
||||
|
||||
const pokemon = this.getPokemon();
|
||||
const move = allMoves[this.moveId];
|
||||
const currentMoveset = pokemon.getMoveset();
|
||||
|
||||
const existingMoveIndex = pokemon.getMoveset().findIndex(m => m?.moveId === move.id);
|
||||
|
||||
if (existingMoveIndex > -1) {
|
||||
// The game first checks if the Pokemon already has the move and ends the phase if it does.
|
||||
const hasMoveAlready = currentMoveset.some(m => m?.moveId === move.id) && this.moveId !== Moves.SKETCH;
|
||||
if (hasMoveAlready) {
|
||||
return this.end();
|
||||
}
|
||||
|
||||
const emptyMoveIndex = pokemon.getMoveset().length < 4
|
||||
? pokemon.getMoveset().length
|
||||
: pokemon.getMoveset().findIndex(m => m === null);
|
||||
|
||||
const messageMode = this.scene.ui.getHandler() instanceof EvolutionSceneHandler
|
||||
? Mode.EVOLUTION_SCENE
|
||||
: Mode.MESSAGE;
|
||||
|
||||
if (emptyMoveIndex > -1) {
|
||||
pokemon.setMove(emptyMoveIndex, this.moveId);
|
||||
if (this.fromTM) {
|
||||
pokemon.usedTMs.push(this.moveId);
|
||||
}
|
||||
initMoveAnim(this.scene, this.moveId).then(() => {
|
||||
loadMoveAnimAssets(this.scene, [this.moveId], true)
|
||||
.then(() => {
|
||||
this.scene.ui.setMode(messageMode).then(() => {
|
||||
// Sound loaded into game as is
|
||||
this.scene.playSound("level_up_fanfare");
|
||||
this.scene.ui.showText(i18next.t("battle:learnMove", { pokemonName: getPokemonNameWithAffix(pokemon), moveName: move.name }), null, () => {
|
||||
this.scene.triggerPokemonFormChange(pokemon, SpeciesFormChangeMoveLearnedTrigger, true);
|
||||
this.end();
|
||||
}, messageMode === Mode.EVOLUTION_SCENE ? 1000 : null, true);
|
||||
});
|
||||
});
|
||||
});
|
||||
this.messageMode = this.scene.ui.getHandler() instanceof EvolutionSceneHandler ? Mode.EVOLUTION_SCENE : Mode.MESSAGE;
|
||||
this.scene.ui.setMode(this.messageMode);
|
||||
// If the Pokemon has less than 4 moves, the new move is added to the largest empty moveset index
|
||||
// If it has 4 moves, the phase then checks if the player wants to replace the move itself.
|
||||
if (currentMoveset.length < 4) {
|
||||
this.learnMove(currentMoveset.length, move, pokemon);
|
||||
} else {
|
||||
this.scene.ui.setMode(messageMode).then(() => {
|
||||
this.scene.ui.showText(i18next.t("battle:learnMovePrompt", { pokemonName: getPokemonNameWithAffix(pokemon), moveName: move.name }), null, () => {
|
||||
this.scene.ui.showText(i18next.t("battle:learnMoveLimitReached", { pokemonName: getPokemonNameWithAffix(pokemon) }), null, () => {
|
||||
this.scene.ui.showText(i18next.t("battle:learnMoveReplaceQuestion", { moveName: move.name }), null, () => {
|
||||
const noHandler = () => {
|
||||
this.scene.ui.setMode(messageMode).then(() => {
|
||||
this.scene.ui.showText(i18next.t("battle:learnMoveStopTeaching", { moveName: move.name }), null, () => {
|
||||
this.scene.ui.setModeWithoutClear(Mode.CONFIRM, () => {
|
||||
this.scene.ui.setMode(messageMode);
|
||||
this.scene.ui.showText(i18next.t("battle:learnMoveNotLearned", { pokemonName: getPokemonNameWithAffix(pokemon), moveName: move.name }), null, () => this.end(), null, true);
|
||||
}, () => {
|
||||
this.scene.ui.setMode(messageMode);
|
||||
this.scene.unshiftPhase(new LearnMovePhase(this.scene, this.partyMemberIndex, this.moveId));
|
||||
this.end();
|
||||
});
|
||||
});
|
||||
});
|
||||
};
|
||||
this.scene.ui.setModeWithoutClear(Mode.CONFIRM, () => {
|
||||
this.scene.ui.setMode(messageMode);
|
||||
this.scene.ui.showText(i18next.t("battle:learnMoveForgetQuestion"), null, () => {
|
||||
this.scene.ui.setModeWithoutClear(Mode.SUMMARY, this.getPokemon(), SummaryUiMode.LEARN_MOVE, move, (moveIndex: integer) => {
|
||||
if (moveIndex === 4) {
|
||||
noHandler();
|
||||
return;
|
||||
}
|
||||
this.scene.ui.setMode(messageMode).then(() => {
|
||||
this.scene.ui.showText(i18next.t("battle:countdownPoof"), null, () => {
|
||||
this.scene.ui.showText(i18next.t("battle:learnMoveForgetSuccess", { pokemonName: getPokemonNameWithAffix(pokemon), moveName: pokemon.moveset[moveIndex]!.getName() }), null, () => { // TODO: is the bang correct?
|
||||
this.scene.ui.showText(i18next.t("battle:learnMoveAnd"), null, () => {
|
||||
if (this.fromTM) {
|
||||
pokemon.usedTMs.push(this.moveId);
|
||||
}
|
||||
pokemon.setMove(moveIndex, Moves.NONE);
|
||||
this.scene.unshiftPhase(new LearnMovePhase(this.scene, this.partyMemberIndex, this.moveId));
|
||||
this.end();
|
||||
}, null, true);
|
||||
}, null, true);
|
||||
}, null, true);
|
||||
});
|
||||
});
|
||||
}, null, true);
|
||||
}, noHandler);
|
||||
});
|
||||
}, null, true);
|
||||
}, null, true);
|
||||
});
|
||||
this.replaceMoveCheck(move, pokemon);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* This displays a chain of messages (listed below) and asks if the user wishes to forget a move.
|
||||
*
|
||||
* > [Pokemon] wants to learn the move [MoveName]
|
||||
* > However, [Pokemon] already knows four moves.
|
||||
* > Should a move be forgotten and replaced with [MoveName]? --> `Mode.CONFIRM` -> Yes: Go to `this.forgetMoveProcess()`, No: Go to `this.rejectMoveAndEnd()`
|
||||
* @param move The Move to be learned
|
||||
* @param Pokemon The Pokemon learning the move
|
||||
*/
|
||||
async replaceMoveCheck(move: Move, pokemon: Pokemon) {
|
||||
const learnMovePrompt = i18next.t("battle:learnMovePrompt", { pokemonName: getPokemonNameWithAffix(pokemon), moveName: move.name });
|
||||
const moveLimitReached = i18next.t("battle:learnMoveLimitReached", { pokemonName: getPokemonNameWithAffix(pokemon) });
|
||||
const shouldReplaceQ = i18next.t("battle:learnMoveReplaceQuestion", { moveName: move.name });
|
||||
const preQText = [learnMovePrompt, moveLimitReached].join("$");
|
||||
await this.scene.ui.showTextPromise(preQText);
|
||||
await this.scene.ui.showTextPromise(shouldReplaceQ, undefined, false);
|
||||
await this.scene.ui.setModeWithoutClear(Mode.CONFIRM,
|
||||
() => this.forgetMoveProcess(move, pokemon), // Yes
|
||||
() => { // No
|
||||
this.scene.ui.setMode(this.messageMode);
|
||||
this.rejectMoveAndEnd(move, pokemon);
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* This facilitates the process in which an old move is chosen to be forgotten.
|
||||
*
|
||||
* > Which move should be forgotten?
|
||||
*
|
||||
* The game then goes `Mode.SUMMARY` to select a move to be forgotten.
|
||||
* If a player does not select a move or chooses the new move (`moveIndex === 4`), the game goes to `this.rejectMoveAndEnd()`.
|
||||
* If an old move is selected, the function then passes the `moveIndex` to `this.learnMove()`
|
||||
* @param move The Move to be learned
|
||||
* @param Pokemon The Pokemon learning the move
|
||||
*/
|
||||
async forgetMoveProcess(move: Move, pokemon: Pokemon) {
|
||||
this.scene.ui.setMode(this.messageMode);
|
||||
await this.scene.ui.showTextPromise(i18next.t("battle:learnMoveForgetQuestion"), undefined, true);
|
||||
await this.scene.ui.setModeWithoutClear(Mode.SUMMARY, pokemon, SummaryUiMode.LEARN_MOVE, move, (moveIndex: integer) => {
|
||||
if (moveIndex === 4) {
|
||||
this.scene.ui.setMode(this.messageMode).then(() => this.rejectMoveAndEnd(move, pokemon));
|
||||
return;
|
||||
}
|
||||
const forgetSuccessText = i18next.t("battle:learnMoveForgetSuccess", { pokemonName: getPokemonNameWithAffix(pokemon), moveName: pokemon.moveset[moveIndex]!.getName() });
|
||||
const fullText = [i18next.t("battle:countdownPoof"), forgetSuccessText, i18next.t("battle:learnMoveAnd")].join("$");
|
||||
this.scene.ui.setMode(this.messageMode).then(() => this.learnMove(moveIndex, move, pokemon, fullText));
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* This asks the player if they wish to end the current move learning process.
|
||||
*
|
||||
* > Stop trying to teach [MoveName]? --> `Mode.CONFIRM` --> Yes: > [Pokemon] did not learn the move [MoveName], No: `this.replaceMoveCheck()`
|
||||
*
|
||||
* If the player wishes to not teach the Pokemon the move, it displays a message and ends the phase.
|
||||
* If the player reconsiders, it repeats the process for a Pokemon with a full moveset once again.
|
||||
* @param move The Move to be learned
|
||||
* @param Pokemon The Pokemon learning the move
|
||||
*/
|
||||
async rejectMoveAndEnd(move: Move, pokemon: Pokemon) {
|
||||
await this.scene.ui.showTextPromise(i18next.t("battle:learnMoveStopTeaching", { moveName: move.name }), undefined, false);
|
||||
this.scene.ui.setModeWithoutClear(Mode.CONFIRM,
|
||||
() => {
|
||||
this.scene.ui.setMode(this.messageMode);
|
||||
this.scene.ui.showTextPromise(i18next.t("battle:learnMoveNotLearned", { pokemonName: getPokemonNameWithAffix(pokemon), moveName: move.name }), undefined, true).then(() => this.end());
|
||||
},
|
||||
() => {
|
||||
this.scene.ui.setMode(this.messageMode);
|
||||
this.replaceMoveCheck(move, pokemon);
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* This teaches the Pokemon the new move and ends the phase.
|
||||
* When a Pokemon forgets a move and learns a new one, its 'Learn Move' message is significantly longer.
|
||||
*
|
||||
* Pokemon with a `moveset.length < 4`
|
||||
* > [Pokemon] learned [MoveName]
|
||||
*
|
||||
* Pokemon with a `moveset.length > 4`
|
||||
* > 1... 2... and 3... and Poof!
|
||||
* > [Pokemon] forgot how to use [MoveName]
|
||||
* > And...
|
||||
* > [Pokemon] learned [MoveName]!
|
||||
* @param move The Move to be learned
|
||||
* @param Pokemon The Pokemon learning the move
|
||||
*/
|
||||
async learnMove(index: number, move: Move, pokemon: Pokemon, textMessage?: string) {
|
||||
if (this.fromTM) {
|
||||
pokemon.usedTMs.push(this.moveId);
|
||||
}
|
||||
pokemon.setMove(index, this.moveId);
|
||||
initMoveAnim(this.scene, this.moveId).then(() => {
|
||||
loadMoveAnimAssets(this.scene, [this.moveId], true);
|
||||
this.scene.playSound("level_up_fanfare"); // Sound loaded into game as is
|
||||
});
|
||||
this.scene.ui.setMode(this.messageMode);
|
||||
const learnMoveText = i18next.t("battle:learnMove", { pokemonName: getPokemonNameWithAffix(pokemon), moveName: move.name });
|
||||
textMessage = textMessage ? textMessage+"$"+learnMoveText : learnMoveText;
|
||||
await this.scene.ui.showTextPromise(textMessage, this.messageMode === Mode.EVOLUTION_SCENE ? 1000 : undefined, true);
|
||||
this.scene.triggerPokemonFormChange(pokemon, SpeciesFormChangeMoveLearnedTrigger, true);
|
||||
this.end();
|
||||
}
|
||||
}
|
||||
|
@ -3,7 +3,6 @@ import { Abilities } from "#enums/abilities";
|
||||
import { Moves } from "#enums/moves";
|
||||
import { Species } from "#enums/species";
|
||||
import GameManager from "#test/utils/gameManager";
|
||||
import { SPLASH_ONLY } from "#test/utils/testUtils";
|
||||
import Phaser from "phaser";
|
||||
import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest";
|
||||
|
||||
@ -27,7 +26,7 @@ describe("Abilities - Aura Break", () => {
|
||||
game = new GameManager(phaserGame);
|
||||
game.override.battleType("single");
|
||||
game.override.moveset([Moves.MOONBLAST, Moves.DARK_PULSE, Moves.MOONBLAST, Moves.DARK_PULSE]);
|
||||
game.override.enemyMoveset(SPLASH_ONLY);
|
||||
game.override.enemyMoveset(Moves.SPLASH);
|
||||
game.override.enemyAbility(Abilities.AURA_BREAK);
|
||||
game.override.enemySpecies(Species.SHUCKLE);
|
||||
});
|
||||
|
@ -5,7 +5,6 @@ import { TurnEndPhase } from "#app/phases/turn-end-phase";
|
||||
import { Moves } from "#enums/moves";
|
||||
import { Species } from "#enums/species";
|
||||
import GameManager from "#test/utils/gameManager";
|
||||
import { SPLASH_ONLY } from "#test/utils/testUtils";
|
||||
import Phaser from "phaser";
|
||||
import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest";
|
||||
|
||||
@ -31,7 +30,7 @@ describe("Abilities - Battery", () => {
|
||||
game.override.enemySpecies(Species.SHUCKLE);
|
||||
game.override.enemyAbility(Abilities.BALL_FETCH);
|
||||
game.override.moveset([Moves.TACKLE, Moves.BREAKING_SWIPE, Moves.SPLASH, Moves.DAZZLING_GLEAM]);
|
||||
game.override.enemyMoveset(SPLASH_ONLY);
|
||||
game.override.enemyMoveset(Moves.SPLASH);
|
||||
});
|
||||
|
||||
it("raises the power of allies' special moves by 30%", async () => {
|
||||
|
@ -4,7 +4,6 @@ import { Moves } from "#enums/moves";
|
||||
import { Species } from "#enums/species";
|
||||
import { Stat } from "#enums/stat";
|
||||
import GameManager from "#test/utils/gameManager";
|
||||
import { SPLASH_ONLY } from "#test/utils/testUtils";
|
||||
import Phaser from "phaser";
|
||||
import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest";
|
||||
|
||||
@ -31,7 +30,7 @@ describe("Abilities - Beast Boost", () => {
|
||||
.ability(Abilities.BEAST_BOOST)
|
||||
.startingLevel(2000)
|
||||
.moveset([ Moves.FLAMETHROWER ])
|
||||
.enemyMoveset(SPLASH_ONLY);
|
||||
.enemyMoveset(Moves.SPLASH);
|
||||
});
|
||||
|
||||
it("should prefer highest stat to boost its corresponding stat stage by 1 when winning a battle", async() => {
|
||||
@ -51,7 +50,7 @@ describe("Abilities - Beast Boost", () => {
|
||||
}, 20000);
|
||||
|
||||
it("should use in-battle overriden stats when determining the stat stage to raise by 1", async() => {
|
||||
game.override.enemyMoveset(new Array(4).fill(Moves.GUARD_SPLIT));
|
||||
game.override.enemyMoveset([Moves.GUARD_SPLIT]);
|
||||
|
||||
await game.classicMode.startBattle([Species.SLOWBRO]);
|
||||
|
||||
|
@ -1,10 +1,10 @@
|
||||
import { Stat } from "#enums/stat";
|
||||
import GameManager from "#test/utils/gameManager";
|
||||
import { Moves } from "#app/enums/moves";
|
||||
import { Abilities } from "#enums/abilities";
|
||||
import { Species } from "#enums/species";
|
||||
import { Stat } from "#enums/stat";
|
||||
import GameManager from "#test/utils/gameManager";
|
||||
import Phaser from "phaser";
|
||||
import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest";
|
||||
import { SPLASH_ONLY } from "../utils/testUtils";
|
||||
|
||||
describe("Abilities - Contrary", () => {
|
||||
let phaserGame: Phaser.Game;
|
||||
@ -27,7 +27,7 @@ describe("Abilities - Contrary", () => {
|
||||
.enemySpecies(Species.BULBASAUR)
|
||||
.enemyAbility(Abilities.CONTRARY)
|
||||
.ability(Abilities.INTIMIDATE)
|
||||
.enemyMoveset(SPLASH_ONLY);
|
||||
.enemyMoveset(Moves.SPLASH);
|
||||
});
|
||||
|
||||
it("should invert stat changes when applied", async() => {
|
||||
|
@ -5,7 +5,6 @@ import { Species } from "#app/enums/species";
|
||||
import { CommandPhase } from "#app/phases/command-phase";
|
||||
import { MessagePhase } from "#app/phases/message-phase";
|
||||
import GameManager from "#test/utils/gameManager";
|
||||
import { SPLASH_ONLY } from "#test/utils/testUtils";
|
||||
import Phaser from "phaser";
|
||||
import { afterEach, beforeAll, beforeEach, describe, expect, test } from "vitest";
|
||||
|
||||
@ -30,7 +29,7 @@ describe("Abilities - COSTAR", () => {
|
||||
game.override.battleType("double");
|
||||
game.override.ability(Abilities.COSTAR);
|
||||
game.override.moveset([Moves.SPLASH, Moves.NASTY_PLOT]);
|
||||
game.override.enemyMoveset(SPLASH_ONLY);
|
||||
game.override.enemyMoveset(Moves.SPLASH);
|
||||
});
|
||||
|
||||
|
||||
|
@ -30,7 +30,7 @@ describe("Abilities - Dancer", () => {
|
||||
.moveset([Moves.SWORDS_DANCE, Moves.SPLASH])
|
||||
.enemySpecies(Species.MAGIKARP)
|
||||
.enemyAbility(Abilities.DANCER)
|
||||
.enemyMoveset(Array(4).fill(Moves.VICTORY_DANCE));
|
||||
.enemyMoveset([Moves.VICTORY_DANCE]);
|
||||
});
|
||||
|
||||
// Reference Link: https://bulbapedia.bulbagarden.net/wiki/Dancer_(Ability)
|
||||
|
@ -6,7 +6,6 @@ import { StatusEffect } from "#app/data/status-effect";
|
||||
import { Stat } from "#enums/stat";
|
||||
import GameManager from "#test/utils/gameManager";
|
||||
import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest";
|
||||
import { SPLASH_ONLY } from "../utils/testUtils";
|
||||
|
||||
const TIMEOUT = 20 * 1000;
|
||||
|
||||
@ -31,7 +30,7 @@ describe("Abilities - Disguise", () => {
|
||||
game.override
|
||||
.battleType("single")
|
||||
.enemySpecies(Species.MIMIKYU)
|
||||
.enemyMoveset(SPLASH_ONLY)
|
||||
.enemyMoveset(Moves.SPLASH)
|
||||
.starterSpecies(Species.REGIELEKI)
|
||||
.moveset([Moves.SHADOW_SNEAK, Moves.VACUUM_WAVE, Moves.TOXIC_THREAD, Moves.SPLASH]);
|
||||
}, TIMEOUT);
|
||||
@ -108,7 +107,7 @@ describe("Abilities - Disguise", () => {
|
||||
}, TIMEOUT);
|
||||
|
||||
it("persists form change when switched out", async () => {
|
||||
game.override.enemyMoveset(Array(4).fill(Moves.SHADOW_SNEAK));
|
||||
game.override.enemyMoveset([Moves.SHADOW_SNEAK]);
|
||||
game.override.starterSpecies(0);
|
||||
|
||||
await game.classicMode.startBattle([ Species.MIMIKYU, Species.FURRET ]);
|
||||
@ -194,7 +193,7 @@ describe("Abilities - Disguise", () => {
|
||||
}, TIMEOUT);
|
||||
|
||||
it("doesn't faint twice when fainting due to Disguise break damage, nor prevent faint from Disguise break damage if using Endure", async () => {
|
||||
game.override.enemyMoveset(Array(4).fill(Moves.ENDURE));
|
||||
game.override.enemyMoveset([Moves.ENDURE]);
|
||||
await game.classicMode.startBattle();
|
||||
|
||||
const mimikyu = game.scene.getEnemyPokemon()!;
|
||||
|
@ -1,9 +1,7 @@
|
||||
import { Species } from "#app/enums/species";
|
||||
import { TurnEndPhase } from "#app/phases/turn-end-phase";
|
||||
import { Abilities } from "#enums/abilities";
|
||||
import { Moves } from "#enums/moves";
|
||||
import GameManager from "#test/utils/gameManager";
|
||||
import { SPLASH_ONLY } from "#test/utils/testUtils";
|
||||
import Phaser from "phaser";
|
||||
import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest";
|
||||
|
||||
@ -23,63 +21,56 @@ describe("Abilities - Dry Skin", () => {
|
||||
|
||||
beforeEach(() => {
|
||||
game = new GameManager(phaserGame);
|
||||
game.override.battleType("single");
|
||||
game.override.disableCrits();
|
||||
game.override.enemyAbility(Abilities.DRY_SKIN);
|
||||
game.override.enemyMoveset(SPLASH_ONLY);
|
||||
game.override.enemySpecies(Species.CHARMANDER);
|
||||
game.override.ability(Abilities.UNNERVE);
|
||||
game.override.starterSpecies(Species.CHANDELURE);
|
||||
game.override
|
||||
.battleType("single")
|
||||
.disableCrits()
|
||||
.enemyAbility(Abilities.DRY_SKIN)
|
||||
.enemyMoveset(Moves.SPLASH)
|
||||
.enemySpecies(Species.CHARMANDER)
|
||||
.ability(Abilities.BALL_FETCH)
|
||||
.moveset([Moves.SUNNY_DAY, Moves.RAIN_DANCE, Moves.SPLASH, Moves.WATER_GUN])
|
||||
.starterSpecies(Species.CHANDELURE);
|
||||
});
|
||||
|
||||
it("during sunlight, lose 1/8 of maximum health at the end of each turn", async () => {
|
||||
game.override.moveset([Moves.SUNNY_DAY, Moves.SPLASH]);
|
||||
|
||||
await game.startBattle();
|
||||
await game.classicMode.startBattle();
|
||||
|
||||
const enemy = game.scene.getEnemyPokemon()!;
|
||||
expect(enemy).not.toBe(undefined);
|
||||
|
||||
// first turn
|
||||
let previousEnemyHp = enemy.hp;
|
||||
game.move.select(Moves.SUNNY_DAY);
|
||||
await game.phaseInterceptor.to(TurnEndPhase);
|
||||
expect(enemy.hp).toBeLessThan(previousEnemyHp);
|
||||
await game.phaseInterceptor.to("TurnEndPhase");
|
||||
expect(enemy.hp).toBeLessThan(enemy.getMaxHp());
|
||||
|
||||
// second turn
|
||||
previousEnemyHp = enemy.hp;
|
||||
enemy.hp = enemy.getMaxHp();
|
||||
game.move.select(Moves.SPLASH);
|
||||
await game.phaseInterceptor.to(TurnEndPhase);
|
||||
expect(enemy.hp).toBeLessThan(previousEnemyHp);
|
||||
await game.phaseInterceptor.to("TurnEndPhase");
|
||||
expect(enemy.hp).toBeLessThan(enemy.getMaxHp());
|
||||
});
|
||||
|
||||
it("during rain, gain 1/8 of maximum health at the end of each turn", async () => {
|
||||
game.override.moveset([Moves.RAIN_DANCE, Moves.SPLASH]);
|
||||
|
||||
await game.startBattle();
|
||||
await game.classicMode.startBattle();
|
||||
|
||||
const enemy = game.scene.getEnemyPokemon()!;
|
||||
expect(enemy).not.toBe(undefined);
|
||||
|
||||
enemy.hp = 1;
|
||||
|
||||
// first turn
|
||||
let previousEnemyHp = enemy.hp;
|
||||
game.move.select(Moves.RAIN_DANCE);
|
||||
await game.phaseInterceptor.to(TurnEndPhase);
|
||||
expect(enemy.hp).toBeGreaterThan(previousEnemyHp);
|
||||
await game.phaseInterceptor.to("TurnEndPhase");
|
||||
expect(enemy.hp).toBeGreaterThan(1);
|
||||
|
||||
// second turn
|
||||
previousEnemyHp = enemy.hp;
|
||||
enemy.hp = 1;
|
||||
game.move.select(Moves.SPLASH);
|
||||
await game.phaseInterceptor.to(TurnEndPhase);
|
||||
expect(enemy.hp).toBeGreaterThan(previousEnemyHp);
|
||||
await game.phaseInterceptor.to("TurnEndPhase");
|
||||
expect(enemy.hp).toBeGreaterThan(1);
|
||||
});
|
||||
|
||||
it("opposing fire attacks do 25% more damage", async () => {
|
||||
game.override.moveset([Moves.FLAMETHROWER]);
|
||||
|
||||
await game.startBattle();
|
||||
await game.classicMode.startBattle();
|
||||
|
||||
const enemy = game.scene.getEnemyPokemon()!;
|
||||
const initialHP = 1000;
|
||||
@ -87,72 +78,65 @@ describe("Abilities - Dry Skin", () => {
|
||||
|
||||
// first turn
|
||||
game.move.select(Moves.FLAMETHROWER);
|
||||
await game.phaseInterceptor.to(TurnEndPhase);
|
||||
await game.phaseInterceptor.to("TurnEndPhase");
|
||||
const fireDamageTakenWithDrySkin = initialHP - enemy.hp;
|
||||
|
||||
expect(enemy.hp > 0);
|
||||
enemy.hp = initialHP;
|
||||
game.override.enemyAbility(Abilities.NONE);
|
||||
|
||||
// second turn
|
||||
game.move.select(Moves.FLAMETHROWER);
|
||||
await game.phaseInterceptor.to(TurnEndPhase);
|
||||
await game.phaseInterceptor.to("TurnEndPhase");
|
||||
const fireDamageTakenWithoutDrySkin = initialHP - enemy.hp;
|
||||
|
||||
expect(fireDamageTakenWithDrySkin).toBeGreaterThan(fireDamageTakenWithoutDrySkin);
|
||||
});
|
||||
|
||||
it("opposing water attacks heal 1/4 of maximum health and deal no damage", async () => {
|
||||
game.override.moveset([Moves.WATER_GUN]);
|
||||
|
||||
await game.startBattle();
|
||||
await game.classicMode.startBattle();
|
||||
|
||||
const enemy = game.scene.getEnemyPokemon()!;
|
||||
expect(enemy).not.toBe(undefined);
|
||||
|
||||
enemy.hp = 1;
|
||||
|
||||
game.move.select(Moves.WATER_GUN);
|
||||
await game.phaseInterceptor.to(TurnEndPhase);
|
||||
await game.phaseInterceptor.to("TurnEndPhase");
|
||||
expect(enemy.hp).toBeGreaterThan(1);
|
||||
});
|
||||
|
||||
it("opposing water attacks do not heal if they were protected from", async () => {
|
||||
game.override.moveset([Moves.WATER_GUN]);
|
||||
game.override.enemyMoveset([Moves.PROTECT]);
|
||||
|
||||
await game.startBattle();
|
||||
await game.classicMode.startBattle();
|
||||
|
||||
const enemy = game.scene.getEnemyPokemon()!;
|
||||
expect(enemy).not.toBe(undefined);
|
||||
|
||||
enemy.hp = 1;
|
||||
game.override.enemyMoveset([Moves.PROTECT, Moves.PROTECT, Moves.PROTECT, Moves.PROTECT]);
|
||||
|
||||
game.move.select(Moves.WATER_GUN);
|
||||
await game.phaseInterceptor.to(TurnEndPhase);
|
||||
await game.phaseInterceptor.to("TurnEndPhase");
|
||||
expect(enemy.hp).toBe(1);
|
||||
});
|
||||
|
||||
it("multi-strike water attacks only heal once", async () => {
|
||||
game.override.moveset([Moves.WATER_GUN, Moves.WATER_SHURIKEN]);
|
||||
|
||||
await game.startBattle();
|
||||
await game.classicMode.startBattle();
|
||||
|
||||
const enemy = game.scene.getEnemyPokemon()!;
|
||||
expect(enemy).not.toBe(undefined);
|
||||
|
||||
enemy.hp = 1;
|
||||
|
||||
// first turn
|
||||
game.move.select(Moves.WATER_SHURIKEN);
|
||||
await game.phaseInterceptor.to(TurnEndPhase);
|
||||
await game.phaseInterceptor.to("TurnEndPhase");
|
||||
const healthGainedFromWaterShuriken = enemy.hp - 1;
|
||||
|
||||
enemy.hp = 1;
|
||||
|
||||
// second turn
|
||||
game.move.select(Moves.WATER_GUN);
|
||||
await game.phaseInterceptor.to(TurnEndPhase);
|
||||
await game.phaseInterceptor.to("TurnEndPhase");
|
||||
const healthGainedFromWaterGun = enemy.hp - 1;
|
||||
|
||||
expect(healthGainedFromWaterShuriken).toBe(healthGainedFromWaterGun);
|
||||
|
@ -7,7 +7,6 @@ import { TurnEndPhase } from "#app/phases/turn-end-phase";
|
||||
import { Abilities } from "#enums/abilities";
|
||||
import { Moves } from "#enums/moves";
|
||||
import GameManager from "#test/utils/gameManager";
|
||||
import { SPLASH_ONLY } from "#test/utils/testUtils";
|
||||
import Phaser from "phaser";
|
||||
import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest";
|
||||
|
||||
@ -38,7 +37,7 @@ describe("Abilities - Flash Fire", () => {
|
||||
|
||||
|
||||
it("immune to Fire-type moves", async () => {
|
||||
game.override.enemyMoveset(Array(4).fill(Moves.EMBER)).moveset(SPLASH_ONLY);
|
||||
game.override.enemyMoveset([Moves.EMBER]).moveset(Moves.SPLASH);
|
||||
await game.startBattle([Species.BLISSEY]);
|
||||
|
||||
const blissey = game.scene.getPlayerPokemon()!;
|
||||
@ -49,7 +48,7 @@ describe("Abilities - Flash Fire", () => {
|
||||
}, 20000);
|
||||
|
||||
it("not activate if the Pokémon is protected from the Fire-type move", async () => {
|
||||
game.override.enemyMoveset(Array(4).fill(Moves.EMBER)).moveset([Moves.PROTECT]);
|
||||
game.override.enemyMoveset([Moves.EMBER]).moveset([Moves.PROTECT]);
|
||||
await game.startBattle([Species.BLISSEY]);
|
||||
|
||||
const blissey = game.scene.getPlayerPokemon()!;
|
||||
@ -60,7 +59,7 @@ describe("Abilities - Flash Fire", () => {
|
||||
}, 20000);
|
||||
|
||||
it("activated by Will-O-Wisp", async () => {
|
||||
game.override.enemyMoveset(Array(4).fill(Moves.WILL_O_WISP)).moveset(SPLASH_ONLY);
|
||||
game.override.enemyMoveset([Moves.WILL_O_WISP]).moveset(Moves.SPLASH);
|
||||
await game.startBattle([Species.BLISSEY]);
|
||||
|
||||
const blissey = game.scene.getPlayerPokemon()!;
|
||||
@ -75,7 +74,7 @@ describe("Abilities - Flash Fire", () => {
|
||||
}, 20000);
|
||||
|
||||
it("activated after being frozen", async () => {
|
||||
game.override.enemyMoveset(Array(4).fill(Moves.EMBER)).moveset(SPLASH_ONLY);
|
||||
game.override.enemyMoveset([Moves.EMBER]).moveset(Moves.SPLASH);
|
||||
game.override.statusEffect(StatusEffect.FREEZE);
|
||||
await game.startBattle([Species.BLISSEY]);
|
||||
|
||||
@ -88,7 +87,7 @@ describe("Abilities - Flash Fire", () => {
|
||||
}, 20000);
|
||||
|
||||
it("not passing with baton pass", async () => {
|
||||
game.override.enemyMoveset(Array(4).fill(Moves.EMBER)).moveset([Moves.BATON_PASS]);
|
||||
game.override.enemyMoveset([Moves.EMBER]).moveset([Moves.BATON_PASS]);
|
||||
await game.startBattle([Species.BLISSEY, Species.CHANSEY]);
|
||||
|
||||
// ensure use baton pass after enemy moved
|
||||
@ -104,7 +103,7 @@ describe("Abilities - Flash Fire", () => {
|
||||
}, 20000);
|
||||
|
||||
it("boosts Fire-type move when the ability is activated", async () => {
|
||||
game.override.enemyMoveset(Array(4).fill(Moves.FIRE_PLEDGE)).moveset([Moves.EMBER, Moves.SPLASH]);
|
||||
game.override.enemyMoveset([Moves.FIRE_PLEDGE]).moveset([Moves.EMBER, Moves.SPLASH]);
|
||||
game.override.enemyAbility(Abilities.FLASH_FIRE).ability(Abilities.NONE);
|
||||
await game.startBattle([Species.BLISSEY]);
|
||||
const blissey = game.scene.getPlayerPokemon()!;
|
||||
|
@ -5,7 +5,6 @@ import { WeatherType } from "#app/enums/weather-type";
|
||||
import { Moves } from "#enums/moves";
|
||||
import { Species } from "#enums/species";
|
||||
import GameManager from "#test/utils/gameManager";
|
||||
import { SPLASH_ONLY } from "#test/utils/testUtils";
|
||||
import Phaser from "phaser";
|
||||
import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest";
|
||||
|
||||
@ -44,7 +43,7 @@ describe("Abilities - Flower Gift", () => {
|
||||
game.override
|
||||
.moveset([Moves.SPLASH, Moves.RAIN_DANCE, Moves.SUNNY_DAY, Moves.SKILL_SWAP])
|
||||
.enemySpecies(Species.MAGIKARP)
|
||||
.enemyMoveset(SPLASH_ONLY)
|
||||
.enemyMoveset(Moves.SPLASH)
|
||||
.enemyAbility(Abilities.BALL_FETCH);
|
||||
});
|
||||
|
||||
@ -92,7 +91,7 @@ describe("Abilities - Flower Gift", () => {
|
||||
});
|
||||
|
||||
it("reverts to Overcast Form when the Pokémon loses Flower Gift, changes form under Harsh Sunlight/Sunny when it regains it", async () => {
|
||||
game.override.enemyMoveset(Array(4).fill(Moves.SKILL_SWAP)).weather(WeatherType.HARSH_SUN);
|
||||
game.override.enemyMoveset([Moves.SKILL_SWAP]).weather(WeatherType.HARSH_SUN);
|
||||
|
||||
await game.classicMode.startBattle([Species.CHERRIM]);
|
||||
|
||||
@ -111,7 +110,7 @@ describe("Abilities - Flower Gift", () => {
|
||||
});
|
||||
|
||||
it("reverts to Overcast Form when the Flower Gift is suppressed, changes form under Harsh Sunlight/Sunny when it regains it", async () => {
|
||||
game.override.enemyMoveset(Array(4).fill(Moves.GASTRO_ACID)).weather(WeatherType.HARSH_SUN);
|
||||
game.override.enemyMoveset([Moves.GASTRO_ACID]).weather(WeatherType.HARSH_SUN);
|
||||
|
||||
await game.classicMode.startBattle([Species.CHERRIM, Species.MAGIKARP]);
|
||||
|
||||
|
@ -10,7 +10,6 @@ import { TurnEndPhase } from "#app/phases/turn-end-phase";
|
||||
import { Moves } from "#enums/moves";
|
||||
import { Species } from "#enums/species";
|
||||
import GameManager from "#test/utils/gameManager";
|
||||
import { SPLASH_ONLY } from "#test/utils/testUtils";
|
||||
import Phaser from "phaser";
|
||||
import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest";
|
||||
|
||||
@ -67,7 +66,7 @@ describe("Abilities - Forecast", () => {
|
||||
game.override
|
||||
.moveset([Moves.SPLASH, Moves.RAIN_DANCE, Moves.SUNNY_DAY, Moves.TACKLE])
|
||||
.enemySpecies(Species.MAGIKARP)
|
||||
.enemyMoveset(SPLASH_ONLY)
|
||||
.enemyMoveset(Moves.SPLASH)
|
||||
.enemyAbility(Abilities.BALL_FETCH);
|
||||
});
|
||||
|
||||
@ -229,7 +228,7 @@ describe("Abilities - Forecast", () => {
|
||||
});
|
||||
|
||||
it("reverts to Normal Form when Forecast is suppressed, changes form to match the weather when it regains it", async () => {
|
||||
game.override.enemyMoveset(Array(4).fill(Moves.GASTRO_ACID)).weather(WeatherType.RAIN);
|
||||
game.override.enemyMoveset([Moves.GASTRO_ACID]).weather(WeatherType.RAIN);
|
||||
await game.startBattle([Species.CASTFORM, Species.PIKACHU]);
|
||||
const castform = game.scene.getPlayerPokemon()!;
|
||||
|
||||
@ -260,7 +259,7 @@ describe("Abilities - Forecast", () => {
|
||||
});
|
||||
|
||||
it("does not change Castform's form until after Stealth Rock deals damage", async () => {
|
||||
game.override.weather(WeatherType.RAIN).enemyMoveset(Array(4).fill(Moves.STEALTH_ROCK));
|
||||
game.override.weather(WeatherType.RAIN).enemyMoveset([Moves.STEALTH_ROCK]);
|
||||
await game.startBattle([Species.PIKACHU, Species.CASTFORM]);
|
||||
|
||||
// First turn - set up stealth rock
|
||||
|
@ -6,7 +6,6 @@ import { Moves } from "#app/enums/moves";
|
||||
import { Species } from "#app/enums/species";
|
||||
import { HitResult } from "#app/field/pokemon";
|
||||
import GameManager from "#test/utils/gameManager";
|
||||
import { SPLASH_ONLY } from "#test/utils/testUtils";
|
||||
import Phaser from "phaser";
|
||||
import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest";
|
||||
|
||||
@ -36,7 +35,7 @@ describe("Abilities - Galvanize", () => {
|
||||
.moveset([Moves.TACKLE, Moves.REVELATION_DANCE, Moves.FURY_SWIPES])
|
||||
.enemySpecies(Species.DUSCLOPS)
|
||||
.enemyAbility(Abilities.BALL_FETCH)
|
||||
.enemyMoveset(SPLASH_ONLY)
|
||||
.enemyMoveset(Moves.SPLASH)
|
||||
.enemyLevel(100);
|
||||
});
|
||||
|
||||
|
83
src/test/abilities/gorilla_tactics.test.ts
Normal file
83
src/test/abilities/gorilla_tactics.test.ts
Normal file
@ -0,0 +1,83 @@
|
||||
import { BattlerIndex } from "#app/battle";
|
||||
import { Moves } from "#app/enums/moves";
|
||||
import { Species } from "#app/enums/species";
|
||||
import { Stat } from "#app/enums/stat";
|
||||
import { Abilities } from "#enums/abilities";
|
||||
import GameManager from "#test/utils/gameManager";
|
||||
import Phaser from "phaser";
|
||||
import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest";
|
||||
|
||||
describe("Abilities - Gorilla Tactics", () => {
|
||||
let phaserGame: Phaser.Game;
|
||||
let game: GameManager;
|
||||
const TIMEOUT = 20 * 1000;
|
||||
|
||||
beforeAll(() => {
|
||||
phaserGame = new Phaser.Game({
|
||||
type: Phaser.HEADLESS,
|
||||
});
|
||||
});
|
||||
|
||||
afterEach(() => {
|
||||
game.phaseInterceptor.restoreOg();
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
game = new GameManager(phaserGame);
|
||||
game.override
|
||||
.battleType("single")
|
||||
.enemyAbility(Abilities.BALL_FETCH)
|
||||
.enemyMoveset([Moves.SPLASH, Moves.DISABLE])
|
||||
.enemySpecies(Species.MAGIKARP)
|
||||
.enemyLevel(30)
|
||||
.moveset([Moves.SPLASH, Moves.TACKLE, Moves.GROWL])
|
||||
.ability(Abilities.GORILLA_TACTICS);
|
||||
});
|
||||
|
||||
it("boosts the Pokémon's Attack by 50%, but limits the Pokémon to using only one move", async () => {
|
||||
await game.classicMode.startBattle([Species.GALAR_DARMANITAN]);
|
||||
|
||||
const darmanitan = game.scene.getPlayerPokemon()!;
|
||||
const initialAtkStat = darmanitan.getStat(Stat.ATK);
|
||||
|
||||
game.move.select(Moves.SPLASH);
|
||||
await game.forceEnemyMove(Moves.SPLASH);
|
||||
|
||||
await game.phaseInterceptor.to("TurnEndPhase");
|
||||
|
||||
expect(darmanitan.getStat(Stat.ATK, false)).toBeCloseTo(initialAtkStat * 1.5);
|
||||
// Other moves should be restricted
|
||||
expect(darmanitan.isMoveRestricted(Moves.TACKLE)).toBe(true);
|
||||
expect(darmanitan.isMoveRestricted(Moves.SPLASH)).toBe(false);
|
||||
}, TIMEOUT);
|
||||
|
||||
it("should struggle if the only usable move is disabled", async () => {
|
||||
await game.classicMode.startBattle([Species.GALAR_DARMANITAN]);
|
||||
|
||||
const darmanitan = game.scene.getPlayerPokemon()!;
|
||||
const enemy = game.scene.getEnemyPokemon()!;
|
||||
|
||||
// First turn, lock move to Growl
|
||||
game.move.select(Moves.GROWL);
|
||||
await game.forceEnemyMove(Moves.SPLASH);
|
||||
|
||||
// Second turn, Growl is interrupted by Disable
|
||||
await game.toNextTurn();
|
||||
|
||||
game.move.select(Moves.GROWL);
|
||||
await game.forceEnemyMove(Moves.DISABLE);
|
||||
await game.setTurnOrder([BattlerIndex.ENEMY, BattlerIndex.PLAYER]);
|
||||
|
||||
await game.phaseInterceptor.to("TurnEndPhase");
|
||||
expect(enemy.getStatStage(Stat.ATK)).toBe(-1); // Only the effect of the first Growl should be applied
|
||||
|
||||
// Third turn, Struggle is used
|
||||
await game.toNextTurn();
|
||||
|
||||
game.move.select(Moves.TACKLE);
|
||||
await game.setTurnOrder([BattlerIndex.PLAYER, BattlerIndex.ENEMY]);
|
||||
|
||||
await game.phaseInterceptor.to("MoveEndPhase");
|
||||
expect(darmanitan.hp).toBeLessThan(darmanitan.getMaxHp());
|
||||
}, TIMEOUT);
|
||||
});
|
@ -11,7 +11,6 @@ import { Moves } from "#enums/moves";
|
||||
import { Species } from "#enums/species";
|
||||
import Phaser from "phaser";
|
||||
import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest";
|
||||
import { SPLASH_ONLY } from "../utils/testUtils";
|
||||
import { Stat } from "#enums/stat";
|
||||
|
||||
describe("Abilities - Gulp Missile", () => {
|
||||
@ -49,7 +48,7 @@ describe("Abilities - Gulp Missile", () => {
|
||||
.moveset([Moves.SURF, Moves.DIVE, Moves.SPLASH])
|
||||
.enemySpecies(Species.SNORLAX)
|
||||
.enemyAbility(Abilities.BALL_FETCH)
|
||||
.enemyMoveset(SPLASH_ONLY)
|
||||
.enemyMoveset(Moves.SPLASH)
|
||||
.enemyLevel(5);
|
||||
});
|
||||
|
||||
@ -108,7 +107,7 @@ describe("Abilities - Gulp Missile", () => {
|
||||
});
|
||||
|
||||
it("deals 1/4 of the attacker's maximum HP when hit by a damaging attack", async () => {
|
||||
game.override.enemyMoveset(Array(4).fill(Moves.TACKLE));
|
||||
game.override.enemyMoveset([Moves.TACKLE]);
|
||||
await game.startBattle([Species.CRAMORANT]);
|
||||
|
||||
const enemy = game.scene.getEnemyPokemon()!;
|
||||
@ -121,7 +120,7 @@ describe("Abilities - Gulp Missile", () => {
|
||||
});
|
||||
|
||||
it("does not have any effect when hit by non-damaging attack", async () => {
|
||||
game.override.enemyMoveset(Array(4).fill(Moves.TAIL_WHIP));
|
||||
game.override.enemyMoveset([Moves.TAIL_WHIP]);
|
||||
await game.startBattle([Species.CRAMORANT]);
|
||||
|
||||
const cramorant = game.scene.getPlayerPokemon()!;
|
||||
@ -140,7 +139,7 @@ describe("Abilities - Gulp Missile", () => {
|
||||
});
|
||||
|
||||
it("lowers attacker's DEF stat stage by 1 when hit in Gulping form", async () => {
|
||||
game.override.enemyMoveset(Array(4).fill(Moves.TACKLE));
|
||||
game.override.enemyMoveset([Moves.TACKLE]);
|
||||
await game.startBattle([Species.CRAMORANT]);
|
||||
|
||||
const cramorant = game.scene.getPlayerPokemon()!;
|
||||
@ -164,7 +163,7 @@ describe("Abilities - Gulp Missile", () => {
|
||||
});
|
||||
|
||||
it("paralyzes the enemy when hit in Gorging form", async () => {
|
||||
game.override.enemyMoveset(Array(4).fill(Moves.TACKLE));
|
||||
game.override.enemyMoveset([Moves.TACKLE]);
|
||||
await game.startBattle([Species.CRAMORANT]);
|
||||
|
||||
const cramorant = game.scene.getPlayerPokemon()!;
|
||||
@ -188,7 +187,7 @@ describe("Abilities - Gulp Missile", () => {
|
||||
});
|
||||
|
||||
it("does not activate the ability when underwater", async () => {
|
||||
game.override.enemyMoveset(Array(4).fill(Moves.SURF));
|
||||
game.override.enemyMoveset([Moves.SURF]);
|
||||
await game.startBattle([Species.CRAMORANT]);
|
||||
|
||||
const cramorant = game.scene.getPlayerPokemon()!;
|
||||
@ -201,7 +200,7 @@ describe("Abilities - Gulp Missile", () => {
|
||||
});
|
||||
|
||||
it("prevents effect damage but inflicts secondary effect on attacker with Magic Guard", async () => {
|
||||
game.override.enemyMoveset(Array(4).fill(Moves.TACKLE)).enemyAbility(Abilities.MAGIC_GUARD);
|
||||
game.override.enemyMoveset([Moves.TACKLE]).enemyAbility(Abilities.MAGIC_GUARD);
|
||||
await game.startBattle([Species.CRAMORANT]);
|
||||
|
||||
const cramorant = game.scene.getPlayerPokemon()!;
|
||||
@ -225,7 +224,7 @@ describe("Abilities - Gulp Missile", () => {
|
||||
});
|
||||
|
||||
it("cannot be suppressed", async () => {
|
||||
game.override.enemyMoveset(Array(4).fill(Moves.GASTRO_ACID));
|
||||
game.override.enemyMoveset([Moves.GASTRO_ACID]);
|
||||
await game.startBattle([Species.CRAMORANT]);
|
||||
|
||||
const cramorant = game.scene.getPlayerPokemon()!;
|
||||
@ -245,7 +244,7 @@ describe("Abilities - Gulp Missile", () => {
|
||||
});
|
||||
|
||||
it("cannot be swapped with another ability", async () => {
|
||||
game.override.enemyMoveset(Array(4).fill(Moves.SKILL_SWAP));
|
||||
game.override.enemyMoveset([Moves.SKILL_SWAP]);
|
||||
await game.startBattle([Species.CRAMORANT]);
|
||||
|
||||
const cramorant = game.scene.getPlayerPokemon()!;
|
||||
|
@ -5,7 +5,6 @@ import { toDmgValue } from "#app/utils";
|
||||
import { Abilities } from "#enums/abilities";
|
||||
import { Moves } from "#enums/moves";
|
||||
import GameManager from "#test/utils/gameManager";
|
||||
import { SPLASH_ONLY } from "#test/utils/testUtils";
|
||||
import Phaser from "phaser";
|
||||
import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest";
|
||||
|
||||
@ -30,7 +29,7 @@ describe("Abilities - Heatproof", () => {
|
||||
.disableCrits()
|
||||
.enemySpecies(Species.CHARMANDER)
|
||||
.enemyAbility(Abilities.HEATPROOF)
|
||||
.enemyMoveset(SPLASH_ONLY)
|
||||
.enemyMoveset(Moves.SPLASH)
|
||||
.enemyLevel(100)
|
||||
.starterSpecies(Species.CHANDELURE)
|
||||
.ability(Abilities.BALL_FETCH)
|
||||
|
@ -4,7 +4,6 @@ import { Stat } from "#app/enums/stat";
|
||||
import { Moves } from "#enums/moves";
|
||||
import { Species } from "#enums/species";
|
||||
import GameManager from "#test/utils/gameManager";
|
||||
import { SPLASH_ONLY } from "#test/utils/testUtils";
|
||||
import Phaser from "phaser";
|
||||
import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest";
|
||||
|
||||
@ -29,7 +28,7 @@ describe("Abilities - Hustle", () => {
|
||||
.moveset([ Moves.TACKLE, Moves.GIGA_DRAIN, Moves.FISSURE ])
|
||||
.disableCrits()
|
||||
.battleType("single")
|
||||
.enemyMoveset(SPLASH_ONLY)
|
||||
.enemyMoveset(Moves.SPLASH)
|
||||
.enemySpecies(Species.SHUCKLE)
|
||||
.enemyAbility(Abilities.BALL_FETCH);
|
||||
});
|
||||
|
@ -3,7 +3,6 @@ import { Abilities } from "#enums/abilities";
|
||||
import { Moves } from "#enums/moves";
|
||||
import { Species } from "#enums/species";
|
||||
import GameManager from "#test/utils/gameManager";
|
||||
import { SPLASH_ONLY } from "#test/utils/testUtils";
|
||||
import Phaser from "phaser";
|
||||
import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest";
|
||||
|
||||
@ -29,7 +28,7 @@ describe("Abilities - Hyper Cutter", () => {
|
||||
.ability(Abilities.BALL_FETCH)
|
||||
.enemySpecies(Species.SHUCKLE)
|
||||
.enemyAbility(Abilities.HYPER_CUTTER)
|
||||
.enemyMoveset(SPLASH_ONLY);
|
||||
.enemyMoveset(Moves.SPLASH);
|
||||
});
|
||||
|
||||
// Reference Link: https://bulbapedia.bulbagarden.net/wiki/Hyper_Cutter_(Ability)
|
||||
|
@ -6,7 +6,6 @@ import { TurnEndPhase } from "#app/phases/turn-end-phase";
|
||||
import { Moves } from "#enums/moves";
|
||||
import { Stat, BATTLE_STATS, EFFECTIVE_STATS } from "#enums/stat";
|
||||
import { Abilities } from "#enums/abilities";
|
||||
import { SPLASH_ONLY } from "../utils/testUtils";
|
||||
|
||||
// TODO: Add more tests once Imposter is fully implemented
|
||||
describe("Abilities - Imposter", () => {
|
||||
@ -31,9 +30,9 @@ describe("Abilities - Imposter", () => {
|
||||
.enemyLevel(200)
|
||||
.enemyAbility(Abilities.BEAST_BOOST)
|
||||
.enemyPassiveAbility(Abilities.BALL_FETCH)
|
||||
.enemyMoveset(SPLASH_ONLY)
|
||||
.enemyMoveset(Moves.SPLASH)
|
||||
.ability(Abilities.IMPOSTER)
|
||||
.moveset(SPLASH_ONLY);
|
||||
.moveset(Moves.SPLASH);
|
||||
});
|
||||
|
||||
it("should copy species, ability, gender, all stats except HP, all stat stages, moveset, and types of target", async () => {
|
||||
@ -77,7 +76,7 @@ describe("Abilities - Imposter", () => {
|
||||
}, 20000);
|
||||
|
||||
it("should copy in-battle overridden stats", async () => {
|
||||
game.override.enemyMoveset(new Array(4).fill(Moves.POWER_SPLIT));
|
||||
game.override.enemyMoveset([Moves.POWER_SPLIT]);
|
||||
|
||||
await game.startBattle([
|
||||
Species.DITTO
|
||||
|
@ -7,7 +7,6 @@ import { getMovePosition } from "#test/utils/gameManagerUtils";
|
||||
import { Abilities } from "#enums/abilities";
|
||||
import { Moves } from "#enums/moves";
|
||||
import { Species } from "#enums/species";
|
||||
import { SPLASH_ONLY } from "#test/utils/testUtils";
|
||||
|
||||
describe("Abilities - Intimidate", () => {
|
||||
let phaserGame: Phaser.Game;
|
||||
@ -31,7 +30,7 @@ describe("Abilities - Intimidate", () => {
|
||||
.enemyPassiveAbility(Abilities.HYDRATION)
|
||||
.ability(Abilities.INTIMIDATE)
|
||||
.startingWave(3)
|
||||
.enemyMoveset(SPLASH_ONLY);
|
||||
.enemyMoveset(Moves.SPLASH);
|
||||
});
|
||||
|
||||
it("should lower ATK stat stage by 1 of enemy Pokemon on entry and player switch", async () => {
|
||||
@ -108,7 +107,7 @@ describe("Abilities - Intimidate", () => {
|
||||
|
||||
it("should lower ATK stat stage by 1 for every switch", async () => {
|
||||
game.override.moveset([Moves.SPLASH])
|
||||
.enemyMoveset(new Array(4).fill(Moves.VOLT_SWITCH))
|
||||
.enemyMoveset([Moves.VOLT_SWITCH])
|
||||
.startingWave(5);
|
||||
await game.classicMode.startBattle([ Species.MIGHTYENA, Species.POOCHYENA ]);
|
||||
|
||||
|
@ -9,7 +9,6 @@ import { Biome } from "#enums/biome";
|
||||
import { Moves } from "#enums/moves";
|
||||
import { Species } from "#enums/species";
|
||||
import GameManager from "#test/utils/gameManager";
|
||||
import { SPLASH_ONLY } from "#test/utils/testUtils";
|
||||
import Phaser from "phaser";
|
||||
import { afterEach, beforeAll, beforeEach, describe, expect, test, vi } from "vitest";
|
||||
|
||||
@ -183,7 +182,7 @@ describe("Abilities - Libero", () => {
|
||||
"ability applies correctly even if the pokemon's move misses",
|
||||
async () => {
|
||||
game.override.moveset([Moves.TACKLE]);
|
||||
game.override.enemyMoveset(SPLASH_ONLY);
|
||||
game.override.enemyMoveset(Moves.SPLASH);
|
||||
|
||||
await game.startBattle([Species.MAGIKARP]);
|
||||
|
||||
|
@ -8,7 +8,6 @@ import { BattlerTagType } from "#enums/battler-tag-type";
|
||||
import { Moves } from "#enums/moves";
|
||||
import { Species } from "#enums/species";
|
||||
import GameManager from "#test/utils/gameManager";
|
||||
import { SPLASH_ONLY } from "#test/utils/testUtils";
|
||||
import Phaser from "phaser";
|
||||
import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest";
|
||||
|
||||
@ -39,7 +38,7 @@ describe("Abilities - Magic Guard", () => {
|
||||
/** Enemy Pokemon overrides */
|
||||
game.override.enemySpecies(Species.SNORLAX);
|
||||
game.override.enemyAbility(Abilities.INSOMNIA);
|
||||
game.override.enemyMoveset(SPLASH_ONLY);
|
||||
game.override.enemyMoveset(Moves.SPLASH);
|
||||
game.override.enemyLevel(100);
|
||||
});
|
||||
|
||||
|
@ -3,7 +3,6 @@ import { Abilities } from "#enums/abilities";
|
||||
import { Moves } from "#enums/moves";
|
||||
import { Species } from "#enums/species";
|
||||
import GameManager from "#test/utils/gameManager";
|
||||
import { SPLASH_ONLY } from "#test/utils/testUtils";
|
||||
import Phaser from "phaser";
|
||||
import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest";
|
||||
|
||||
@ -29,8 +28,8 @@ describe("Abilities - Moody", () => {
|
||||
.enemySpecies(Species.RATTATA)
|
||||
.enemyAbility(Abilities.BALL_FETCH)
|
||||
.ability(Abilities.MOODY)
|
||||
.enemyMoveset(SPLASH_ONLY)
|
||||
.moveset(SPLASH_ONLY);
|
||||
.enemyMoveset(Moves.SPLASH)
|
||||
.moveset(Moves.SPLASH);
|
||||
});
|
||||
|
||||
it("should increase one stat stage by 2 and decrease a different stat stage by 1",
|
||||
|
@ -5,7 +5,6 @@ import { Moves } from "#enums/moves";
|
||||
import { Species } from "#enums/species";
|
||||
import Phaser from "phaser";
|
||||
import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest";
|
||||
import { SPLASH_ONLY } from "../utils/testUtils";
|
||||
import { BattlerIndex } from "#app/battle";
|
||||
import { EnemyCommandPhase } from "#app/phases/enemy-command-phase";
|
||||
import { VictoryPhase } from "#app/phases/victory-phase";
|
||||
@ -34,7 +33,7 @@ describe("Abilities - Moxie", () => {
|
||||
game.override.ability(Abilities.MOXIE);
|
||||
game.override.startingLevel(2000);
|
||||
game.override.moveset([ moveToUse ]);
|
||||
game.override.enemyMoveset(SPLASH_ONLY);
|
||||
game.override.enemyMoveset(Moves.SPLASH);
|
||||
});
|
||||
|
||||
it("should raise ATK stat stage by 1 when winning a battle", async() => {
|
||||
|
@ -7,7 +7,6 @@ import { Abilities } from "#enums/abilities";
|
||||
import { Moves } from "#enums/moves";
|
||||
import { Species } from "#enums/species";
|
||||
import GameManager from "#test/utils/gameManager";
|
||||
import { SPLASH_ONLY } from "#test/utils/testUtils";
|
||||
import Phaser from "phaser";
|
||||
import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest";
|
||||
|
||||
@ -34,7 +33,7 @@ describe("Abilities - Parental Bond", () => {
|
||||
game.override.ability(Abilities.PARENTAL_BOND);
|
||||
game.override.enemySpecies(Species.SNORLAX);
|
||||
game.override.enemyAbility(Abilities.FUR_COAT);
|
||||
game.override.enemyMoveset(SPLASH_ONLY);
|
||||
game.override.enemyMoveset(Moves.SPLASH);
|
||||
game.override.startingLevel(100);
|
||||
game.override.enemyLevel(100);
|
||||
});
|
||||
@ -175,7 +174,7 @@ describe("Abilities - Parental Bond", () => {
|
||||
"should not apply multiplier to counter moves",
|
||||
async () => {
|
||||
game.override.moveset([Moves.COUNTER]);
|
||||
game.override.enemyMoveset(Array(4).fill(Moves.TACKLE));
|
||||
game.override.enemyMoveset([Moves.TACKLE]);
|
||||
|
||||
await game.classicMode.startBattle([Species.SHUCKLE]);
|
||||
|
||||
@ -465,7 +464,7 @@ describe("Abilities - Parental Bond", () => {
|
||||
"should not cause user to hit into King's Shield more than once",
|
||||
async () => {
|
||||
game.override.moveset([Moves.TACKLE]);
|
||||
game.override.enemyMoveset(Array(4).fill(Moves.KINGS_SHIELD));
|
||||
game.override.enemyMoveset([Moves.KINGS_SHIELD]);
|
||||
|
||||
await game.classicMode.startBattle([Species.MAGIKARP]);
|
||||
|
||||
|
@ -8,7 +8,6 @@ import { Species } from "#enums/species";
|
||||
import GameManager from "#test/utils/gameManager";
|
||||
import Phaser from "phaser";
|
||||
import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest";
|
||||
import { SPLASH_ONLY } from "../utils/testUtils";
|
||||
|
||||
describe("Abilities - Pastel Veil", () => {
|
||||
let phaserGame: Phaser.Game;
|
||||
@ -31,7 +30,7 @@ describe("Abilities - Pastel Veil", () => {
|
||||
.moveset([Moves.TOXIC_THREAD, Moves.SPLASH])
|
||||
.enemyAbility(Abilities.BALL_FETCH)
|
||||
.enemySpecies(Species.SUNKERN)
|
||||
.enemyMoveset(SPLASH_ONLY);
|
||||
.enemyMoveset(Moves.SPLASH);
|
||||
});
|
||||
|
||||
it("prevents the user and its allies from being afflicted by poison", async () => {
|
||||
|
@ -5,7 +5,6 @@ import { TurnEndPhase } from "#app/phases/turn-end-phase";
|
||||
import { Moves } from "#enums/moves";
|
||||
import { Species } from "#enums/species";
|
||||
import GameManager from "#test/utils/gameManager";
|
||||
import { SPLASH_ONLY } from "#test/utils/testUtils";
|
||||
import Phaser from "phaser";
|
||||
import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest";
|
||||
|
||||
@ -29,7 +28,7 @@ describe("Abilities - Power Spot", () => {
|
||||
game = new GameManager(phaserGame);
|
||||
game.override.battleType("double");
|
||||
game.override.moveset([Moves.TACKLE, Moves.BREAKING_SWIPE, Moves.SPLASH, Moves.DAZZLING_GLEAM]);
|
||||
game.override.enemyMoveset(SPLASH_ONLY);
|
||||
game.override.enemyMoveset(Moves.SPLASH);
|
||||
game.override.enemySpecies(Species.SHUCKLE);
|
||||
game.override.enemyAbility(Abilities.BALL_FETCH);
|
||||
});
|
||||
|
@ -9,7 +9,6 @@ import { Biome } from "#enums/biome";
|
||||
import { Moves } from "#enums/moves";
|
||||
import { Species } from "#enums/species";
|
||||
import GameManager from "#test/utils/gameManager";
|
||||
import { SPLASH_ONLY } from "#test/utils/testUtils";
|
||||
import Phaser from "phaser";
|
||||
import { afterEach, beforeAll, beforeEach, describe, expect, test, vi } from "vitest";
|
||||
|
||||
@ -183,7 +182,7 @@ describe("Abilities - Protean", () => {
|
||||
"ability applies correctly even if the pokemon's move misses",
|
||||
async () => {
|
||||
game.override.moveset([Moves.TACKLE]);
|
||||
game.override.enemyMoveset(SPLASH_ONLY);
|
||||
game.override.enemyMoveset(Moves.SPLASH);
|
||||
|
||||
await game.startBattle([Species.MAGIKARP]);
|
||||
|
||||
|
@ -32,7 +32,7 @@ describe("Abilities - Quick Draw", () => {
|
||||
game.override.enemyLevel(100);
|
||||
game.override.enemySpecies(Species.MAGIKARP);
|
||||
game.override.enemyAbility(Abilities.BALL_FETCH);
|
||||
game.override.enemyMoveset(Array(4).fill(Moves.TACKLE));
|
||||
game.override.enemyMoveset([Moves.TACKLE]);
|
||||
|
||||
vi.spyOn(allAbilities[Abilities.QUICK_DRAW].getAttrs(BypassSpeedChanceAbAttr)[0], "chance", "get").mockReturnValue(100);
|
||||
});
|
||||
@ -76,7 +76,7 @@ describe("Abilities - Quick Draw", () => {
|
||||
);
|
||||
|
||||
test("does not increase priority", async () => {
|
||||
game.override.enemyMoveset(Array(4).fill(Moves.EXTREME_SPEED));
|
||||
game.override.enemyMoveset([Moves.EXTREME_SPEED]);
|
||||
|
||||
await game.startBattle();
|
||||
|
||||
|
@ -35,7 +35,7 @@ describe("Abilities - Sand Spit", () => {
|
||||
});
|
||||
|
||||
it("should trigger when hit with damaging move", async () => {
|
||||
game.override.enemyMoveset(Array(4).fill(Moves.TACKLE));
|
||||
game.override.enemyMoveset([Moves.TACKLE]);
|
||||
await game.startBattle();
|
||||
|
||||
game.move.select(Moves.SPLASH);
|
||||
@ -45,7 +45,7 @@ describe("Abilities - Sand Spit", () => {
|
||||
}, 20000);
|
||||
|
||||
it("should not trigger when targetted with status moves", async () => {
|
||||
game.override.enemyMoveset(Array(4).fill(Moves.GROWL));
|
||||
game.override.enemyMoveset([Moves.GROWL]);
|
||||
await game.startBattle();
|
||||
|
||||
game.move.select(Moves.COIL);
|
||||
|
@ -9,7 +9,6 @@ import { Species } from "#enums/species";
|
||||
import GameManager from "#test/utils/gameManager";
|
||||
import Phaser from "phaser";
|
||||
import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest";
|
||||
import { SPLASH_ONLY } from "../utils/testUtils";
|
||||
|
||||
// See also: TypeImmunityAbAttr
|
||||
describe("Abilities - Sap Sipper", () => {
|
||||
@ -37,7 +36,7 @@ describe("Abilities - Sap Sipper", () => {
|
||||
const enemyAbility = Abilities.SAP_SIPPER;
|
||||
|
||||
game.override.moveset([ moveToUse ]);
|
||||
game.override.enemyMoveset(SPLASH_ONLY);
|
||||
game.override.enemyMoveset(Moves.SPLASH);
|
||||
game.override.enemySpecies(Species.DUSKULL);
|
||||
game.override.enemyAbility(enemyAbility);
|
||||
|
||||
@ -59,7 +58,7 @@ describe("Abilities - Sap Sipper", () => {
|
||||
const enemyAbility = Abilities.SAP_SIPPER;
|
||||
|
||||
game.override.moveset([ moveToUse ]);
|
||||
game.override.enemyMoveset(SPLASH_ONLY);
|
||||
game.override.enemyMoveset(Moves.SPLASH);
|
||||
game.override.enemySpecies(Species.RATTATA);
|
||||
game.override.enemyAbility(enemyAbility);
|
||||
|
||||
@ -80,7 +79,7 @@ describe("Abilities - Sap Sipper", () => {
|
||||
const enemyAbility = Abilities.SAP_SIPPER;
|
||||
|
||||
game.override.moveset([ moveToUse ]);
|
||||
game.override.enemyMoveset(SPLASH_ONLY);
|
||||
game.override.enemyMoveset(Moves.SPLASH);
|
||||
game.override.enemySpecies(Species.RATTATA);
|
||||
game.override.enemyAbility(enemyAbility);
|
||||
|
||||
@ -100,7 +99,7 @@ describe("Abilities - Sap Sipper", () => {
|
||||
const enemyAbility = Abilities.SAP_SIPPER;
|
||||
|
||||
game.override.moveset([ moveToUse ]);
|
||||
game.override.enemyMoveset(SPLASH_ONLY);
|
||||
game.override.enemyMoveset(Moves.SPLASH);
|
||||
game.override.enemySpecies(Species.RATTATA);
|
||||
game.override.enemyAbility(enemyAbility);
|
||||
|
||||
@ -123,7 +122,7 @@ describe("Abilities - Sap Sipper", () => {
|
||||
|
||||
game.override.moveset([ moveToUse ]);
|
||||
game.override.ability(ability);
|
||||
game.override.enemyMoveset(SPLASH_ONLY);
|
||||
game.override.enemyMoveset(Moves.SPLASH);
|
||||
game.override.enemySpecies(Species.RATTATA);
|
||||
game.override.enemyAbility(Abilities.NONE);
|
||||
|
||||
|
@ -1,10 +1,10 @@
|
||||
import { Stat } from "#enums/stat";
|
||||
import GameManager from "#test/utils/gameManager";
|
||||
import { Moves } from "#app/enums/moves";
|
||||
import { Abilities } from "#enums/abilities";
|
||||
import { Species } from "#enums/species";
|
||||
import { Stat } from "#enums/stat";
|
||||
import GameManager from "#test/utils/gameManager";
|
||||
import Phaser from "phaser";
|
||||
import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest";
|
||||
import { SPLASH_ONLY } from "../utils/testUtils";
|
||||
|
||||
describe("Abilities - Simple", () => {
|
||||
let phaserGame: Phaser.Game;
|
||||
@ -27,7 +27,7 @@ describe("Abilities - Simple", () => {
|
||||
.enemySpecies(Species.BULBASAUR)
|
||||
.enemyAbility(Abilities.SIMPLE)
|
||||
.ability(Abilities.INTIMIDATE)
|
||||
.enemyMoveset(SPLASH_ONLY);
|
||||
.enemyMoveset(Moves.SPLASH);
|
||||
});
|
||||
|
||||
it("should double stat changes when applied", async() => {
|
||||
|
@ -4,7 +4,6 @@ import { Abilities } from "#app/enums/abilities";
|
||||
import { Moves } from "#enums/moves";
|
||||
import { Species } from "#enums/species";
|
||||
import GameManager from "#test/utils/gameManager";
|
||||
import { SPLASH_ONLY } from "#test/utils/testUtils";
|
||||
import Phaser from "phaser";
|
||||
import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest";
|
||||
|
||||
@ -31,7 +30,7 @@ describe("Abilities - Steely Spirit", () => {
|
||||
game.override.enemySpecies(Species.SHUCKLE);
|
||||
game.override.enemyAbility(Abilities.BALL_FETCH);
|
||||
game.override.moveset([Moves.IRON_HEAD, Moves.SPLASH]);
|
||||
game.override.enemyMoveset(SPLASH_ONLY);
|
||||
game.override.enemyMoveset(Moves.SPLASH);
|
||||
vi.spyOn(allMoves[moveToCheck], "calculateBattlePower");
|
||||
});
|
||||
|
||||
|
@ -6,7 +6,6 @@ import { TurnEndPhase } from "#app/phases/turn-end-phase";
|
||||
import { Moves } from "#enums/moves";
|
||||
import { Species } from "#enums/species";
|
||||
import GameManager from "#test/utils/gameManager";
|
||||
import { SPLASH_ONLY } from "#test/utils/testUtils";
|
||||
import Phaser from "phaser";
|
||||
import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest";
|
||||
|
||||
@ -45,7 +44,7 @@ describe("Abilities - Sweet Veil", () => {
|
||||
});
|
||||
|
||||
it("causes Rest to fail when used by the user or its allies", async () => {
|
||||
game.override.enemyMoveset(SPLASH_ONLY);
|
||||
game.override.enemyMoveset(Moves.SPLASH);
|
||||
await game.startBattle([Species.SWIRLIX, Species.MAGIKARP]);
|
||||
|
||||
game.move.select(Moves.SPLASH);
|
||||
@ -72,7 +71,7 @@ describe("Abilities - Sweet Veil", () => {
|
||||
game.override.enemySpecies(Species.PIKACHU);
|
||||
game.override.enemyLevel(5);
|
||||
game.override.startingLevel(5);
|
||||
game.override.enemyMoveset(SPLASH_ONLY);
|
||||
game.override.enemyMoveset(Moves.SPLASH);
|
||||
|
||||
await game.startBattle([Species.SHUCKLE, Species.SHUCKLE, Species.SWIRLIX]);
|
||||
|
||||
|
@ -30,7 +30,7 @@ describe("Abilities - Tera Shell", () => {
|
||||
.moveset([Moves.SPLASH])
|
||||
.enemySpecies(Species.SNORLAX)
|
||||
.enemyAbility(Abilities.INSOMNIA)
|
||||
.enemyMoveset(Array(4).fill(Moves.MACH_PUNCH))
|
||||
.enemyMoveset([Moves.MACH_PUNCH])
|
||||
.startingLevel(100)
|
||||
.enemyLevel(100);
|
||||
});
|
||||
@ -60,7 +60,7 @@ describe("Abilities - Tera Shell", () => {
|
||||
it(
|
||||
"should not override type immunities",
|
||||
async () => {
|
||||
game.override.enemyMoveset(Array(4).fill(Moves.SHADOW_SNEAK));
|
||||
game.override.enemyMoveset([Moves.SHADOW_SNEAK]);
|
||||
|
||||
await game.classicMode.startBattle([Species.SNORLAX]);
|
||||
|
||||
@ -77,7 +77,7 @@ describe("Abilities - Tera Shell", () => {
|
||||
it(
|
||||
"should not override type multipliers less than 0.5x",
|
||||
async () => {
|
||||
game.override.enemyMoveset(Array(4).fill(Moves.QUICK_ATTACK));
|
||||
game.override.enemyMoveset([Moves.QUICK_ATTACK]);
|
||||
|
||||
await game.classicMode.startBattle([Species.AGGRON]);
|
||||
|
||||
@ -94,7 +94,7 @@ describe("Abilities - Tera Shell", () => {
|
||||
it(
|
||||
"should not affect the effectiveness of fixed-damage moves",
|
||||
async () => {
|
||||
game.override.enemyMoveset(Array(4).fill(Moves.DRAGON_RAGE));
|
||||
game.override.enemyMoveset([Moves.DRAGON_RAGE]);
|
||||
|
||||
await game.classicMode.startBattle([Species.CHARIZARD]);
|
||||
|
||||
|
@ -4,7 +4,6 @@ import { Abilities } from "#enums/abilities";
|
||||
import { Moves } from "#enums/moves";
|
||||
import { Species } from "#enums/species";
|
||||
import GameManager from "#test/utils/gameManager";
|
||||
import { SPLASH_ONLY } from "#test/utils/testUtils";
|
||||
import Phaser from "phaser";
|
||||
import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest";
|
||||
|
||||
@ -28,7 +27,7 @@ describe("Abilities - Wind Power", () => {
|
||||
game.override.enemySpecies(Species.SHIFTRY);
|
||||
game.override.enemyAbility(Abilities.WIND_POWER);
|
||||
game.override.moveset([Moves.TAILWIND, Moves.SPLASH, Moves.PETAL_BLIZZARD, Moves.SANDSTORM]);
|
||||
game.override.enemyMoveset(SPLASH_ONLY);
|
||||
game.override.enemyMoveset(Moves.SPLASH);
|
||||
});
|
||||
|
||||
it("it becomes charged when hit by wind moves", async () => {
|
||||
|
@ -3,7 +3,6 @@ import GameManager from "#test/utils/gameManager";
|
||||
import { Abilities } from "#enums/abilities";
|
||||
import { Moves } from "#enums/moves";
|
||||
import { Species } from "#enums/species";
|
||||
import { SPLASH_ONLY } from "#test/utils/testUtils";
|
||||
import Phaser from "phaser";
|
||||
import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest";
|
||||
|
||||
@ -28,7 +27,7 @@ describe("Abilities - Wind Rider", () => {
|
||||
.enemySpecies(Species.SHIFTRY)
|
||||
.enemyAbility(Abilities.WIND_RIDER)
|
||||
.moveset([Moves.TAILWIND, Moves.SPLASH, Moves.PETAL_BLIZZARD, Moves.SANDSTORM])
|
||||
.enemyMoveset(SPLASH_ONLY);
|
||||
.enemyMoveset(Moves.SPLASH);
|
||||
});
|
||||
|
||||
it("takes no damage from wind moves and its ATK stat stage is raised by 1 when hit by one", async () => {
|
||||
|
@ -5,7 +5,6 @@ import { Abilities } from "#enums/abilities";
|
||||
import { Moves } from "#enums/moves";
|
||||
import { Species } from "#enums/species";
|
||||
import GameManager from "#test/utils/gameManager";
|
||||
import { SPLASH_ONLY } from "#test/utils/testUtils";
|
||||
import Phaser from "phaser";
|
||||
import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest";
|
||||
|
||||
@ -30,7 +29,7 @@ describe("Abilities - Wonder Skin", () => {
|
||||
game.override.ability(Abilities.BALL_FETCH);
|
||||
game.override.enemySpecies(Species.SHUCKLE);
|
||||
game.override.enemyAbility(Abilities.WONDER_SKIN);
|
||||
game.override.enemyMoveset(SPLASH_ONLY);
|
||||
game.override.enemyMoveset(Moves.SPLASH);
|
||||
});
|
||||
|
||||
it("lowers accuracy of status moves to 50%", async () => {
|
||||
|
@ -6,7 +6,6 @@ import { Moves } from "#enums/moves";
|
||||
import { Species } from "#enums/species";
|
||||
import GameManager from "#test/utils/gameManager";
|
||||
import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest";
|
||||
import { SPLASH_ONLY } from "../utils/testUtils";
|
||||
|
||||
const TIMEOUT = 20 * 1000;
|
||||
|
||||
@ -30,8 +29,8 @@ describe("Abilities - ZERO TO HERO", () => {
|
||||
game = new GameManager(phaserGame);
|
||||
game.override
|
||||
.battleType("single")
|
||||
.moveset(SPLASH_ONLY)
|
||||
.enemyMoveset(SPLASH_ONLY)
|
||||
.moveset(Moves.SPLASH)
|
||||
.enemyMoveset(Moves.SPLASH)
|
||||
.enemyAbility(Abilities.BALL_FETCH);
|
||||
});
|
||||
|
||||
|
@ -8,7 +8,6 @@ import { Species } from "#enums/species";
|
||||
import GameManager from "#test/utils/gameManager";
|
||||
import Phaser from "phaser";
|
||||
import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest";
|
||||
import { SPLASH_ONLY } from "../utils/testUtils";
|
||||
|
||||
describe("Arena - Gravity", () => {
|
||||
let phaserGame: Phaser.Game;
|
||||
@ -32,7 +31,7 @@ describe("Arena - Gravity", () => {
|
||||
.ability(Abilities.UNNERVE)
|
||||
.enemyAbility(Abilities.BALL_FETCH)
|
||||
.enemySpecies(Species.SHUCKLE)
|
||||
.enemyMoveset(SPLASH_ONLY);
|
||||
.enemyMoveset(Moves.SPLASH);
|
||||
});
|
||||
|
||||
// Reference: https://bulbapedia.bulbagarden.net/wiki/Gravity_(move)
|
||||
|
@ -31,7 +31,7 @@ describe("Weather - Fog", () => {
|
||||
game.override.ability(Abilities.BALL_FETCH);
|
||||
game.override.enemyAbility(Abilities.BALL_FETCH);
|
||||
game.override.enemySpecies(Species.MAGIKARP);
|
||||
game.override.enemyMoveset(new Array(4).fill(Moves.SPLASH));
|
||||
game.override.enemyMoveset([Moves.SPLASH]);
|
||||
});
|
||||
|
||||
it("move accuracy is multiplied by 90%", async () => {
|
||||
|
@ -4,7 +4,6 @@ import { Species } from "#enums/species";
|
||||
import GameManager from "#test/utils/gameManager";
|
||||
import Phaser from "phaser";
|
||||
import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest";
|
||||
import { SPLASH_ONLY } from "../utils/testUtils";
|
||||
import { BattlerIndex } from "#app/battle";
|
||||
|
||||
describe("Weather - Hail", () => {
|
||||
@ -26,8 +25,8 @@ describe("Weather - Hail", () => {
|
||||
game.override
|
||||
.weather(WeatherType.HAIL)
|
||||
.battleType("single")
|
||||
.moveset(SPLASH_ONLY)
|
||||
.enemyMoveset(SPLASH_ONLY)
|
||||
.moveset(Moves.SPLASH)
|
||||
.enemyMoveset(Moves.SPLASH)
|
||||
.enemySpecies(Species.MAGIKARP);
|
||||
});
|
||||
|
||||
|
@ -4,7 +4,6 @@ import { Species } from "#enums/species";
|
||||
import GameManager from "#test/utils/gameManager";
|
||||
import Phaser from "phaser";
|
||||
import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest";
|
||||
import { SPLASH_ONLY } from "../utils/testUtils";
|
||||
|
||||
describe("Weather - Sandstorm", () => {
|
||||
let phaserGame: Phaser.Game;
|
||||
@ -25,8 +24,8 @@ describe("Weather - Sandstorm", () => {
|
||||
game.override
|
||||
.weather(WeatherType.SANDSTORM)
|
||||
.battleType("single")
|
||||
.moveset(SPLASH_ONLY)
|
||||
.enemyMoveset(SPLASH_ONLY)
|
||||
.moveset(Moves.SPLASH)
|
||||
.enemyMoveset(Moves.SPLASH)
|
||||
.enemySpecies(Species.MAGIKARP);
|
||||
});
|
||||
|
||||
|
@ -1,4 +1,5 @@
|
||||
import { allMoves } from "#app/data/move";
|
||||
import { StatusEffect } from "#app/enums/status-effect";
|
||||
import { TurnStartPhase } from "#app/phases/turn-start-phase";
|
||||
import { Abilities } from "#enums/abilities";
|
||||
import { Moves } from "#enums/moves";
|
||||
@ -33,7 +34,7 @@ describe("Weather - Strong Winds", () => {
|
||||
it("electric type move is not very effective on Rayquaza", async () => {
|
||||
game.override.enemySpecies(Species.RAYQUAZA);
|
||||
|
||||
await game.startBattle([Species.PIKACHU]);
|
||||
await game.classicMode.startBattle([Species.PIKACHU]);
|
||||
const pikachu = game.scene.getPlayerPokemon()!;
|
||||
const enemy = game.scene.getEnemyPokemon()!;
|
||||
|
||||
@ -44,7 +45,7 @@ describe("Weather - Strong Winds", () => {
|
||||
});
|
||||
|
||||
it("electric type move is neutral for flying type pokemon", async () => {
|
||||
await game.startBattle([Species.PIKACHU]);
|
||||
await game.classicMode.startBattle([Species.PIKACHU]);
|
||||
const pikachu = game.scene.getPlayerPokemon()!;
|
||||
const enemy = game.scene.getEnemyPokemon()!;
|
||||
|
||||
@ -55,7 +56,7 @@ describe("Weather - Strong Winds", () => {
|
||||
});
|
||||
|
||||
it("ice type move is neutral for flying type pokemon", async () => {
|
||||
await game.startBattle([Species.PIKACHU]);
|
||||
await game.classicMode.startBattle([Species.PIKACHU]);
|
||||
const pikachu = game.scene.getPlayerPokemon()!;
|
||||
const enemy = game.scene.getEnemyPokemon()!;
|
||||
|
||||
@ -66,7 +67,7 @@ describe("Weather - Strong Winds", () => {
|
||||
});
|
||||
|
||||
it("rock type move is neutral for flying type pokemon", async () => {
|
||||
await game.startBattle([Species.PIKACHU]);
|
||||
await game.classicMode.startBattle([Species.PIKACHU]);
|
||||
const pikachu = game.scene.getPlayerPokemon()!;
|
||||
const enemy = game.scene.getEnemyPokemon()!;
|
||||
|
||||
@ -75,4 +76,18 @@ describe("Weather - Strong Winds", () => {
|
||||
await game.phaseInterceptor.to(TurnStartPhase);
|
||||
expect(enemy.getAttackTypeEffectiveness(allMoves[Moves.ROCK_SLIDE].type, pikachu)).toBe(1);
|
||||
});
|
||||
|
||||
it("weather goes away when last trainer pokemon dies to indirect damage", async () => {
|
||||
game.override.enemyStatusEffect(StatusEffect.POISON);
|
||||
|
||||
await game.classicMode.startBattle([Species.MAGIKARP]);
|
||||
|
||||
const enemy = game.scene.getEnemyPokemon()!;
|
||||
enemy.hp = 1;
|
||||
|
||||
game.move.select(Moves.SPLASH);
|
||||
await game.phaseInterceptor.to("TurnEndPhase");
|
||||
|
||||
expect(game.scene.arena.weather?.weatherType).toBeUndefined();
|
||||
});
|
||||
});
|
||||
|
@ -25,7 +25,6 @@ import { PlayerGender } from "#enums/player-gender";
|
||||
import { Species } from "#enums/species";
|
||||
import Phaser from "phaser";
|
||||
import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest";
|
||||
import { SPLASH_ONLY } from "../utils/testUtils";
|
||||
|
||||
describe("Test Battle Phase", () => {
|
||||
let phaserGame: Phaser.Game;
|
||||
@ -319,7 +318,7 @@ describe("Test Battle Phase", () => {
|
||||
.startingWave(1)
|
||||
.startingLevel(100)
|
||||
.moveset([moveToUse])
|
||||
.enemyMoveset(SPLASH_ONLY)
|
||||
.enemyMoveset(Moves.SPLASH)
|
||||
.startingHeldItems([{ name: "TEMP_STAT_STAGE_BOOSTER", type: Stat.ACC }]);
|
||||
|
||||
await game.startBattle();
|
||||
|
@ -5,7 +5,6 @@ import { ArenaTagType } from "#enums/arena-tag-type";
|
||||
import { Moves } from "#enums/moves";
|
||||
import { Species } from "#enums/species";
|
||||
import GameManager from "#test/utils/gameManager";
|
||||
import { SPLASH_ONLY } from "#test/utils/testUtils";
|
||||
import Phaser from "phaser";
|
||||
import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest";
|
||||
|
||||
@ -31,7 +30,7 @@ describe("Round Down and Minimun 1 test in Damage Calculation", () => {
|
||||
|
||||
it("When the user fails to use Jump Kick with Wonder Guard ability, the damage should be 1.", async () => {
|
||||
game.override.enemySpecies(Species.GASTLY);
|
||||
game.override.enemyMoveset(SPLASH_ONLY);
|
||||
game.override.enemyMoveset(Moves.SPLASH);
|
||||
game.override.starterSpecies(Species.SHEDINJA);
|
||||
game.override.moveset([Moves.JUMP_KICK]);
|
||||
game.override.ability(Abilities.WONDER_GUARD);
|
||||
|
@ -4,7 +4,6 @@ import { TurnInitPhase } from "#app/phases/turn-init-phase";
|
||||
import { Moves } from "#enums/moves";
|
||||
import { Species } from "#enums/species";
|
||||
import GameManager from "#test/utils/gameManager";
|
||||
import { SPLASH_ONLY } from "#test/utils/testUtils";
|
||||
import Phaser from "phaser";
|
||||
import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest";
|
||||
|
||||
@ -29,7 +28,7 @@ describe("Double Battles", () => {
|
||||
// double-battle player's pokemon both fainted in same round, then revive one, and next double battle summons two player's pokemon successfully.
|
||||
// (There were bugs that either only summon one when can summon two, player stuck in switchPhase etc)
|
||||
it("3v2 edge case: player summons 2 pokemon on the next battle after being fainted and revived", async () => {
|
||||
game.override.battleType("double").enemyMoveset(SPLASH_ONLY).moveset(SPLASH_ONLY);
|
||||
game.override.battleType("double").enemyMoveset(Moves.SPLASH).moveset(Moves.SPLASH);
|
||||
await game.startBattle([
|
||||
Species.BULBASAUR,
|
||||
Species.CHARIZARD,
|
||||
|
@ -8,7 +8,6 @@ import { Species } from "#enums/species";
|
||||
import { StatusEffect } from "#enums/status-effect";
|
||||
import GameManager from "#test/utils/gameManager";
|
||||
import Phaser from "phaser";
|
||||
import { SPLASH_ONLY } from "#test/utils/testUtils";
|
||||
import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest";
|
||||
|
||||
const TIMEOUT = 20 * 1000;
|
||||
@ -38,7 +37,7 @@ describe("Inverse Battle", () => {
|
||||
.ability(Abilities.BALL_FETCH)
|
||||
.enemySpecies(Species.MAGIKARP)
|
||||
.enemyAbility(Abilities.BALL_FETCH)
|
||||
.enemyMoveset(SPLASH_ONLY);
|
||||
.enemyMoveset(Moves.SPLASH);
|
||||
});
|
||||
|
||||
it("Immune types are 2x effective - Thunderbolt against Ground Type", async () => {
|
||||
|
@ -2,7 +2,6 @@ import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest";
|
||||
import GameManager from "./utils/gameManager";
|
||||
import { Species } from "#app/enums/species";
|
||||
import { getPokemonSpecies } from "#app/data/pokemon-species";
|
||||
import { SPLASH_ONLY } from "./utils/testUtils";
|
||||
import { Abilities } from "#app/enums/abilities";
|
||||
import { Moves } from "#app/enums/moves";
|
||||
import { EFFECTIVE_STATS } from "#app/enums/stat";
|
||||
@ -33,7 +32,7 @@ describe("Boss Pokemon / Shields", () => {
|
||||
.disableTrainerWaves()
|
||||
.disableCrits()
|
||||
.enemySpecies(Species.RATTATA)
|
||||
.enemyMoveset(SPLASH_ONLY)
|
||||
.enemyMoveset(Moves.SPLASH)
|
||||
.enemyHeldItems([])
|
||||
.startingLevel(1000)
|
||||
.moveset([Moves.FALSE_SWIPE, Moves.SUPER_FANG, Moves.SPLASH])
|
||||
|
@ -6,7 +6,6 @@ import * as Utils from "#app/utils";
|
||||
import GameManager from "#test/utils/gameManager";
|
||||
import Phaser from "phaser";
|
||||
import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest";
|
||||
import { SPLASH_ONLY } from "./utils/testUtils";
|
||||
|
||||
describe("Evolution", () => {
|
||||
let phaserGame: Phaser.Game;
|
||||
@ -99,7 +98,7 @@ describe("Evolution", () => {
|
||||
it("should increase both HP and max HP when evolving", async () => {
|
||||
game.override.moveset([Moves.SURF])
|
||||
.enemySpecies(Species.GOLEM)
|
||||
.enemyMoveset(SPLASH_ONLY)
|
||||
.enemyMoveset(Moves.SPLASH)
|
||||
.startingWave(21)
|
||||
.startingLevel(16)
|
||||
.enemyLevel(50);
|
||||
@ -126,7 +125,7 @@ describe("Evolution", () => {
|
||||
it("should not fully heal HP when evolving", async () => {
|
||||
game.override.moveset([Moves.SURF])
|
||||
.enemySpecies(Species.GOLEM)
|
||||
.enemyMoveset(SPLASH_ONLY)
|
||||
.enemyMoveset(Moves.SPLASH)
|
||||
.startingWave(21)
|
||||
.startingLevel(13)
|
||||
.enemyLevel(30);
|
||||
|
@ -7,7 +7,6 @@ import { GameModes } from "#app/game-mode";
|
||||
import { TurnHeldItemTransferModifier } from "#app/modifier/modifier";
|
||||
import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest";
|
||||
import GameManager from "./utils/gameManager";
|
||||
import { SPLASH_ONLY } from "./utils/testUtils";
|
||||
|
||||
const FinalWave = {
|
||||
Classic: 200,
|
||||
@ -29,7 +28,7 @@ describe("Final Boss", () => {
|
||||
.startingWave(FinalWave.Classic)
|
||||
.startingBiome(Biome.END)
|
||||
.disableCrits()
|
||||
.enemyMoveset(SPLASH_ONLY)
|
||||
.enemyMoveset(Moves.SPLASH)
|
||||
.moveset([ Moves.SPLASH, Moves.WILL_O_WISP, Moves.DRAGON_PULSE ])
|
||||
.startingLevel(10000);
|
||||
});
|
||||
|
@ -4,7 +4,6 @@ import { Species } from "#enums/species";
|
||||
import GameManager from "#test/utils/gameManager";
|
||||
import Phase from "phaser";
|
||||
import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest";
|
||||
import { SPLASH_ONLY } from "../utils/testUtils";
|
||||
import { BattleEndPhase } from "#app/phases/battle-end-phase";
|
||||
import { TempCritBoosterModifier } from "#app/modifier/modifier";
|
||||
import { Mode } from "#app/ui/ui";
|
||||
@ -34,7 +33,7 @@ describe("Items - Dire Hit", () => {
|
||||
|
||||
game.override
|
||||
.enemySpecies(Species.MAGIKARP)
|
||||
.enemyMoveset(SPLASH_ONLY)
|
||||
.enemyMoveset(Moves.SPLASH)
|
||||
.moveset([ Moves.POUND ])
|
||||
.startingHeldItems([{ name: "DIRE_HIT" }])
|
||||
.battleType("single")
|
||||
|
@ -4,7 +4,6 @@ import { DoubleBattleChanceBoosterModifier } from "#app/modifier/modifier";
|
||||
import GameManager from "#test/utils/gameManager";
|
||||
import Phaser from "phaser";
|
||||
import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest";
|
||||
import { SPLASH_ONLY } from "../utils/testUtils";
|
||||
import { ShopCursorTarget } from "#app/enums/shop-cursor-target.js";
|
||||
import { Mode } from "#app/ui/ui.js";
|
||||
import ModifierSelectUiHandler from "#app/ui/modifier-select-ui-handler.js";
|
||||
@ -64,7 +63,7 @@ describe("Items - Double Battle Chance Boosters", () => {
|
||||
game.override
|
||||
.startingModifier([{ name: "LURE" }])
|
||||
.itemRewards([{ name: "LURE" }])
|
||||
.moveset(SPLASH_ONLY)
|
||||
.moveset(Moves.SPLASH)
|
||||
.startingLevel(200);
|
||||
|
||||
await game.classicMode.startBattle([
|
||||
|
@ -8,7 +8,6 @@ import { MoveEndPhase } from "#app/phases/move-end-phase";
|
||||
import GameManager from "#test/utils/gameManager";
|
||||
import Phase from "phaser";
|
||||
import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest";
|
||||
import { SPLASH_ONLY } from "../utils/testUtils";
|
||||
|
||||
const TIMEOUT = 20 * 1000; // 20 seconds
|
||||
|
||||
@ -38,7 +37,7 @@ describe("Items - Grip Claw", () => {
|
||||
])
|
||||
.enemySpecies(Species.SNORLAX)
|
||||
.ability(Abilities.KLUTZ)
|
||||
.enemyMoveset(SPLASH_ONLY)
|
||||
.enemyMoveset(Moves.SPLASH)
|
||||
.enemyHeldItems([
|
||||
{ name: "BERRY", type: BerryType.SITRUS, count: 2 },
|
||||
{ name: "BERRY", type: BerryType.LUM, count: 2 },
|
||||
|
@ -4,7 +4,6 @@ import { Species } from "#enums/species";
|
||||
import GameManager from "#test/utils/gameManager";
|
||||
import Phase from "phaser";
|
||||
import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest";
|
||||
import { SPLASH_ONLY } from "../utils/testUtils";
|
||||
|
||||
describe("Items - Scope Lens", () => {
|
||||
let phaserGame: Phaser.Game;
|
||||
@ -25,7 +24,7 @@ describe("Items - Scope Lens", () => {
|
||||
|
||||
game.override
|
||||
.enemySpecies(Species.MAGIKARP)
|
||||
.enemyMoveset(SPLASH_ONLY)
|
||||
.enemyMoveset(Moves.SPLASH)
|
||||
.moveset([ Moves.POUND ])
|
||||
.startingHeldItems([{ name: "SCOPE_LENS" }])
|
||||
.battleType("single")
|
||||
|
@ -5,7 +5,6 @@ import Phase from "phaser";
|
||||
import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest";
|
||||
import { Moves } from "#app/enums/moves";
|
||||
import { TurnEndPhase } from "#app/phases/turn-end-phase";
|
||||
import { SPLASH_ONLY } from "../utils/testUtils";
|
||||
import { Abilities } from "#app/enums/abilities";
|
||||
import { TempStatStageBoosterModifier } from "#app/modifier/modifier";
|
||||
import { Mode } from "#app/ui/ui";
|
||||
@ -34,7 +33,7 @@ describe("Items - Temporary Stat Stage Boosters", () => {
|
||||
game.override
|
||||
.battleType("single")
|
||||
.enemySpecies(Species.SHUCKLE)
|
||||
.enemyMoveset(SPLASH_ONLY)
|
||||
.enemyMoveset(Moves.SPLASH)
|
||||
.enemyAbility(Abilities.BALL_FETCH)
|
||||
.moveset([ Moves.TACKLE, Moves.SPLASH, Moves.HONE_CLAWS, Moves.BELLY_DRUM ])
|
||||
.startingModifier([{ name: "TEMP_STAT_STAGE_BOOSTER", type: Stat.ATK }]);
|
||||
|
65
src/test/moves/after_you.test.ts
Normal file
65
src/test/moves/after_you.test.ts
Normal file
@ -0,0 +1,65 @@
|
||||
import { BattlerIndex } from "#app/battle";
|
||||
import { Abilities } from "#app/enums/abilities";
|
||||
import { MoveResult } from "#app/field/pokemon";
|
||||
import { MovePhase } from "#app/phases/move-phase";
|
||||
import { Moves } from "#enums/moves";
|
||||
import { Species } from "#enums/species";
|
||||
import GameManager from "#test/utils/gameManager";
|
||||
import Phaser from "phaser";
|
||||
import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest";
|
||||
|
||||
const TIMEOUT = 20 * 1000;
|
||||
|
||||
describe("Moves - After You", () => {
|
||||
let phaserGame: Phaser.Game;
|
||||
let game: GameManager;
|
||||
|
||||
beforeAll(() => {
|
||||
phaserGame = new Phaser.Game({
|
||||
type: Phaser.HEADLESS,
|
||||
});
|
||||
});
|
||||
|
||||
afterEach(() => {
|
||||
game.phaseInterceptor.restoreOg();
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
game = new GameManager(phaserGame);
|
||||
game.override
|
||||
.battleType("double")
|
||||
.enemyLevel(5)
|
||||
.enemySpecies(Species.PIKACHU)
|
||||
.enemyAbility(Abilities.BALL_FETCH)
|
||||
.enemyMoveset(Moves.SPLASH)
|
||||
.ability(Abilities.BALL_FETCH)
|
||||
.moveset([Moves.AFTER_YOU, Moves.SPLASH]);
|
||||
});
|
||||
|
||||
it("makes the target move immediately after the user", async () => {
|
||||
await game.classicMode.startBattle([Species.REGIELEKI, Species.SHUCKLE]);
|
||||
|
||||
game.move.select(Moves.AFTER_YOU, 0, BattlerIndex.PLAYER_2);
|
||||
game.move.select(Moves.SPLASH, 1);
|
||||
|
||||
await game.phaseInterceptor.to("MoveEffectPhase");
|
||||
await game.phaseInterceptor.to(MovePhase, false);
|
||||
const phase = game.scene.getCurrentPhase() as MovePhase;
|
||||
expect(phase.pokemon).toBe(game.scene.getPlayerField()[1]);
|
||||
await game.phaseInterceptor.to("MoveEndPhase");
|
||||
}, TIMEOUT);
|
||||
|
||||
it("fails if target already moved", async () => {
|
||||
game.override.enemySpecies(Species.SHUCKLE);
|
||||
await game.classicMode.startBattle([Species.REGIELEKI, Species.PIKACHU]);
|
||||
|
||||
game.move.select(Moves.SPLASH);
|
||||
game.move.select(Moves.AFTER_YOU, 1, BattlerIndex.PLAYER);
|
||||
|
||||
await game.phaseInterceptor.to("MoveEndPhase");
|
||||
await game.phaseInterceptor.to("MoveEndPhase");
|
||||
await game.phaseInterceptor.to(MovePhase);
|
||||
|
||||
expect(game.scene.getPlayerField()[1].getLastXMoves(1)[0].result).toBe(MoveResult.FAIL);
|
||||
}, TIMEOUT);
|
||||
});
|
@ -31,7 +31,7 @@ describe("Moves - Alluring Voice", () => {
|
||||
.disableCrits()
|
||||
.enemySpecies(Species.MAGIKARP)
|
||||
.enemyAbility(Abilities.ICE_SCALES)
|
||||
.enemyMoveset(Array(4).fill(Moves.HOWL))
|
||||
.enemyMoveset([Moves.HOWL])
|
||||
.startingLevel(10)
|
||||
.enemyLevel(10)
|
||||
.starterSpecies(Species.FEEBAS)
|
||||
|
@ -5,7 +5,6 @@ import { BattlerTagType } from "#enums/battler-tag-type";
|
||||
import { Moves } from "#enums/moves";
|
||||
import { Species } from "#enums/species";
|
||||
import { Stat } from "#enums/stat";
|
||||
import { SPLASH_ONLY } from "#test/utils/testUtils";
|
||||
import Phaser from "phaser";
|
||||
import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest";
|
||||
|
||||
@ -31,7 +30,7 @@ describe("Moves - Baton Pass", () => {
|
||||
.enemyAbility(Abilities.BALL_FETCH)
|
||||
.moveset([Moves.BATON_PASS, Moves.NASTY_PLOT, Moves.SPLASH])
|
||||
.ability(Abilities.BALL_FETCH)
|
||||
.enemyMoveset(SPLASH_ONLY)
|
||||
.enemyMoveset(Moves.SPLASH)
|
||||
.disableCrits();
|
||||
});
|
||||
|
||||
@ -71,7 +70,10 @@ describe("Moves - Baton Pass", () => {
|
||||
|
||||
// round 2 - baton pass
|
||||
game.scene.getEnemyPokemon()!.hp = 100;
|
||||
game.override.enemyMoveset(new Array(4).fill(Moves.BATON_PASS));
|
||||
game.override.enemyMoveset([Moves.BATON_PASS]);
|
||||
// Force moveset to update mid-battle
|
||||
// TODO: replace with enemy ai control function when it's added
|
||||
game.scene.getEnemyParty()[0].getMoveset();
|
||||
game.move.select(Moves.SPLASH);
|
||||
await game.phaseInterceptor.to("PostSummonPhase", false);
|
||||
|
||||
@ -90,7 +92,7 @@ describe("Moves - Baton Pass", () => {
|
||||
}, 20000);
|
||||
|
||||
it("doesn't transfer effects that aren't transferrable", async() => {
|
||||
game.override.enemyMoveset(Array(4).fill(Moves.SALT_CURE));
|
||||
game.override.enemyMoveset([Moves.SALT_CURE]);
|
||||
await game.classicMode.startBattle([Species.PIKACHU, Species.FEEBAS]);
|
||||
|
||||
const [player1, player2] = game.scene.getParty();
|
||||
|
@ -34,7 +34,7 @@ describe("Moves - Beak Blast", () => {
|
||||
.moveset([Moves.BEAK_BLAST])
|
||||
.enemySpecies(Species.SNORLAX)
|
||||
.enemyAbility(Abilities.INSOMNIA)
|
||||
.enemyMoveset(Array(4).fill(Moves.TACKLE))
|
||||
.enemyMoveset([Moves.TACKLE])
|
||||
.startingLevel(100)
|
||||
.enemyLevel(100);
|
||||
});
|
||||
@ -80,7 +80,7 @@ describe("Moves - Beak Blast", () => {
|
||||
it(
|
||||
"should not burn attackers that don't make contact",
|
||||
async () => {
|
||||
game.override.enemyMoveset(Array(4).fill(Moves.WATER_GUN));
|
||||
game.override.enemyMoveset([Moves.WATER_GUN]);
|
||||
|
||||
await game.startBattle([Species.BLASTOISE]);
|
||||
|
||||
@ -116,7 +116,7 @@ describe("Moves - Beak Blast", () => {
|
||||
it(
|
||||
"should be blocked by Protect",
|
||||
async () => {
|
||||
game.override.enemyMoveset(Array(4).fill(Moves.PROTECT));
|
||||
game.override.enemyMoveset([Moves.PROTECT]);
|
||||
|
||||
await game.startBattle([Species.BLASTOISE]);
|
||||
|
||||
|
@ -29,7 +29,7 @@ describe("Moves - Beat Up", () => {
|
||||
|
||||
game.override.enemySpecies(Species.SNORLAX);
|
||||
game.override.enemyLevel(100);
|
||||
game.override.enemyMoveset(Array(4).fill(Moves.SPLASH));
|
||||
game.override.enemyMoveset([Moves.SPLASH]);
|
||||
game.override.enemyAbility(Abilities.INSOMNIA);
|
||||
|
||||
game.override.startingLevel(100);
|
||||
|
@ -6,7 +6,6 @@ import { Stat } from "#enums/stat";
|
||||
import GameManager from "#test/utils/gameManager";
|
||||
import Phaser from "phaser";
|
||||
import { afterEach, beforeAll, beforeEach, describe, expect, test } from "vitest";
|
||||
import { SPLASH_ONLY } from "../utils/testUtils";
|
||||
import { Abilities } from "#app/enums/abilities";
|
||||
|
||||
const TIMEOUT = 20 * 1000;
|
||||
@ -37,7 +36,7 @@ describe("Moves - BELLY DRUM", () => {
|
||||
.startingLevel(100)
|
||||
.enemyLevel(100)
|
||||
.moveset([Moves.BELLY_DRUM])
|
||||
.enemyMoveset(SPLASH_ONLY)
|
||||
.enemyMoveset(Moves.SPLASH)
|
||||
.enemyAbility(Abilities.BALL_FETCH);
|
||||
});
|
||||
|
||||
|
@ -7,7 +7,6 @@ import { Species } from "#enums/species";
|
||||
import GameManager from "#test/utils/gameManager";
|
||||
import Phaser from "phaser";
|
||||
import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest";
|
||||
import { SPLASH_ONLY } from "../utils/testUtils";
|
||||
|
||||
const TIMEOUT = 20 * 1000;
|
||||
|
||||
@ -32,7 +31,7 @@ describe("Moves - Burning Jealousy", () => {
|
||||
.disableCrits()
|
||||
.enemySpecies(Species.MAGIKARP)
|
||||
.enemyAbility(Abilities.ICE_SCALES)
|
||||
.enemyMoveset(Array(4).fill(Moves.HOWL))
|
||||
.enemyMoveset([Moves.HOWL])
|
||||
.startingLevel(10)
|
||||
.enemyLevel(10)
|
||||
.starterSpecies(Species.FEEBAS)
|
||||
@ -73,7 +72,7 @@ describe("Moves - Burning Jealousy", () => {
|
||||
game.override
|
||||
.enemySpecies(Species.DITTO)
|
||||
.enemyAbility(Abilities.IMPOSTER)
|
||||
.enemyMoveset(SPLASH_ONLY);
|
||||
.enemyMoveset(Moves.SPLASH);
|
||||
await game.classicMode.startBattle();
|
||||
|
||||
const enemy = game.scene.getEnemyPokemon()!;
|
||||
@ -91,7 +90,7 @@ describe("Moves - Burning Jealousy", () => {
|
||||
it("should be boosted by Sheer Force even if opponent didn't raise stat stages", async () => {
|
||||
game.override
|
||||
.ability(Abilities.SHEER_FORCE)
|
||||
.enemyMoveset(SPLASH_ONLY);
|
||||
.enemyMoveset(Moves.SPLASH);
|
||||
vi.spyOn(allMoves[Moves.BURNING_JEALOUSY], "calculateBattlePower");
|
||||
await game.classicMode.startBattle();
|
||||
|
||||
|
@ -5,7 +5,6 @@ import { TurnEndPhase } from "#app/phases/turn-end-phase";
|
||||
import { Moves } from "#enums/moves";
|
||||
import { Species } from "#enums/species";
|
||||
import { Stat } from "#enums/stat";
|
||||
import { SPLASH_ONLY } from "#test/utils/testUtils";
|
||||
|
||||
const TIMEOUT = 20 * 1000;
|
||||
/** HP Cost of Move */
|
||||
@ -34,7 +33,7 @@ describe("Moves - Clangorous Soul", () => {
|
||||
game.override.startingLevel(100);
|
||||
game.override.enemyLevel(100);
|
||||
game.override.moveset([Moves.CLANGOROUS_SOUL]);
|
||||
game.override.enemyMoveset(SPLASH_ONLY);
|
||||
game.override.enemyMoveset(Moves.SPLASH);
|
||||
});
|
||||
|
||||
//Bulbapedia Reference: https://bulbapedia.bulbagarden.net/wiki/Clangorous_Soul_(move)
|
||||
|
@ -33,7 +33,7 @@ describe("Moves - Crafty Shield", () => {
|
||||
game.override.moveset([Moves.CRAFTY_SHIELD, Moves.SPLASH, Moves.SWORDS_DANCE]);
|
||||
|
||||
game.override.enemySpecies(Species.SNORLAX);
|
||||
game.override.enemyMoveset(Array(4).fill(Moves.GROWL));
|
||||
game.override.enemyMoveset([Moves.GROWL]);
|
||||
game.override.enemyAbility(Abilities.INSOMNIA);
|
||||
|
||||
game.override.startingLevel(100);
|
||||
@ -62,7 +62,7 @@ describe("Moves - Crafty Shield", () => {
|
||||
test(
|
||||
"should not protect the user and allies from attack moves",
|
||||
async () => {
|
||||
game.override.enemyMoveset(Array(4).fill(Moves.TACKLE));
|
||||
game.override.enemyMoveset([Moves.TACKLE]);
|
||||
|
||||
await game.startBattle([Species.CHARIZARD, Species.BLASTOISE]);
|
||||
|
||||
@ -84,7 +84,7 @@ describe("Moves - Crafty Shield", () => {
|
||||
"should protect the user and allies from moves that ignore other protection",
|
||||
async () => {
|
||||
game.override.enemySpecies(Species.DUSCLOPS);
|
||||
game.override.enemyMoveset(Array(4).fill(Moves.CURSE));
|
||||
game.override.enemyMoveset([Moves.CURSE]);
|
||||
|
||||
await game.startBattle([Species.CHARIZARD, Species.BLASTOISE]);
|
||||
|
||||
|
@ -4,7 +4,6 @@ import { Abilities } from "#enums/abilities";
|
||||
import { Moves } from "#enums/moves";
|
||||
import { Species } from "#enums/species";
|
||||
import GameManager from "#test/utils/gameManager";
|
||||
import { SPLASH_ONLY } from "#test/utils/testUtils";
|
||||
import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest";
|
||||
|
||||
describe("Moves - Disable", () => {
|
||||
@ -28,7 +27,7 @@ describe("Moves - Disable", () => {
|
||||
.ability(Abilities.BALL_FETCH)
|
||||
.enemyAbility(Abilities.BALL_FETCH)
|
||||
.moveset([Moves.DISABLE, Moves.SPLASH])
|
||||
.enemyMoveset(SPLASH_ONLY)
|
||||
.enemyMoveset(Moves.SPLASH)
|
||||
.starterSpecies(Species.PIKACHU)
|
||||
.enemySpecies(Species.SHUCKLE);
|
||||
});
|
||||
@ -79,7 +78,7 @@ describe("Moves - Disable", () => {
|
||||
}, 20000);
|
||||
|
||||
it("cannot disable STRUGGLE", async() => {
|
||||
game.override.enemyMoveset(Array(4).fill(Moves.STRUGGLE));
|
||||
game.override.enemyMoveset([Moves.STRUGGLE]);
|
||||
await game.classicMode.startBattle();
|
||||
|
||||
const playerMon = game.scene.getPlayerPokemon()!;
|
||||
@ -114,7 +113,7 @@ describe("Moves - Disable", () => {
|
||||
}, 20000);
|
||||
|
||||
it("disables NATURE POWER, not the move invoked by it", async() => {
|
||||
game.override.enemyMoveset(Array(4).fill(Moves.NATURE_POWER));
|
||||
game.override.enemyMoveset([Moves.NATURE_POWER]);
|
||||
await game.classicMode.startBattle();
|
||||
|
||||
const enemyMon = game.scene.getEnemyPokemon()!;
|
||||
|
@ -4,7 +4,6 @@ import { Moves } from "#app/enums/moves";
|
||||
import { Species } from "#app/enums/species";
|
||||
import { Abilities } from "#enums/abilities";
|
||||
import GameManager from "#test/utils/gameManager";
|
||||
import { SPLASH_ONLY } from "#test/utils/testUtils";
|
||||
import Phaser from "phaser";
|
||||
import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest";
|
||||
|
||||
@ -28,7 +27,7 @@ describe("Moves - Dragon Cheer", () => {
|
||||
game.override
|
||||
.battleType("double")
|
||||
.enemyAbility(Abilities.BALL_FETCH)
|
||||
.enemyMoveset(SPLASH_ONLY)
|
||||
.enemyMoveset(Moves.SPLASH)
|
||||
.enemyLevel(20)
|
||||
.moveset([Moves.DRAGON_CHEER, Moves.TACKLE, Moves.SPLASH]);
|
||||
});
|
||||
|
@ -8,7 +8,6 @@ import { Abilities } from "#enums/abilities";
|
||||
import { BattlerTagType } from "#enums/battler-tag-type";
|
||||
import { Moves } from "#enums/moves";
|
||||
import GameManager from "#test/utils/gameManager";
|
||||
import { SPLASH_ONLY } from "#test/utils/testUtils";
|
||||
import Phaser from "phaser";
|
||||
import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest";
|
||||
|
||||
@ -42,7 +41,7 @@ describe("Moves - Dragon Rage", () => {
|
||||
game.override.startingLevel(100);
|
||||
|
||||
game.override.enemySpecies(Species.SNORLAX);
|
||||
game.override.enemyMoveset(SPLASH_ONLY);
|
||||
game.override.enemyMoveset(Moves.SPLASH);
|
||||
game.override.enemyAbility(Abilities.BALL_FETCH);
|
||||
game.override.enemyPassiveAbility(Abilities.BALL_FETCH);
|
||||
game.override.enemyLevel(100);
|
||||
|
@ -9,7 +9,6 @@ import { Species } from "#enums/species";
|
||||
import Phaser from "phaser";
|
||||
import { afterEach, beforeAll, beforeEach, describe, expect, test, vi } from "vitest";
|
||||
import GameManager from "../utils/gameManager";
|
||||
import { SPLASH_ONLY } from "../utils/testUtils";
|
||||
|
||||
const TIMEOUT = 20 * 1000;
|
||||
|
||||
@ -32,7 +31,7 @@ describe("Moves - Dragon Tail", () => {
|
||||
game.override.battleType("single")
|
||||
.moveset([Moves.DRAGON_TAIL, Moves.SPLASH])
|
||||
.enemySpecies(Species.WAILORD)
|
||||
.enemyMoveset(SPLASH_ONLY)
|
||||
.enemyMoveset(Moves.SPLASH)
|
||||
.startingLevel(5)
|
||||
.enemyLevel(5);
|
||||
|
||||
@ -82,7 +81,7 @@ describe("Moves - Dragon Tail", () => {
|
||||
test(
|
||||
"Double battles should proceed without crashing",
|
||||
async () => {
|
||||
game.override.battleType("double").enemyMoveset(SPLASH_ONLY);
|
||||
game.override.battleType("double").enemyMoveset(Moves.SPLASH);
|
||||
game.override.moveset([Moves.DRAGON_TAIL, Moves.SPLASH, Moves.FLAMETHROWER])
|
||||
.enemyAbility(Abilities.ROUGH_SKIN);
|
||||
await game.startBattle([Species.DRATINI, Species.DRATINI, Species.WAILORD, Species.WAILORD]);
|
||||
@ -116,7 +115,7 @@ describe("Moves - Dragon Tail", () => {
|
||||
test(
|
||||
"Flee move redirection works",
|
||||
async () => {
|
||||
game.override.battleType("double").enemyMoveset(SPLASH_ONLY);
|
||||
game.override.battleType("double").enemyMoveset(Moves.SPLASH);
|
||||
game.override.moveset([Moves.DRAGON_TAIL, Moves.SPLASH, Moves.FLAMETHROWER]);
|
||||
game.override.enemyAbility(Abilities.ROUGH_SKIN);
|
||||
await game.startBattle([Species.DRATINI, Species.DRATINI, Species.WAILORD, Species.WAILORD]);
|
||||
|
@ -3,7 +3,6 @@ import { Moves } from "#enums/moves";
|
||||
import { Species } from "#enums/species";
|
||||
import Phaser from "phaser";
|
||||
import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest";
|
||||
import { SPLASH_ONLY } from "../utils/testUtils";
|
||||
|
||||
describe("Moves - Fake Out", () => {
|
||||
let phaserGame: Phaser.Game;
|
||||
@ -26,7 +25,7 @@ describe("Moves - Fake Out", () => {
|
||||
.enemySpecies(Species.CORVIKNIGHT)
|
||||
.starterSpecies(Species.FEEBAS)
|
||||
.moveset([Moves.FAKE_OUT, Moves.SPLASH])
|
||||
.enemyMoveset(SPLASH_ONLY)
|
||||
.enemyMoveset(Moves.SPLASH)
|
||||
.disableCrits();
|
||||
});
|
||||
|
||||
|
@ -4,7 +4,6 @@ import { Moves } from "#enums/moves";
|
||||
import { Species } from "#enums/species";
|
||||
import { Stat } from "#enums/stat";
|
||||
import GameManager from "#test/utils/gameManager";
|
||||
import { SPLASH_ONLY } from "#test/utils/testUtils";
|
||||
import Phaser from "phaser";
|
||||
import { afterEach, beforeAll, beforeEach, describe, expect, test } from "vitest";
|
||||
|
||||
@ -35,7 +34,7 @@ describe("Moves - FILLET AWAY", () => {
|
||||
game.override.startingLevel(100);
|
||||
game.override.enemyLevel(100);
|
||||
game.override.moveset([Moves.FILLET_AWAY]);
|
||||
game.override.enemyMoveset(SPLASH_ONLY);
|
||||
game.override.enemyMoveset(Moves.SPLASH);
|
||||
});
|
||||
|
||||
//Bulbapedia Reference: https://bulbapedia.bulbagarden.net/wiki/fillet_away_(move)
|
||||
|
@ -6,7 +6,6 @@ import { TurnEndPhase } from "#app/phases/turn-end-phase";
|
||||
import { Abilities } from "#enums/abilities";
|
||||
import { Moves } from "#enums/moves";
|
||||
import GameManager from "#test/utils/gameManager";
|
||||
import { SPLASH_ONLY } from "#test/utils/testUtils";
|
||||
import Phaser from "phaser";
|
||||
import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest";
|
||||
|
||||
@ -38,7 +37,7 @@ describe("Moves - Fissure", () => {
|
||||
game.override.startingLevel(100);
|
||||
|
||||
game.override.enemySpecies(Species.SNORLAX);
|
||||
game.override.enemyMoveset(SPLASH_ONLY);
|
||||
game.override.enemyMoveset(Moves.SPLASH);
|
||||
game.override.enemyPassiveAbility(Abilities.BALL_FETCH);
|
||||
game.override.enemyLevel(100);
|
||||
|
||||
|
@ -42,7 +42,7 @@ describe("Moves - Flame Burst", () => {
|
||||
game.override.startingWave(4);
|
||||
game.override.enemySpecies(Species.SHUCKLE);
|
||||
game.override.enemyAbility(Abilities.BALL_FETCH);
|
||||
game.override.enemyMoveset(new Array(4).fill(Moves.SPLASH));
|
||||
game.override.enemyMoveset([Moves.SPLASH]);
|
||||
});
|
||||
|
||||
it("inflicts damage to the target's ally equal to 1/16 of its max HP", async () => {
|
||||
|
@ -7,7 +7,6 @@ import { Abilities } from "#enums/abilities";
|
||||
import { Moves } from "#enums/moves";
|
||||
import { Species } from "#enums/species";
|
||||
import GameManager from "#test/utils/gameManager";
|
||||
import { SPLASH_ONLY } from "#test/utils/testUtils";
|
||||
import Phaser from "phaser";
|
||||
import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest";
|
||||
|
||||
@ -31,7 +30,7 @@ describe("Moves - Flower Shield", () => {
|
||||
game.override.enemyAbility(Abilities.NONE);
|
||||
game.override.battleType("single");
|
||||
game.override.moveset([Moves.FLOWER_SHIELD, Moves.SPLASH]);
|
||||
game.override.enemyMoveset(SPLASH_ONLY);
|
||||
game.override.enemyMoveset(Moves.SPLASH);
|
||||
});
|
||||
|
||||
it("raises DEF stat stage by 1 for all Grass-type Pokemon on the field by one stage - single battle", async () => {
|
||||
|
@ -7,7 +7,6 @@ import { Abilities } from "#enums/abilities";
|
||||
import { Moves } from "#enums/moves";
|
||||
import { Species } from "#enums/species";
|
||||
import GameManager from "#test/utils/gameManager";
|
||||
import { SPLASH_ONLY } from "#test/utils/testUtils";
|
||||
import Phaser from "phaser";
|
||||
import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest";
|
||||
|
||||
@ -35,7 +34,7 @@ describe("Moves - Focus Punch", () => {
|
||||
.moveset([Moves.FOCUS_PUNCH])
|
||||
.enemySpecies(Species.GROUDON)
|
||||
.enemyAbility(Abilities.INSOMNIA)
|
||||
.enemyMoveset(SPLASH_ONLY)
|
||||
.enemyMoveset(Moves.SPLASH)
|
||||
.startingLevel(100)
|
||||
.enemyLevel(100);
|
||||
});
|
||||
@ -68,7 +67,7 @@ describe("Moves - Focus Punch", () => {
|
||||
it(
|
||||
"should fail if the user is hit",
|
||||
async () => {
|
||||
game.override.enemyMoveset(Array(4).fill(Moves.TACKLE));
|
||||
game.override.enemyMoveset([Moves.TACKLE]);
|
||||
|
||||
await game.startBattle([Species.CHARIZARD]);
|
||||
|
||||
@ -95,7 +94,7 @@ describe("Moves - Focus Punch", () => {
|
||||
it(
|
||||
"should be cancelled if the user falls asleep mid-turn",
|
||||
async () => {
|
||||
game.override.enemyMoveset(Array(4).fill(Moves.SPORE));
|
||||
game.override.enemyMoveset([Moves.SPORE]);
|
||||
|
||||
await game.startBattle([Species.CHARIZARD]);
|
||||
|
||||
|
@ -4,7 +4,6 @@ import { MoveEffectPhase } from "#app/phases/move-effect-phase";
|
||||
import GameManager from "#test/utils/gameManager";
|
||||
import Phaser from "phaser";
|
||||
import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest";
|
||||
import { SPLASH_ONLY } from "../utils/testUtils";
|
||||
|
||||
describe("Moves - Foresight", () => {
|
||||
let phaserGame: Phaser.Game;
|
||||
@ -25,7 +24,7 @@ describe("Moves - Foresight", () => {
|
||||
game.override
|
||||
.disableCrits()
|
||||
.enemySpecies(Species.GASTLY)
|
||||
.enemyMoveset(SPLASH_ONLY)
|
||||
.enemyMoveset(Moves.SPLASH)
|
||||
.enemyLevel(5)
|
||||
.starterSpecies(Species.MAGIKARP)
|
||||
.moveset([Moves.FORESIGHT, Moves.QUICK_ATTACK, Moves.MACH_PUNCH]);
|
||||
@ -55,7 +54,7 @@ describe("Moves - Foresight", () => {
|
||||
});
|
||||
|
||||
it("should ignore target's evasiveness boosts", async () => {
|
||||
game.override.enemyMoveset(Array(4).fill(Moves.MINIMIZE));
|
||||
game.override.enemyMoveset([Moves.MINIMIZE]);
|
||||
await game.startBattle();
|
||||
|
||||
const pokemon = game.scene.getPlayerPokemon()!;
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user