Deukhoofd 9ff4745c0a
All checks were successful
Build / Build (push) Successful in 49s
Finishes the last few moves
2025-05-18 12:20:21 +02:00

17 lines
558 B
C#

namespace PkmnLib.Plugin.Gen7.Scripts.Moves;
[Script(ScriptCategory.Move, "worry_seed")]
public class WorrySeed : Script
{
/// <inheritdoc />
public override void OnSecondaryEffect(IExecutingMove move, IPokemon target, byte hit)
{
var abilityLibrary = move.Battle.Library.StaticLibrary.Abilities;
if (!abilityLibrary.TryGet("insomnia", out var ability))
{
// Edge case: if the ability is not found, we should not change the ability.
return;
}
target.ChangeAbility(ability);
}
}