@Override public boolean apply(Game game, Ability source) { int amount = (Integer) getValue("damage"); if (amount > 0) { Player controller = game.getPlayer(source.getControllerId()); if (controller != null) { return new GetEnergyCountersControllerEffect(amount).apply(game, source); } } return false; } }
@Override public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); if (controller != null) { new GetEnergyCountersControllerEffect(4).apply(game, source); Permanent targetPermanent = game.getPermanent(getTargetPointer().getFirst(game, source)); if (targetPermanent != null) { Cost cost = new PayEnergyCost(targetPermanent.getManaCost().convertedManaCost()); if (cost.canPay(source, source.getSourceId(), source.getControllerId(), game)) { int convertedManaCost = targetPermanent.getManaCost().convertedManaCost(); StringBuilder energy = new StringBuilder(convertedManaCost); for (int i = 0; i < convertedManaCost; i++) { energy.append("{E}"); } if (controller.chooseUse(outcome, "Pay " + energy + " to get control of " + targetPermanent.getLogName() + '?', source, game)) { if (cost.pay(source, game, source.getSourceId(), source.getControllerId(), true)) { ContinuousEffect controllEffect = new GainControlTargetEffect(Duration.Custom); controllEffect.setTargetPointer(new FixedTarget(targetPermanent, game)); game.addEffect(controllEffect, source); } } } } return true; } return false; } }
@Override public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); if (controller != null) { new GetEnergyCountersControllerEffect(3).apply(game, source); int numberToPay = controller.getAmount(0, controller.getCounters().getCount(CounterType.ENERGY), "How many {E} do you like to pay?", game); if (numberToPay > 0) { Cost cost = new PayEnergyCost(numberToPay); if (cost.pay(source, game, source.getSourceId(), source.getControllerId(), true)) { Permanent targetCreature = game.getPermanent(getTargetPointer().getFirst(game, source)); if (targetCreature != null) { targetCreature.damage(numberToPay, source.getSourceId(), game, false, true); } } } return true; } return false; } }
@Override public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); if (controller != null) { new GetEnergyCountersControllerEffect(2).apply(game, source); if (controller.getCounters().getCount(CounterType.ENERGY) > 7) { Cost cost = new PayEnergyCost(8); if (controller.chooseUse(outcome, "Pay {E}{E}{E}{E}{E}{E}{E}{E} to use this? ", "Untap all creatures you control and after this phase, there is an additional combat phase.", "Yes", "No", source, game) && cost.pay(source, game, source.getSourceId(), source.getControllerId(), true)) { new UntapAllControllerEffect(new FilterControlledCreaturePermanent()).apply(game, source); new AdditionalCombatPhaseEffect().apply(game, source); } } return true; } return false; }
@Override public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); if (controller != null) { new GetEnergyCountersControllerEffect(2).apply(game, source); int max = controller.getCounters().getCount(CounterType.ENERGY); int numberToPayed = controller.getAmount(0, max, "How many energy counters do you like to pay? (maximum = " + max + ')', game); if (numberToPayed > 0) { Cost cost = new PayEnergyCost(numberToPayed); if (cost.pay(source, game, source.getSourceId(), source.getControllerId(), true)) { Permanent targetCreature = game.getPermanent(getTargetPointer().getFirst(game, source)); if (targetCreature != null) { numberToPayed *= -1; ContinuousEffect effect = new BoostTargetEffect(numberToPayed, numberToPayed, Duration.EndOfTurn); effect.setTargetPointer(new FixedTarget(targetCreature, game)); game.addEffect(effect, source); } } } return true; } return false; } }