From 06cdd808fd95cead5ebb295903520151186a0fbc Mon Sep 17 00:00:00 2001 From: shayebeadlingkl Date: Tue, 23 Apr 2024 12:35:26 -0400 Subject: [PATCH 1/3] Implements healer --- src/data/ability.ts | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/src/data/ability.ts b/src/data/ability.ts index e0bd24b4e62..38d1e603e6d 100644 --- a/src/data/ability.ts +++ b/src/data/ability.ts @@ -1794,12 +1794,25 @@ export class PostTurnAbAttr extends AbAttr { } export class PostTurnResetStatusAbAttr extends PostTurnAbAttr { + private allyTarget: boolean; + private target: Pokemon; + + constructor(allyTarget: boolean = false) { + super(true); + this.allyTarget = allyTarget; + } + applyPostTurn(pokemon: Pokemon, passive: boolean, args: any[]): boolean { - if (pokemon.status) { + if (this.allyTarget) { + this.target = pokemon.getAlly(); + } else { + this.target = pokemon; + } + if (this.target.status) { - pokemon.scene.queueMessage(getPokemonMessage(pokemon, getStatusEffectHealText(pokemon.status?.effect))); - pokemon.resetStatus(); - pokemon.updateInfo(); + this.target.scene.queueMessage(getPokemonMessage(this.target, getStatusEffectHealText(this.target.status?.effect))); + this.target.resetStatus(); + this.target.updateInfo(); return true; } @@ -2748,7 +2761,8 @@ export function initAbilities() { .attr(BattleStatMultiplierAbAttr, BattleStat.SPATK, 0.5) .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 (N)", "Sometimes heals an ally's status condition.", 5), + new Ability(Abilities.HEALER, "Healer", "Sometimes heals an ally's status condition.", 5) + .conditionalAttr(pokemon => !Utils.randSeedInt(3), 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) From d0df0c06ff463fab04bbed86fe5f1e16ff96225f Mon Sep 17 00:00:00 2001 From: shayebeadlingkl Date: Tue, 23 Apr 2024 12:43:19 -0400 Subject: [PATCH 2/3] adds an ally check to the condition --- src/data/ability.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/data/ability.ts b/src/data/ability.ts index 38d1e603e6d..d5036646e08 100644 --- a/src/data/ability.ts +++ b/src/data/ability.ts @@ -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) From da3e06713ed8122b88dc44ec185e48c360fdb451 Mon Sep 17 00:00:00 2001 From: shayebeadlingkl Date: Tue, 23 Apr 2024 12:47:21 -0400 Subject: [PATCH 3/3] done testing, changes chance back to 30% --- src/data/ability.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/data/ability.ts b/src/data/ability.ts index d5036646e08..93d2a83febf 100644 --- a/src/data/ability.ts +++ b/src/data/ability.ts @@ -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 => pokemon.getAlly() && !Utils.randSeedInt(1), PostTurnResetStatusAbAttr, true), + .conditionalAttr(pokemon => pokemon.getAlly() && Utils.randSeedInt(10) < 3, 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)