mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-18 03:38:01 +00:00
- Fixed Mosswort Bridge
- fixed a possible NPE related to xCount with SAs
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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,12 +2341,14 @@ public class CardFactoryUtil {
|
||||
final String[] sq;
|
||||
sq = l[0].split("\\.");
|
||||
|
||||
// Count$Kicked.<numHB>.<numNotHB>
|
||||
if (sq[0].contains("Kicked")) {
|
||||
if (sa.isKicked()) {
|
||||
return CardFactoryUtil.doXMath(Integer.parseInt(sq[1]), m, c); // Kicked
|
||||
} else {
|
||||
return CardFactoryUtil.doXMath(Integer.parseInt(sq[2]), m, c); // not Kicked
|
||||
if (sa != null) {
|
||||
// Count$Kicked.<numHB>.<numNotHB>
|
||||
if (sq[0].contains("Kicked")) {
|
||||
if (sa.isKicked()) {
|
||||
return CardFactoryUtil.doXMath(Integer.parseInt(sq[1]), m, c); // Kicked
|
||||
} else {
|
||||
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")) {
|
||||
@@ -4680,19 +4684,19 @@ public class CardFactoryUtil {
|
||||
+ Counters.valueOf(splitkw[1]).getName() + " counters on it.";
|
||||
String extraparams = "";
|
||||
String amount = splitkw[2];
|
||||
if(splitkw.length > 3) {
|
||||
if(!splitkw[3].equals("no Condition")) {
|
||||
if (splitkw.length > 3) {
|
||||
if (!splitkw[3].equals("no Condition")) {
|
||||
extraparams = splitkw[3];
|
||||
}
|
||||
}
|
||||
if(splitkw.length > 4) {
|
||||
if (splitkw.length > 4) {
|
||||
desc = splitkw[4];
|
||||
}
|
||||
String repStr = "DB$ PutCounter | Defined$ Self | CounterType$ " + splitkw[1] + " | CounterNum$ " + amount;
|
||||
try {
|
||||
Integer.parseInt(amount);
|
||||
}
|
||||
catch(NumberFormatException ignored) {
|
||||
catch (NumberFormatException ignored) {
|
||||
repStr += " | References$ " + amount;
|
||||
}
|
||||
SpellAbility repAb = af.getAbility(repStr, card);
|
||||
@@ -4719,19 +4723,19 @@ public class CardFactoryUtil {
|
||||
String desc = "CARDNAME enters the battlefield with " + splitkw[2] + " " + splitkw[1] + " counters on it.";
|
||||
String extraparams = "";
|
||||
String amount = splitkw[2];
|
||||
if(splitkw.length > 3) {
|
||||
if(!splitkw[3].equals("no Condition")) {
|
||||
if (splitkw.length > 3) {
|
||||
if (!splitkw[3].equals("no Condition")) {
|
||||
extraparams = splitkw[3];
|
||||
}
|
||||
}
|
||||
if(splitkw.length > 4) {
|
||||
if (splitkw.length > 4) {
|
||||
desc = splitkw[4];
|
||||
}
|
||||
String repStr = "DB$ PutCounter | Defined$ Self | CounterType$ " + splitkw[1] + " | CounterNum$ " + amount;
|
||||
try {
|
||||
Integer.parseInt(amount);
|
||||
}
|
||||
catch(NumberFormatException ignored) {
|
||||
catch (NumberFormatException ignored) {
|
||||
repStr += " | References$ " + amount;
|
||||
}
|
||||
SpellAbility repAb = af.getAbility(repStr, card);
|
||||
|
||||
Reference in New Issue
Block a user