From db3262aff6cd466151417da5db42b7aa240a5541 Mon Sep 17 00:00:00 2001 From: "Alex W. Jackson" Date: Thu, 6 Oct 2022 22:50:37 -0400 Subject: [PATCH] Fix #8062 --- Mage.Sets/src/mage/cards/c/CaptivatingGlance.java | 12 ++++++------ .../mage/abilities/effects/common/ClashEffect.java | 8 ++------ 2 files changed, 8 insertions(+), 12 deletions(-) diff --git a/Mage.Sets/src/mage/cards/c/CaptivatingGlance.java b/Mage.Sets/src/mage/cards/c/CaptivatingGlance.java index 2a5b5697c3..c447f31196 100644 --- a/Mage.Sets/src/mage/cards/c/CaptivatingGlance.java +++ b/Mage.Sets/src/mage/cards/c/CaptivatingGlance.java @@ -83,14 +83,14 @@ class CaptivatingGlanceEffect extends OneShotEffect { clashResult = ClashEffect.getInstance().apply(game, source); if (enchantedCreature != null) { if (clashResult) { - ContinuousEffect effect = new GainControlTargetEffect(Duration.Custom, false, controller.getId()); - effect.setTargetPointer(new FixedTarget(enchantedCreature.getId(), game)); + ContinuousEffect effect = new GainControlTargetEffect(Duration.Custom, controller.getId()); + effect.setTargetPointer(new FixedTarget(enchantedCreature, game)); game.addEffect(effect, source); } else { - Player opponentWhomControllerClashedWith = game.getPlayer(targetPointer.getFirst(game, source)); - if (opponentWhomControllerClashedWith != null) { - ContinuousEffect effect = new GainControlTargetEffect(Duration.Custom, false, opponentWhomControllerClashedWith.getId()); - effect.setTargetPointer(new FixedTarget(enchantedCreature.getId(), game)); + Object opponent = getValue("clashOpponent"); + if (opponent instanceof Player) { + ContinuousEffect effect = new GainControlTargetEffect(Duration.Custom, ((Player)opponent).getId()); + effect.setTargetPointer(new FixedTarget(enchantedCreature, game)); game.addEffect(effect, source); } } diff --git a/Mage/src/main/java/mage/abilities/effects/common/ClashEffect.java b/Mage/src/main/java/mage/abilities/effects/common/ClashEffect.java index 1d5d983c28..afd3b9ccc7 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/ClashEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/ClashEffect.java @@ -139,7 +139,7 @@ public class ClashEffect extends OneShotEffect implements MageSingleton { game.informPlayer(controller, "You won the clash!"); } else if (cmcController < cmcOpponent) { message.append(opponent.getLogName()).append(" won the clash"); - game.informPlayer(controller, opponent.getLogName() + " won the clash!"); + game.informPlayer(controller, opponent.getName() + " won the clash!"); } else { message.append(" no winner "); } @@ -177,11 +177,7 @@ public class ClashEffect extends OneShotEffect implements MageSingleton { )); // set opponent to DoIfClashWonEffect - for (Effect effect : source.getEffects()) { - if (effect instanceof DoIfClashWonEffect) { - effect.setValue("clashOpponent", opponent); - } - } + source.getEffects().setValue("clashOpponent", opponent); return cmcController > cmcOpponent; } }