@Override public boolean apply(Game game, Permanent permanent, Ability source, UUID copyToObjectId) { permanent.addAbility(ability, game); return true; }
@Override public boolean apply(Game game, Permanent permanent, Ability source, UUID copyToObjectId) { /** * 29/05/2014 The ability of Dack's Duplicate doesn't target the * creature. */ permanent.addAbility(new DethroneAbility(), game); permanent.addAbility(HasteAbility.getInstance(), game); return true; }
@Override public boolean apply(Game game, Ability source) { for (Iterator<MageObjectReference> it = affectedObjectList.iterator(); it.hasNext();) { Permanent permanent = it.next().getPermanent(game); if (permanent != null) { permanent.addAbility(ChangelingAbility.getInstance(), source.getSourceId(), game, false); } else { it.remove(); } } return true; } }
@Override public boolean apply(Game game, Ability source) { Permanent creature = game.getPermanent(source.getFirstTarget()); if (creature != null) { creature.addAbility(ability, game); return true; } return false; }
@Override public boolean apply(Game game, Ability source) { Permanent permanent = game.getPermanent(source.getSourceId()); if (permanent != null) { permanent.addAbility(ability, game); return true; } return false; }
@Override public boolean apply(Game game, Ability source) { int affectedTargets = 0; for (UUID permanentId : targetPointer.getTargets(game, source)) { Permanent permanent = game.getPermanent(permanentId); if (permanent != null && permanent.hasSubtype(SubType.SPIRIT, game)) { permanent.addAbility(TrampleAbility.getInstance(), game); affectedTargets++; } } return affectedTargets > 0; }
@Override public boolean apply(Game game, Permanent permanent, Ability source, UUID copyToObjectId) { // At the beginning of your upkeep, you may exile this enchantment. If you do, return it to the battlefield under its owner's control. permanent.addAbility(new BeginningOfUpkeepTriggeredAbility( new EstridsInvocationEffect(), TargetController.YOU, true ), source.getSourceId(), game); return true; }
@Override public boolean apply(Game game, Permanent permanent, Ability source, UUID copyToObjectId) { Effect effect = new CopyPermanentEffect(new ArtisanOfFormsApplyToPermanent()); effect.setText("have {this} become a copy of target creature, except it has this ability"); permanent.addAbility(new HeroicAbility(effect, true), game); return true; }
@Override public boolean apply(Game game, Ability source) { GeneratorServantWatcher watcher = game.getState().getWatcher(GeneratorServantWatcher.class, source.getSourceId()); if (watcher != null) { for (Permanent perm : game.getBattlefield().getAllActivePermanents()) { if (watcher.creatures.contains(perm.getId())) { perm.addAbility(HasteAbility.getInstance(), source.getSourceId(), game); } } return true; } return false; }
@Override public boolean apply(Game game, Ability source) { Permanent permanent = game.getPermanent(source.getSourceId()); Card card = game.getCard(cardId); if (permanent != null && card != null) { for (ActivatedAbility ability : card.getAbilities().getActivatedAbilities(Zone.BATTLEFIELD)) { permanent.addAbility(ability, source.getSourceId(), game); } } return false; } }
@Override public boolean apply(Game game, Permanent permanent, Ability source, UUID copyToObjectId) { Ability upkeepAbility = new BeginningOfUpkeepTriggeredAbility(new CryptoplasmEffect(), TargetController.YOU, true); upkeepAbility.addTarget(new TargetCreaturePermanent()); permanent.addAbility(upkeepAbility, source.getSourceId(), game); return true; }
@Override public boolean apply(Game game, Ability source) { Permanent permanent = game.getPermanent(this.getTargetPointer().getFirst(game, source)); if (permanent != null) { permanent.addAbility(new BecomesTargetTriggeredAbility(new SacrificeSourceEffect()), source.getSourceId(), game); return true; } return false; }
@Override public boolean apply(Game game, Ability source) { Permanent target = game.getPermanent(source.getFirstTarget()); if (target != null) { if (!target.getAbilities().contains(FlyingAbility.getInstance())) { target.addAbility(FlyingAbility.getInstance(), source.getSourceId(), game); return true; } } return false; }
@Override public boolean apply(Game game, Ability source) { Permanent permanent = game.getPermanent(getTargetPointer().getFirst(game, source)); if (permanent != null) { ActivatedAbilityImpl ability = new MartyrdomActivatedAbility(source.getControllerId()); ability.setMayActivate(TargetController.ANY); permanent.addAbility(ability, source.getSourceId(), game, false); return true; } return false; }
@Override public boolean apply(Game game, Ability source) { Permanent permanent = game.getPermanent(source.getSourceId()); if (permanent != null && new MageObjectReference(permanent, game).refersTo(source.getSourceObject(game), game)) { permanent.addAbility(ability, source.getSourceId(), game); } else { // the source permanent is no longer on the battlefield, effect can be discarded discard(); } return true; }
@Override public boolean apply(Game game, Permanent permanent, Ability source, UUID copyToObjectId) { Effect effect = new VesuvanShapeshifterFaceDownEffect(); Ability ability = new BeginningOfUpkeepTriggeredAbility(effect, TargetController.YOU, true); permanent.getAbilities().add(ability); // Why is this needed? permanent.addAbility(new MorphAbility(permanent, new ManaCostsImpl("{1}{U}")), permanent.getId(), game); return true; }
@Override public boolean apply(Game game, Permanent permanent, Ability source, UUID copyToObjectId) { Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DestroyTargetEffect(), new ManaCostsImpl("{U}{B}")); ability.addCost(new TapSourceCost()); ability.addTarget(new TargetCreaturePermanent(filter)); permanent.addAbility(ability, game); return true; }
@Override public boolean apply(Game game, Ability source) { Permanent permanent = game.getPermanent(source.getSourceId()); Permanent targetCreature = game.getPermanentOrLKIBattlefield(getTargetPointer().getFirst(game, source)); if (targetCreature != null && permanent != null) { Permanent blueprintPermanent = game.copyPermanent(Duration.Custom, targetCreature, permanent.getId(), source, new EmptyApplyToPermanent()); blueprintPermanent.addAbility(new EntersBattlefieldAllTriggeredAbility(Zone.BATTLEFIELD, new UnstableShapeshifterEffect(), filterAnotherCreature, false, SetTargetPointer.PERMANENT, ""), game); return true; } return false; } }
@Override public boolean apply(Game game, Ability source) { Permanent creature = game.getPermanent(getTargetPointer().getFirst(game, source)); if (creature != null) { FilterCard protectionFilter = (FilterCard) ((ProtectionAbility) ability).getFilter(); protectionFilter.add(new ColorPredicate(choice.getColor())); protectionFilter.setMessage(choice.getChoice()); ((ProtectionAbility) ability).setFilter(protectionFilter); creature.addAbility(ability, source.getSourceId(), game); return true; } return false; }
@Override public boolean apply(Game game, Permanent permanent, Ability source, UUID copyToObjectId) { permanent.addSuperType(SuperType.LEGENDARY); permanent.setName("Sakashima the Impostor"); // {2}{U}{U}: Return Sakashima the Impostor to its owner's hand at the beginning of the next end step permanent.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new CreateDelayedTriggeredAbilityEffect(new AtTheBeginOfNextEndStepDelayedTriggeredAbility(new ReturnToHandSourceEffect(true)), false), new ManaCostsImpl("{2}{U}{U}") ), game); return true; }