2025-06-15 12:29:13 +02:00

19 lines
646 B
C#

namespace PkmnLib.Plugin.Gen7.Scripts.Abilities;
/// <summary>
/// Sturdy is an ability that allows the Pokémon to survive a one-hit KO attack with 1 HP.
///
/// <see href="https://bulbapedia.bulbagarden.net/wiki/Sturdy_(Ability)">Bulbapedia - Sturdy</see>
/// </summary>
[Script(ScriptCategory.Ability, "sturdy")]
public class Sturdy : Script
{
/// <inheritdoc />
public override void ChangeIncomingMoveDamage(IExecutingMove move, IPokemon target, byte hit, ref uint damage)
{
if (damage >= target.MaxHealth && target.CurrentHealth == target.MaxHealth)
{
damage = target.MaxHealth - 1;
}
}
}