2025-06-28 12:02:24 +02:00

23 lines
666 B
C#

using PkmnLib.Plugin.Gen7.Scripts.Pokemon;
namespace PkmnLib.Plugin.Gen7.Scripts.Moves;
[Script(ScriptCategory.Move, "fake_out")]
public class FakeOut : Script, IScriptStopBeforeMove
{
/// <inheritdoc />
public void StopBeforeMove(IExecutingMove move, ref bool stop)
{
var battleData = move.User.BattleData;
if (battleData == null)
return;
if (battleData.SwitchInTurn != battleData.Battle.CurrentTurnNumber)
stop = true;
}
/// <inheritdoc />
public override void OnSecondaryEffect(IExecutingMove move, IPokemon target, byte hit)
{
target.Volatile.Add(new FlinchEffect());
}
}