mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-18 19:58:00 +00:00
- Expanded checkDiscardCost.
- Added Phantasmagorian.
This commit is contained in:
@@ -379,7 +379,6 @@ public final class GameActionUtil {
|
||||
final ArrayList<CostPart> parts = cost.getCostParts();
|
||||
ArrayList<CostPart> remainingParts = new ArrayList<CostPart>(cost.getCostParts());
|
||||
CostPart costPart = null;
|
||||
int num_parts = parts.size();
|
||||
if (!parts.isEmpty()) {
|
||||
costPart = parts.get(0);
|
||||
}
|
||||
@@ -396,7 +395,7 @@ public final class GameActionUtil {
|
||||
return;
|
||||
}
|
||||
boolean hasPaid = true;
|
||||
//the three following costs do not need inputs
|
||||
//the following costs do not need inputs
|
||||
for (CostPart part : parts) {
|
||||
if (part instanceof CostPayLife) {
|
||||
String amountString = part.getAmount();
|
||||
@@ -449,6 +448,7 @@ public final class GameActionUtil {
|
||||
}
|
||||
remainingParts.remove(part);
|
||||
}
|
||||
|
||||
else if (part instanceof CostExile) {
|
||||
Player p = Singletons.getControl().getPlayer();
|
||||
if ("All".equals(part.getType())) {
|
||||
@@ -486,6 +486,7 @@ public final class GameActionUtil {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
else if (part instanceof CostSacrifice) {
|
||||
|
||||
CostSacrifice sacCost = (CostSacrifice) part;
|
||||
@@ -522,7 +523,10 @@ public final class GameActionUtil {
|
||||
list.remove(c);
|
||||
}
|
||||
}
|
||||
|
||||
remainingParts.remove(part);
|
||||
}
|
||||
|
||||
else if (part instanceof CostMana && ((CostMana) part).getManaToPay().equals("0")) {
|
||||
remainingParts.remove(part);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1628,6 +1628,7 @@ public class AbilityFactory {
|
||||
}
|
||||
if (ComputerUtil.canPayCost(ability, payer) && CostUtil.checkLifeCost(payer, cost, source, 4, sa)
|
||||
&& CostUtil.checkDamageCost(payer, cost, source, 4)
|
||||
&& CostUtil.checkDiscardCost(payer, cost, source)
|
||||
&& (!source.getName().equals("Tyrannize") || payer.getCardsIn(ZoneType.Hand).size() > 2)
|
||||
&& (!source.getName().equals("Breaking Point") || payer.getCreaturesInPlay().size() > 1)) {
|
||||
// AI was crashing because the blank ability used to pay costs
|
||||
|
||||
@@ -215,8 +215,14 @@ public class CostUtil {
|
||||
if (typeList.size() > ai.getMaxHandSize()) {
|
||||
continue;
|
||||
}
|
||||
if (ComputerUtil.getCardPreference(ai, source, "DiscardCost", typeList) == null) {
|
||||
return false;
|
||||
int num = AbilityFactory.calculateAmount(source, disc.getAmount(), null);
|
||||
for (int i = 0; i < num; i++) {
|
||||
Card pref = ComputerUtil.getCardPreference(ai, source, "DiscardCost", typeList);
|
||||
if (pref == null) {
|
||||
return false;
|
||||
} else {
|
||||
typeList.remove(pref);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user