public ExileFromGraveCost(final ExileFromGraveCost cost) { super(cost); this.exiledCards.addAll(cost.getExiledCards()); }
@Override public int calculate(Game game, Ability sourceAbility, Effect effect) { for (Cost cost : sourceAbility.getCosts()) { if (cost.isPaid() && cost instanceof ExileFromGraveCost) { int xValue = 0; for (Card card : ((ExileFromGraveCost) cost).getExiledCards()) { xValue += card.getConvertedManaCost(); } return xValue; } } return 0; }
@Override public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); if (controller != null) { int amount = 0; for (Cost cost : source.getCosts()) { if (cost instanceof ExileFromGraveCost) { amount = ((ExileFromGraveCost) cost).getExiledCards().size() * 2; new CreateTokenEffect(new CorpseweftZombieToken(amount, amount), 1, true, false).apply(game, source); } } if (amount > 0) { } } return false; } }
@Override public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); if (controller != null) { Permanent targetCreature = game.getPermanent(getTargetPointer().getFirst(game, source)); if (targetCreature != null) { int amount = 0; for (Cost cost : source.getCosts()) { if (cost instanceof ExileFromGraveCost) { amount = ((ExileFromGraveCost) cost).getExiledCards().size(); ContinuousEffect effect = new BoostTargetEffect(-amount, -amount, Duration.EndOfTurn); effect.setTargetPointer(new FixedTarget(source.getTargets().getFirstTarget())); game.addEffect(effect, source); } } } } return false; } }
@Override public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); if (controller != null) { ExileFromGraveCost exileFromGraveCost = (ExileFromGraveCost) source.getCosts().get(0); List<Card> exiledCards = exileFromGraveCost.getExiledCards(); if (!exiledCards.isEmpty()) { Cards toDelve = new CardsImpl(); for (Card card : exiledCards) { toDelve.add(card); } ManaPool manaPool = controller.getManaPool(); manaPool.addMana(new Mana(0, 0, 0, 0, 0, 0, 0, toDelve.size()), game, source); manaPool.unlockManaType(ManaType.COLORLESS); String keyString = CardUtil.getCardZoneString("delvedCards", source.getSourceId(), game); @SuppressWarnings("unchecked") Cards delvedCards = (Cards) game.getState().getValue(keyString); if (delvedCards == null) { game.getState().setValue(keyString, toDelve); } else { delvedCards.addAll(toDelve); } } return true; } return false; } }
xValue = ((ExileFromGraveCost) cost).getExiledCards().size();