Imlements baneful bunker, data fixes
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
using PkmnLib.Dynamic.Models;
|
||||
using PkmnLib.Dynamic.Models.Choices;
|
||||
using PkmnLib.Dynamic.ScriptHandling;
|
||||
using PkmnLib.Dynamic.ScriptHandling.Registry;
|
||||
|
||||
namespace PkmnLib.Plugin.Gen7.Scripts.Pokemon;
|
||||
|
||||
/// <summary>
|
||||
/// Attached script for <see cref="ProtectionEffectScript"/> to keep track of the consecutive turns of using Protect,
|
||||
/// or protect-like moves.
|
||||
/// </summary>
|
||||
[Script(ScriptCategory.Pokemon, "protection_failure")]
|
||||
public class ProtectionFailureScript : Script
|
||||
{
|
||||
public int ProtectTurns { get; set; }
|
||||
public bool UsedProtect { get; set; }
|
||||
|
||||
/// <inheritdoc />
|
||||
public override void OnBeforeTurnStart(ITurnChoice choice)
|
||||
{
|
||||
UsedProtect = false;
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override void OnEndTurn(IBattle battle)
|
||||
{
|
||||
if (!UsedProtect)
|
||||
{
|
||||
RemoveSelf();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user