From 015e5819f3ecf9534a1bad2c799c3cae58ecc444 Mon Sep 17 00:00:00 2001 From: Deukhoofd Date: Mon, 19 May 2025 11:48:51 +0200 Subject: [PATCH] Make Disable actually stop after a set number of turns --- .../Scripts/Pokemon/DisableEffect.cs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/Plugins/PkmnLib.Plugin.Gen7/Scripts/Pokemon/DisableEffect.cs b/Plugins/PkmnLib.Plugin.Gen7/Scripts/Pokemon/DisableEffect.cs index 5475d9a..f414615 100644 --- a/Plugins/PkmnLib.Plugin.Gen7/Scripts/Pokemon/DisableEffect.cs +++ b/Plugins/PkmnLib.Plugin.Gen7/Scripts/Pokemon/DisableEffect.cs @@ -5,6 +5,7 @@ namespace PkmnLib.Plugin.Gen7.Scripts.Pokemon; [Script(ScriptCategory.Pokemon, "disable")] public class DisableEffect : Script { + private int _turnsLeft = 4; private readonly StringKey _move; public DisableEffect(StringKey move) @@ -18,4 +19,14 @@ public class DisableEffect : Script if (choice.ChosenMove.MoveData.Name == _move) prevent = true; } + + /// + public override void OnEndTurn(IBattle battle) + { + _turnsLeft--; + if (_turnsLeft <= 0) + { + RemoveSelf(); + } + } } \ No newline at end of file