@Override public TransformTargetEffect copy() { return new TransformTargetEffect(this); }
@Override public boolean apply(Game game, Ability source) { Permanent permanent = game.getPermanent(getTargetPointer().getFirst(game, source)); if (permanent != null) { if (permanent.canTransform(source, game)) { // check not to transform twice the same side if (withoutTrigger) { permanent.setTransformed(!permanent.isTransformed()); } else { permanent.transform(game); } if (!game.isSimulation()) { if (permanent.isTransformed()) { if (permanent.getSecondCardFace() != null) { if (permanent instanceof PermanentCard) { game.informPlayers(((PermanentCard) permanent).getCard().getLogName() + " transforms into " + permanent.getSecondCardFace().getLogName()); } } } else { game.informPlayers(permanent.getSecondCardFace().getLogName() + " transforms into " + permanent.getLogName()); } } } return true; } return false; }
@Override public boolean apply(Game game, Ability source) { MageObject sourceObject = source.getSourceObjectIfItStillExists(game); if (sourceObject instanceof Permanent) { //create delayed triggered ability Effect effect = new TransformTargetEffect(false); effect.setTargetPointer(new FixedTarget((Permanent) sourceObject, game)); AtTheBeginOfNextUpkeepDelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextUpkeepDelayedTriggeredAbility(effect); game.addDelayedTriggeredAbility(delayedAbility, source); } return true; }
public WaxingMoon(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{1}{G}"); // Transform up to one target Werewolf you control. Effect effect = new TransformTargetEffect(false); effect.setText("Transform up to one target Werewolf you control"); this.getSpellAbility().addEffect(effect); this.getSpellAbility().addTarget(new TargetCreaturePermanent(0, 1, filter, false)); // Creatures you control gain trample until end of turn. this.getSpellAbility().addEffect(new GainAbilityAllEffect(TrampleAbility.getInstance(), Duration.EndOfTurn, new FilterControlledCreaturePermanent(), "Creatures you control gain trample until end of turn")); }