mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-07-20 07:12:32 +02:00
review corrections
This commit is contained in:
parent
f9eb01d466
commit
377aafa85c
@ -5245,14 +5245,13 @@ export class IllusionBreakAbAttr extends PostDefendAbAttr {
|
|||||||
* @param args - unused
|
* @param args - unused
|
||||||
* @returns - Whether the illusion was destroyed.
|
* @returns - Whether the illusion was destroyed.
|
||||||
*/
|
*/
|
||||||
applyPostDefend(pokemon: Pokemon, passive: boolean, simulated: boolean, attacker: Pokemon, move: Move, hitResult: HitResult, args: any[]): boolean {
|
override applyPostDefend(pokemon: Pokemon, passive: boolean, simulated: boolean, attacker: Pokemon, move: Move, hitResult: HitResult, args: any[]): void {
|
||||||
|
|
||||||
const breakIllusion: HitResult[] = [ HitResult.EFFECTIVE, HitResult.SUPER_EFFECTIVE, HitResult.NOT_VERY_EFFECTIVE, HitResult.ONE_HIT_KO ];
|
|
||||||
if (!breakIllusion.includes(hitResult)) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
pokemon.breakIllusion();
|
pokemon.breakIllusion();
|
||||||
return true;
|
}
|
||||||
|
|
||||||
|
override canApplyPostDefend(pokemon: Pokemon, passive: boolean, simulated: boolean, attacker: Pokemon, move: Move, hitResult: HitResult, args: any[]): boolean {
|
||||||
|
const breakIllusion: HitResult[] = [ HitResult.EFFECTIVE, HitResult.SUPER_EFFECTIVE, HitResult.NOT_VERY_EFFECTIVE, HitResult.ONE_HIT_KO ];
|
||||||
|
return breakIllusion.includes(hitResult) && pokemon.battleData.illusion.active
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -5265,10 +5264,9 @@ export class IllusionPostBattleAbAttr extends PostBattleAbAttr {
|
|||||||
* @param {...any} args - N/A
|
* @param {...any} args - N/A
|
||||||
* @returns {boolean} - Whether the illusion was applied.
|
* @returns {boolean} - Whether the illusion was applied.
|
||||||
*/
|
*/
|
||||||
applyPostBattle(pokemon: Pokemon, passive: boolean, simulated:boolean, args: any[]): boolean {
|
override applyPostBattle(pokemon: Pokemon, passive: boolean, simulated:boolean, args: any[]): void {
|
||||||
pokemon.breakIllusion();
|
pokemon.breakIllusion();
|
||||||
pokemon.battleData.illusion.available = true;
|
pokemon.battleData.illusion.available = true;
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -735,10 +735,12 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
|
|||||||
} else {
|
} else {
|
||||||
let availables: Species[] = [];
|
let availables: Species[] = [];
|
||||||
let randomIllusion: PokemonSpecies = globalScene.arena.randomSpecies(globalScene.currentBattle.waveIndex, this.level);
|
let randomIllusion: PokemonSpecies = globalScene.arena.randomSpecies(globalScene.currentBattle.waveIndex, this.level);
|
||||||
|
/*
|
||||||
if (this.isBoss()) {
|
if (this.isBoss()) {
|
||||||
availables = [ Species.ENTEI, Species.RAIKOU, Species.SUICUNE ];
|
availables = [ Species.ENTEI, Species.RAIKOU, Species.SUICUNE ];
|
||||||
randomIllusion = getPokemonSpecies(availables[this.randSeedInt(availables.length)]);
|
randomIllusion = getPokemonSpecies(availables[this.randSeedInt(availables.length)]);
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
this.battleData.illusion = {
|
this.battleData.illusion = {
|
||||||
active: true,
|
active: true,
|
||||||
@ -1857,6 +1859,11 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param fakeShininess - Whether we want the fake or real shininess (illusion ability).
|
||||||
|
* @returns `true` if the {@linkcode Pokemon} is shiny and the fusion is shiny as well, `false` otherwise
|
||||||
|
*/
|
||||||
isDoubleShiny(fakeShininess: boolean = false): boolean {
|
isDoubleShiny(fakeShininess: boolean = false): boolean {
|
||||||
if (!fakeShininess && this.battleData?.illusion.active) {
|
if (!fakeShininess && this.battleData?.illusion.active) {
|
||||||
return this.isFusion(false) && this.battleData?.illusion.basePokemon!.shiny && this.battleData?.illusion.basePokemon.fusionShiny;
|
return this.isFusion(false) && this.battleData?.illusion.basePokemon!.shiny && this.battleData?.illusion.basePokemon.fusionShiny;
|
||||||
|
@ -6,6 +6,7 @@ import i18next from "i18next";
|
|||||||
/**
|
/**
|
||||||
* Retrieves the Pokemon's name, potentially with an affix indicating its role (wild or foe) in the current battle context, translated
|
* Retrieves the Pokemon's name, potentially with an affix indicating its role (wild or foe) in the current battle context, translated
|
||||||
* @param pokemon {@linkcode Pokemon} name and battle context will be retrieved from this instance
|
* @param pokemon {@linkcode Pokemon} name and battle context will be retrieved from this instance
|
||||||
|
* @param {boolean} useIllusion - Whether we want the name of the illusion or not. Default value : true
|
||||||
* @returns {string} ex: "Wild Gengar", "Ectoplasma sauvage"
|
* @returns {string} ex: "Wild Gengar", "Ectoplasma sauvage"
|
||||||
*/
|
*/
|
||||||
export function getPokemonNameWithAffix(pokemon: Pokemon | undefined, useIllusion = true): string {
|
export function getPokemonNameWithAffix(pokemon: Pokemon | undefined, useIllusion = true): string {
|
||||||
|
@ -28,10 +28,10 @@ describe("Abilities - Illusion", () => {
|
|||||||
game.override.battleType("single");
|
game.override.battleType("single");
|
||||||
game.override.enemySpecies(Species.ZORUA);
|
game.override.enemySpecies(Species.ZORUA);
|
||||||
game.override.enemyAbility(Abilities.ILLUSION);
|
game.override.enemyAbility(Abilities.ILLUSION);
|
||||||
game.override.enemyMoveset([Moves.TACKLE, Moves.TACKLE, Moves.TACKLE, Moves.TACKLE]);
|
game.override.enemyMoveset(Moves.TACKLE);
|
||||||
game.override.enemyHeldItems([{ name: "WIDE_LENS", count: 3 }]);
|
game.override.enemyHeldItems([{ name: "WIDE_LENS", count: 3 }]);
|
||||||
|
|
||||||
game.override.moveset([Moves.WORRY_SEED, Moves.SOAK, Moves.TACKLE, Moves.TACKLE]);
|
game.override.moveset([Moves.WORRY_SEED, Moves.SOAK, Moves.TACKLE]);
|
||||||
game.override.startingHeldItems([{ name: "WIDE_LENS", count: 3 }]);
|
game.override.startingHeldItems([{ name: "WIDE_LENS", count: 3 }]);
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -108,7 +108,7 @@ describe("Abilities - Illusion", () => {
|
|||||||
it("does not break from indirect damage", async () => {
|
it("does not break from indirect damage", async () => {
|
||||||
game.override.enemySpecies(Species.GIGALITH);
|
game.override.enemySpecies(Species.GIGALITH);
|
||||||
game.override.enemyAbility(Abilities.SAND_STREAM);
|
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.enemyMoveset(Moves.WILL_O_WISP);
|
||||||
game.override.moveset([Moves.FLARE_BLITZ]);
|
game.override.moveset([Moves.FLARE_BLITZ]);
|
||||||
|
|
||||||
await game.classicMode.startBattle([Species.ZOROARK, Species.AZUMARILL]);
|
await game.classicMode.startBattle([Species.ZOROARK, Species.AZUMARILL]);
|
||||||
@ -122,9 +122,9 @@ describe("Abilities - Illusion", () => {
|
|||||||
expect(zoroark.battleData.illusion.active).equals(true);
|
expect(zoroark.battleData.illusion.active).equals(true);
|
||||||
});
|
});
|
||||||
|
|
||||||
it("copy the the name, the nickname, the gender, the shininess and the pokeball of the pokemon", async () => {
|
it("copies the the name, nickname, gender, shininess, and pokeball from the illusion source", async () => {
|
||||||
await game.classicMode.startBattle([Species.ABRA, Species.ZOROARK, Species.AXEW]).enemyMoveset([Moves.SPLASH]);
|
game.override.enemyMoveset(Moves.SPLASH);
|
||||||
|
await game.classicMode.startBattle([Species.ABRA, Species.ZOROARK, Species.AXEW]);
|
||||||
const axew = game.scene.getPlayerParty().at(2)!;
|
const axew = game.scene.getPlayerParty().at(2)!;
|
||||||
axew.shiny = true;
|
axew.shiny = true;
|
||||||
axew.nickname = btoa(unescape(encodeURIComponent("axew nickname")));
|
axew.nickname = btoa(unescape(encodeURIComponent("axew nickname")));
|
||||||
|
Loading…
Reference in New Issue
Block a user