Fixed dancer fr fr
This commit is contained in:
parent
110fd2f0a1
commit
d116f3f4e2
|
@ -64,8 +64,8 @@ import { MoveCategory } from "#enums/MoveCategory";
|
|||
|
||||
|
||||
// Type imports
|
||||
import type { EnemyPokemon, PokemonMove } from "#app/field/pokemon";
|
||||
import type Pokemon from "#app/field/pokemon";
|
||||
import { EnemyPokemon, PokemonMove } from "#app/field/pokemon";
|
||||
import Pokemon from "#app/field/pokemon";
|
||||
import type { Weather } from "#app/data/weather";
|
||||
import type { BattlerTag } from "#app/data/battler-tags";
|
||||
import type { AbAttrCondition, PokemonDefendCondition, PokemonStatStageChangeCondition, PokemonAttackCondition, AbAttrApplyFunc, AbAttrSuccessFunc } from "#app/@types/ability-types";
|
||||
|
@ -3262,13 +3262,13 @@ export class ConditionalUserFieldStatusEffectImmunityAbAttr extends UserFieldSta
|
|||
|
||||
/**
|
||||
* Conditionally provides immunity to stat drop effects to the user's field.
|
||||
*
|
||||
*
|
||||
* Used by {@linkcode Abilities.FLOWER_VEIL | Flower Veil}.
|
||||
*/
|
||||
export class ConditionalUserFieldProtectStatAbAttr extends PreStatStageChangeAbAttr {
|
||||
/** {@linkcode BattleStat} to protect or `undefined` if **all** {@linkcode BattleStat} are protected */
|
||||
protected protectedStat?: BattleStat;
|
||||
|
||||
|
||||
/** If the method evaluates to true, the stat will be protected. */
|
||||
protected condition: (target: Pokemon) => boolean;
|
||||
|
||||
|
@ -3285,7 +3285,7 @@ export class ConditionalUserFieldProtectStatAbAttr extends PreStatStageChangeAbA
|
|||
* @param stat The stat being affected
|
||||
* @param cancelled Holds whether the stat change was already prevented.
|
||||
* @param args Args[0] is the target pokemon of the stat change.
|
||||
* @returns
|
||||
* @returns
|
||||
*/
|
||||
override canApplyPreStatStageChange(pokemon: Pokemon, passive: boolean, simulated: boolean, stat: BattleStat, cancelled: BooleanHolder, args: [Pokemon, ...any]): boolean {
|
||||
const target = args[0];
|
||||
|
@ -3417,7 +3417,7 @@ export class BonusCritAbAttr extends AbAttr {
|
|||
|
||||
/**
|
||||
* Apply the bonus crit ability by increasing the value in the provided number holder by 1
|
||||
*
|
||||
*
|
||||
* @param pokemon The pokemon with the BonusCrit ability (unused)
|
||||
* @param passive Unused
|
||||
* @param simulated Unused
|
||||
|
@ -3570,7 +3570,7 @@ export class PreWeatherEffectAbAttr extends AbAttr {
|
|||
args: any[]): boolean {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
applyPreWeatherEffect(
|
||||
pokemon: Pokemon,
|
||||
passive: boolean,
|
||||
|
@ -4341,13 +4341,16 @@ export class PostDancingMoveAbAttr extends PostMoveUsedAbAttr {
|
|||
simulated: boolean,
|
||||
args: any[]): void {
|
||||
if (!simulated) {
|
||||
const m = move.getMove();
|
||||
const newMove = new PokemonMove(m.id, 0, 0, true) // mark new move as virtual for instruct & co
|
||||
|
||||
// If the move is an AttackMove or a StatusMove the Dancer must replicate the move on the source of the Dance
|
||||
if (move.getMove() instanceof AttackMove || move.getMove() instanceof StatusMove) {
|
||||
if (m instanceof AttackMove || m instanceof StatusMove) {
|
||||
const target = this.getTarget(dancer, source, targets);
|
||||
globalScene.unshiftPhase(new MovePhase(dancer, target, move, true, true));
|
||||
} else if (move.getMove() instanceof SelfStatusMove) {
|
||||
globalScene.unshiftPhase(new MovePhase(dancer, target, newMove, true, true));
|
||||
} else if (m instanceof SelfStatusMove) {
|
||||
// If the move is a SelfStatusMove (ie. Swords Dance) the Dancer should replicate it on itself
|
||||
globalScene.unshiftPhase(new MovePhase(dancer, [ dancer.getBattlerIndex() ], move, true, true));
|
||||
globalScene.unshiftPhase(new MovePhase(dancer, [ dancer.getBattlerIndex() ], newMove, true, true));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -5057,7 +5060,7 @@ export class PostSummonStatStageChangeOnArenaAbAttr extends PostSummonStatStageC
|
|||
/**
|
||||
* Takes no damage from the first hit of a damaging move.
|
||||
* This is used in the Disguise and Ice Face abilities.
|
||||
*
|
||||
*
|
||||
* Does not apply to a user's substitute
|
||||
* @extends ReceivedMoveDamageMultiplierAbAttr
|
||||
*/
|
||||
|
@ -5150,7 +5153,7 @@ export class IllusionPreSummonAbAttr extends PreSummonAbAttr {
|
|||
|
||||
// If the last conscious Pokémon in the party is a Terastallized Ogerpon or Terapagos, Illusion will not activate.
|
||||
// Illusion will also not activate if the Pokémon with Illusion is Terastallized and the last Pokémon in the party is Ogerpon or Terapagos.
|
||||
if (
|
||||
if (
|
||||
lastPokemon === pokemon ||
|
||||
((speciesId === Species.OGERPON || speciesId === Species.TERAPAGOS) && (lastPokemon.isTerastallized || pokemon.isTerastallized))
|
||||
) {
|
||||
|
|
|
@ -63,40 +63,56 @@ describe("Abilities - Dancer", () => {
|
|||
expect(oricorio.moveset[1]?.ppUsed).toBe(0);
|
||||
});
|
||||
|
||||
// TODO: Enable after Dancer rework to not push to move history
|
||||
it.todo("should not count as the last move used for mirror move/instruct", async () => {
|
||||
// TODO: Enable once i figure stuff out
|
||||
it.todo("should copy copied dance moves from mirror move", async () => {
|
||||
game.override
|
||||
.moveset([Moves.FIERY_DANCE, Moves.REVELATION_DANCE])
|
||||
.enemyMoveset([Moves.INSTRUCT, Moves.MIRROR_MOVE, Moves.SPLASH])
|
||||
.enemyMoveset([Moves.MIRROR_MOVE, Moves.SPLASH])
|
||||
.enemySpecies(Species.SHUCKLE)
|
||||
.enemyLevel(10);
|
||||
await game.classicMode.startBattle([Species.ORICORIO, Species.FEEBAS]);
|
||||
|
||||
const [oricorio] = game.scene.getPlayerField();
|
||||
const [, shuckle2] = game.scene.getEnemyField();
|
||||
const [, shuckle2] = game.scene.getPlayerParty();
|
||||
|
||||
game.move.select(Moves.REVELATION_DANCE, BattlerIndex.PLAYER, BattlerIndex.ENEMY_2);
|
||||
game.move.select(Moves.FIERY_DANCE, BattlerIndex.PLAYER_2, BattlerIndex.ENEMY_2);
|
||||
await game.forceEnemyMove(Moves.INSTRUCT, BattlerIndex.PLAYER);
|
||||
await game.forceEnemyMove(Moves.SPLASH, BattlerIndex.PLAYER);
|
||||
await game.forceEnemyMove(Moves.MIRROR_MOVE, BattlerIndex.PLAYER);
|
||||
await game.setTurnOrder([BattlerIndex.PLAYER, BattlerIndex.PLAYER_2, BattlerIndex.ENEMY_2, BattlerIndex.ENEMY]);
|
||||
await game.phaseInterceptor.to("MovePhase"); // Oricorio rev dance
|
||||
|
||||
await game.phaseInterceptor.to("TurnEndPhase"); // Oricorio rev dance
|
||||
await game.phaseInterceptor.to("MovePhase"); // Feebas fiery dance
|
||||
await game.phaseInterceptor.to("MovePhase"); // Oricorio fiery dance (from dancer)
|
||||
await game.phaseInterceptor.to("MoveEndPhase", false);
|
||||
// dancer copied move doesn't appear in move history
|
||||
expect(oricorio.getLastXMoves(-1)[0].move).toBe(Moves.REVELATION_DANCE);
|
||||
|
||||
await game.phaseInterceptor.to("MovePhase"); // shuckle 2 mirror moves oricorio
|
||||
await game.phaseInterceptor.to("MovePhase"); // calls instructed rev dance
|
||||
let currentPhase = game.scene.getCurrentPhase() as MovePhase;
|
||||
await game.phaseInterceptor.to("MovePhase"); // shuckle 2 copies oricorio
|
||||
await game.phaseInterceptor.to("MovePhase"); // copied move used
|
||||
|
||||
const currentPhase = game.scene.getCurrentPhase() as MovePhase;
|
||||
expect(currentPhase.pokemon).toBe(shuckle2);
|
||||
expect(currentPhase.move.moveId).toBe(Moves.REVELATION_DANCE);
|
||||
});
|
||||
|
||||
await game.phaseInterceptor.to("MovePhase"); // shuckle 1 instructs oricorio
|
||||
await game.phaseInterceptor.to("MovePhase");
|
||||
currentPhase = game.scene.getCurrentPhase() as MovePhase;
|
||||
expect(currentPhase.pokemon).toBe(oricorio);
|
||||
it("should not count as the last move used for instruct", async () => {
|
||||
game.override
|
||||
.moveset([Moves.FIERY_DANCE, Moves.REVELATION_DANCE])
|
||||
.enemyMoveset([Moves.INSTRUCT, Moves.SPLASH])
|
||||
.enemySpecies(Species.SHUCKLE)
|
||||
.enemyLevel(10);
|
||||
await game.classicMode.startBattle([Species.ORICORIO, Species.FEEBAS]);
|
||||
|
||||
game.move.select(Moves.REVELATION_DANCE, BattlerIndex.PLAYER, BattlerIndex.ENEMY_2);
|
||||
game.move.select(Moves.FIERY_DANCE, BattlerIndex.PLAYER_2, BattlerIndex.ENEMY_2);
|
||||
await game.forceEnemyMove(Moves.SPLASH, BattlerIndex.PLAYER);
|
||||
await game.forceEnemyMove(Moves.INSTRUCT, BattlerIndex.PLAYER);
|
||||
await game.setTurnOrder([BattlerIndex.PLAYER, BattlerIndex.PLAYER_2, BattlerIndex.ENEMY_2, BattlerIndex.ENEMY]);
|
||||
await game.phaseInterceptor.to("TurnEndPhase"); // Oricorio rev dance
|
||||
await game.phaseInterceptor.to("MovePhase"); // Feebas fiery dance
|
||||
await game.phaseInterceptor.to("MovePhase"); // Oricorio fiery dance (from dancer)
|
||||
|
||||
await game.phaseInterceptor.to("MovePhase"); // shuckle 2 instructs oricorio
|
||||
await game.phaseInterceptor.to("MovePhase"); // instructed move used
|
||||
const currentPhase = game.scene.getCurrentPhase() as MovePhase;
|
||||
expect(currentPhase.pokemon).toBe(game.scene.getPlayerPokemon());
|
||||
expect(currentPhase.move.moveId).toBe(Moves.REVELATION_DANCE);
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue