22 lines
755 B
C#
22 lines
755 B
C#
namespace PkmnLib.Plugin.Gen7.Scripts.Abilities;
|
|
|
|
/// <summary>
|
|
/// Sand Veil is an ability that raises the Pokémon's evasion during a sandstorm.
|
|
///
|
|
/// <see href="https://bulbapedia.bulbagarden.net/wiki/Sand_Veil_(Ability)">Bulbapedia - Sand Veil</see>
|
|
/// </summary>
|
|
[Script(ScriptCategory.Ability, "sand_veil")]
|
|
public class SandVeil : Script
|
|
{
|
|
/// <inheritdoc />
|
|
public override void ChangeIncomingAccuracy(IExecutingMove executingMove, IPokemon target, byte hitIndex,
|
|
ref int modifiedAccuracy)
|
|
{
|
|
if (executingMove.Battle.WeatherName != ScriptUtils.ResolveName<Weather.Sandstorm>())
|
|
return;
|
|
|
|
modifiedAccuracy = (int)(modifiedAccuracy * (3277f / 4096f));
|
|
}
|
|
|
|
// TODO: Prevent sandstorm damage.
|
|
} |