More abilities, refactor stealing held items
All checks were successful
Build / Build (push) Successful in 50s

This commit is contained in:
2025-06-15 11:49:15 +02:00
parent 1b9d137bb0
commit f5d18d7186
22 changed files with 326 additions and 21 deletions

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