Deukhoofd 4385f0afaa
All checks were successful
Build / Build (push) Successful in 50s
More abilities
2025-06-13 12:56:47 +02:00

17 lines
684 B
C#

namespace PkmnLib.Plugin.Gen7.Scripts.Abilities;
/// <summary>
/// Overgrow is an ability that boosts the power of Grass-type moves when the Pokémon's HP is low.
///
/// <see href="https://bulbapedia.bulbagarden.net/wiki/Overgrow_(Ability)">Bulbapedia - Overgrow</see>
/// </summary>
[Script(ScriptCategory.Ability, "overgrow")]
public class Overgrow : Script
{
/// <inheritdoc />
public override void ChangeBasePower(IExecutingMove move, IPokemon target, byte hit, ref ushort basePower)
{
if (move.GetHitData(target, hit).Type?.Name == "grass" && target.CurrentHealth <= target.BoostedStats.Hp / 3)
basePower = basePower.MultiplyOrMax(1.5f);
}
}