Refactor move selection prevention to use interface
This commit is contained in:
@@ -1,10 +1,10 @@
|
||||
namespace PkmnLib.Plugin.Gen7.Scripts.Moves;
|
||||
|
||||
[Script(ScriptCategory.Move, "belch")]
|
||||
public class Belch : Script
|
||||
public class Belch : Script, IScriptPreventMoveSelection
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override void PreventMoveSelection(IMoveChoice choice, ref bool prevent)
|
||||
public void PreventMoveSelection(IMoveChoice choice, ref bool prevent)
|
||||
{
|
||||
var battleData = choice.User.BattleData;
|
||||
if (battleData == null)
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
namespace PkmnLib.Plugin.Gen7.Scripts.Moves;
|
||||
|
||||
[Script(ScriptCategory.Move, "celebrate")]
|
||||
public class Celebrate : Script
|
||||
public class Celebrate : Script, IScriptPreventMoveSelection
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override void PreventMoveSelection(IMoveChoice choice, ref bool prevent)
|
||||
public void PreventMoveSelection(IMoveChoice choice, ref bool prevent)
|
||||
{
|
||||
// This move is mostly useless, and it's not worth the effort to implement it.
|
||||
// Prevent it from being selected.
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
namespace PkmnLib.Plugin.Gen7.Scripts.Moves;
|
||||
|
||||
[Script(ScriptCategory.Move, "last_resort")]
|
||||
public class LastResort : Script
|
||||
public class LastResort : Script, IScriptPreventMoveSelection
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override void PreventMoveSelection(IMoveChoice choice, ref bool prevent)
|
||||
public void PreventMoveSelection(IMoveChoice choice, ref bool prevent)
|
||||
{
|
||||
var battleData = choice.User.BattleData;
|
||||
if (battleData == null)
|
||||
|
||||
Reference in New Issue
Block a user