[Bug] Fixes dragon tail vs ice face eiscue interaction (#2397)

* add optional chaining

* specify first hit
This commit is contained in:
Adrian T 2024-06-19 21:51:50 +08:00 committed by GitHub
parent 58642e6be3
commit 29b8b3aa1f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 3 additions and 3 deletions

View File

@ -3743,7 +3743,7 @@ function applyAbAttrsInternal<TAttr extends AbAttr>(attrType: { new(...args: any
const attrs = ability.getAttrs(attrType);
const clearSpliceQueueAndResolve = () => {
pokemon.scene.clearPhaseQueueSplice();
pokemon.scene?.clearPhaseQueueSplice();
if (!passive) {
return applyAbAttrsInternal(attrType, pokemon, applyFunc, args, isAsync, showAbilityInstant, quiet, true).then(() => resolve());
} else {

View File

@ -278,7 +278,7 @@ export class QuietFormChangePhase extends BattlePhase {
}
end(): void {
if (this.pokemon.scene.currentBattle.battleSpec === BattleSpec.FINAL_BOSS && this.pokemon instanceof EnemyPokemon) {
if (this.pokemon.scene?.currentBattle.battleSpec === BattleSpec.FINAL_BOSS && this.pokemon instanceof EnemyPokemon) {
this.scene.playBgm();
this.pokemon.summonData.battleStats = [ 0, 0, 0, 0, 0, 0, 0 ];
this.scene.unshiftPhase(new PokemonHealPhase(this.scene, this.pokemon.getBattlerIndex(), this.pokemon.getMaxHp(), null, false, false, false, true));

View File

@ -53,7 +53,7 @@ describe("Abilities - Ice Face", () => {
expect(eiscue.getTag(BattlerTagType.ICE_FACE)).toBe(undefined);
});
it("takes no damage from multihit physical move and transforms to Noice", async () => {
it("takes no damage from the first hit of multihit physical move and transforms to Noice", async () => {
vi.spyOn(overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.SURGING_STRIKES]);
vi.spyOn(overrides, "OPP_LEVEL_OVERRIDE", "get").mockReturnValue(5);
await game.startBattle([Species.HITMONLEE]);