19 lines
748 B
C#
19 lines
748 B
C#
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);
|
|
}
|
|
} |