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