mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-01-21 16:31:03 +00:00
Merge branch 'beta' into sheerForceImp
This commit is contained in:
commit
bc41e3e7c0
@ -4951,9 +4951,10 @@ class ForceSwitchOutHelper {
|
||||
}
|
||||
/**
|
||||
* For wild Pokémon battles, the Pokémon will flee if the conditions are met (waveIndex and double battles).
|
||||
* It will not flee if it is a Mystery Encounter with fleeing disabled (checked in `getSwitchOutCondition()`) or if it is a wave 10x wild boss
|
||||
*/
|
||||
} else {
|
||||
if (!pokemon.scene.currentBattle.waveIndex && pokemon.scene.currentBattle.waveIndex % 10 === 0) {
|
||||
if (!pokemon.scene.currentBattle.waveIndex || pokemon.scene.currentBattle.waveIndex % 10 === 0) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -3101,10 +3101,10 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
|
||||
}
|
||||
|
||||
lapseTag(tagType: BattlerTagType): boolean {
|
||||
const tags = this.summonData?.tags;
|
||||
if (isNullOrUndefined(tags)) {
|
||||
if (!this.summonData) {
|
||||
return false;
|
||||
}
|
||||
const tags = this.summonData.tags;
|
||||
const tag = tags.find(t => t.tagType === tagType);
|
||||
if (tag && !(tag.lapse(this, BattlerTagLapseType.CUSTOM))) {
|
||||
tag.onRemove(this);
|
||||
@ -3114,6 +3114,9 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
|
||||
}
|
||||
|
||||
lapseTags(lapseType: BattlerTagLapseType): void {
|
||||
if (!this.summonData) {
|
||||
return;
|
||||
}
|
||||
const tags = this.summonData.tags;
|
||||
tags.filter(t => lapseType === BattlerTagLapseType.FAINT || ((t.lapseTypes.some(lType => lType === lapseType)) && !(t.lapse(this, lapseType)))).forEach(t => {
|
||||
t.onRemove(this);
|
||||
@ -3122,6 +3125,9 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
|
||||
}
|
||||
|
||||
removeTag(tagType: BattlerTagType): boolean {
|
||||
if (!this.summonData) {
|
||||
return false;
|
||||
}
|
||||
const tags = this.summonData.tags;
|
||||
const tag = tags.find(t => t.tagType === tagType);
|
||||
if (tag) {
|
||||
|
@ -613,4 +613,23 @@ describe("Abilities - Wimp Out", () => {
|
||||
|
||||
confirmNoSwitch();
|
||||
});
|
||||
|
||||
it("should not activate on wave X0 bosses", async () => {
|
||||
game.override.enemyAbility(Abilities.WIMP_OUT)
|
||||
.startingLevel(5850)
|
||||
.startingWave(10);
|
||||
await game.classicMode.startBattle([ Species.GOLISOPOD ]);
|
||||
|
||||
const enemyPokemon = game.scene.getEnemyPokemon()!;
|
||||
|
||||
// Use 2 turns of False Swipe due to opponent's health bar shield
|
||||
game.move.select(Moves.FALSE_SWIPE);
|
||||
await game.toNextTurn();
|
||||
game.move.select(Moves.FALSE_SWIPE);
|
||||
await game.toNextTurn();
|
||||
|
||||
const isVisible = enemyPokemon.visible;
|
||||
const hasFled = enemyPokemon.switchOutStatus;
|
||||
expect(isVisible && !hasFled).toBe(true);
|
||||
});
|
||||
});
|
||||
|
Loading…
x
Reference in New Issue
Block a user