namespace PkmnLib.Plugin.Gen7.Scripts.Battle;
[Script(ScriptCategory.Battle, "magic_room")]
public class MagicRoomEffect : Script
{
private int _turnsLeft = 5;
///
public override void PreventHeldItemConsume(IPokemon pokemon, IItem heldItem, ref bool prevented)
{
prevented = true;
}
///
public override void OnBeforeAnyHookInvoked(ref List? suppressedCategories)
{
suppressedCategories ??= [];
suppressedCategories.Add(ScriptCategory.ItemBattleTrigger);
}
///
public override void OnEndTurn(IBattle battle)
{
if (_turnsLeft > 0)
_turnsLeft--;
else
RemoveSelf();
}
}