Deukhoofd 5961bb746e
All checks were successful
Build / Build (push) Successful in 51s
Even more abilities
2025-06-14 13:24:38 +02:00

26 lines
951 B
C#

namespace PkmnLib.Plugin.Gen7.Scripts.Abilities;
/// <summary>
/// Sand Force is an ability that boosts the power of Rock, Ground, and Steel-type moves in a sandstorm.
///
/// <see href="https://bulbapedia.bulbagarden.net/wiki/Sand_Force_(Ability)">Bulbapedia - Sand Force</see>
/// </summary>
[Script(ScriptCategory.Ability, "sand_force")]
public class SandForce : Script
{
/// <inheritdoc />
public override void ChangeBasePower(IExecutingMove move, IPokemon target, byte hit, ref ushort basePower)
{
if (move.Battle.WeatherName == ScriptUtils.ResolveName<Weather.Sandstorm>())
{
var type = move.GetHitData(target, hit).Type;
if (type != null &&
(type.Value.Name == "rock" || type.Value.Name == "ground" || type.Value.Name == "steel"))
{
basePower = basePower.MultiplyOrMax(1.3f);
}
}
}
// TODO: Prevent sandstorm damage.
}