Refactor move selection prevention to use interface
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
namespace PkmnLib.Plugin.Gen7.Scripts.Pokemon;
|
||||
|
||||
[Script(ScriptCategory.Pokemon, "imprison")]
|
||||
public class ImprisonEffect : Script
|
||||
public class ImprisonEffect : Script, IScriptPreventMoveSelection
|
||||
{
|
||||
private readonly IPokemon _user;
|
||||
|
||||
@@ -11,7 +11,7 @@ public class ImprisonEffect : Script
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override void PreventMoveSelection(IMoveChoice choice, ref bool prevent)
|
||||
public void PreventMoveSelection(IMoveChoice choice, ref bool prevent)
|
||||
{
|
||||
if (_user.Moves.WhereNotNull().Any(x => x.MoveData.Name == choice.ChosenMove.MoveData.Name))
|
||||
prevent = true;
|
||||
|
||||
Reference in New Issue
Block a user