namespace PkmnLib.Plugin.Gen7.Scripts.Abilities;
///
/// Swarm is an ability that powers up Bug-type moves when the Pokémon's HP is low.
///
/// Bulbapedia - Swarm
///
[Script(ScriptCategory.Ability, "swarm")]
public class Swarm : Script
{
///
public override void ChangeOffensiveStatValue(IExecutingMove move, IPokemon target, byte hit, uint defensiveStat,
ImmutableStatisticSet targetStats, Statistic stat, ref uint value)
{
if (move.GetHitData(target, hit).Type?.Name == "bug" && target.CurrentHealth <= target.MaxHealth / 3)
{
value = value.MultiplyOrMax(1.5f);
}
}
}