Fix Card Detail for Equip and Fortify cards

This commit is contained in:
drdev
2013-11-23 22:49:54 +00:00
parent 1cc1516feb
commit 427cef758f
3 changed files with 25 additions and 18 deletions

View File

@@ -2,7 +2,7 @@ Name:Darksteel Garrison
ManaCost:2 ManaCost:2
Types:Artifact Fortification Types:Artifact Fortification
K:Fortify 3 K:Fortify 3
S:Mode$ Continuous | Affected$ Land.FortifiedBy | AddKeyword$ Indestructible | Description$ Fortified land is indestructible. S:Mode$ Continuous | Affected$ Land.FortifiedBy | AddKeyword$ Indestructible | Description$ Fortified land is indestructible.
T:Mode$ Taps | ValidCard$ Land.FortifiedBy | Execute$ TrigPump | TriggerDescription$ Whenever fortified land becomes tapped, target creature gets +1/+1 until end of turn. T:Mode$ Taps | ValidCard$ Land.FortifiedBy | Execute$ TrigPump | TriggerDescription$ Whenever fortified land becomes tapped, target creature gets +1/+1 until end of turn.
SVar:TrigPump:AB$ Pump | Cost$ 0 | ValidTgts$ Creature | TgtPrompt$ Select target creature | NumAtt$ 1 | NumDef$ 1 SVar:TrigPump:AB$ Pump | Cost$ 0 | ValidTgts$ Creature | TgtPrompt$ Select target creature | NumAtt$ 1 | NumDef$ 1
SVar:Picture:http://www.wizards.com/global/images/magic/general/darksteel_garrison.jpg SVar:Picture:http://www.wizards.com/global/images/magic/general/darksteel_garrison.jpg

View File

@@ -2100,7 +2100,7 @@ public class Card extends GameEntity implements Comparable<Card> {
sbLong.append("with another unpaired creature when either "); sbLong.append("with another unpaired creature when either ");
sbLong.append("enters the battlefield. They remain paired for "); sbLong.append("enters the battlefield. They remain paired for ");
sbLong.append("as long as you control both of them)"); sbLong.append("as long as you control both of them)");
} else if (keyword.startsWith("Equip") || keyword.startsWith("Fortification")) { } else if (keyword.startsWith("Equip") || keyword.startsWith("Fortify")) {
// keyword parsing takes care of adding a proper description // keyword parsing takes care of adding a proper description
continue; continue;
} else if (keyword.startsWith("CantBeBlockedBy")) { } else if (keyword.startsWith("CantBeBlockedBy")) {

View File

@@ -2555,7 +2555,7 @@ public class CardFactoryUtil {
} else { } else {
equipCost = equipString.trim(); equipCost = equipString.trim();
} }
// Create attach ability string // Create attach ability string
final StringBuilder abilityStr = new StringBuilder(); final StringBuilder abilityStr = new StringBuilder();
abilityStr.append("AB$ Attach | Cost$ "); abilityStr.append("AB$ Attach | Cost$ ");
abilityStr.append(equipCost); abilityStr.append(equipCost);
@@ -2564,12 +2564,13 @@ public class CardFactoryUtil {
if (equipExtras != null) { if (equipExtras != null) {
abilityStr.append("| ").append(equipExtras[1]).append(" "); abilityStr.append("| ").append(equipExtras[1]).append(" ");
} }
if (equipCost.matches(".+<.+>")) { //Something other than a mana cost abilityStr.append("| PrecostDesc$ Equip ");
abilityStr.append("| PrecostDesc$ Equip - | SpellDescription$ (Attach to target creature you control. Equip only as a sorcery.)"); Cost cost = new Cost(equipCost, true);
} if (!cost.isOnlyManaCost()) { //Something other than a mana cost
else { abilityStr.append("- ");
abilityStr.append("| PrecostDesc$ Equip | SpellDescription$ (Attach to target creature you control. Equip only as a sorcery.)");
} }
abilityStr.append("| CostDesc$ " + cost.toSimpleString() + " ");
abilityStr.append("| SpellDescription$ (" + cost.toSimpleString() + ": Attach to target creature you control. Equip only as a sorcery.)");
// instantiate attach ability // instantiate attach ability
final SpellAbility sa = AbilityFactory.getAbility(abilityStr.toString(), card); final SpellAbility sa = AbilityFactory.getAbility(abilityStr.toString(), card);
card.addSpellAbility(sa); card.addSpellAbility(sa);
@@ -2588,7 +2589,7 @@ public class CardFactoryUtil {
} else { } else {
equipCost = equipString.trim(); equipCost = equipString.trim();
} }
// Create attach ability string // Create attach ability string
final StringBuilder abilityStr = new StringBuilder(); final StringBuilder abilityStr = new StringBuilder();
abilityStr.append("AB$ Attach | Cost$ "); abilityStr.append("AB$ Attach | Cost$ ");
abilityStr.append(equipCost); abilityStr.append(equipCost);
@@ -2597,7 +2598,13 @@ public class CardFactoryUtil {
if (equipExtras != null) { if (equipExtras != null) {
abilityStr.append("| ").append(equipExtras[1]).append(" "); abilityStr.append("| ").append(equipExtras[1]).append(" ");
} }
abilityStr.append("| PrecostDesc$ Fortify | SpellDescription$ (Attach to target land you control. Fortify only as a sorcery.)"); abilityStr.append("| PrecostDesc$ Fortify ");
Cost cost = new Cost(equipCost, true);
if (!cost.isOnlyManaCost()) { //Something other than a mana cost
abilityStr.append("- ");
}
abilityStr.append("| CostDesc$ " + cost.toSimpleString() + " ");
abilityStr.append("| SpellDescription$ (" + cost.toSimpleString() + ": Attach to target land you control. Fortify only as a sorcery.)");
// instantiate attach ability // instantiate attach ability
final SpellAbility sa = AbilityFactory.getAbility(abilityStr.toString(), card); final SpellAbility sa = AbilityFactory.getAbility(abilityStr.toString(), card);