This commit is contained in:
29
Plugins/PkmnLib.Plugin.Gen7/Scripts/Abilities/Overcoat.cs
Normal file
29
Plugins/PkmnLib.Plugin.Gen7/Scripts/Abilities/Overcoat.cs
Normal file
@@ -0,0 +1,29 @@
|
||||
namespace PkmnLib.Plugin.Gen7.Scripts.Abilities;
|
||||
|
||||
/// <summary>
|
||||
/// Overcoat is an ability that protects the Pokémon from weather damage and powder moves.
|
||||
///
|
||||
/// <see href="https://bulbapedia.bulbagarden.net/wiki/Overcoat_(Ability)">Bulbapedia - Overcoat</see>
|
||||
/// </summary>
|
||||
[Script(ScriptCategory.Ability, "overcoat")]
|
||||
public class Overcoat : Script
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override void CustomTrigger(StringKey eventName, ICustomTriggerArgs args)
|
||||
{
|
||||
if (eventName == CustomTriggers.IgnoreHail && args is CustomTriggers.IgnoreHailArgs hailArgs)
|
||||
{
|
||||
hailArgs.Ignore = true;
|
||||
}
|
||||
// TODO: Ignore sandstorm damage
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override void IsInvulnerableToMove(IExecutingMove move, IPokemon target, ref bool invulnerable)
|
||||
{
|
||||
if (move.UseMove.HasFlag("powder"))
|
||||
{
|
||||
invulnerable = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user