[Bug] Fixes dragon tail vs ice face eiscue interaction (#2397)
* add optional chaining * specify first hit
This commit is contained in:
parent
58642e6be3
commit
29b8b3aa1f
|
@ -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 {
|
||||
|
|
|
@ -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));
|
||||
|
|
|
@ -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]);
|
||||
|
|
Loading…
Reference in New Issue