From afa55bbe90a68f9778e8023b1f57eaaff83d5982 Mon Sep 17 00:00:00 2001 From: moomarc Date: Tue, 13 Nov 2012 07:12:56 +0000 Subject: [PATCH] - Added Magmasaur - Fixed RememberRemoved remembering more counters than were originally on a card --- .gitattributes | 1 + res/cardsfolder/m/magmasaur.txt | 20 ++++++++++++++++ res/cardsfolder/p/prismatic_circle.txt | 1 + .../effects/CountersRemoveEffect.java | 23 +++++++++++-------- 4 files changed, 35 insertions(+), 10 deletions(-) create mode 100644 res/cardsfolder/m/magmasaur.txt diff --git a/.gitattributes b/.gitattributes index d62d3182626..2b3413f6826 100644 --- a/.gitattributes +++ b/.gitattributes @@ -5857,6 +5857,7 @@ res/cardsfolder/m/magma_sliver.txt svneol=native#text/plain res/cardsfolder/m/magma_spray.txt svneol=native#text/plain res/cardsfolder/m/magma_vein.txt svneol=native#text/plain res/cardsfolder/m/magmaquake.txt -text +res/cardsfolder/m/magmasaur.txt -text res/cardsfolder/m/magmatic_force.txt svneol=native#text/plain res/cardsfolder/m/magmaw.txt svneol=native#text/plain res/cardsfolder/m/magnetic_flux.txt svneol=native#text/plain diff --git a/res/cardsfolder/m/magmasaur.txt b/res/cardsfolder/m/magmasaur.txt new file mode 100644 index 00000000000..bd8c97075e5 --- /dev/null +++ b/res/cardsfolder/m/magmasaur.txt @@ -0,0 +1,20 @@ +Name:Magmasaur +ManaCost:3 R R +Types:Creature Elemental Lizard +Text:no text +PT:0/0 +K:etbCounter:P1P1:5 +T:Mode$ Phase | Phase$ Upkeep | ValidPlayer$ You | TriggerZones$ Battlefield | Execute$ Choices | TriggerDescription$ At the beginning of your upkeep, you may remove a +1/+1 counter from CARDNAME. If you don't, sacrifice CARDNAME and it deals damage equal to the number of +1/+1 counters on it to each creature without flying and each player. +SVar:Choices:AB$ GenericChoice | Cost$ 0 | Choices$ Shrink,SelfDestruct | Defined$ You +SVar:Shrink:DB$ RemoveCounter | Defined$ Self | CounterType$ P1P1 | CounterNum$ 1 | UpTo$ True | RememberRemoved$ True | SubAbility$ SelfDestruct | ChoiceDescription$ Remove a +1/+1 counter from CARDNAME. +SVar:SelfDestruct:DB$ Sacrifice | Defined$ Self | ConditionCheckSVar$ X | ConditionSVarCompare$ EQ0 | References$ X | SubAbility$ LetEmHaveIt | ChoiceDescription$ Sacrifice CARDNAME and it deals damage equal to the number of +1/+1 counters on it to each creature without flying and each player. +SVar:LetEmHaveIt:DB$ DamageAll | ValidCards$ Creature.withoutFlying | ValidPlayers$ Each | NumDmg$ Y | References$ Y | SubAbility$ DBCleanup | ConditionCheckSVar$ X | ConditionSVarCompare$ EQ0 +SVar:DBCleanup:DB$ Cleanup | ClearRemembered$ True +SVar:X:Count$RememberedSize +SVar:Y:Count$CardCounters.P1P1 +SVar:RemAIDeck:True +SVar:Rarity:Rare +SVar:Picture:http://www.wizards.com/global/images/magic/general/magmasaur.jpg +SetInfo:TMP|Rare|http://magiccards.info/scans/en/tp/188.jpg +Oracle:Magmasaur enters the battlefield with five +1/+1 counters on it.\nAt the beginning of your upkeep, you may remove a +1/+1 counter from Magmasaur. If you don't, sacrifice Magmasaur and it deals damage equal to the number of +1/+1 counters on it to each creature without flying and each player. +End \ No newline at end of file diff --git a/res/cardsfolder/p/prismatic_circle.txt b/res/cardsfolder/p/prismatic_circle.txt index 2874ff85a06..92d021b6f8a 100644 --- a/res/cardsfolder/p/prismatic_circle.txt +++ b/res/cardsfolder/p/prismatic_circle.txt @@ -14,4 +14,5 @@ SVar:RemAIDeck:True SVar:Rarity:Rare SVar:Picture:http://www.wizards.com/global/images/magic/general/prismatic_circle.jpg SetInfo:MIR|Common|http://magiccards.info/scans/en/mr/238.jpg +Oracle:Cumulative upkeep {1} (At the beginning of your upkeep, put an age counter on this permanent, then sacrifice it unless you pay its upkeep cost for each age counter on it.)\nAs Prismatic Circle enters the battlefield, choose a color.\n{1}: The next time a source of your choice of the chosen color would deal damage to you this turn, prevent that damage. End \ No newline at end of file diff --git a/src/main/java/forge/card/abilityfactory/effects/CountersRemoveEffect.java b/src/main/java/forge/card/abilityfactory/effects/CountersRemoveEffect.java index fb4da639f26..08543f8dcca 100644 --- a/src/main/java/forge/card/abilityfactory/effects/CountersRemoveEffect.java +++ b/src/main/java/forge/card/abilityfactory/effects/CountersRemoveEffect.java @@ -15,15 +15,15 @@ import forge.game.zone.Zone; import forge.game.zone.ZoneType; import forge.gui.GuiChoose; -public class CountersRemoveEffect extends SpellEffect { +public class CountersRemoveEffect extends SpellEffect { @Override protected String getStackDescription(SpellAbility sa) { final StringBuilder sb = new StringBuilder(); - + final String counterName = sa.getParam("CounterType"); - + final int amount = AbilityFactory.calculateAmount(sa.getSourceCard(), sa.getParam("CounterNum"), sa); - + sb.append("Remove "); if (sa.hasParam("UpTo")) { sb.append("up to "); @@ -43,13 +43,13 @@ public class CountersRemoveEffect extends SpellEffect { sb.append("s"); } sb.append(" from"); - + for (final Card c : getTargetCards(sa)) { sb.append(" ").append(c); } - + sb.append("."); - + return sb.toString(); } @@ -64,7 +64,7 @@ public class CountersRemoveEffect extends SpellEffect { } final Target tgt = sa.getTarget(); - + boolean rememberRemoved = false; if (sa.hasParam("RememberRemoved")) { rememberRemoved = true; @@ -101,7 +101,7 @@ public class CountersRemoveEffect extends SpellEffect { chosenAmount = counterAmount; } // make list of amount choices - + if (chosenAmount > 1) { final List choices = new ArrayList(); for (int i = 1; i <= chosenAmount; i++) { @@ -149,6 +149,9 @@ public class CountersRemoveEffect extends SpellEffect { } tgtCard.subtractCounter(Counters.valueOf(type), counterAmount); if (rememberRemoved) { + if (counterAmount > tgtCard.getCounters(Counters.valueOf(type))) { + counterAmount = tgtCard.getCounters(Counters.valueOf(type)); + } for (int i = 0; i < counterAmount; i++) { card.addRemembered(Counters.valueOf(type)); } @@ -158,4 +161,4 @@ public class CountersRemoveEffect extends SpellEffect { } } -} \ No newline at end of file +}