Compare commits

...

3 Commits

Author SHA1 Message Date
ifzeroequalsone
7ed71ceb90
[Bug] Clicking Right from Lock Rarities moves to transfer or check team (#2177)
* Clicking Right from Lock Rarities moves to transfer or check team

* make cursor left movement more natural

---------

Co-authored-by: flx-sta <50131232+flx-sta@users.noreply.github.com>
2024-08-23 23:12:31 -07:00
NightKev
4867ffb229
[Test] Update new Disguise test with test framework changes (#3724) 2024-08-24 01:51:39 -04:00
NightKev
41a0dfe192
[Bug] Fix duplicate FaintPhase if Mimikyu faints to Disguise damage (#3686)
* Fix duplicate `FaintPhase` if Mimikyu faints to Disguise damage

* Add regression test
2024-08-23 22:04:49 -07:00
3 changed files with 27 additions and 2 deletions

View File

@ -4243,7 +4243,7 @@ export class FormBlockDamageAbAttr extends ReceivedMoveDamageMultiplierAbAttr {
(args[0] as Utils.NumberHolder).value = this.multiplier;
pokemon.removeTag(this.tagType);
if (this.recoilDamageFunc) {
pokemon.damageAndUpdate(this.recoilDamageFunc(pokemon), HitResult.OTHER);
pokemon.damageAndUpdate(this.recoilDamageFunc(pokemon), HitResult.OTHER, false, false, true, true);
}
}
return true;

View File

@ -207,4 +207,18 @@ describe("Abilities - Disguise", () => {
expect(mimikyu1.formIndex).toBe(disguisedForm);
}, TIMEOUT);
it("doesn't faint twice when fainting due to Disguise break damage, nor prevent faint from Disguise break damage if using Endure", async () => {
game.override.enemyMoveset(Array(4).fill(Moves.ENDURE));
await game.startBattle();
const mimikyu = game.scene.getEnemyPokemon()!;
mimikyu.hp = 1;
game.move.select(Moves.SHADOW_SNEAK);
await game.toNextWave();
expect(game.scene.getCurrentPhase()?.constructor.name).toBe("CommandPhase");
expect(game.scene.currentBattle.waveIndex).toBe(2);
}, TIMEOUT);
});

View File

@ -334,7 +334,11 @@ export default class ModifierSelectUiHandler extends AwaitableUiHandler {
success = false;
break;
case 1:
success = this.rerollButtonContainer.visible && this.setCursor(0);
if (this.transferButtonContainer.visible) {
success = this.setCursor(3);
} else {
success = this.rerollButtonContainer.visible && this.setCursor(0);
}
break;
case 2:
if (this.transferButtonContainer.visible) {
@ -368,6 +372,13 @@ export default class ModifierSelectUiHandler extends AwaitableUiHandler {
case 2:
success = false;
break;
case 3:
if (this.transferButtonContainer.visible) {
success = this.setCursor(1);
} else {
success = this.setCursor(2);
}
break;
}
} else if (this.cursor < this.getRowItems(this.rowCursor) - 1) {
success = this.setCursor(this.cursor + 1);