Last couple abilities
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
namespace PkmnLib.Plugin.Gen7.Scripts.Abilities;
|
||||
|
||||
/// <summary>
|
||||
/// Water Compaction is an ability that sharply raises Defense when hit by a Water-type move.
|
||||
///
|
||||
/// <see href="https://bulbapedia.bulbagarden.net/wiki/Water_Compaction_(Ability)">Bulbapedia - Water Compaction</see>
|
||||
/// </summary>
|
||||
[Script(ScriptCategory.Ability, "water_compaction")]
|
||||
public class WaterCompaction : Script
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override void OnIncomingHit(IExecutingMove move, IPokemon target, byte hit)
|
||||
{
|
||||
if (move.GetHitData(target, hit).Type?.Name != "water")
|
||||
return;
|
||||
target.BattleData?.Battle.EventHook.Invoke(new AbilityTriggerEvent(target));
|
||||
target.ChangeStatBoost(Statistic.Defense, 2, true, false);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user