- Added Koskun Falls

This commit is contained in:
swordshine
2013-03-30 12:37:09 +00:00
parent ba5c9fbc84
commit c238925c22
3 changed files with 38 additions and 0 deletions

View File

@@ -51,6 +51,7 @@ import forge.card.cost.CostPutCounter;
import forge.card.cost.CostRemoveCounter;
import forge.card.cost.CostReturn;
import forge.card.cost.CostSacrifice;
import forge.card.cost.CostTapType;
import forge.card.cost.CostUtil;
import forge.card.mana.ManaCost;
import forge.card.spellability.Ability;
@@ -563,6 +564,31 @@ public final class GameActionUtil {
cpl.reportPaidCardsTo(sourceAbility);
}
else if (part instanceof CostTapType) {
List<Card> choiceList = CardLists.getValidCards(p.getCardsIn(ZoneType.Battlefield), part.getType().split(";"), p, source);
choiceList = CardLists.filter(choiceList, Presets.UNTAPPED);
int amount = getAmountFromPartX(part, source, sourceAbility);
if (choiceList.size() < amount) {
// unable to pay (not enough cards)
return false;
}
InputSelectCards inp = new InputSelectCardsFromList(amount, amount, choiceList);
inp.setMessage("Select %d card(s) to tap");
inp.setCancelAllowed(true);
FThreads.setInputAndWait(inp);
if (inp.hasCancelled() || inp.getSelected().size() != amount)
return false;
CostPartWithList cpl = (CostPartWithList)part;
for (Card c : inp.getSelected()) {
cpl.executePayment(sourceAbility, c);
}
cpl.reportPaidCardsTo(sourceAbility);
}
else if (part instanceof CostPartMana ) {
if (!((CostPartMana) part).getManaToPay().equals("0")) // non-zero costs require input
mayRemovePart = false;