fix nit
This commit is contained in:
parent
1e9a2a749d
commit
cf8f778dd3
|
@ -4562,7 +4562,7 @@ export class IllusionPreSummonAbAttr extends PreSummonAbAttr {
|
|||
*/
|
||||
applyPreSummon(pokemon: Pokemon, passive: boolean, args: any[]): boolean {
|
||||
let suppressed = false;
|
||||
console.log("PRESUMMONILLUSION : ", pokemon.name)
|
||||
console.log("PRESUMMONILLUSION : ", pokemon.name);
|
||||
pokemon.scene.getField(true).filter(p => p !== pokemon).map(p => {
|
||||
if ((p.getAbility().hasAttr(SuppressFieldAbilitiesAbAttr) && p.canApplyAbility()) || (p.getPassiveAbility().hasAttr(SuppressFieldAbilitiesAbAttr) && p.canApplyAbility(true))) {
|
||||
suppressed = true;
|
||||
|
|
|
@ -399,10 +399,10 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
|
|||
*/
|
||||
generateIllusion(): boolean {
|
||||
if (this.hasTrainer()) {
|
||||
console.log("GENERATEILLUSION() : ", this.name)
|
||||
console.log("GENERATEILLUSION() : ", this.name);
|
||||
const party: Pokemon[] = (this.isPlayer() ? this.scene.getParty() : this.scene.getEnemyParty()).filter(p => p.isAllowedInBattle());
|
||||
const lastPokemon: Pokemon = party.filter(p => p !== this).at(-1) || this;
|
||||
console.log(lastPokemon.name)
|
||||
console.log(lastPokemon.name);
|
||||
const speciesId = lastPokemon.species.speciesId;
|
||||
|
||||
if ( lastPokemon === this || this.illusion.active ||
|
||||
|
@ -475,12 +475,12 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
|
|||
this.name = randomIllusion.name;
|
||||
this.loadAssets(false, true).then(() => this.playAnim());
|
||||
}
|
||||
console.log("L'ILLUSION : ", this.illusion)
|
||||
console.log("L'ILLUSION : ", this.illusion);
|
||||
return true;
|
||||
}
|
||||
|
||||
breakIllusion(): boolean {
|
||||
console.log("BREAKILLUSION")
|
||||
console.log("BREAKILLUSION");
|
||||
if (!this.illusion.active) {
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -18,27 +18,27 @@ describe("Abilities - Illusion", () => {
|
|||
beforeAll(() => {
|
||||
phaserGame = new Phaser.Game({
|
||||
type: Phaser.HEADLESS,
|
||||
});
|
||||
});
|
||||
} );
|
||||
} );
|
||||
|
||||
afterEach(() => {
|
||||
game.phaseInterceptor.restoreOg();
|
||||
});
|
||||
} );
|
||||
|
||||
beforeEach(() => {
|
||||
game = new GameManager(phaserGame);
|
||||
game.override.battleType("single");
|
||||
game.override.enemySpecies(Species.ZORUA);
|
||||
game.override.enemyAbility(Abilities.ILLUSION);
|
||||
game.override.enemyMoveset([Moves.TACKLE, Moves.TACKLE, Moves.TACKLE, Moves.TACKLE]);
|
||||
game.override.enemyHeldItems([{name: "WIDE_LENS", count: 3}]);
|
||||
game.override.enemyMoveset([ Moves.TACKLE, Moves.TACKLE, Moves.TACKLE, Moves.TACKLE ] );
|
||||
game.override.enemyHeldItems([ { name: "WIDE_LENS", count: 3 } ] );
|
||||
|
||||
game.override.moveset([Moves.WORRY_SEED, Moves.SOAK, Moves.TACKLE, Moves.TACKLE]);
|
||||
game.override.startingHeldItems([{name: "WIDE_LENS", count: 3}]);
|
||||
});
|
||||
game.override.moveset([ Moves.WORRY_SEED, Moves.SOAK, Moves.TACKLE, Moves.TACKLE ] );
|
||||
game.override.startingHeldItems([ { name: "WIDE_LENS", count: 3 } ] );
|
||||
} );
|
||||
|
||||
it("creates illusion at the start", async () => {
|
||||
await game.startBattle([Species.ZOROARK, Species.AXEW]);
|
||||
await game.startBattle([ Species.ZOROARK, Species.AXEW ] );
|
||||
|
||||
const zoroark = game.scene.getPlayerPokemon()!;
|
||||
const zorua = game.scene.getEnemyPokemon()!;
|
||||
|
@ -46,10 +46,10 @@ describe("Abilities - Illusion", () => {
|
|||
expect(zoroark.illusion.active).equals(true);
|
||||
expect(zorua.illusion.active).equals(true);
|
||||
expect(zoroark.illusion.available).equals(false);
|
||||
});
|
||||
} );
|
||||
|
||||
it("break after receiving damaging move", async () => {
|
||||
await game.startBattle([Species.AXEW]);
|
||||
await game.startBattle([ Species.AXEW ] );
|
||||
game.move.select(Moves.TACKLE);
|
||||
|
||||
await game.phaseInterceptor.to(TurnEndPhase);
|
||||
|
@ -57,10 +57,10 @@ describe("Abilities - Illusion", () => {
|
|||
const zorua = game.scene.getEnemyPokemon()!;
|
||||
|
||||
expect(zorua.illusion.active).equals(false);
|
||||
});
|
||||
} );
|
||||
|
||||
it("break after getting ability changed", async () => {
|
||||
await game.startBattle([Species.AXEW]);
|
||||
await game.startBattle([ Species.AXEW ] );
|
||||
game.move.select(Moves.WORRY_SEED);
|
||||
|
||||
await game.phaseInterceptor.to(TurnEndPhase);
|
||||
|
@ -68,38 +68,38 @@ describe("Abilities - Illusion", () => {
|
|||
const zorua = game.scene.getEnemyPokemon()!;
|
||||
|
||||
expect(zorua.illusion.active).equals(false);
|
||||
});
|
||||
} );
|
||||
|
||||
it("break if the ability is suppressed", async () => {
|
||||
game.override.enemyAbility(Abilities.NEUTRALIZING_GAS);
|
||||
await game.startBattle([Species.KOFFING]);
|
||||
await game.startBattle([ Species.KOFFING ] );
|
||||
|
||||
const zorua = game.scene.getEnemyPokemon()!;
|
||||
|
||||
expect(zorua.illusion.active).equals(false);
|
||||
});
|
||||
} );
|
||||
|
||||
it("trick the enemy AI for moves effectiveness using ILLUSION type instead of actual type", async () => {
|
||||
game.override.enemyMoveset([Moves.FLAMETHROWER, Moves.PSYCHIC, Moves.TACKLE, Moves.TACKLE]);
|
||||
await game.startBattle([Species.ZOROARK, Species.AXEW]);
|
||||
game.override.enemyMoveset([ Moves.FLAMETHROWER, Moves.PSYCHIC, Moves.TACKLE, Moves.TACKLE ] );
|
||||
await game.startBattle([ Species.ZOROARK, Species.AXEW ] );
|
||||
|
||||
const enemy = game.scene.getEnemyPokemon()!;
|
||||
const zoroark = game.scene.getPlayerPokemon()!;
|
||||
|
||||
const flameThrower = enemy.getMoveset()[0]!.getMove();
|
||||
const psychic = enemy.getMoveset()[1]!.getMove();
|
||||
const flameThrower = enemy.getMoveset()[ 0] !.getMove();
|
||||
const psychic = enemy.getMoveset()[ 1] !.getMove();
|
||||
const flameThrowerEffectiveness = zoroark.getAttackTypeEffectiveness(flameThrower.type, enemy, undefined, undefined, true);
|
||||
const psychicEffectiveness = zoroark.getAttackTypeEffectiveness(psychic.type, enemy, undefined, undefined, true);
|
||||
expect(psychicEffectiveness).above(flameThrowerEffectiveness);
|
||||
});
|
||||
} );
|
||||
|
||||
it("do not breaks if the pokemon takes indirect damages", async () => {
|
||||
game.override.enemySpecies(Species.GIGALITH);
|
||||
game.override.enemyAbility(Abilities.SAND_STREAM);
|
||||
game.override.enemyMoveset([Moves.WILL_O_WISP, Moves.WILL_O_WISP, Moves.WILL_O_WISP, Moves.WILL_O_WISP]);
|
||||
game.override.moveset([Moves.FLARE_BLITZ]);
|
||||
game.override.enemyMoveset([ Moves.WILL_O_WISP, Moves.WILL_O_WISP, Moves.WILL_O_WISP, Moves.WILL_O_WISP ] );
|
||||
game.override.moveset([ Moves.FLARE_BLITZ ] );
|
||||
|
||||
await game.startBattle([Species.ZOROARK, Species.AZUMARILL]);
|
||||
await game.startBattle([ Species.ZOROARK, Species.AZUMARILL ] );
|
||||
|
||||
game.move.select(Moves.FLARE_BLITZ);
|
||||
|
||||
|
@ -108,12 +108,12 @@ describe("Abilities - Illusion", () => {
|
|||
const zoroark = game.scene.getPlayerPokemon()!;
|
||||
|
||||
expect(zoroark.illusion.active).equals(true);
|
||||
});
|
||||
} );
|
||||
|
||||
it("copy the the name, the nickname, the gender, the shininess and the pokeball of the pokemon", async () => {
|
||||
vi.spyOn(overrides, "OPP_MOVESET_OVERRIDE", "get").mockReturnValue([Moves.SCARY_FACE, Moves.SCARY_FACE, Moves.SCARY_FACE, Moves.SCARY_FACE]);
|
||||
vi.spyOn(overrides, "OPP_MOVESET_OVERRIDE", "get").mockReturnValue([ Moves.SCARY_FACE, Moves.SCARY_FACE, Moves.SCARY_FACE, Moves.SCARY_FACE ] );
|
||||
|
||||
await game.startBattle([Species.ABRA, Species.ZOROARK, Species.AXEW]);
|
||||
await game.startBattle([ Species.ABRA, Species.ZOROARK, Species.AXEW ] );
|
||||
|
||||
const axew = game.scene.getParty().at(2)!;
|
||||
axew.shiny = true;
|
||||
|
@ -126,11 +126,11 @@ describe("Abilities - Illusion", () => {
|
|||
await game.phaseInterceptor.to(TurnEndPhase);
|
||||
|
||||
const zoroark = game.scene.getPlayerPokemon()!;
|
||||
console.log(zoroark.illusion)
|
||||
console.log(zoroark.illusion);
|
||||
expect(zoroark.name).equals("Axew");
|
||||
expect(zoroark.getNameToRender()).equals("axew nickname");
|
||||
expect(zoroark.getGender(false, true)).equals(Gender.FEMALE);
|
||||
expect(zoroark.isShiny(true)).equals(true);
|
||||
expect(zoroark.illusion.pokeball).equals(PokeballType.GREAT_BALL);
|
||||
});
|
||||
});
|
||||
} );
|
||||
} );
|
||||
|
|
Loading…
Reference in New Issue