22 lines
628 B
C#
22 lines
628 B
C#
using PkmnLib.Plugin.Gen7.Scripts.Side;
|
|
|
|
namespace PkmnLib.Plugin.Gen7.Scripts.Moves;
|
|
|
|
[Script(ScriptCategory.Move, "mat_block")]
|
|
public class MatBlock : Script
|
|
{
|
|
/// <inheritdoc />
|
|
public override void OnSecondaryEffect(IExecutingMove move, IPokemon target, byte hit)
|
|
{
|
|
var battleData = move.User.BattleData;
|
|
if (battleData == null)
|
|
return;
|
|
if (battleData.SwitchInTurn != battleData.Battle.CurrentTurnNumber)
|
|
{
|
|
move.GetHitData(target, hit).Fail();
|
|
return;
|
|
}
|
|
|
|
battleData.BattleSide.VolatileScripts.Add(new MatBlockEffect());
|
|
}
|
|
} |