From 427cef758f0e355ab41b7b7332cfab6432ccdf6e Mon Sep 17 00:00:00 2001 From: drdev Date: Sat, 23 Nov 2013 22:49:54 +0000 Subject: [PATCH] Fix Card Detail for Equip and Fortify cards --- .../res/cardsfolder/d/darksteel_garrison.txt | 18 +++++++-------- forge-gui/src/main/java/forge/Card.java | 2 +- .../card/cardfactory/CardFactoryUtil.java | 23 ++++++++++++------- 3 files changed, 25 insertions(+), 18 deletions(-) diff --git a/forge-gui/res/cardsfolder/d/darksteel_garrison.txt b/forge-gui/res/cardsfolder/d/darksteel_garrison.txt index 5c3c32dde78..d3ecfd0dddf 100644 --- a/forge-gui/res/cardsfolder/d/darksteel_garrison.txt +++ b/forge-gui/res/cardsfolder/d/darksteel_garrison.txt @@ -1,9 +1,9 @@ -Name:Darksteel Garrison -ManaCost:2 -Types:Artifact Fortification -K:Fortify 3 -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. -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 -Oracle:Fortified land is indestructible.\nWhenever fortified land becomes tapped, target creature gets +1/+1 until end of turn.\nFortify {3} ({3}: Attach to target land you control. Fortify only as a sorcery. This card enters the battlefield unattached and stays on the battlefield if the land leaves.) +Name:Darksteel Garrison +ManaCost:2 +Types:Artifact Fortification +K:Fortify 3 +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. +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 +Oracle:Fortified land is indestructible.\nWhenever fortified land becomes tapped, target creature gets +1/+1 until end of turn.\nFortify {3} ({3}: Attach to target land you control. Fortify only as a sorcery. This card enters the battlefield unattached and stays on the battlefield if the land leaves.) \ No newline at end of file diff --git a/forge-gui/src/main/java/forge/Card.java b/forge-gui/src/main/java/forge/Card.java index d436e0da83d..8e13cb5431b 100644 --- a/forge-gui/src/main/java/forge/Card.java +++ b/forge-gui/src/main/java/forge/Card.java @@ -2100,7 +2100,7 @@ public class Card extends GameEntity implements Comparable { sbLong.append("with another unpaired creature when either "); sbLong.append("enters the battlefield. They remain paired for "); 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 continue; } else if (keyword.startsWith("CantBeBlockedBy")) { diff --git a/forge-gui/src/main/java/forge/card/cardfactory/CardFactoryUtil.java b/forge-gui/src/main/java/forge/card/cardfactory/CardFactoryUtil.java index 10cbafce51e..25944a7c9db 100644 --- a/forge-gui/src/main/java/forge/card/cardfactory/CardFactoryUtil.java +++ b/forge-gui/src/main/java/forge/card/cardfactory/CardFactoryUtil.java @@ -2555,7 +2555,7 @@ public class CardFactoryUtil { } else { equipCost = equipString.trim(); } - // Create attach ability string + // Create attach ability string final StringBuilder abilityStr = new StringBuilder(); abilityStr.append("AB$ Attach | Cost$ "); abilityStr.append(equipCost); @@ -2564,12 +2564,13 @@ public class CardFactoryUtil { if (equipExtras != null) { abilityStr.append("| ").append(equipExtras[1]).append(" "); } - if (equipCost.matches(".+<.+>")) { //Something other than a mana cost - abilityStr.append("| PrecostDesc$ Equip - | SpellDescription$ (Attach to target creature you control. Equip only as a sorcery.)"); - } - else { - abilityStr.append("| PrecostDesc$ Equip | SpellDescription$ (Attach to target creature you control. Equip only as a sorcery.)"); + abilityStr.append("| PrecostDesc$ Equip "); + 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 creature you control. Equip only as a sorcery.)"); // instantiate attach ability final SpellAbility sa = AbilityFactory.getAbility(abilityStr.toString(), card); card.addSpellAbility(sa); @@ -2588,7 +2589,7 @@ public class CardFactoryUtil { } else { equipCost = equipString.trim(); } - // Create attach ability string + // Create attach ability string final StringBuilder abilityStr = new StringBuilder(); abilityStr.append("AB$ Attach | Cost$ "); abilityStr.append(equipCost); @@ -2597,7 +2598,13 @@ public class CardFactoryUtil { if (equipExtras != null) { 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 final SpellAbility sa = AbilityFactory.getAbility(abilityStr.toString(), card);