More abilities, refactor stealing held items
All checks were successful
Build / Build (push) Successful in 50s
All checks were successful
Build / Build (push) Successful in 50s
This commit is contained in:
26
Plugins/PkmnLib.Plugin.Gen7/Scripts/Abilities/Steadfast.cs
Normal file
26
Plugins/PkmnLib.Plugin.Gen7/Scripts/Abilities/Steadfast.cs
Normal file
@@ -0,0 +1,26 @@
|
||||
namespace PkmnLib.Plugin.Gen7.Scripts.Abilities;
|
||||
|
||||
/// <summary>
|
||||
/// Steadfast is an ability that raises the user's Speed each time it flinches.
|
||||
///
|
||||
/// <see href="https://bulbapedia.bulbagarden.net/wiki/Steadfast_(Ability)">Bulbapedia - Steadfast</see>
|
||||
/// </summary>
|
||||
[Script(ScriptCategory.Ability, "steadfast")]
|
||||
public class Steadfast : Script
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override void CustomTrigger(StringKey eventName, ICustomTriggerArgs args)
|
||||
{
|
||||
if (eventName != CustomTriggers.OnFlinch)
|
||||
return;
|
||||
if (args is not CustomTriggers.OnFlinchArgs flinchArgs)
|
||||
return;
|
||||
|
||||
EventBatchId batchId = new();
|
||||
flinchArgs.Move.Battle.EventHook.Invoke(new AbilityTriggerEvent(flinchArgs.Move.User)
|
||||
{
|
||||
BatchId = batchId,
|
||||
});
|
||||
flinchArgs.Move.User.ChangeStatBoost(Statistic.Speed, 1, true, false, batchId);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user