- Small fixes to last commit and added some Shuffle params where necessary

This commit is contained in:
moomarc
2013-05-24 11:16:24 +00:00
parent 6dbd03841b
commit 42f77b29e9
6 changed files with 24 additions and 17 deletions

View File

@@ -2,7 +2,7 @@ Name:Mass Polymorph
ManaCost:5 U
Types:Sorcery
A:SP$ ChangeZoneAll | Cost$ 5 U | ChangeType$ Creature.YouCtrl | Origin$ Battlefield | Destination$ Exile | RememberChanged$ True | SubAbility$ DBMassReveal | SpellDescription$ Exile all creatures you control, then reveal cards from the top of your library until you reveal that many creature cards. Put all creature cards revealed this way onto the battlefield, then shuffle the rest of the revealed cards into your library.
SVar:DBMassReveal:DB$ DigUntil | Amount$ MassX | References$ MassX | Valid$ Creature.YouOwn | ValidDescription$ creature | RevealedDestination$ Library | RevealedLibraryPosition$ 0 | FoundDestination$ Battlefield | SubAbility$ DBMassCleanup
SVar:DBMassReveal:DB$ DigUntil | Amount$ MassX | References$ MassX | Valid$ Creature.YouOwn | ValidDescription$ creature | RevealedDestination$ Library | RevealedLibraryPosition$ 0 | FoundDestination$ Battlefield | SubAbility$ DBMassCleanup | Shuffle$ True
SVar:DBMassCleanup:DB$ Cleanup | ClearRemembered$ True | SubAbility$ DBMassShuffle
SVar:DBMassShuffle:DB$ Shuffle
SVar:MassX:Remembered$Amount

View File

@@ -2,7 +2,7 @@ Name:Spellshift
ManaCost:3 U
Types:Instant
A:SP$ Counter | Cost$ 3 U | TargetType$ Spell | ValidTgts$ Instant,Sorcery | TgtPrompt$ Select target Instant or Sorcery Spell | SubAbility$ DBDig | SpellDescription$ Counter target instant or sorcery spell. Its controller reveals cards from the top of his or her library until he or she reveals an instant or sorcery card. That player may cast that card without paying its mana cost. Then he or she shuffles his or her library.
SVar:DBDig:DB$ DigUntil | Defined$ TargetedController | Valid$ Instant,Sorcery | ValidDescription$ Sorcery or Instant | FoundDestination$ Library | RevealedDestination$ Library | RememberFound$ True | SubAbility$ DBPlay
SVar:DBDig:DB$ DigUntil | Defined$ TargetedController | Valid$ Instant,Sorcery | ValidDescription$ Sorcery or Instant | FoundDestination$ Library | RevealedDestination$ Library | RememberFound$ True | SubAbility$ DBPlay | Shuffle$ True
SVar:DBPlay:DB$ Play | Defined$ Remembered | Controller$ TargetedController | WithoutManaCost$ True | Optional$ True | SubAbility$ DBShuffle
SVar:DBShuffle:DB$ Shuffle | Defined$ TargetedController | SubAbility$ DBCleanup
SVar:DBCleanup:DB$ Cleanup | ClearRemembered$ True

View File

@@ -104,7 +104,7 @@ public class DigUntilEffect extends SpellAbilityEffect {
for (final Player p : getTargetPlayers(sa)) {
if ((tgt == null) || p.canBeTargetedBy(sa)) {
final List<Card> found = new ArrayList<Card>();
List<Card> found = new ArrayList<Card>();
List<Card> revealed = new ArrayList<Card>();
final PlayerZone library = p.getZone(digSite);
@@ -130,12 +130,13 @@ public class DigUntilEffect extends SpellAbilityEffect {
}
final GameState game = p.getGame();
if (revealedDest == ZoneType.Battlefield && revealed.size() >= 2) {
revealed = p.getController().orderMoveToZoneList(revealed, revealedDest);
// should possibly use host.getController().getController()... above instead of p.getController?
if (foundDest != null) {
// Allow ordering of found cards
if ((foundDest.isKnown()) && found.size() >= 2) {
found = p.getController().orderMoveToZoneList(found, foundDest);
// should possibly use host.getController().getController()... for these instead of p.getController?
}
if (foundDest != null) {
final Iterator<Card> itr = found.iterator();
while (itr.hasNext()) {
final Card c = itr.next();
@@ -166,9 +167,13 @@ public class DigUntilEffect extends SpellAbilityEffect {
Collections.shuffle(revealed, random);
}
if (revealedDest == ZoneType.Library && !sa.hasParam("Shuffle") && revealed.size() >= 2) {
// Allow ordering the rest of the revealed cards
if ((revealedDest.isKnown()) && revealed.size() >= 2) {
revealed = p.getController().orderMoveToZoneList(revealed, revealedDest);
}
if (revealedDest == ZoneType.Library && !sa.hasParam("Shuffle")
&& !sa.hasParam("RevealRandomOrder") && revealed.size() >= 2) {
revealed = p.getController().orderMoveToZoneList(revealed, revealedDest);
// should possibly use host.getController().getController()... above instead of p.getController?
}
final Iterator<Card> itr = revealed.iterator();

View File

@@ -126,7 +126,7 @@ public abstract class PlayerController {
public abstract void reveal(String string, Collection<Card> cards, ZoneType zone, Player owner);
public abstract ImmutablePair<List<Card>, List<Card>> arrangeForScry(List<Card> topN);
public abstract boolean willPutCardOnTop(Card c);
public abstract List<Card> orderMoveToZoneList(List<Card> revealed, ZoneType destinationZone);
public abstract List<Card> orderMoveToZoneList(List<Card> cards, ZoneType destinationZone);
/** p = target player, validCards - possible discards, min cards to discard */
public abstract List<Card> chooseCardsToDiscardFrom(Player playerDiscard, SpellAbility sa, List<Card> validCards, int min, int max);

View File

@@ -211,9 +211,9 @@ public class PlayerControllerAi extends PlayerController {
}
@Override
public List<Card> orderMoveToZoneList(List<Card> revealed, ZoneType destinationZone) {
public List<Card> orderMoveToZoneList(List<Card> cards, ZoneType destinationZone) {
//TODO Add logic for AI ordering here
return revealed;
return cards;
}
@Override

View File

@@ -334,13 +334,15 @@ public class PlayerControllerHuman extends PlayerController {
}
@Override
public List<Card> orderMoveToZoneList(List<Card> revealed, ZoneType destinationZone) {
public List<Card> orderMoveToZoneList(List<Card> cards, ZoneType destinationZone) {
if (destinationZone == ZoneType.Library) {
return GuiChoose.order("Choose order of cards to put into the library", "Closest to top", 0, revealed, null, null);
return GuiChoose.order("Choose order of cards to put into the library", "Closest to top", 0, cards, null, null);
} else if (destinationZone == ZoneType.Battlefield) {
return GuiChoose.order("Choose order of cards to put onto the battlefield", "Put first", 0, revealed, null, null);
return GuiChoose.order("Choose order of cards to put onto the battlefield", "Put first", 0, cards, null, null);
} else if (destinationZone == ZoneType.Graveyard) {
return GuiChoose.order("Choose order of cards to put into the graveyard", "Closest to top", 0, cards, null, null);
}
return revealed;
return cards;
}
@Override