Deukhoofd bf83b25238
All checks were successful
Build / Build (push) Successful in 58s
Implements AI Switching
2025-07-12 13:03:00 +02:00

19 lines
548 B
C#

using PkmnLib.Plugin.Gen7.Scripts.Utils;
namespace PkmnLib.Plugin.Gen7.Scripts.Moves;
[Script(ScriptCategory.Move, "copycat")]
public class Copycat : Script, IScriptChangeMove
{
/// <inheritdoc />
public void ChangeMove(IMoveChoice choice, ref StringKey moveName)
{
var lastMove = choice.User.BattleData?.LastMoveChoice;
if (lastMove == null || !lastMove.ChosenMove.MoveData.CanCopyMove())
{
choice.Fail();
return;
}
moveName = lastMove.ChosenMove.MoveData.Name;
}
}