@Override public boolean apply(Game game, Ability source) { Permanent creature = game.getPermanentOrLKIBattlefield(source.getFirstTarget()); if (creature == null) { return false; } return new GainLifeEffect(creature.getToughness().getValue()).apply(game, source); } }
@Override public boolean apply(Game game, Ability source) { Permanent perm = game.getPermanent(source.getSourceId()); GainLifeEffect lifeEffect = new GainLifeEffect(perm.getPower().getValue()); return lifeEffect.apply(game, source); } }
@Override public boolean apply(Game game, Ability source) { RevealTargetFromHandCost cost = new RevealTargetFromHandCost(new TargetCardInHand(0, Integer.MAX_VALUE, filter)); if (!cost.pay(source, game, source.getSourceId(), source.getControllerId(), true)) { return false; } int xValue = cost.getNumberRevealedCards(); return new GainLifeEffect(2 * xValue).apply(game, source); } }
@Override public boolean apply(Game game, Ability source) { RevealTargetFromHandCost cost = new RevealTargetFromHandCost(new TargetCardInHand(0, Integer.MAX_VALUE, filter)); if (!cost.pay(source, game, source.getSourceId(), source.getControllerId(), true)) { return false; } int xValue = cost.getNumberRevealedCards(); return new GainLifeEffect(2 * xValue).apply(game, source); } }
@Override public boolean apply(Game game, Ability source) { int counter = 0; for (Permanent permanent : game.getBattlefield().getActivePermanents( StaticFilters.FILTER_PERMANENT_CREATURE, source.getControllerId(), source.getSourceId(), game )) { if (permanent != null) { boolean isMine = permanent.isControlledBy(source.getControllerId()); if (permanent.destroy(source.getSourceId(), game, false) && isMine) { counter++; } } } return new GainLifeEffect(counter).apply(game, source); } }
@Override public boolean apply(Game game, Ability source) { Player player = game.getPlayer(source.getControllerId()); Choice typeChoice = new ChoiceCreatureType(game.getObject(source.getSourceId())); if (player != null && player.choose(Outcome.BoostCreature, typeChoice, game)) { FilterControlledPermanent filter = new FilterControlledPermanent(); filter.add(new SubtypePredicate(SubType.byDescription(typeChoice.getChoice()))); return new GainLifeEffect(new PermanentsOnBattlefieldCount(filter, 2)).apply(game, source); } return false; } }
@Override public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); if (controller != null) { int destroyedCreature = 0; FilterCreaturePermanent filter = new FilterCreaturePermanent("all tapped creatures"); filter.add(TappedPredicate.instance); for(Permanent creature: game.getState().getBattlefield().getActivePermanents(filter, controller.getId(), game)) { if (creature.destroy(source.getSourceId(), game, false)) { destroyedCreature++; } } if (destroyedCreature > 0) { new GainLifeEffect(destroyedCreature * 2).apply(game, source); } return true; } return false; } }
@Override public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); if (controller == null) { return false; } ChoiceColor choice = new ChoiceColor(); if (controller.choose(outcome, choice, game)) { game.informPlayers(controller.getLogName() + " chooses " + choice.getColor()); FilterPermanent filter = new FilterPermanent(); filter.add(new ColorPredicate(choice.getColor())); int cardsWithColor = game.getBattlefield().count(filter, source.getSourceId(), controller.getId(), game); if (cardsWithColor > 0) { new GainLifeEffect(cardsWithColor).apply(game, source); } return true; } return false; } }