22 lines
770 B
C#

namespace PkmnLib.Plugin.Gen7.Scripts.Abilities;
/// <summary>
/// Soul-Heart is an ability that raises Special Attack when another Pokémon faints.
///
/// <see href="https://bulbapedia.bulbagarden.net/wiki/Soul-Heart_(Ability)">Bulbapedia - Soul-Heart</see>
/// </summary>
[Script(ScriptCategory.Ability, "soul_heart")]
public class SoulHeart : Script, IScriptOnOpponentFaints, IScriptOnAllyFaint
{
/// <inheritdoc />
public void OnAllyFaint(IPokemon ally, IPokemon faintedPokemon)
{
ally.ChangeStatBoost(Statistic.SpecialAttack, 1, true, false);
}
/// <inheritdoc />
public void OnOpponentFaints(IExecutingMove move, IPokemon target, byte hit)
{
move.User.ChangeStatBoost(Statistic.SpecialAttack, 1, true, false);
}
}