Added Mind Maggots

Small change to ChooseNumber to make Min/Max read SVars.
Small change to ChooseNumber to allow different titles for the list block to expand its uses slightly.
Changed title of choice list for Ashling's Prerogative
This commit is contained in:
moomarc
2012-03-08 20:19:47 +00:00
parent 03a5fa7750
commit 7c9b5704ed
4 changed files with 49 additions and 3 deletions

1
.gitattributes vendored
View File

@@ -5545,6 +5545,7 @@ res/cardsfolder/m/mind_funeral.txt svneol=native#text/plain
res/cardsfolder/m/mind_games.txt svneol=native#text/plain
res/cardsfolder/m/mind_harness.txt svneol=native#text/plain
res/cardsfolder/m/mind_knives.txt svneol=native#text/plain
res/cardsfolder/m/mind_maggots.txt -text
res/cardsfolder/m/mind_over_matter.txt svneol=native#text/plain
res/cardsfolder/m/mind_peel.txt svneol=native#text/plain
res/cardsfolder/m/mind_ravel.txt svneol=native#text/plain

View File

@@ -3,7 +3,7 @@ ManaCost:1 R
Types:Enchantment
Text:no text
T:Mode$ ChangesZone | ValidCard$ Card.Self | Origin$ Any | Destination$ Battlefield | Execute$ ChooseMode | Static$ True | TriggerDescription$ As CARDNAME enters the battlefield, choose odd or even. (Zero is even.)
SVar:ChooseMode:AB$ ChooseNumber | Cost$ 0 | Defined$ You | Min$ 0 | Max$ 1 | SpellDescription$ Choose odd or even (Zero is even.)
SVar:ChooseMode:AB$ ChooseNumber | Cost$ 0 | Defined$ You | Min$ 0 | Max$ 1 | ListTitle$ Choose ODD or EVEN (0=Even; 1=Odd) | SpellDescription$ Choose odd or even (Zero is even.)
S:Mode$ Continuous | Affected$ Creature.cmcM2X | AddKeyword$ Haste | Description$ Each creature with converted mana cost of the chosen value has haste.
S:Mode$ ETBTapped | ValidCard$ Creature.cmcM2Y | Description$ Each creature without converted mana cost of the chosen value enters the battlefield tapped.
# The next 2 static abilities add text to the card panel for convenience indicating choice.

View File

@@ -0,0 +1,21 @@
Name:Mind Maggots
ManaCost:3 B
Types:Creature Insect
Text:no text
PT:2/2
T:Mode$ ChangesZone | ValidCard$ Card.Self | Origin$ Any | Destination$ Battlefield | Execute$ ChooseDiscardCount | TriggerDescription$ When CARDNAME enters the battlefield, discard any number of creature cards. For each card discarded this way, put two +1/+1 counters on CARDNAME.
SVar:ChooseDiscardCount:AB$ ChooseNumber | Cost$ 0 | Defined$ You | Min$ 0 | Max$ MaxChoice | ListTitle$ Discard how many creatures? | SubAbility$ MindMaggotsDiscard
# Used ChooseNumber here because otherwise the user must cancel for every valid card not discarded which can make it seem slow or broken.
SVar:MindMaggotsDiscard:DB$ Discard | DiscardValid$ Creature | NumCards$ ChosenMaggots | Optional$ True | Mode$ TgtChoose | RememberDiscarded$ True | SubAbility$ MindMaggotsPutCounter
SVar:MindMaggotsPutCounter:DB$ PutCounter | CounterType$ P1P1 | CounterNum$ MindMaggotsCount | SubAbility$ MindMaggotsCleanup
SVar:MindMaggotsCleanup:DB$ Cleanup | ClearRemembered$ True
SVar:MaxChoice:Count$TypeInYourHand.Creature
SVar:ChosenMaggots:Count$ChosenNumber
SVar:DiscardedMind:Remembered$Amount
SVar:MindMaggotsCount:SVar$DiscardedMind/Times.2
SVar:RemAIDeck:True
SVar:Rarity:Uncommon
SVar:Picture:http://www.wizards.com/global/images/magic/general/mind_maggots.jpg
SetInfo:EXO|Uncommon|http://magiccards.info/scans/en/ex/66.jpg
Oracle:When Mind Maggots enters the battlefield, discard any number of creature cards. For each card discarded this way, put two +1/+1 counters on Mind Maggots.
End

View File

@@ -911,10 +911,28 @@ public final class AbilityFactoryChoose {
private static void chooseNumberResolve(final AbilityFactory af, final SpellAbility sa) {
final HashMap<String, String> params = af.getMapParams();
final Card card = af.getHostCard();
final int min = params.containsKey("Min") ? Integer.parseInt(params.get("Min")) : 0;
final int max = params.containsKey("Max") ? Integer.parseInt(params.get("Max")) : 99;
//final int min = params.containsKey("Min") ? Integer.parseInt(params.get("Min")) : 0;
//final int max = params.containsKey("Max") ? Integer.parseInt(params.get("Max")) : 99;
final boolean random = params.containsKey("Random");
final int min;
if (!params.containsKey("Min")) {
min = Integer.parseInt("0");
} else if (params.get("Min").matches("[0-9][0-9]?")) {
min = Integer.parseInt(params.get("Min"));
} else {
min = CardFactoryUtil.xCount(card, card.getSVar(params.get("Min")));
} // Allow variables for Min
final int max;
if (!params.containsKey("Max")) {
max = Integer.parseInt("99");
} else if (params.get("Max").matches("[0-9][0-9]?")) {
max = Integer.parseInt(params.get("Max"));
} else {
max = CardFactoryUtil.xCount(card, card.getSVar(params.get("Max")));
} // Allow variables for Max
final String[] choices = new String[max + 1];
if (!random) {
// initialize the array
@@ -941,6 +959,12 @@ public final class AbilityFactoryChoose {
chosen = randomGen.nextInt(max - min) + min;
final String message = "Randomly chosen number: " + chosen;
JOptionPane.showMessageDialog(null, message, "" + card, JOptionPane.PLAIN_MESSAGE);
} else if (params.containsKey("ListTitle")) {
final Object o = GuiUtils.chooseOne(params.get("ListTitle"), choices);
if (null == o) {
return;
}
chosen = Integer.parseInt((String) o);
} else {
final Object o = GuiUtils.chooseOne("Choose a number", choices);
if (null == o) {