From d6e1a324fbc29aa520f106c41a8e15d0fdc158de Mon Sep 17 00:00:00 2001 From: Sol Date: Sun, 2 Oct 2011 02:43:10 +0000 Subject: [PATCH] - Add Support for ChosenColor in AF_Mana - Add My Grail (Sol Grail) --- .gitattributes | 1 + res/cardsfolder/h/hunting_kavu.txt | 20 +++++++------ res/cardsfolder/r/riptide_replicator.txt | 30 ++++++++++--------- res/cardsfolder/s/sol_grail.txt | 13 ++++++++ .../abilityFactory/AbilityFactory_Mana.java | 4 +++ 5 files changed, 45 insertions(+), 23 deletions(-) create mode 100644 res/cardsfolder/s/sol_grail.txt diff --git a/.gitattributes b/.gitattributes index 60f4cf27ead..b354f350e9b 100644 --- a/.gitattributes +++ b/.gitattributes @@ -7263,6 +7263,7 @@ res/cardsfolder/s/soaring_hope.txt svneol=native#text/plain res/cardsfolder/s/soaring_seacliff.txt svneol=native#text/plain res/cardsfolder/s/soilshaper.txt svneol=native#text/plain res/cardsfolder/s/sokenzan_bruiser.txt svneol=native#text/plain +res/cardsfolder/s/sol_grail.txt -text res/cardsfolder/s/sol_ring.txt svneol=native#text/plain res/cardsfolder/s/solar_blast.txt svneol=native#text/plain res/cardsfolder/s/solar_tide.txt svneol=native#text/plain diff --git a/res/cardsfolder/h/hunting_kavu.txt b/res/cardsfolder/h/hunting_kavu.txt index 39e64d4f5c8..e4e27f54c78 100644 --- a/res/cardsfolder/h/hunting_kavu.txt +++ b/res/cardsfolder/h/hunting_kavu.txt @@ -1,10 +1,12 @@ -Name:Hunting Kavu -ManaCost:1 R G -Types:Creature Kavu -Text:no text -PT:2/3 -A:AB$ ChangeZone | Cost$ 1 R G T | ValidTgts$ Creature.withoutFlying+YouDontCtrl+attacking | TgtPrompt$ Select target creature without flying that's attacking you | Origin$ Battlefield | Destination$ Exile | SubAbility$ ExileSelf | SpellDescription$ Exile CARDNAME and target creature without flying that's attacking you. -SVar:ExileSelf:DB$ ChangeZone | Defined$ Self | Origin$ Battlefield | Destination$ Exile -SVar:Rarity:Uncommon -SVar:Picture:http://www.wizards.com/global/images/magic/general/hunting_kavu.jpg +Name:Hunting Kavu +ManaCost:1 R G +Types:Creature Kavu +Text:no text +PT:2/3 +A:AB$ ChangeZone | Cost$ 1 R G T | ValidTgts$ Creature.withoutFlying+YouDontCtrl+attacking | TgtPrompt$ Select target creature without flying that's attacking you | Origin$ Battlefield | Destination$ Exile | SubAbility$ ExileSelf | SpellDescription$ Exile CARDNAME and target creature without flying that's attacking you. +SVar:ExileSelf:DB$ ChangeZone | Defined$ Self | Origin$ Battlefield | Destination$ Exile +SVar:Rarity:Uncommon +SVar:Picture:http://www.wizards.com/global/images/magic/general/hunting_kavu.jpg +SetInfo:INV|Uncommon|http://magiccards.info/scans/en/in/252.jpg +Oracle:{1}{R}{G}, {T}: Exile Hunting Kavu and target creature without flying that's attacking you. End \ No newline at end of file diff --git a/res/cardsfolder/r/riptide_replicator.txt b/res/cardsfolder/r/riptide_replicator.txt index 245d9a0fa2f..d90f28035dc 100644 --- a/res/cardsfolder/r/riptide_replicator.txt +++ b/res/cardsfolder/r/riptide_replicator.txt @@ -1,15 +1,17 @@ -Name:Riptide Replicator -ManaCost:X 4 -Types:Artifact -Text:no text -T:Mode$ ChangesZone | ValidCard$ Card.Self | Origin$ Any | Destination$ Battlefield | Execute$ ChooseColor | Static$ True | TriggerDescription$ As CARDNAME enters the battlefield, choose a color and a creature type. -SVar:ChooseColor:AB$ ChooseColor | Cost$ 0 | Defined$ You | SubAbility$ ChooseCT -SVar:ChooseCT:DB$ ChooseType | Defined$ You | Type$ Creature -K:etbCounter:CHARGE:X -SVar:X:Count$xPaid -A:AB$ Token | Cost$ 4 T | TokenAmount$ 1 | TokenName$ ChosenType | TokenTypes$ Creature,ChosenType | TokenOwner$ You | TokenColors$ ChosenColor | TokenPower$ Y | TokenToughness$ Y | SpellDescription$ Put an X/X creature token of the chosen color and type onto the battlefield, where X is the number of charge counters on CARDNAME. -SVar:Y:Count$CardCounters.CHARGE -SVar:RemAIDeck:True -SVar:Rarity:Rare -SVar:Picture:http://www.wizards.com/global/images/magic/general/riptide_replicator.jpg +Name:Riptide Replicator +ManaCost:X 4 +Types:Artifact +Text:no text +T:Mode$ ChangesZone | ValidCard$ Card.Self | Origin$ Any | Destination$ Battlefield | Execute$ ChooseColor | Static$ True | TriggerDescription$ As CARDNAME enters the battlefield, choose a color and a creature type. +SVar:ChooseColor:AB$ ChooseColor | Cost$ 0 | Defined$ You | SubAbility$ ChooseCT +SVar:ChooseCT:DB$ ChooseType | Defined$ You | Type$ Creature +K:etbCounter:CHARGE:X +SVar:X:Count$xPaid +A:AB$ Token | Cost$ 4 T | TokenAmount$ 1 | TokenName$ ChosenType | TokenTypes$ Creature,ChosenType | TokenOwner$ You | TokenColors$ ChosenColor | TokenPower$ Y | TokenToughness$ Y | SpellDescription$ Put an X/X creature token of the chosen color and type onto the battlefield, where X is the number of charge counters on CARDNAME. +SVar:Y:Count$CardCounters.CHARGE +SVar:RemAIDeck:True +SVar:Rarity:Rare +SVar:Picture:http://www.wizards.com/global/images/magic/general/riptide_replicator.jpg +SetInfo:ONS|Rare|http://magiccards.info/scans/en/on/309.jpg +Oracle:As Riptide Replicator enters the battlefield, choose a color and a creature type.\nRiptide Replicator enters the battlefield with X charge counters on it.\n{4}, {T}: Put an X/X creature token of the chosen color and type onto the battlefield, where X is the number of charge counters on Riptide Replicator. End \ No newline at end of file diff --git a/res/cardsfolder/s/sol_grail.txt b/res/cardsfolder/s/sol_grail.txt new file mode 100644 index 00000000000..a787fe675f5 --- /dev/null +++ b/res/cardsfolder/s/sol_grail.txt @@ -0,0 +1,13 @@ +Name:Sol Grail +ManaCost:3 +Types:Artifact +Text:no text +T:Mode$ ChangesZone | ValidCard$ Card.Self | Origin$ Any | Destination$ Battlefield | Execute$ ChooseColor | Static$ True | TriggerDescription$ As CARDNAME enters the battlefield, choose a color. +SVar:ChooseColor:DB$ ChooseColor | Defined$ You +A:AB$ Mana | Cost$ T | Produced$ Chosen | SpellDescription$ Add one mana of the chosen color to your mana pool. +SVar:RemAIDeck:True +SVar:Rarity:Uncommon +SVar:Picture:http://www.wizards.com/global/images/magic/general/sol_grail.jpg +SetInfo:ALL|Uncommon|http://magiccards.info/scans/en/ai/173.jpg +Oracle:As Sol Grail enters the battlefield, choose a color.\n{T}: Add one mana of the chosen color to your mana pool. +End \ No newline at end of file diff --git a/src/main/java/forge/card/abilityFactory/AbilityFactory_Mana.java b/src/main/java/forge/card/abilityFactory/AbilityFactory_Mana.java index aa88755a554..111342897be 100644 --- a/src/main/java/forge/card/abilityFactory/AbilityFactory_Mana.java +++ b/src/main/java/forge/card/abilityFactory/AbilityFactory_Mana.java @@ -237,9 +237,13 @@ public class AbilityFactory_Mana { private static String generatedMana(Ability_Mana abMana, AbilityFactory af, SpellAbility sa) { // Calculate generated mana here for stack description and resolving HashMap params = af.getMapParams(); + Card card = sa.getSourceCard(); int amount = params.containsKey("Amount") ? AbilityFactory.calculateAmount(af.getHostCard(), params.get("Amount"), sa) : 1; String baseMana = abMana.mana(); + if (baseMana.equals("Chosen")){ + baseMana = Input_PayManaCostUtil.getShortColorString(card.getChosenColor()); + } if (params.containsKey("Bonus")) { // For mana abilities that get a bonus