- The "DiscardValid" parameter in AF Discard now also works if the mode is "TgtChoose".

- Converted Krovikan Sorcerer to script.
This commit is contained in:
Sloth
2011-11-16 08:39:55 +00:00
parent 003741a77e
commit 05f8c20c81
4 changed files with 22 additions and 17 deletions

View File

@@ -4,6 +4,10 @@ Types:Creature Human Wizard
Text:no text Text:no text
PT:1/1 PT:1/1
A:AB$ Draw | Cost$ T Discard<1/Card.nonBlack> | NumCards$ 1 | CostDesc$ Tap, Discard a non black card: | SpellDescription$ Draw a card. A:AB$ Draw | Cost$ T Discard<1/Card.nonBlack> | NumCards$ 1 | CostDesc$ Tap, Discard a non black card: | SpellDescription$ Draw a card.
A:AB$ Draw | Cost$ T Discard<1/Card.Black> | NumCards$ 2 | CostDesc$ Tap, Discard a black card: | RememberDrawn$ True | SubAbility$ DBDiscard | SpellDescription$ Draw two cards, then discard one of them.
SVar:DBDiscard:DB$Discard | Defined$ You | Mode$ TgtChoose | DiscardValid$ Card.IsRemembered | NumCards$ 1 | SubAbility$ DBCleanup
SVar:DBCleanup:DB$Cleanup | ClearRemembered$ True
SVar:RemAIDeck:True
SVar:Rarity:Common SVar:Rarity:Common
SVar:Picture:http://www.wizards.com/global/images/magic/general/krovikan_sorcerer.jpg SVar:Picture:http://www.wizards.com/global/images/magic/general/krovikan_sorcerer.jpg
SetInfo:5ED|Common|http://magiccards.info/scans/en/5e/96.jpg SetInfo:5ED|Common|http://magiccards.info/scans/en/5e/96.jpg

View File

@@ -3,7 +3,7 @@ ManaCost:1 U
Types:Creature Merfolk Rogue Types:Creature Merfolk Rogue
Text:no text Text:no text
PT:1/1 PT:1/1
A:AB$ Draw | Cost$ T | NumCards$ 1 | SpellDescription$ Draw a card, then discard a card. | SubAbility$ SVar=DBDiscard A:AB$ Draw | Cost$ T | NumCards$ 1 | SpellDescription$ Draw a card, then discard a card. | SubAbility$ DBDiscard
SVar:DBDiscard:DB$Discard | Defined$ You | Mode$ TgtChoose | NumCards$ 1 SVar:DBDiscard:DB$Discard | Defined$ You | Mode$ TgtChoose | NumCards$ 1
SVar:Rarity:Common SVar:Rarity:Common
SVar:Picture:http://www.wizards.com/global/images/magic/general/merfolk_looter.jpg SVar:Picture:http://www.wizards.com/global/images/magic/general/merfolk_looter.jpg

View File

@@ -1129,12 +1129,8 @@ public class AbilityFactoryZoneAffecting {
if (mode.equals("Random")) { if (mode.equals("Random")) {
final String valid = params.containsKey("DiscardValid") ? params.get("DiscardValid") : "Card"; final String valid = params.containsKey("DiscardValid") ? params.get("DiscardValid") : "Card";
discarded.addAll(p.discardRandom(numCards, sa, valid)); discarded.addAll(p.discardRandom(numCards, sa, valid));
} else if (mode.equals("TgtChoose")) { } else if (mode.equals("TgtChoose") && params.containsKey("UnlessType")) {
if (params.containsKey("UnlessType")) { p.discardUnless(numCards, params.get("UnlessType"), sa);
p.discardUnless(numCards, params.get("UnlessType"), sa);
} else {
discarded.addAll(p.discard(numCards, sa, true));
}
} else if (mode.equals("RevealDiscardAll")) { } else if (mode.equals("RevealDiscardAll")) {
// Reveal // Reveal
final CardList dPHand = p.getCardsIn(Zone.Hand); final CardList dPHand = p.getCardsIn(Zone.Hand);
@@ -1160,7 +1156,8 @@ public class AbilityFactoryZoneAffecting {
p.discard(c, sa); p.discard(c, sa);
discarded.add(c); discarded.add(c);
} }
} else if (mode.equals("RevealYouChoose") || mode.equals("RevealOppChoose")) { } else if (mode.equals("RevealYouChoose") || mode.equals("RevealOppChoose")
|| mode.equals("TgtChoose")) {
// Is Reveal you choose right? I think the wrong player is // Is Reveal you choose right? I think the wrong player is
// being used? // being used?
final CardList dPHand = p.getCardsIn(Zone.Hand); final CardList dPHand = p.getCardsIn(Zone.Hand);
@@ -1173,10 +1170,10 @@ public class AbilityFactoryZoneAffecting {
final String[] dValid = params.get("DiscardValid").split(","); final String[] dValid = params.get("DiscardValid").split(",");
dPChHand = dPHand.getValidCards(dValid, source.getController(), source); dPChHand = dPHand.getValidCards(dValid, source.getController(), source);
} }
Player chooser = null; Player chooser = p;
if (mode.equals("RevealYouChoose")) { if (mode.equals("RevealYouChoose")) {
chooser = source.getController(); chooser = source.getController();
} else { } else if (mode.equals("RevealOppChoose")){
chooser = source.getController().getOpponent(); chooser = source.getController().getOpponent();
} }
@@ -1203,10 +1200,12 @@ public class AbilityFactoryZoneAffecting {
final Card dC = dChoices.get(CardUtil.getRandomIndex(dChoices)); final Card dC = dChoices.get(CardUtil.getRandomIndex(dChoices));
dPChHand.remove(dC); dPChHand.remove(dC);
final CardList dCs = new CardList(); if (mode.startsWith("Reveal")) {
dCs.add(dC); final CardList dCs = new CardList();
GuiUtils.getChoiceOptional("Computer has chosen", dCs.toArray()); dCs.add(dC);
GuiUtils.getChoiceOptional("Computer has chosen", dCs.toArray());
}
discarded.add(dC); discarded.add(dC);
AllZone.getComputerPlayer().discard(dC, sa); // is AllZone.getComputerPlayer().discard(dC, sa); // is
// this // this
@@ -1215,7 +1214,9 @@ public class AbilityFactoryZoneAffecting {
} }
} else { } else {
// human // human
GuiUtils.getChoiceOptional("Revealed computer hand", dPHand.toArray()); if (mode.startsWith("Reveal")) {
GuiUtils.getChoiceOptional("Revealed computer hand", dPHand.toArray());
}
for (int i = 0; i < numCards; i++) { for (int i = 0; i < numCards; i++) {
if (dPChHand.size() > 0) { if (dPChHand.size() > 0) {

View File

@@ -2644,7 +2644,7 @@ public class CardFactoryCreatures {
} // *************** END ************ END ************************** } // *************** END ************ END **************************
// *************** START *********** START ************************** // *************** START *********** START **************************
else if (cardName.equals("Krovikan Sorcerer")) { /*else if (cardName.equals("Krovikan Sorcerer")) {
final Cost abCost = new Cost("T Discard<1/Card.Black>", cardName, true); final Cost abCost = new Cost("T Discard<1/Card.Black>", cardName, true);
final AbilityActivated ability = new AbilityActivated(card, abCost, null) { final AbilityActivated ability = new AbilityActivated(card, abCost, null) {
private static final long serialVersionUID = 3689290210743241201L; private static final long serialVersionUID = 3689290210743241201L;
@@ -2695,7 +2695,7 @@ public class CardFactoryCreatures {
final StringBuilder sbStack = new StringBuilder(); final StringBuilder sbStack = new StringBuilder();
sbStack.append(card).append(" - Draw two cards, then discard one of them."); sbStack.append(card).append(" - Draw two cards, then discard one of them.");
ability.setStackDescription(sbStack.toString()); ability.setStackDescription(sbStack.toString());
} // *************** END ************ END ************************** }*/ // *************** END ************ END **************************
// *************************************************** // ***************************************************
// end of card specific code // end of card specific code