mirror of
https://github.com/correl/mage.git
synced 2025-04-10 09:11:04 -09:00
Fix #8062
This commit is contained in:
parent
92cafbd8b1
commit
db3262aff6
2 changed files with 8 additions and 12 deletions
Mage.Sets/src/mage/cards/c
Mage/src/main/java/mage/abilities/effects/common
|
@ -83,14 +83,14 @@ class CaptivatingGlanceEffect extends OneShotEffect {
|
||||||
clashResult = ClashEffect.getInstance().apply(game, source);
|
clashResult = ClashEffect.getInstance().apply(game, source);
|
||||||
if (enchantedCreature != null) {
|
if (enchantedCreature != null) {
|
||||||
if (clashResult) {
|
if (clashResult) {
|
||||||
ContinuousEffect effect = new GainControlTargetEffect(Duration.Custom, false, controller.getId());
|
ContinuousEffect effect = new GainControlTargetEffect(Duration.Custom, controller.getId());
|
||||||
effect.setTargetPointer(new FixedTarget(enchantedCreature.getId(), game));
|
effect.setTargetPointer(new FixedTarget(enchantedCreature, game));
|
||||||
game.addEffect(effect, source);
|
game.addEffect(effect, source);
|
||||||
} else {
|
} else {
|
||||||
Player opponentWhomControllerClashedWith = game.getPlayer(targetPointer.getFirst(game, source));
|
Object opponent = getValue("clashOpponent");
|
||||||
if (opponentWhomControllerClashedWith != null) {
|
if (opponent instanceof Player) {
|
||||||
ContinuousEffect effect = new GainControlTargetEffect(Duration.Custom, false, opponentWhomControllerClashedWith.getId());
|
ContinuousEffect effect = new GainControlTargetEffect(Duration.Custom, ((Player)opponent).getId());
|
||||||
effect.setTargetPointer(new FixedTarget(enchantedCreature.getId(), game));
|
effect.setTargetPointer(new FixedTarget(enchantedCreature, game));
|
||||||
game.addEffect(effect, source);
|
game.addEffect(effect, source);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -139,7 +139,7 @@ public class ClashEffect extends OneShotEffect implements MageSingleton {
|
||||||
game.informPlayer(controller, "You won the clash!");
|
game.informPlayer(controller, "You won the clash!");
|
||||||
} else if (cmcController < cmcOpponent) {
|
} else if (cmcController < cmcOpponent) {
|
||||||
message.append(opponent.getLogName()).append(" won the clash");
|
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 {
|
} else {
|
||||||
message.append(" no winner ");
|
message.append(" no winner ");
|
||||||
}
|
}
|
||||||
|
@ -177,11 +177,7 @@ public class ClashEffect extends OneShotEffect implements MageSingleton {
|
||||||
));
|
));
|
||||||
|
|
||||||
// set opponent to DoIfClashWonEffect
|
// set opponent to DoIfClashWonEffect
|
||||||
for (Effect effect : source.getEffects()) {
|
source.getEffects().setValue("clashOpponent", opponent);
|
||||||
if (effect instanceof DoIfClashWonEffect) {
|
|
||||||
effect.setValue("clashOpponent", opponent);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return cmcController > cmcOpponent;
|
return cmcController > cmcOpponent;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue