@Override public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); Permanent sourcePermanent = game.getPermanentOrLKIBattlefield(source.getSourceId()); if (controller != null && sourcePermanent != null) { TargetControlledPermanent target = new TargetControlledPermanent(1, 1, filter, true); SacrificeTargetCost cost = new SacrificeTargetCost(target); if (!controller.chooseUse(Outcome.AIDontUseIt, "Do you wish to sacrifice an Island?", source, game) || !cost.canPay(source, source.getSourceId(), source.getControllerId(), game) || !cost.pay(source, game, source.getSourceId(), source.getControllerId(), true)) { sourcePermanent.sacrifice(source.getSourceId(), game); controller.damage(6, sourcePermanent.getId(), game, false, true); } return true; } return false; } }
@Override public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); Permanent minionLeshrac = game.getPermanentOrLKIBattlefield(source.getSourceId()); if (controller != null && minionLeshrac != null) { FilterControlledPermanent filterCreature = new FilterControlledPermanent(); filterCreature.add(new CardTypePredicate(CardType.CREATURE)); filterCreature.add(AnotherPredicate.instance); TargetControlledPermanent target = new TargetControlledPermanent(filterCreature); SacrificeTargetCost cost = new SacrificeTargetCost(target); if (controller.chooseUse(Outcome.AIDontUseIt, "Do you wish to sacrifice another creature to prevent the 5 damage to you?", source, game) && cost.canPay(source, source.getSourceId(), source.getControllerId(), game) && cost.pay(source, game, source.getSourceId(), source.getControllerId(), true)) { return true; } if (controller.damage(5, minionLeshrac.getId(), game, false, true) > 0) { minionLeshrac.tap(game); return true; } } return false; }
@Override public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); Permanent sourcePermanent = game.getPermanentOrLKIBattlefield(source.getSourceId()); if (controller != null && sourcePermanent != null) { TargetControlledPermanent target = new TargetControlledPermanent(1, 1, filter, true); SacrificeTargetCost cost = new SacrificeTargetCost(target); if (!controller.chooseUse(Outcome.Benefit, "Do you wish to sacrifice a Forest?", source, game) || !cost.canPay(source, source.getSourceId(), source.getControllerId(), game) || !cost.pay(source, game, source.getSourceId(), source.getControllerId(), true)) { sourcePermanent.sacrifice(source.getSourceId(), game); controller.damage(7, sourcePermanent.getId(), game, false, true); } else if (cost.isPaid()) { for (Permanent permanent : cost.getPermanents()) { if (filterSnow.match(permanent, game)) { game.addEffect(new GainAbilitySourceEffect(TrampleAbility.getInstance(), Duration.EndOfTurn), source); break; } } } return true; } return false; } }
@Override public boolean apply(Game game, Ability source) { MageObject sourceObject = source.getSourceObject(game); if (sourceObject != null) { SacrificeTargetCost cost = new SacrificeTargetCost(new TargetControlledCreaturePermanent(FILTER_CONTROLLED_CREATURE_SHORT_TEXT)); for (UUID playerId : game.getState().getPlayerList(source.getControllerId())) { cost.clearPaid(); Player player = game.getPlayer(playerId); if (player != null && cost.canPay(source, source.getSourceId(), player.getId(), game) && player.chooseUse(outcome, "Sacrifice a creature to counter " + sourceObject.getIdName() + '?', source, game)) { if (cost.pay(source, game, source.getSourceId(), player.getId(), false, null)) { game.informPlayers(player.getLogName() + " sacrifices a creature to counter " + sourceObject.getIdName() + '.'); Spell spell = game.getStack().getSpell(source.getSourceId()); if (spell != null) { game.getStack().counter(spell.getId(), source.getSourceId(), game); } } } } return true; } return false; } }