PkmnLib.NET/Plugins/PkmnLib.Plugin.Gen7/Scripts/Battle/FairyLockEffect.cs

27 lines
603 B
C#
Raw Normal View History

2025-02-03 10:40:26 +00:00
namespace PkmnLib.Plugin.Gen7.Scripts.Battle;
[Script(ScriptCategory.Battle, "fairy_lock")]
public class FairyLockEffect : Script
{
private int _turns = 1;
2025-03-02 16:19:57 +00:00
2025-02-03 10:40:26 +00:00
/// <inheritdoc />
public override void PreventSelfRunAway(IFleeChoice choice, ref bool prevent)
{
prevent = true;
}
/// <inheritdoc />
public override void PreventSelfSwitch(ISwitchChoice choice, ref bool prevent)
{
prevent = true;
}
/// <inheritdoc />
public override void OnEndTurn(IBattle battle)
{
2025-03-02 16:19:57 +00:00
if (_turns <= 0)
2025-02-03 10:40:26 +00:00
RemoveSelf();
_turns--;
}
}