adds an ally check to the condition

This commit is contained in:
shayebeadlingkl 2024-04-23 12:43:19 -04:00
parent 06cdd808fd
commit d0df0c06ff

View File

@ -1808,7 +1808,7 @@ export class PostTurnResetStatusAbAttr extends PostTurnAbAttr {
} else {
this.target = pokemon;
}
if (this.target.status) {
if (this.target?.status) {
this.target.scene.queueMessage(getPokemonMessage(this.target, getStatusEffectHealText(this.target.status?.effect)));
this.target.resetStatus();
@ -2762,7 +2762,7 @@ export function initAbilities() {
.condition((pokemon) => pokemon.getHpRatio() <= 0.5),
new Ability(Abilities.CURSED_BODY, "Cursed Body (N)", "May disable a move used on the Pokémon.", 5),
new Ability(Abilities.HEALER, "Healer", "Sometimes heals an ally's status condition.", 5)
.conditionalAttr(pokemon => !Utils.randSeedInt(3), PostTurnResetStatusAbAttr, true),
.conditionalAttr(pokemon => pokemon.getAlly() && !Utils.randSeedInt(1), PostTurnResetStatusAbAttr, true),
new Ability(Abilities.FRIEND_GUARD, "Friend Guard (N)", "Reduces damage done to allies.", 5)
.ignorable(),
new Ability(Abilities.WEAK_ARMOR, "Weak Armor", "Physical attacks to the Pokémon lower its Defense stat but sharply raise its Speed stat.", 5)