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.
|
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
|
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$ 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:X:Count$SumPower_Creature.YouCtrl
|
||||||
SVar:Rarity:Rare
|
SVar:Rarity:Rare
|
||||||
SVar:Picture:http://www.wizards.com/global/images/magic/general/mosswort_bridge.jpg
|
SVar:Picture:http://www.wizards.com/global/images/magic/general/mosswort_bridge.jpg
|
||||||
|
|||||||
@@ -982,7 +982,7 @@ public class CardFactoryUtil {
|
|||||||
final Map<String, Object> runParams = new TreeMap<String, Object>();
|
final Map<String, Object> runParams = new TreeMap<String, Object>();
|
||||||
runParams.put("Card", sourceCard);
|
runParams.put("Card", sourceCard);
|
||||||
AllZone.getTriggerHandler().runTrigger(TriggerType.TurnFaceUp, runParams);
|
AllZone.getTriggerHandler().runTrigger(TriggerType.TurnFaceUp, runParams);
|
||||||
|
|
||||||
StringBuilder sb = new StringBuilder();
|
StringBuilder sb = new StringBuilder();
|
||||||
sb.append(this.getActivatingPlayer()).append(" has unmorphed ");
|
sb.append(this.getActivatingPlayer()).append(" has unmorphed ");
|
||||||
sb.append(sourceCard.getName());
|
sb.append(sourceCard.getName());
|
||||||
@@ -1201,7 +1201,7 @@ public class CardFactoryUtil {
|
|||||||
public void resolve() {
|
public void resolve() {
|
||||||
final Card c = Singletons.getModel().getGameAction().exile(sourceCard);
|
final Card c = Singletons.getModel().getGameAction().exile(sourceCard);
|
||||||
c.addCounter(Counters.TIME, suspendCounters);
|
c.addCounter(Counters.TIME, suspendCounters);
|
||||||
|
|
||||||
StringBuilder sb = new StringBuilder();
|
StringBuilder sb = new StringBuilder();
|
||||||
sb.append(this.getActivatingPlayer()).append(" has suspended ");
|
sb.append(this.getActivatingPlayer()).append(" has suspended ");
|
||||||
sb.append(c.getName()).append("with ");
|
sb.append(c.getName()).append("with ");
|
||||||
@@ -1221,7 +1221,7 @@ public class CardFactoryUtil {
|
|||||||
suspend.getRestrictions().setZone(ZoneType.Hand);
|
suspend.getRestrictions().setZone(ZoneType.Hand);
|
||||||
return suspend;
|
return suspend;
|
||||||
} // abilitySuspend()
|
} // abilitySuspend()
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p>
|
* <p>
|
||||||
* entersBattleFieldWithCounters.
|
* entersBattleFieldWithCounters.
|
||||||
@@ -2319,7 +2319,7 @@ public class CardFactoryUtil {
|
|||||||
|
|
||||||
return num;
|
return num;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p>
|
* <p>
|
||||||
* Parse non-mana X variables.
|
* Parse non-mana X variables.
|
||||||
@@ -2329,22 +2329,26 @@ public class CardFactoryUtil {
|
|||||||
* a {@link forge.Card} object.
|
* a {@link forge.Card} object.
|
||||||
* @param s
|
* @param s
|
||||||
* a {@link java.lang.String} object.
|
* a {@link java.lang.String} object.
|
||||||
|
* @param sa
|
||||||
|
* a {@link forge.SpellAbility} object.
|
||||||
* @return a int.
|
* @return a int.
|
||||||
*/
|
*/
|
||||||
public static int xCount(final Card c, final String s, final SpellAbility sa) {
|
public static int xCount(final Card c, final String s, final SpellAbility sa) {
|
||||||
|
|
||||||
final String[] l = s.split("/");
|
final String[] l = s.split("/");
|
||||||
final String[] m = CardFactoryUtil.parseMath(l);
|
final String[] m = CardFactoryUtil.parseMath(l);
|
||||||
|
|
||||||
final String[] sq;
|
final String[] sq;
|
||||||
sq = l[0].split("\\.");
|
sq = l[0].split("\\.");
|
||||||
|
|
||||||
// Count$Kicked.<numHB>.<numNotHB>
|
if (sa != null) {
|
||||||
if (sq[0].contains("Kicked")) {
|
// Count$Kicked.<numHB>.<numNotHB>
|
||||||
if (sa.isKicked()) {
|
if (sq[0].contains("Kicked")) {
|
||||||
return CardFactoryUtil.doXMath(Integer.parseInt(sq[1]), m, c); // Kicked
|
if (sa.isKicked()) {
|
||||||
} else {
|
return CardFactoryUtil.doXMath(Integer.parseInt(sq[1]), m, c); // Kicked
|
||||||
return CardFactoryUtil.doXMath(Integer.parseInt(sq[2]), m, c); // not Kicked
|
} else {
|
||||||
|
return CardFactoryUtil.doXMath(Integer.parseInt(sq[2]), m, c); // not Kicked
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return xCount(c, s);
|
return xCount(c, s);
|
||||||
@@ -2812,7 +2816,7 @@ public class CardFactoryUtil {
|
|||||||
for (int i = 0; i < filteredCards.size(); i++) {
|
for (int i = 0; i < filteredCards.size(); i++) {
|
||||||
sumPower += filteredCards.get(i).getManaCost().getCMC();
|
sumPower += filteredCards.get(i).getManaCost().getCMC();
|
||||||
}
|
}
|
||||||
return sumPower;
|
return CardFactoryUtil.doXMath(sumPower, m, c);
|
||||||
}
|
}
|
||||||
// Count$CardManaCost
|
// Count$CardManaCost
|
||||||
if (sq[0].contains("CardManaCost")) {
|
if (sq[0].contains("CardManaCost")) {
|
||||||
@@ -4075,7 +4079,7 @@ public class CardFactoryUtil {
|
|||||||
|
|
||||||
card.addSpellAbility(kickedSpell);
|
card.addSpellAbility(kickedSpell);
|
||||||
}*/
|
}*/
|
||||||
|
|
||||||
if (CardFactoryUtil.hasKeyword(card, "Multikicker") != -1) {
|
if (CardFactoryUtil.hasKeyword(card, "Multikicker") != -1) {
|
||||||
final int n = CardFactoryUtil.hasKeyword(card, "Multikicker");
|
final int n = CardFactoryUtil.hasKeyword(card, "Multikicker");
|
||||||
if (n != -1) {
|
if (n != -1) {
|
||||||
@@ -4554,19 +4558,19 @@ public class CardFactoryUtil {
|
|||||||
eff.setColor(card.getColor());
|
eff.setColor(card.getColor());
|
||||||
eff.setImmutable(true);
|
eff.setImmutable(true);
|
||||||
eff.setEffectSource(card);
|
eff.setEffectSource(card);
|
||||||
|
|
||||||
eff.addStaticAbility("Mode$ CantBeCast | ValidCard$ Card | Caster$ You "
|
eff.addStaticAbility("Mode$ CantBeCast | ValidCard$ Card | Caster$ You "
|
||||||
+ "| Description$ For the rest of the game, you can't cast spells.");
|
+ "| Description$ For the rest of the game, you can't cast spells.");
|
||||||
|
|
||||||
eff.setSVar("EpicCopy", "AB$ CopySpell | Cost$ 0 | Defined$ EffectSource");
|
eff.setSVar("EpicCopy", "AB$ CopySpell | Cost$ 0 | Defined$ EffectSource");
|
||||||
|
|
||||||
final Trigger copyTrigger = forge.card.trigger.TriggerHandler.parseTrigger(
|
final Trigger copyTrigger = forge.card.trigger.TriggerHandler.parseTrigger(
|
||||||
"Mode$ Phase | Phase$ Upkeep | ValidPlayer$ You | Execute$ EpicCopy | TriggerDescription$ "
|
"Mode$ Phase | Phase$ Upkeep | ValidPlayer$ You | Execute$ EpicCopy | TriggerDescription$ "
|
||||||
+ "At the beginning of each of your upkeeps, copy " + card.toString()
|
+ "At the beginning of each of your upkeeps, copy " + card.toString()
|
||||||
+ " except for its epic ability.", eff, false);
|
+ " except for its epic ability.", eff, false);
|
||||||
|
|
||||||
eff.addTrigger(copyTrigger);
|
eff.addTrigger(copyTrigger);
|
||||||
|
|
||||||
AllZone.getTriggerHandler().suppressMode(TriggerType.ChangesZone);
|
AllZone.getTriggerHandler().suppressMode(TriggerType.ChangesZone);
|
||||||
Singletons.getModel().getGameAction().moveToPlay(eff);
|
Singletons.getModel().getGameAction().moveToPlay(eff);
|
||||||
AllZone.getTriggerHandler().clearSuppression(TriggerType.ChangesZone);
|
AllZone.getTriggerHandler().clearSuppression(TriggerType.ChangesZone);
|
||||||
@@ -4672,27 +4676,27 @@ public class CardFactoryUtil {
|
|||||||
} else if (kw.startsWith("etbCounter")) {
|
} else if (kw.startsWith("etbCounter")) {
|
||||||
String parse = kw;
|
String parse = kw;
|
||||||
card.removeIntrinsicKeyword(parse);
|
card.removeIntrinsicKeyword(parse);
|
||||||
|
|
||||||
String[] splitkw = parse.split(":");
|
String[] splitkw = parse.split(":");
|
||||||
|
|
||||||
AbilityFactory af = new AbilityFactory();
|
AbilityFactory af = new AbilityFactory();
|
||||||
String desc = "CARDNAME enters the battlefield with " + splitkw[2] + " "
|
String desc = "CARDNAME enters the battlefield with " + splitkw[2] + " "
|
||||||
+ Counters.valueOf(splitkw[1]).getName() + " counters on it.";
|
+ Counters.valueOf(splitkw[1]).getName() + " counters on it.";
|
||||||
String extraparams = "";
|
String extraparams = "";
|
||||||
String amount = splitkw[2];
|
String amount = splitkw[2];
|
||||||
if(splitkw.length > 3) {
|
if (splitkw.length > 3) {
|
||||||
if(!splitkw[3].equals("no Condition")) {
|
if (!splitkw[3].equals("no Condition")) {
|
||||||
extraparams = splitkw[3];
|
extraparams = splitkw[3];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(splitkw.length > 4) {
|
if (splitkw.length > 4) {
|
||||||
desc = splitkw[4];
|
desc = splitkw[4];
|
||||||
}
|
}
|
||||||
String repStr = "DB$ PutCounter | Defined$ Self | CounterType$ " + splitkw[1] + " | CounterNum$ " + amount;
|
String repStr = "DB$ PutCounter | Defined$ Self | CounterType$ " + splitkw[1] + " | CounterNum$ " + amount;
|
||||||
try {
|
try {
|
||||||
Integer.parseInt(amount);
|
Integer.parseInt(amount);
|
||||||
}
|
}
|
||||||
catch(NumberFormatException ignored) {
|
catch (NumberFormatException ignored) {
|
||||||
repStr += " | References$ " + amount;
|
repStr += " | References$ " + amount;
|
||||||
}
|
}
|
||||||
SpellAbility repAb = af.getAbility(repStr, card);
|
SpellAbility repAb = af.getAbility(repStr, card);
|
||||||
@@ -4707,31 +4711,31 @@ public class CardFactoryUtil {
|
|||||||
card.addReplacementEffect(re);
|
card.addReplacementEffect(re);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int etbcounter = CardFactoryUtil.hasKeyword(card, "etbCounter");
|
int etbcounter = CardFactoryUtil.hasKeyword(card, "etbCounter");
|
||||||
if (etbcounter != -1) {
|
if (etbcounter != -1) {
|
||||||
String parse = card.getKeyword().get(etbcounter);
|
String parse = card.getKeyword().get(etbcounter);
|
||||||
card.removeIntrinsicKeyword(parse);
|
card.removeIntrinsicKeyword(parse);
|
||||||
|
|
||||||
String[] splitkw = parse.split(":");
|
String[] splitkw = parse.split(":");
|
||||||
|
|
||||||
AbilityFactory af = new AbilityFactory();
|
AbilityFactory af = new AbilityFactory();
|
||||||
String desc = "CARDNAME enters the battlefield with " + splitkw[2] + " " + splitkw[1] + " counters on it.";
|
String desc = "CARDNAME enters the battlefield with " + splitkw[2] + " " + splitkw[1] + " counters on it.";
|
||||||
String extraparams = "";
|
String extraparams = "";
|
||||||
String amount = splitkw[2];
|
String amount = splitkw[2];
|
||||||
if(splitkw.length > 3) {
|
if (splitkw.length > 3) {
|
||||||
if(!splitkw[3].equals("no Condition")) {
|
if (!splitkw[3].equals("no Condition")) {
|
||||||
extraparams = splitkw[3];
|
extraparams = splitkw[3];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(splitkw.length > 4) {
|
if (splitkw.length > 4) {
|
||||||
desc = splitkw[4];
|
desc = splitkw[4];
|
||||||
}
|
}
|
||||||
String repStr = "DB$ PutCounter | Defined$ Self | CounterType$ " + splitkw[1] + " | CounterNum$ " + amount;
|
String repStr = "DB$ PutCounter | Defined$ Self | CounterType$ " + splitkw[1] + " | CounterNum$ " + amount;
|
||||||
try {
|
try {
|
||||||
Integer.parseInt(amount);
|
Integer.parseInt(amount);
|
||||||
}
|
}
|
||||||
catch(NumberFormatException ignored) {
|
catch (NumberFormatException ignored) {
|
||||||
repStr += " | References$ " + amount;
|
repStr += " | References$ " + amount;
|
||||||
}
|
}
|
||||||
SpellAbility repAb = af.getAbility(repStr, card);
|
SpellAbility repAb = af.getAbility(repStr, card);
|
||||||
|
|||||||
Reference in New Issue
Block a user