Last couple abilities
This commit is contained in:
23
Plugins/PkmnLib.Plugin.Gen7/Scripts/Abilities/WeakArmor.cs
Normal file
23
Plugins/PkmnLib.Plugin.Gen7/Scripts/Abilities/WeakArmor.cs
Normal file
@@ -0,0 +1,23 @@
|
||||
using PkmnLib.Static.Moves;
|
||||
|
||||
namespace PkmnLib.Plugin.Gen7.Scripts.Abilities;
|
||||
|
||||
/// <summary>
|
||||
/// Weak Armor is an ability that lowers Defense and raises Speed when hit by a physical move.
|
||||
///
|
||||
/// <see href="https://bulbapedia.bulbagarden.net/wiki/Weak_Armor_(Ability)">Bulbapedia - Weak Armor</see>
|
||||
/// </summary>
|
||||
[Script(ScriptCategory.Ability, "weak_armor")]
|
||||
public class WeakArmor : Script
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override void OnIncomingHit(IExecutingMove move, IPokemon target, byte hit)
|
||||
{
|
||||
if (move.UseMove.Category != MoveCategory.Physical)
|
||||
return;
|
||||
|
||||
target.BattleData?.Battle.EventHook.Invoke(new AbilityTriggerEvent(target));
|
||||
target.ChangeStatBoost(Statistic.Defense, -1, true, false);
|
||||
target.ChangeStatBoost(Statistic.Speed, 1, true, false);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user