- Expanded checkDiscardCost.

- Added Phantasmagorian.
This commit is contained in:
Sloth
2012-12-03 15:47:49 +00:00
parent c438325d63
commit 03ca3d4872
5 changed files with 30 additions and 5 deletions

1
.gitattributes vendored
View File

@@ -7245,6 +7245,7 @@ res/cardsfolder/p/petrified_plating.txt svneol=native#text/plain
res/cardsfolder/p/petrified_wood_kin.txt -text res/cardsfolder/p/petrified_wood_kin.txt -text
res/cardsfolder/p/pewter_golem.txt svneol=native#text/plain res/cardsfolder/p/pewter_golem.txt svneol=native#text/plain
res/cardsfolder/p/phage_the_untouchable.txt -text res/cardsfolder/p/phage_the_untouchable.txt -text
res/cardsfolder/p/phantasmagorian.txt -text
res/cardsfolder/p/phantasmal_abomination.txt svneol=native#text/plain res/cardsfolder/p/phantasmal_abomination.txt svneol=native#text/plain
res/cardsfolder/p/phantasmal_bear.txt svneol=native#text/plain res/cardsfolder/p/phantasmal_bear.txt svneol=native#text/plain
res/cardsfolder/p/phantasmal_dragon.txt svneol=native#text/plain res/cardsfolder/p/phantasmal_dragon.txt svneol=native#text/plain

View File

@@ -0,0 +1,13 @@
Name:Phantasmagorian
ManaCost:5 B B
Types:Creature Horror
Text:no text
PT:6/6
T:Mode$ SpellCast | ValidCard$ Card.Self | Execute$ TrigCounter | TriggerDescription$ When you cast CARDNAME, any player may discard three cards. If a player does, counter CARDNAME.
SVar:TrigCounter:DB$ Counter | Cost$ 0 | UnlessCost$ Discard<3/Card> | Defined$ TriggeredSpellAbility | UnlessPayer$ Player | UnlessSwitched$ True
A:AB$ ChangeZone | Cost$ Discard<3/Card> | Origin$ Graveyard | Destination$ Hand | ActivationZone$ Graveyard | SpellDescription$ Return CARDNAME from your graveyard to your hand.
SVar:Rarity:Common
SVar:Picture:http://www.wizards.com/global/images/magic/general/phantasmagorian.jpg
SetInfo:PLC|Uncommon|http://magiccards.info/scans/en/pc/77.jpg
Oracle:When you cast Phantasmagorian, any player may discard three cards. If a player does, counter Phantasmagorian.\nDiscard three cards: Return Phantasmagorian from your graveyard to your hand.
End

View File

@@ -379,7 +379,6 @@ public final class GameActionUtil {
final ArrayList<CostPart> parts = cost.getCostParts(); final ArrayList<CostPart> parts = cost.getCostParts();
ArrayList<CostPart> remainingParts = new ArrayList<CostPart>(cost.getCostParts()); ArrayList<CostPart> remainingParts = new ArrayList<CostPart>(cost.getCostParts());
CostPart costPart = null; CostPart costPart = null;
int num_parts = parts.size();
if (!parts.isEmpty()) { if (!parts.isEmpty()) {
costPart = parts.get(0); costPart = parts.get(0);
} }
@@ -396,7 +395,7 @@ public final class GameActionUtil {
return; return;
} }
boolean hasPaid = true; boolean hasPaid = true;
//the three following costs do not need inputs //the following costs do not need inputs
for (CostPart part : parts) { for (CostPart part : parts) {
if (part instanceof CostPayLife) { if (part instanceof CostPayLife) {
String amountString = part.getAmount(); String amountString = part.getAmount();
@@ -449,6 +448,7 @@ public final class GameActionUtil {
} }
remainingParts.remove(part); remainingParts.remove(part);
} }
else if (part instanceof CostExile) { else if (part instanceof CostExile) {
Player p = Singletons.getControl().getPlayer(); Player p = Singletons.getControl().getPlayer();
if ("All".equals(part.getType())) { if ("All".equals(part.getType())) {
@@ -486,6 +486,7 @@ public final class GameActionUtil {
} }
} }
} }
else if (part instanceof CostSacrifice) { else if (part instanceof CostSacrifice) {
CostSacrifice sacCost = (CostSacrifice) part; CostSacrifice sacCost = (CostSacrifice) part;
@@ -522,7 +523,10 @@ public final class GameActionUtil {
list.remove(c); list.remove(c);
} }
} }
remainingParts.remove(part);
}
else if (part instanceof CostMana && ((CostMana) part).getManaToPay().equals("0")) {
remainingParts.remove(part); remainingParts.remove(part);
} }
} }

View File

@@ -1628,6 +1628,7 @@ public class AbilityFactory {
} }
if (ComputerUtil.canPayCost(ability, payer) && CostUtil.checkLifeCost(payer, cost, source, 4, sa) if (ComputerUtil.canPayCost(ability, payer) && CostUtil.checkLifeCost(payer, cost, source, 4, sa)
&& CostUtil.checkDamageCost(payer, cost, source, 4) && CostUtil.checkDamageCost(payer, cost, source, 4)
&& CostUtil.checkDiscardCost(payer, cost, source)
&& (!source.getName().equals("Tyrannize") || payer.getCardsIn(ZoneType.Hand).size() > 2) && (!source.getName().equals("Tyrannize") || payer.getCardsIn(ZoneType.Hand).size() > 2)
&& (!source.getName().equals("Breaking Point") || payer.getCreaturesInPlay().size() > 1)) { && (!source.getName().equals("Breaking Point") || payer.getCreaturesInPlay().size() > 1)) {
// AI was crashing because the blank ability used to pay costs // AI was crashing because the blank ability used to pay costs

View File

@@ -215,8 +215,14 @@ public class CostUtil {
if (typeList.size() > ai.getMaxHandSize()) { if (typeList.size() > ai.getMaxHandSize()) {
continue; continue;
} }
if (ComputerUtil.getCardPreference(ai, source, "DiscardCost", typeList) == null) { int num = AbilityFactory.calculateAmount(source, disc.getAmount(), null);
return false; for (int i = 0; i < num; i++) {
Card pref = ComputerUtil.getCardPreference(ai, source, "DiscardCost", typeList);
if (pref == null) {
return false;
} else {
typeList.remove(pref);
}
} }
} }
} }