mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-08-02 05:32:24 +02:00
Merge branch 'beta' into sortcount
This commit is contained in:
commit
3bcb34102c
@ -1 +1 @@
|
||||
Subproject commit 7bfcbccb9b8192b1059ca7c4c7e7d24901cf579d
|
||||
Subproject commit e07ab625f2080afe36b61fad291b0ec5eff4000c
|
@ -3606,6 +3606,9 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
|
||||
if (!this.canSetStatus(effect, asPhase, false, sourcePokemon)) {
|
||||
return false;
|
||||
}
|
||||
if (this.isFainted() && effect !== StatusEffect.FAINT) {
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* If this Pokemon falls asleep or freezes in the middle of a multi-hit attack,
|
||||
|
@ -400,4 +400,42 @@ describe("Status Effects", () => {
|
||||
expect(player.getLastXMoves(1)[0].result).toBe(MoveResult.SUCCESS);
|
||||
});
|
||||
});
|
||||
|
||||
describe("Behavior", () => {
|
||||
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
|
||||
.moveset([ Moves.SPLASH ])
|
||||
.ability(Abilities.BALL_FETCH)
|
||||
.battleType("single")
|
||||
.disableCrits()
|
||||
.enemySpecies(Species.MAGIKARP)
|
||||
.enemyAbility(Abilities.BALL_FETCH)
|
||||
.enemyMoveset(Moves.NUZZLE)
|
||||
.enemyLevel(2000);
|
||||
});
|
||||
|
||||
it("should not inflict a 0 HP mon with a status", async () => {
|
||||
await game.classicMode.startBattle([ Species.FEEBAS, Species.MILOTIC ]);
|
||||
|
||||
const player = game.scene.getPlayerPokemon()!;
|
||||
player.hp = 0;
|
||||
|
||||
expect(player.trySetStatus(StatusEffect.BURN)).toBe(false);
|
||||
expect(player.status?.effect).not.toBe(StatusEffect.BURN);
|
||||
});
|
||||
});
|
||||
});
|
10
src/utils.ts
10
src/utils.ts
@ -349,14 +349,14 @@ export class IntegerHolder extends NumberHolder {
|
||||
}
|
||||
}
|
||||
|
||||
/** @deprecated Use {@linkcode NumberHolder}*/
|
||||
export class FixedInt extends IntegerHolder {
|
||||
constructor(value: integer) {
|
||||
super(value);
|
||||
export class FixedInt {
|
||||
public readonly value: number;
|
||||
|
||||
constructor(value: number) {
|
||||
this.value = value;
|
||||
}
|
||||
}
|
||||
|
||||
/** @deprecated */
|
||||
export function fixedInt(value: integer): integer {
|
||||
return new FixedInt(value) as unknown as integer;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user