mirror of
https://github.com/correl/mage.git
synced 2024-11-15 03:00:16 +00:00
Fix #8062
This commit is contained in:
parent
92cafbd8b1
commit
db3262aff6
2 changed files with 8 additions and 12 deletions
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue