- Fixed Mosswort Bridge

- fixed a possible NPE related to xCount with SAs
This commit is contained in:
moomarc
2012-09-19 05:54:34 +00:00
parent 6fcac03089
commit fd0f91435c
2 changed files with 35 additions and 31 deletions

View File

@@ -6,7 +6,7 @@ K:Hideaway
T:Mode$ ChangesZone | Destination$ Battlefield | ValidCard$ Card.Self | Execute$ TrigDig | TriggerDescription$ This land enters the battlefield tapped. When it does, look at the top four cards of your library, exile one face down, then put the rest on the bottom of your library.
SVar:TrigDig:AB$ Dig | Cost$ 0 | Defined$ You | DigNum$ 4 | DestinationZone$ Exile | ExileFaceDown$ True | RememberChanged$ True | ForgetOtherRemembered$ True
A:AB$ Mana | Cost$ T | Produced$ G | SpellDescription$ Add G to your mana pool.
A:AB$ Play | Cost$ G T | Defined$ Remembered | Controller$ You | WithoutManaCost$ True | Optional$ True | ConditionCheckSVar$ X | ConditionSVarCompare$ GE10 | ForgetRemembered$ True | SpellDescription$ You may play the exiled card without paying its mana cost if creatures you control have total power 10 or greater.
A:AB$ Play | Cost$ G T | Defined$ Remembered | Controller$ You | WithoutManaCost$ True | Optional$ True | References$ X | ConditionCheckSVar$ X | ConditionSVarCompare$ GE10 | ForgetRemembered$ True | SpellDescription$ You may play the exiled card without paying its mana cost if creatures you control have total power 10 or greater.
SVar:X:Count$SumPower_Creature.YouCtrl
SVar:Rarity:Rare
SVar:Picture:http://www.wizards.com/global/images/magic/general/mosswort_bridge.jpg

View File

@@ -2329,6 +2329,8 @@ public class CardFactoryUtil {
* a {@link forge.Card} object.
* @param s
* a {@link java.lang.String} object.
* @param sa
* a {@link forge.SpellAbility} object.
* @return a int.
*/
public static int xCount(final Card c, final String s, final SpellAbility sa) {
@@ -2339,6 +2341,7 @@ public class CardFactoryUtil {
final String[] sq;
sq = l[0].split("\\.");
if (sa != null) {
// Count$Kicked.<numHB>.<numNotHB>
if (sq[0].contains("Kicked")) {
if (sa.isKicked()) {
@@ -2347,6 +2350,7 @@ public class CardFactoryUtil {
return CardFactoryUtil.doXMath(Integer.parseInt(sq[2]), m, c); // not Kicked
}
}
}
return xCount(c, s);
}
@@ -2812,7 +2816,7 @@ public class CardFactoryUtil {
for (int i = 0; i < filteredCards.size(); i++) {
sumPower += filteredCards.get(i).getManaCost().getCMC();
}
return sumPower;
return CardFactoryUtil.doXMath(sumPower, m, c);
}
// Count$CardManaCost
if (sq[0].contains("CardManaCost")) {