Last couple abilities

This commit is contained in:
Deukhoofd committed 2025-06-15 13:32:58 +02:00
1 parent cd6095455a
commit b11203cb3a
12 files changed
+229 -20

No files matched your search

@@ -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);
}
}