- Fixed Fettergeist.

This commit is contained in:
Sloth
2012-09-19 10:52:58 +00:00
parent c891188a56
commit 4a762f7e4e
2 changed files with 15 additions and 11 deletions

View File

@@ -447,10 +447,23 @@ public final class GameActionUtil {
*/
public static void payCostDuringAbilityResolve(final SpellAbility ability, final Cost cost, final Command paid, final Command unpaid) {
final Card source = ability.getSourceCard();
if (cost.getCostParts().size() > 1) {
final ArrayList<CostPart> parts = cost.getCostParts();
if (parts.size() > 1) {
throw new RuntimeException("GameActionUtil::payCostDuringAbilityResolve - Too many payment types - " + source);
}
final CostPart costPart = cost.getCostParts().get(0);
CostPart costPart = null;
if (!parts.isEmpty()) {
costPart = parts.get(0);
}
if (parts.isEmpty() || costPart.getAmount().equals("0")) {
if (showYesNoDialog(source, "Do you want to pay 0?")) {
paid.execute();
} else {
unpaid.execute();
}
return;
}
if (costPart instanceof CostPayLife) {
String amountString = costPart.getAmount();
final int amount = amountString.matches("[0-9][0-9]?") ? Integer.parseInt(amountString)
@@ -520,14 +533,6 @@ public final class GameActionUtil {
AllZone.getStack().setResolving(bResolving);
}
else if (costPart instanceof CostMana) {
if (costPart.getAmount().equals("0")) {
if (showYesNoDialog(source, "Do you want to pay 0?")) {
paid.execute();
} else {
unpaid.execute();
}
return;
}
// temporarily disable the Resolve flag, so the user can payMana for the
// resolving Ability
final boolean bResolving = AllZone.getStack().getResolving();

View File

@@ -2796,7 +2796,6 @@ public class AbilityFactory {
};
if (payer.isHuman()) {
//GameActionUtil.payCostDuringAbilityResolve(source + "\r\n", source, unlessCost, paidCommand, unpaidCommand);
GameActionUtil.payCostDuringAbilityResolve(ability, cost, paidCommand, unpaidCommand);
} else {
if (ComputerUtil.canPayCost(ability) && CostUtil.checkLifeCost(cost, source, 4)