@Override public boolean apply(Game game, Ability source) { Effect effect1 = new DestroyTargetEffect("destroy that land"); effect1.apply(game, source); return new DamageEverythingEffect(1).apply(game, source); } }
@Override public boolean apply(Game game, Ability source) { Permanent sourcePerm = game.getPermanent(source.getSourceId()); if (sourcePerm == null) { return false; } Effect effect = new BecomesChosenCreatureTypeTargetEffect(nonWall, duration); effect.setTargetPointer(new FixedTarget(sourcePerm, game)); return effect.apply(game, source); }
@Override public boolean apply(Game game, Ability source) { Object object = game.getState().getValue(source.getSourceId().toString() + "returnedCreature"); if ((object instanceof MageObjectReference)) { Effect effect = new ExileTargetEffect(null, "", Zone.BATTLEFIELD); effect.setTargetPointer(new FixedTarget(((MageObjectReference) object).getSourceId())); effect.apply(game, source); } return false; } }
@Override public boolean apply(Game game, Ability source) { Effect effect = new BecomesColorOrColorsTargetEffect(Duration.Custom); effect.setTargetPointer(new FixedTarget(source.getSourceId(), source.getSourceObjectZoneChangeCounter())); return effect.apply(game, source); } }
@Override public boolean apply(Game game, Ability source) { Permanent imminentDoom = game.getPermanent(source.getSourceId()); if (imminentDoom != null) { Effect effect = new DamageTargetEffect((int) game.getState().getValue("ImminentDoomCount" + source.getSourceId().toString())); effect.apply(game, source); imminentDoom.addCounters(CounterType.DOOM.createInstance(), source, game); return true; } return false; }
@Override public boolean apply(Game game, Ability source) { Player player = game.getPlayerOrPlaneswalkerController(source.getFirstTarget()); if (player == null) { return false; } Effect effect = new DiscardTargetEffect(2); effect.setTargetPointer(new FixedTarget(player.getId(), game)); return effect.apply(game, source); } }
@Override public boolean apply(Game game, Ability source) { int damage = (int) this.getValue("damage"); if (damage > 0) { Effect effect = new CreateTokenTargetEffect(new SurvivorToken(), damage); effect.setTargetPointer(getTargetPointer()); return effect.apply(game, source); } return false; } }
@Override public boolean apply(Game game, Ability source) { Player player = game.getPlayerOrPlaneswalkerController(source.getFirstTarget()); if (player == null) { return false; } Effect effect = new DiscardTargetEffect(ManacostVariableValue.instance); effect.setTargetPointer(new FixedTarget(player.getId(), game)); return effect.apply(game, source); } }
@Override public boolean apply(Game game, Ability source) { Permanent permanent = (Permanent) source.getSourceObjectIfItStillExists(game); if (permanent != null) { if (permanent.sacrifice(source.getSourceId(), game)) { Effect effect = new DestroyTargetEffect(); effect.setTargetPointer(this.getTargetPointer()); return effect.apply(game, source); } } return false; } }
@Override public boolean apply(Game game, Ability source) { Object object = game.getState().getValue(source.getSourceId().toString() + "returnedCreature"); if ((object instanceof MageObjectReference)) { Effect effect = new ExileTargetEffect(); effect.setTargetPointer(new FixedTarget(((MageObjectReference) object).getSourceId())); effect.apply(game, source); return new ReturnToHandSourceEffect(true).apply(game, source); } return false; } }
@Override public boolean apply(Game game, Ability source) { Permanent targetCreature = game.getPermanentOrLKIBattlefield(getTargetPointer().getFirst(game, source)); if (targetCreature != null) { Effect effect = new ManifestTargetPlayerEffect(1, "Its controller"); effect.setTargetPointer(new FixedTarget(targetCreature.getControllerId())); return effect.apply(game, source); } return false; } }
@Override public boolean apply(Game game, Ability source) { Permanent permanent = (Permanent) source.getSourceObjectIfItStillExists(game); if (permanent != null) { if (permanent.sacrifice(source.getSourceId(), game)) { Effect effect = new DamageTargetEffect(4).setText("{this} deals 4 damage to it"); effect.setTargetPointer(this.getTargetPointer()); return effect.apply(game, source); } } return false; } }
@Override public boolean apply(Game game, Ability source) { Permanent enchantment = game.getPermanentOrLKIBattlefield(source.getSourceId()); Permanent target = game.getPermanentOrLKIBattlefield(enchantment.getAttachedTo()); if (target != null) { Effect effect = new CreateTokenCopyTargetEffect(); effect.setTargetPointer(new FixedTarget(enchantment.getAttachedTo())); return effect.apply(game, source); } return false; } }
@Override public boolean apply(Game game, Ability source) { for (Permanent creature : game.getBattlefield().getActivePermanents(StaticFilters.FILTER_PERMANENT_CREATURE, source.getControllerId(), game)) { if (!creature.isControlledBy(source.getControllerId())) { Effect effect = new GoadTargetEffect(); effect.setTargetPointer(new FixedTarget(creature, game)); effect.apply(game, source); } } return true; } }
@Override public boolean apply(Game game, Ability source) { Card card = game.getCard(source.getSourceId()); if (card != null) { int count = card.getPower().getValue(); if (count > 0) { Effect effect = new AddCountersTargetEffect(CounterType.P1P1.createInstance(count)); effect.setTargetPointer(getTargetPointer()); return effect.apply(game, source); } } return false; }
@Override public boolean apply(Game game, Ability source) { Permanent creature = game.getPermanent(source.getFirstTarget()); if (creature == null) { return false; } Effect effect = new CreateTokenTargetEffect(new OxToken()); effect.setTargetPointer(new FixedTarget(creature.getControllerId(), game)); new DestroyTargetEffect().apply(game, source); return effect.apply(game, source); } }
@Override public boolean apply(Game game, Ability source) { Player attacker = game.getPlayer(this.getTargetPointer().getFirst(game, source)); if (attacker != null && attacker.chooseUse(outcome, "create a tapped 2/2 black Zombie creature token?", source, game)) { Effect effect = new CreateTokenTargetEffect(new ZombieToken(), new StaticValue(1), true, false); effect.setTargetPointer(targetPointer); return effect.apply(game, source); } return false; } }
@Override public boolean apply(Game game, Ability source) { Card card = game.getCard(getTargetPointer().getFirst(game, source)); Player controller = game.getPlayer(source.getControllerId()); if (card != null && controller != null) { controller.moveCards(card, Zone.BATTLEFIELD, source, game); Effect effect = new AttachEffect(Outcome.AddAbility); effect.setTargetPointer(new FixedTarget(card.getId())); effect.apply(game, source); return true; } return false; }
@Override public boolean apply(Game game, Ability source) { Permanent permanent = game.getPermanent(source.getSourceId()); Player controller = game.getPlayer(source.getControllerId()); if (controller != null && permanent != null && permanent.getCounters(game).getCount(CounterType.P1P1) > 0) { permanent.removeCounters(CounterType.P1P1.createInstance(), game); Effect effect = new CreateTokenEffect(new ZombieToken()); return effect.apply(game, source); } return false; } }
@Override public boolean apply(Game game, Ability source) { Permanent permanent = game.getPermanent(source.getFirstTarget()); if (permanent != null) { permanent.destroy(source.getSourceId(), game, false); } Effect effect = new DamageTargetEffect(new StaticValue(2), true, "", true); effect.setTargetPointer(new FixedTarget(source.getTargets().get(1).getFirstTarget(), game)); effect.apply(game, source); return true; } }