- Added Tunnel Vision

This commit is contained in:
moomarc
2013-05-29 09:15:13 +00:00
parent 4f43579c20
commit 4d34b23a02
3 changed files with 50 additions and 14 deletions

1
.gitattributes vendored
View File

@@ -11596,6 +11596,7 @@ res/cardsfolder/t/tundra_kavu.txt -text
res/cardsfolder/t/tundra_wolves.txt svneol=native#text/plain res/cardsfolder/t/tundra_wolves.txt svneol=native#text/plain
res/cardsfolder/t/tunnel.txt svneol=native#text/plain res/cardsfolder/t/tunnel.txt svneol=native#text/plain
res/cardsfolder/t/tunnel_ignus.txt -text res/cardsfolder/t/tunnel_ignus.txt -text
res/cardsfolder/t/tunnel_vision.txt -text
res/cardsfolder/t/tunneler_wurm.txt svneol=native#text/plain res/cardsfolder/t/tunneler_wurm.txt svneol=native#text/plain
res/cardsfolder/t/turbulent_dreams.txt -text res/cardsfolder/t/turbulent_dreams.txt -text
res/cardsfolder/t/turf_wound.txt -text res/cardsfolder/t/turf_wound.txt -text

View File

@@ -0,0 +1,9 @@
Name:Tunnel Vision
ManaCost:5 U
Types:Sorcery
A:SP$ NameCard | Cost$ 5 U | Defined$ You | SubAbility$ FindThePrecious | AILogic$ MostProminentInHumanDeck | SpellDescription$ Name a card. Target player reveals cards from the top of his or her library until the named card is revealed. If it is, that player puts the rest of the revealed cards into his or her graveyard and puts the named card on top of his or her library. Otherwise, the player shuffles his or her library.
SVar:FindThePrecious:DB$ DigUntil | ValidTgts$ Player | TgtPrompt$ Select target player | IsCurse$ True | Valid$ Card.NamedCard | ValidDescription$ the named | RememberFound$ True | NoMoveFound$ True | FoundDestination$ Library | FoundLibraryPosition$ 0 | RevealedDestination$ Graveyard | NoneFoundDestination$ Library | NoneFoundLibraryPosition$ 0 | Shuffle$ True | ShuffleCondition$ NoneFound
SVar:RemAIDeck:True
SVar:Picture:http://www.wizards.com/global/images/magic/general/tunnel_vision.jpg
Oracle:Name a card. Target player reveals cards from the top of his or her library until the named card is revealed. If it is, that player puts the rest of the revealed cards into his or her graveyard and puts the named card on top of his or her library. Otherwise, the player shuffles his or her library.
SetInfo:RAV Rare

View File

@@ -100,7 +100,10 @@ public class DigUntilEffect extends SpellAbilityEffect {
final int foundLibPos = AbilityUtils.calculateAmount(host, sa.getParam("FoundLibraryPosition"), sa); final int foundLibPos = AbilityUtils.calculateAmount(host, sa.getParam("FoundLibraryPosition"), sa);
final ZoneType revealedDest = ZoneType.smartValueOf(sa.getParam("RevealedDestination")); final ZoneType revealedDest = ZoneType.smartValueOf(sa.getParam("RevealedDestination"));
final int revealedLibPos = AbilityUtils.calculateAmount(host, sa.getParam("RevealedLibraryPosition"), sa); final int revealedLibPos = AbilityUtils.calculateAmount(host, sa.getParam("RevealedLibraryPosition"), sa);
final ZoneType noneFoundDest = ZoneType.smartValueOf(sa.getParam("NoneFoundDestination"));
final int noneFoundLibPos = AbilityUtils.calculateAmount(host, sa.getParam("NoneFoundLibraryPosition"), sa);
final ZoneType digSite = sa.hasParam("DigZone") ? ZoneType.smartValueOf(sa.getParam("DigZone")) : ZoneType.Library; final ZoneType digSite = sa.hasParam("DigZone") ? ZoneType.smartValueOf(sa.getParam("DigZone")) : ZoneType.Library;
boolean shuffle = sa.hasParam("Shuffle");
for (final Player p : getTargetPlayers(sa)) { for (final Player p : getTargetPlayers(sa)) {
if ((tgt == null) || p.canBeTargetedBy(sa)) { if ((tgt == null) || p.canBeTargetedBy(sa)) {
@@ -125,6 +128,12 @@ public class DigUntilEffect extends SpellAbilityEffect {
} }
} }
if (shuffle && sa.hasParam("ShuffleCondition")) {
if (sa.getParam("ShuffleCondition").equals("NoneFound")) {
shuffle = found.isEmpty();
}
}
if (revealed.size() > 0) { if (revealed.size() > 0) {
GuiChoose.one(p + " revealed: ", revealed); GuiChoose.one(p + " revealed: ", revealed);
} }
@@ -166,22 +175,39 @@ public class DigUntilEffect extends SpellAbilityEffect {
Collections.shuffle(revealed, random); Collections.shuffle(revealed, random);
} }
// Allow ordering the rest of the revealed cards if (sa.hasParam("NoneFoundDestination") && found.size() < untilAmount) {
if ((revealedDest.isKnown()) && revealed.size() >= 2) { // Allow ordering the revealed cards
revealed = p.getController().orderMoveToZoneList(revealed, revealedDest); if ((noneFoundDest.isKnown()) && revealed.size() >= 2) {
} revealed = p.getController().orderMoveToZoneList(revealed, noneFoundDest);
if (revealedDest == ZoneType.Library && !sa.hasParam("Shuffle") }
&& !sa.hasParam("RevealRandomOrder") && revealed.size() >= 2) { if (noneFoundDest == ZoneType.Library && !shuffle
revealed = p.getController().orderMoveToZoneList(revealed, revealedDest); && !sa.hasParam("RevealRandomOrder") && revealed.size() >= 2) {
revealed = p.getController().orderMoveToZoneList(revealed, noneFoundDest);
}
final Iterator<Card> itr = revealed.iterator();
while (itr.hasNext()) {
final Card c = itr.next();
game.getAction().moveTo(noneFoundDest, c, noneFoundLibPos);
}
} else {
// Allow ordering the rest of the revealed cards
if ((revealedDest.isKnown()) && revealed.size() >= 2) {
revealed = p.getController().orderMoveToZoneList(revealed, revealedDest);
}
if (revealedDest == ZoneType.Library && !shuffle
&& !sa.hasParam("RevealRandomOrder") && revealed.size() >= 2) {
revealed = p.getController().orderMoveToZoneList(revealed, revealedDest);
}
final Iterator<Card> itr = revealed.iterator();
while (itr.hasNext()) {
final Card c = itr.next();
game.getAction().moveTo(revealedDest, c, revealedLibPos);
}
} }
final Iterator<Card> itr = revealed.iterator(); if (shuffle) {
while (itr.hasNext()) {
final Card c = itr.next();
game.getAction().moveTo(revealedDest, c, revealedLibPos);
}
if (sa.hasParam("Shuffle")) {
p.shuffle(); p.shuffle();
} }
} // end foreach player } // end foreach player