Move all battle state from IPokemon to an ephemeral IBattlePokemon wrapper
This commit is contained in:
@@ -13,7 +13,7 @@ namespace PkmnLib.Plugin.Gen7.Scripts.Moves;
|
||||
public class Mimic : Script, IScriptOnSecondaryEffect
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public void OnSecondaryEffect(IExecutingMove move, IPokemon target, byte hit)
|
||||
public void OnSecondaryEffect(IExecutingMove move, IBattlePokemon target, byte hit)
|
||||
{
|
||||
var moveSlot = move.User.Moves.IndexOf(move.ChosenMove);
|
||||
if (moveSlot == -1)
|
||||
@@ -22,7 +22,7 @@ public class Mimic : Script, IScriptOnSecondaryEffect
|
||||
return;
|
||||
}
|
||||
|
||||
var lastMove = target.BattleData?.LastMoveChoice;
|
||||
var lastMove = target.LastMoveChoice;
|
||||
if (lastMove == null || !lastMove.ChosenMove.MoveData.CanCopyMove())
|
||||
{
|
||||
move.GetHitData(target, hit).Fail();
|
||||
|
||||
Reference in New Issue
Block a user