mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-07-08 01:12:17 +02:00
Address Initial NITs
This commit is contained in:
parent
f77bf5351e
commit
3be9b0fdb1
@ -124,7 +124,7 @@ type AbAttrCondition = (pokemon: Pokemon) => boolean;
|
|||||||
|
|
||||||
type PokemonAttackCondition = (user: Pokemon | null, target: Pokemon | null, move: Move) => boolean;
|
type PokemonAttackCondition = (user: Pokemon | null, target: Pokemon | null, move: Move) => boolean;
|
||||||
type PokemonDefendCondition = (target: Pokemon, user: Pokemon, move: Move) => boolean;
|
type PokemonDefendCondition = (target: Pokemon, user: Pokemon, move: Move) => boolean;
|
||||||
type PokemonStatStageChangeCondition = (target: Pokemon, statsChanged: BattleStat[], stages: integer) => boolean;
|
type PokemonStatStageChangeCondition = (target: Pokemon, statsChanged: BattleStat[], stages: number) => boolean;
|
||||||
|
|
||||||
export abstract class AbAttr {
|
export abstract class AbAttr {
|
||||||
public showAbility: boolean;
|
public showAbility: boolean;
|
||||||
@ -206,7 +206,7 @@ export class PostBattleInitStatStageChangeAbAttr extends PostBattleInitAbAttr {
|
|||||||
private stages: number;
|
private stages: number;
|
||||||
private selfTarget: boolean;
|
private selfTarget: boolean;
|
||||||
|
|
||||||
constructor(stats: BattleStat[], stages: integer, selfTarget?: boolean) {
|
constructor(stats: BattleStat[], stages: number, selfTarget?: boolean) {
|
||||||
super();
|
super();
|
||||||
|
|
||||||
this.stats = stats;
|
this.stats = stats;
|
||||||
@ -542,7 +542,7 @@ export class FieldPriorityMoveImmunityAbAttr extends PreDefendAbAttr {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export class PostStatStageChangeAbAttr extends AbAttr {
|
export class PostStatStageChangeAbAttr extends AbAttr {
|
||||||
applyPostStatStageChange(pokemon: Pokemon, simulated: boolean, statsChanged: BattleStat[], levelChanged: integer, selfTarget: boolean, args: any[]): boolean | Promise<boolean> {
|
applyPostStatStageChange(pokemon: Pokemon, simulated: boolean, statsStagesChanged: BattleStat[], levelChanged: integer, selfTarget: boolean, args: any[]): boolean | Promise<boolean> {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -868,7 +868,7 @@ export class PostDefendContactApplyTagChanceAbAttr extends PostDefendAbAttr {
|
|||||||
|
|
||||||
export class PostDefendCritStatStageChangeAbAttr extends PostDefendAbAttr {
|
export class PostDefendCritStatStageChangeAbAttr extends PostDefendAbAttr {
|
||||||
private stat: BattleStat;
|
private stat: BattleStat;
|
||||||
private stages: integer;
|
private stages: number;
|
||||||
|
|
||||||
constructor(stat: BattleStat, stages: number) {
|
constructor(stat: BattleStat, stages: number) {
|
||||||
super();
|
super();
|
||||||
@ -1079,8 +1079,8 @@ export class PostStatStageChangeStatStageChangeAbAttr extends PostStatStageChang
|
|||||||
this.stages = stages;
|
this.stages = stages;
|
||||||
}
|
}
|
||||||
|
|
||||||
applyPostStatStageChange(pokemon: Pokemon, simulated: boolean, statsChanged: BattleStat[], stagesChanged: integer, selfTarget: boolean, args: any[]): boolean {
|
applyPostStatStageChange(pokemon: Pokemon, simulated: boolean, statStagesChanged: BattleStat[], stagesChanged: number, selfTarget: boolean, args: any[]): boolean {
|
||||||
if (this.condition(pokemon, statsChanged, stagesChanged) && !selfTarget) {
|
if (this.condition(pokemon, statStagesChanged, stagesChanged) && !selfTarget) {
|
||||||
if (!simulated) {
|
if (!simulated) {
|
||||||
pokemon.scene.unshiftPhase(new StatStageChangePhase(pokemon.scene, (pokemon).getBattlerIndex(), true, this.statsToChange, this.stages));
|
pokemon.scene.unshiftPhase(new StatStageChangePhase(pokemon.scene, (pokemon).getBattlerIndex(), true, this.statsToChange, this.stages));
|
||||||
}
|
}
|
||||||
@ -3570,7 +3570,7 @@ export class StatStageChangeMultiplierAbAttr extends AbAttr {
|
|||||||
export class StatStageChangeCopyAbAttr extends AbAttr {
|
export class StatStageChangeCopyAbAttr extends AbAttr {
|
||||||
apply(pokemon: Pokemon, passive: boolean, simulated: boolean, cancelled: Utils.BooleanHolder, args: any[]): boolean | Promise<boolean> {
|
apply(pokemon: Pokemon, passive: boolean, simulated: boolean, cancelled: Utils.BooleanHolder, args: any[]): boolean | Promise<boolean> {
|
||||||
if (!simulated) {
|
if (!simulated) {
|
||||||
pokemon.scene.unshiftPhase(new StatStageChangePhase(pokemon.scene, pokemon.getBattlerIndex(), true, (args[0] as BattleStat[]), (args[1] as integer), true, false, false));
|
pokemon.scene.unshiftPhase(new StatStageChangePhase(pokemon.scene, pokemon.getBattlerIndex(), true, (args[0] as BattleStat[]), (args[1] as number), true, false, false));
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -27,16 +27,17 @@ describe("Abilities - Beast Boost", () => {
|
|||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
game = new GameManager(phaserGame);
|
game = new GameManager(phaserGame);
|
||||||
game.override.battleType("single");
|
game.override
|
||||||
game.override.enemySpecies(Species.BULBASAUR);
|
.battleType("single")
|
||||||
game.override.enemyAbility(Abilities.BEAST_BOOST);
|
.enemySpecies(Species.BULBASAUR)
|
||||||
game.override.ability(Abilities.BEAST_BOOST);
|
.enemyAbility(Abilities.BEAST_BOOST)
|
||||||
game.override.startingLevel(2000);
|
.ability(Abilities.BEAST_BOOST)
|
||||||
game.override.moveset([ Moves.FLAMETHROWER ]);
|
.startingLevel(2000)
|
||||||
game.override.enemyMoveset(SPLASH_ONLY);
|
.moveset([ Moves.FLAMETHROWER ])
|
||||||
|
.enemyMoveset(SPLASH_ONLY);
|
||||||
});
|
});
|
||||||
|
|
||||||
// Note that both MOXIE and BEAST_BOOST test for their current implementation and not the mainline behavior.
|
// Note that both MOXIE and BEAST_BOOST test for their current implementation and not their mainline behavior.
|
||||||
it("should prefer highest stat to boost its corresponding stat stage by 1 when winning a battle", async() => {
|
it("should prefer highest stat to boost its corresponding stat stage by 1 when winning a battle", async() => {
|
||||||
// SLOWBRO's highest stat is DEF, so it should be picked here
|
// SLOWBRO's highest stat is DEF, so it should be picked here
|
||||||
await game.startBattle([
|
await game.startBattle([
|
||||||
|
@ -22,11 +22,12 @@ describe("Abilities - Contrary", () => {
|
|||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
game = new GameManager(phaserGame);
|
game = new GameManager(phaserGame);
|
||||||
game.override.battleType("single");
|
game.override
|
||||||
game.override.enemySpecies(Species.BULBASAUR);
|
.battleType("single")
|
||||||
game.override.enemyAbility(Abilities.CONTRARY);
|
.enemySpecies(Species.BULBASAUR)
|
||||||
game.override.ability(Abilities.INTIMIDATE);
|
.enemyAbility(Abilities.CONTRARY)
|
||||||
game.override.enemyMoveset(SPLASH_ONLY);
|
.ability(Abilities.INTIMIDATE)
|
||||||
|
.enemyMoveset(SPLASH_ONLY);
|
||||||
});
|
});
|
||||||
|
|
||||||
it("should invert stat changes when applied", async() => {
|
it("should invert stat changes when applied", async() => {
|
||||||
|
@ -24,13 +24,14 @@ describe("Abilities - Imposter", () => {
|
|||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
game = new GameManager(phaserGame);
|
game = new GameManager(phaserGame);
|
||||||
game.override.battleType("single");
|
game.override
|
||||||
game.override.enemySpecies(Species.MEW);
|
.battleType("single")
|
||||||
game.override.enemyLevel(200);
|
.enemySpecies(Species.MEW)
|
||||||
game.override.enemyAbility(Abilities.BEAST_BOOST);
|
.enemyLevel(200)
|
||||||
game.override.enemyMoveset(SPLASH_ONLY);
|
.enemyAbility(Abilities.BEAST_BOOST)
|
||||||
game.override.ability(Abilities.IMPOSTER);
|
.enemyMoveset(SPLASH_ONLY)
|
||||||
game.override.moveset([ Moves.TACKLE ]);
|
.ability(Abilities.IMPOSTER)
|
||||||
|
.moveset([ Moves.TACKLE ]);
|
||||||
});
|
});
|
||||||
|
|
||||||
it("should copy species, ability, gender, all stats except HP, all stat stages, moveset, and types of target", async () => {
|
it("should copy species, ability, gender, all stats except HP, all stat stages, moveset, and types of target", async () => {
|
||||||
|
@ -22,11 +22,12 @@ describe("Abilities - Simple", () => {
|
|||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
game = new GameManager(phaserGame);
|
game = new GameManager(phaserGame);
|
||||||
game.override.battleType("single");
|
game.override
|
||||||
game.override.enemySpecies(Species.BULBASAUR);
|
.battleType("single")
|
||||||
game.override.enemyAbility(Abilities.SIMPLE);
|
.enemySpecies(Species.BULBASAUR)
|
||||||
game.override.ability(Abilities.INTIMIDATE);
|
.enemyAbility(Abilities.SIMPLE)
|
||||||
game.override.enemyMoveset(SPLASH_ONLY);
|
.ability(Abilities.INTIMIDATE)
|
||||||
|
.enemyMoveset(SPLASH_ONLY);
|
||||||
});
|
});
|
||||||
|
|
||||||
it("should double stat changes when applied", async() => {
|
it("should double stat changes when applied", async() => {
|
||||||
|
@ -35,12 +35,13 @@ describe("Items - Temporary Stat Stage Boosters", () => {
|
|||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
game = new GameManager(phaserGame);
|
game = new GameManager(phaserGame);
|
||||||
|
|
||||||
game.override.battleType("single");
|
game.override
|
||||||
game.override.enemySpecies(Species.SHUCKLE);
|
.battleType("single")
|
||||||
game.override.enemyMoveset(SPLASH_ONLY);
|
.enemySpecies(Species.SHUCKLE)
|
||||||
game.override.enemyAbility(Abilities.BALL_FETCH);
|
.enemyMoveset(SPLASH_ONLY)
|
||||||
game.override.moveset([ Moves.TACKLE, Moves.SPLASH, Moves.HONE_CLAWS, Moves.BELLY_DRUM ]);
|
.enemyAbility(Abilities.BALL_FETCH)
|
||||||
game.override.startingModifier([{ name: "TEMP_STAT_STAGE_BOOSTER", type: Stat.ATK }]);
|
.moveset([ Moves.TACKLE, Moves.SPLASH, Moves.HONE_CLAWS, Moves.BELLY_DRUM ])
|
||||||
|
.startingModifier([{ name: "TEMP_STAT_STAGE_BOOSTER", type: Stat.ATK }]);
|
||||||
});
|
});
|
||||||
|
|
||||||
it("should provide a x1.3 stat stage multiplier", async() => {
|
it("should provide a x1.3 stat stage multiplier", async() => {
|
||||||
@ -60,8 +61,9 @@ describe("Items - Temporary Stat Stage Boosters", () => {
|
|||||||
}, 20000);
|
}, 20000);
|
||||||
|
|
||||||
it("should increase existing ACC stat stage by 1 for X_ACCURACY only", async() => {
|
it("should increase existing ACC stat stage by 1 for X_ACCURACY only", async() => {
|
||||||
game.override.startingModifier([{ name: "TEMP_STAT_STAGE_BOOSTER", type: Stat.ACC }]);
|
game.override
|
||||||
game.override.ability(Abilities.SIMPLE);
|
.startingModifier([{ name: "TEMP_STAT_STAGE_BOOSTER", type: Stat.ACC }])
|
||||||
|
.ability(Abilities.SIMPLE);
|
||||||
|
|
||||||
await game.startBattle([
|
await game.startBattle([
|
||||||
Species.PIKACHU
|
Species.PIKACHU
|
||||||
@ -131,8 +133,9 @@ describe("Items - Temporary Stat Stage Boosters", () => {
|
|||||||
}, 20000);
|
}, 20000);
|
||||||
|
|
||||||
it("should renew how many battles are left of existing booster when picking up new booster of same type", async() => {
|
it("should renew how many battles are left of existing booster when picking up new booster of same type", async() => {
|
||||||
game.override.startingLevel(200);
|
game.override
|
||||||
game.override.itemRewards([{ name: "TEMP_STAT_STAGE_BOOSTER", type: Stat.ATK }]);
|
.startingLevel(200)
|
||||||
|
.itemRewards([{ name: "TEMP_STAT_STAGE_BOOSTER", type: Stat.ATK }]);
|
||||||
|
|
||||||
await game.startBattle([
|
await game.startBattle([
|
||||||
Species.PIKACHU
|
Species.PIKACHU
|
||||||
|
@ -24,12 +24,13 @@ describe("Moves - Guard Split", () => {
|
|||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
game = new GameManager(phaserGame);
|
game = new GameManager(phaserGame);
|
||||||
game.override.battleType("single");
|
game.override
|
||||||
game.override.enemyAbility(Abilities.NONE);
|
.battleType("single")
|
||||||
game.override.enemySpecies(Species.MEW);
|
.enemyAbility(Abilities.NONE)
|
||||||
game.override.enemyLevel(200);
|
.enemySpecies(Species.MEW)
|
||||||
game.override.moveset([ Moves.GUARD_SPLIT ]);
|
.enemyLevel(200)
|
||||||
game.override.ability(Abilities.NONE);
|
.moveset([ Moves.GUARD_SPLIT ])
|
||||||
|
.ability(Abilities.NONE);
|
||||||
});
|
});
|
||||||
|
|
||||||
it("should average the user's DEF and SPDEF stats with those of the target", async () => {
|
it("should average the user's DEF and SPDEF stats with those of the target", async () => {
|
||||||
|
@ -24,13 +24,14 @@ describe("Moves - Guard Swap", () => {
|
|||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
game = new GameManager(phaserGame);
|
game = new GameManager(phaserGame);
|
||||||
game.override.battleType("single");
|
game.override
|
||||||
game.override.enemyAbility(Abilities.BALL_FETCH);
|
.battleType("single")
|
||||||
game.override.enemyMoveset(new Array(4).fill(Moves.SHELL_SMASH));
|
.enemyAbility(Abilities.BALL_FETCH)
|
||||||
game.override.enemySpecies(Species.MEW);
|
.enemyMoveset(new Array(4).fill(Moves.SHELL_SMASH))
|
||||||
game.override.enemyLevel(200);
|
.enemySpecies(Species.MEW)
|
||||||
game.override.moveset([ Moves.GUARD_SWAP ]);
|
.enemyLevel(200)
|
||||||
game.override.ability(Abilities.NONE);
|
.moveset([ Moves.GUARD_SWAP ])
|
||||||
|
.ability(Abilities.NONE);
|
||||||
});
|
});
|
||||||
|
|
||||||
it("should swap the user's DEF AND SPDEF stat stages with the target's", async () => {
|
it("should swap the user's DEF AND SPDEF stat stages with the target's", async () => {
|
||||||
|
@ -24,12 +24,13 @@ describe("Moves - Power Split", () => {
|
|||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
game = new GameManager(phaserGame);
|
game = new GameManager(phaserGame);
|
||||||
game.override.battleType("single");
|
game.override
|
||||||
game.override.enemyAbility(Abilities.NONE);
|
.battleType("single")
|
||||||
game.override.enemySpecies(Species.MEW);
|
.enemyAbility(Abilities.NONE)
|
||||||
game.override.enemyLevel(200);
|
.enemySpecies(Species.MEW)
|
||||||
game.override.moveset([ Moves.POWER_SPLIT ]);
|
.enemyLevel(200)
|
||||||
game.override.ability(Abilities.NONE);
|
.moveset([ Moves.POWER_SPLIT ])
|
||||||
|
.ability(Abilities.NONE);
|
||||||
});
|
});
|
||||||
|
|
||||||
it("should average the user's ATK and SPATK stats with those of the target", async () => {
|
it("should average the user's ATK and SPATK stats with those of the target", async () => {
|
||||||
|
@ -24,13 +24,14 @@ describe("Moves - Power Swap", () => {
|
|||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
game = new GameManager(phaserGame);
|
game = new GameManager(phaserGame);
|
||||||
game.override.battleType("single");
|
game.override
|
||||||
game.override.enemyAbility(Abilities.BALL_FETCH);
|
.battleType("single")
|
||||||
game.override.enemyMoveset(new Array(4).fill(Moves.SHELL_SMASH));
|
.enemyAbility(Abilities.BALL_FETCH)
|
||||||
game.override.enemySpecies(Species.MEW);
|
.enemyMoveset(new Array(4).fill(Moves.SHELL_SMASH))
|
||||||
game.override.enemyLevel(200);
|
.enemySpecies(Species.MEW)
|
||||||
game.override.moveset([ Moves.POWER_SWAP ]);
|
.enemyLevel(200)
|
||||||
game.override.ability(Abilities.NONE);
|
.moveset([ Moves.POWER_SWAP ])
|
||||||
|
.ability(Abilities.NONE);
|
||||||
});
|
});
|
||||||
|
|
||||||
it("should swap the user's ATK AND SPATK stat stages with the target's", async () => {
|
it("should swap the user's ATK AND SPATK stat stages with the target's", async () => {
|
||||||
|
@ -24,13 +24,14 @@ describe("Moves - Speed Swap", () => {
|
|||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
game = new GameManager(phaserGame);
|
game = new GameManager(phaserGame);
|
||||||
game.override.battleType("single");
|
game.override
|
||||||
game.override.enemyAbility(Abilities.NONE);
|
.battleType("single")
|
||||||
game.override.enemyMoveset(SPLASH_ONLY);
|
.enemyAbility(Abilities.NONE)
|
||||||
game.override.enemySpecies(Species.MEW);
|
.enemyMoveset(SPLASH_ONLY)
|
||||||
game.override.enemyLevel(200);
|
.enemySpecies(Species.MEW)
|
||||||
game.override.moveset([ Moves.SPEED_SWAP ]);
|
.enemyLevel(200)
|
||||||
game.override.ability(Abilities.NONE);
|
.moveset([ Moves.SPEED_SWAP ])
|
||||||
|
.ability(Abilities.NONE);
|
||||||
});
|
});
|
||||||
|
|
||||||
it("should swap the user's SPD and the target's SPD stats", async () => {
|
it("should swap the user's SPD and the target's SPD stats", async () => {
|
||||||
|
@ -24,13 +24,14 @@ describe("Moves - Transform", () => {
|
|||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
game = new GameManager(phaserGame);
|
game = new GameManager(phaserGame);
|
||||||
game.override.battleType("single");
|
game.override
|
||||||
game.override.enemySpecies(Species.MEW);
|
.battleType("single")
|
||||||
game.override.enemyLevel(200);
|
.enemySpecies(Species.MEW)
|
||||||
game.override.enemyAbility(Abilities.BEAST_BOOST);
|
.enemyLevel(200)
|
||||||
game.override.enemyMoveset(SPLASH_ONLY);
|
.enemyAbility(Abilities.BEAST_BOOST)
|
||||||
game.override.ability(Abilities.INTIMIDATE);
|
.enemyMoveset(SPLASH_ONLY)
|
||||||
game.override.moveset([ Moves.TRANSFORM ]);
|
.ability(Abilities.INTIMIDATE)
|
||||||
|
.moveset([ Moves.TRANSFORM ]);
|
||||||
});
|
});
|
||||||
|
|
||||||
it("should copy species, ability, gender, all stats except HP, all stat stages, moveset, and types of target", async () => {
|
it("should copy species, ability, gender, all stats except HP, all stat stages, moveset, and types of target", async () => {
|
||||||
|
Loading…
Reference in New Issue
Block a user