Implements healer

This commit is contained in:
shayebeadlingkl 2024-04-23 12:35:26 -04:00
parent 049fa306b9
commit 06cdd808fd

View File

@ -1794,12 +1794,25 @@ export class PostTurnAbAttr extends AbAttr {
} }
export class PostTurnResetStatusAbAttr extends PostTurnAbAttr { export class PostTurnResetStatusAbAttr extends PostTurnAbAttr {
applyPostTurn(pokemon: Pokemon, passive: boolean, args: any[]): boolean { private allyTarget: boolean;
if (pokemon.status) { private target: Pokemon;
pokemon.scene.queueMessage(getPokemonMessage(pokemon, getStatusEffectHealText(pokemon.status?.effect))); constructor(allyTarget: boolean = false) {
pokemon.resetStatus(); super(true);
pokemon.updateInfo(); this.allyTarget = allyTarget;
}
applyPostTurn(pokemon: Pokemon, passive: boolean, args: any[]): boolean {
if (this.allyTarget) {
this.target = pokemon.getAlly();
} else {
this.target = pokemon;
}
if (this.target.status) {
this.target.scene.queueMessage(getPokemonMessage(this.target, getStatusEffectHealText(this.target.status?.effect)));
this.target.resetStatus();
this.target.updateInfo();
return true; return true;
} }
@ -2748,7 +2761,8 @@ export function initAbilities() {
.attr(BattleStatMultiplierAbAttr, BattleStat.SPATK, 0.5) .attr(BattleStatMultiplierAbAttr, BattleStat.SPATK, 0.5)
.condition((pokemon) => pokemon.getHpRatio() <= 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.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) new Ability(Abilities.FRIEND_GUARD, "Friend Guard (N)", "Reduces damage done to allies.", 5)
.ignorable(), .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) new Ability(Abilities.WEAK_ARMOR, "Weak Armor", "Physical attacks to the Pokémon lower its Defense stat but sharply raise its Speed stat.", 5)