25 lines
686 B
C#
25 lines
686 B
C#
namespace PkmnLib.Plugin.Gen7.Scripts.Pokemon;
|
|
|
|
[Script(ScriptCategory.Pokemon, "torment")]
|
|
public class TormentEffect(IMoveChoice? moveChoice) : Script
|
|
{
|
|
private IMoveChoice? _moveChoice = moveChoice;
|
|
|
|
/// <inheritdoc />
|
|
public override void PreventMoveSelection(IMoveChoice choice, ref bool prevent)
|
|
{
|
|
if (_moveChoice == null)
|
|
return;
|
|
if (choice.ChosenMove.MoveData == _moveChoice.ChosenMove.MoveData)
|
|
{
|
|
prevent = true;
|
|
}
|
|
}
|
|
|
|
/// <inheritdoc />
|
|
public override void OnBeforeTurnStart(ITurnChoice choice)
|
|
{
|
|
if (choice is IMoveChoice moveChoice)
|
|
_moveChoice = moveChoice;
|
|
}
|
|
} |