21 lines
552 B
C#
21 lines
552 B
C#
namespace PkmnLib.Plugin.Gen7.Scripts.Side;
|
|
|
|
[Script(ScriptCategory.Side, "lucky_chant")]
|
|
public class LuckyChantEffect : Script, IScriptBlockIncomingCriticalHit, IScriptOnEndTurn
|
|
{
|
|
private int _turnsLeft = 5;
|
|
|
|
/// <inheritdoc />
|
|
public void OnEndTurn(IScriptSource owner, IBattle battle)
|
|
{
|
|
_turnsLeft--;
|
|
if (_turnsLeft > 0)
|
|
return;
|
|
RemoveSelf();
|
|
}
|
|
|
|
public void BlockIncomingCriticalHit(IExecutingMove move, IBattlePokemon target, byte hit, ref bool block)
|
|
{
|
|
block = true;
|
|
}
|
|
} |