Make Disable actually stop after a set number of turns
This commit is contained in:
parent
377c1a1c68
commit
015e5819f3
@ -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;
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override void OnEndTurn(IBattle battle)
|
||||
{
|
||||
_turnsLeft--;
|
||||
if (_turnsLeft <= 0)
|
||||
{
|
||||
RemoveSelf();
|
||||
}
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user