More abilities
This commit is contained in:
25
Plugins/PkmnLib.Plugin.Gen7/Scripts/Abilities/Justified.cs
Normal file
25
Plugins/PkmnLib.Plugin.Gen7/Scripts/Abilities/Justified.cs
Normal file
@@ -0,0 +1,25 @@
|
||||
namespace PkmnLib.Plugin.Gen7.Scripts.Abilities;
|
||||
|
||||
/// <summary>
|
||||
/// Justified is an ability that raises the Pokémon's Attack stat when hit by a Dark-type move.
|
||||
///
|
||||
/// <see href="https://bulbapedia.bulbagarden.net/wiki/Justified_(Ability)">Bulbapedia - Justified</see>
|
||||
/// </summary>
|
||||
[Script(ScriptCategory.Ability, "justified")]
|
||||
public class Justified : Script
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override void OnIncomingHit(IExecutingMove move, IPokemon target, byte hit)
|
||||
{
|
||||
if (move.GetHitData(target, hit).Type?.Name != "dark")
|
||||
return;
|
||||
|
||||
EventBatchId batchId = new();
|
||||
|
||||
move.Battle.EventHook.Invoke(new AbilityTriggerEvent(target)
|
||||
{
|
||||
BatchId = batchId,
|
||||
});
|
||||
target.ChangeStatBoost(Statistic.Attack, 1, true, false, batchId);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user