This commit is contained in:
25
Plugins/PkmnLib.Plugin.Gen7/Scripts/Pokemon/TormentEffect.cs
Normal file
25
Plugins/PkmnLib.Plugin.Gen7/Scripts/Pokemon/TormentEffect.cs
Normal file
@@ -0,0 +1,25 @@
|
||||
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;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user