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:
1
.gitattributes
vendored
1
.gitattributes
vendored
@@ -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/pewter_golem.txt svneol=native#text/plain
|
||||
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_bear.txt svneol=native#text/plain
|
||||
res/cardsfolder/p/phantasmal_dragon.txt svneol=native#text/plain
|
||||
|
||||
13
res/cardsfolder/p/phantasmagorian.txt
Normal file
13
res/cardsfolder/p/phantasmagorian.txt
Normal 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
|
||||
@@ -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