continue; names.add(GameLog.getColoredObjectIdNameForTooltip(mageObject));
@Override public boolean apply(Game game, Ability source) { Permanent permanent = game.getPermanent(source.getSourceId()); if (permanent != null && permanent.isCreature()) { Player controller = game.getPlayer(permanent.getControllerId()); if (controller != null) { TargetControlledPermanent target = new TargetControlledPermanent(filter); target.setNotTarget(true); if (target.canChoose(permanent.getId(), controller.getId(), game)) { if (controller.choose(Outcome.Benefit, target, permanent.getId(), game)) { Permanent chosen = game.getPermanent(target.getFirstTarget()); if (chosen != null) { chosen.setPairedCard(new MageObjectReference(permanent, game)); chosen.addInfo("soulbond", "Soulbond to " + GameLog.getColoredObjectIdNameForTooltip(permanent), game); permanent.setPairedCard(new MageObjectReference(chosen, game)); permanent.addInfo("soulbond", "Soulbond to " + GameLog.getColoredObjectIdNameForTooltip(chosen), game); if (!game.isSimulation()) { game.informPlayers(controller.getLogName() + " soulbonds " + permanent.getLogName() + " with " + chosen.getLogName()); } } } } } return true; } return false; } }
continue; names.add(GameLog.getColoredObjectIdNameForTooltip(mageObject));
@Override public boolean apply(Game game, Ability source) { Permanent sourcePermanent = game.getPermanent(source.getSourceId()); Player controller = game.getPlayer(source.getControllerId()); Permanent target = game.getPermanent(getTargetPointer().getFirst(game, source)); if (controller != null && sourcePermanent != null) { if (target != null && controller.getId().equals(sourcePermanent.getControllerId())) { SourceHasRemainedInSameZoneCondition condition = new SourceHasRemainedInSameZoneCondition(sourcePermanent.getId()); game.addEffect(new ConditionalContinuousEffect( new GainControlTargetEffect(Duration.Custom), new CompoundCondition(new SourceOnBattlefieldControlUnchangedCondition(), condition), null), source); if (!game.isSimulation()) { game.informPlayers(sourcePermanent.getLogName() + ": " + controller.getLogName() + " gained control of " + target.getLogName()); } sourcePermanent.addInfo("gained control of", CardUtil.addToolTipMarkTags("Gained control of: " + GameLog.getColoredObjectIdNameForTooltip(target)), game); } return true; } return false; } }
@Override public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); MageObject sourceObject = source.getSourceObject(game); if (controller != null && sourceObject != null) { TargetCard target = new TargetCard(Zone.HAND, filter); target.setNotTarget(true); Card cardToImprint = null; Permanent sourcePermanent = game.getPermanent(source.getSourceId()); if (!controller.getHand().isEmpty() && controller.choose(Outcome.Benefit, target, source.getSourceId(), game)) { cardToImprint = controller.getHand().get(target.getFirstTarget(), game); } if (sourcePermanent != null) { if (cardToImprint != null) { controller.moveCardsToExile(cardToImprint, source, game, true, source.getSourceId(), sourceObject.getIdName() + " (Imprint)"); sourcePermanent.imprint(cardToImprint.getId(), game); sourcePermanent.addInfo("imprint", CardUtil.addToolTipMarkTags("[Imprinted card - " + GameLog.getColoredObjectIdNameForTooltip(cardToImprint) + ']'), game); } else { sourcePermanent.addInfo("imprint", CardUtil.addToolTipMarkTags("[Imprinted card - None]"), game); } } return true; } return false; }