- Bolas's Citadel now handles additional costs correctly.

This commit is contained in:
Jeff 2019-04-30 17:21:03 -05:00
parent c5249d6ef0
commit 2352e9d765

View file

@ -23,6 +23,7 @@ import mage.players.Player;
import mage.target.common.TargetControlledPermanent; import mage.target.common.TargetControlledPermanent;
import java.util.UUID; import java.util.UUID;
import mage.abilities.costs.Cost;
/** /**
* @author jeffwadsworth * @author jeffwadsworth
@ -98,9 +99,14 @@ class BolassCitadelPlayTheTopCardEffect extends AsThoughEffectImpl {
Player controller = game.getPlayer(cardOnTop.getOwnerId()); Player controller = game.getPlayer(cardOnTop.getOwnerId());
if (controller != null if (controller != null
&& cardOnTop.equals(controller.getLibrary().getFromTop(game))) { && cardOnTop.equals(controller.getLibrary().getFromTop(game))) {
// add the life cost first
PayLifeCost cost = new PayLifeCost(cardOnTop.getManaCost().convertedManaCost()); PayLifeCost cost = new PayLifeCost(cardOnTop.getManaCost().convertedManaCost());
Costs costs = new CostsImpl(); Costs costs = new CostsImpl();
costs.add(cost); costs.add(cost);
// check for additional costs that must be paid
for (Cost additionalCost : cardOnTop.getSpellAbility().getCosts()) {
costs.add(additionalCost);
}
controller.setCastSourceIdWithAlternateMana(cardOnTop.getId(), null, costs); controller.setCastSourceIdWithAlternateMana(cardOnTop.getId(), null, costs);
return true; return true;
} }