This commit is contained in:
@@ -16,10 +16,14 @@ public class MirrorMove : Script, IScriptChangeMove
|
||||
if (battle.ChoiceQueue == null)
|
||||
return;
|
||||
var currentTurn = battle.ChoiceQueue.LastRanChoice;
|
||||
var target = battle.GetPokemon(choice.TargetSide, choice.TargetPosition);
|
||||
if (target is null)
|
||||
{
|
||||
choice.Fail();
|
||||
return;
|
||||
}
|
||||
var lastMove = battle.PreviousTurnChoices.SelectMany(x => x).OfType<IMoveChoice>()
|
||||
.TakeWhile(x => !Equals(x, currentTurn)).LastOrDefault(x => x.TargetPosition == choice.TargetPosition &&
|
||||
x.TargetSide == choice.TargetSide &&
|
||||
x.User.BattleData?.IsOnBattlefield == true);
|
||||
.TakeWhile(x => !Equals(x, currentTurn)).LastOrDefault(x => x.User == target);
|
||||
if (lastMove == null || !lastMove.ChosenMove.MoveData.CanCopyMove())
|
||||
{
|
||||
choice.Fail();
|
||||
|
||||
Reference in New Issue
Block a user