From 75ce0e8f73988c40ae4cf3162fdfece8fad807a2 Mon Sep 17 00:00:00 2001 From: Flashfyre Date: Sun, 14 Apr 2024 12:23:49 -0400 Subject: [PATCH] Fix transform and imposter not copying ability --- src/data/ability.ts | 1 + src/data/move.ts | 1 + src/field/pokemon.ts | 4 ++-- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/data/ability.ts b/src/data/ability.ts index eb83d53e237..e122a4bd76b 100644 --- a/src/data/ability.ts +++ b/src/data/ability.ts @@ -1111,6 +1111,7 @@ export class PostSummonTransformAbAttr extends PostSummonAbAttr { pokemon.summonData.speciesForm = target.getSpeciesForm(); pokemon.summonData.fusionSpeciesForm = target.getFusionSpeciesForm(); + pokemon.summonData.ability = target.getAbility().id; pokemon.summonData.gender = target.getGender(); pokemon.summonData.fusionGender = target.getFusionGender(); pokemon.summonData.stats = [ pokemon.stats[Stat.HP] ].concat(target.stats.slice(1)); diff --git a/src/data/move.ts b/src/data/move.ts index 0fe4a87868f..e2a7e3cd39c 100644 --- a/src/data/move.ts +++ b/src/data/move.ts @@ -3028,6 +3028,7 @@ export class TransformAttr extends MoveEffectAttr { user.summonData.speciesForm = target.getSpeciesForm(); user.summonData.fusionSpeciesForm = target.getFusionSpeciesForm(); + user.summonData.ability = target.getAbility().id; user.summonData.gender = target.getGender(); user.summonData.fusionGender = target.getFusionGender(); user.summonData.stats = [ user.stats[Stat.HP] ].concat(target.stats.slice(1)); diff --git a/src/field/pokemon.ts b/src/field/pokemon.ts index 03019054001..86355b17a9e 100644 --- a/src/field/pokemon.ts +++ b/src/field/pokemon.ts @@ -716,8 +716,8 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container { if (OPP_ABILITY_OVERRIDE && !this.isPlayer()) return allAbilities[OPP_ABILITY_OVERRIDE]; if (this.isFusion()) - return allAbilities[this.getFusionSpeciesForm().getAbility(this.fusionAbilityIndex)]; - let abilityId = this.getSpeciesForm().getAbility(this.abilityIndex); + return allAbilities[this.getFusionSpeciesForm(ignoreOverride).getAbility(this.fusionAbilityIndex)]; + let abilityId = this.getSpeciesForm(ignoreOverride).getAbility(this.abilityIndex); if (abilityId === Abilities.NONE) abilityId = this.species.ability1; return allAbilities[abilityId];