*Added Archive Trap

This commit is contained in:
Hellfish
2013-06-03 18:47:29 +00:00
parent 2b58e949eb
commit 76a012c716
9 changed files with 51 additions and 0 deletions

1
.gitattributes vendored
View File

@@ -441,6 +441,7 @@ res/cardsfolder/a/archangels_light.txt -text
res/cardsfolder/a/archdemon_of_unx.txt svneol=native#text/plain
res/cardsfolder/a/archery_training.txt -text
res/cardsfolder/a/architects_of_will.txt svneol=native#text/plain
res/cardsfolder/a/archive_trap.txt -text
res/cardsfolder/a/archivist.txt svneol=native#text/plain
res/cardsfolder/a/archmage_ascension.txt -text
res/cardsfolder/a/archon_of_justice.txt svneol=native#text/plain

View File

@@ -0,0 +1,9 @@
Name:Archive Trap
ManaCost:3 U U
Types:Instant Trap
A:SP$ Mill | Cost$ 3 U U | NumCards$ 13 | ValidTgts$ Opponent | TgtPrompt$ Choose an opponent | SpellDescription$ Target opponent puts the top three cards of his or her library into his or her graveyard.
A:SP$ Mill | Cost$ 0 | CheckSVar$ TrapTrigger | NumCards$ 13 | ValidTgts$ Opponent | TgtPrompt$ Choose an opponent | CostDesc$ If an opponent searched his or her library this turn, you may pay 0 rather than pay CARDNAME's mana cost. | SpellDescription$
SVar:TrapTrigger:Count$SearchedLibrary.Opponent
SVar:Picture:http://www.wizards.com/global/images/magic/general/archive_trap.jpg
Oracle:If an opponent searched his or her library this turn, you may pay {0} rather than pay Archive Trap's mana cost.\nTarget opponent puts the top thirteen cards of his or her library into his or her graveyard.
SetInfo:ZEN Rare

View File

@@ -1200,6 +1200,17 @@ public class AbilityUtils {
}
}
//Count$SearchedLibrary.<DefinedPlayer>
if(sq[0].contains("SearchedLibrary")) {
int sum = 0;
for(Player p : AbilityUtils.getDefinedPlayers(c, sq[1], sa))
{
sum += p.getLibrarySearched();
}
return sum;
}
// Count$Compare <int comparator value>.<True>.<False>
if (sq[0].startsWith("Compare")) {
final String[] compString = sq[0].split(" ");

View File

@@ -1090,6 +1090,10 @@ public class ChangeZoneAi extends SpellAbilityAi {
origin = ZoneType.listValueOf(sa.getParam("Origin"));
}
if(origin.contains(ZoneType.Library)) {
sa.getActivatingPlayer().incLibrarySearched();
}
String type = sa.getParam("ChangeType");
if (type == null) {
type = "Card";

View File

@@ -41,6 +41,10 @@ public class ChangeZoneAllEffect extends SpellAbilityEffect {
final ZoneType destination = ZoneType.smartValueOf(sa.getParam("Destination"));
final List<ZoneType> origin = ZoneType.listValueOf(sa.getParam("Origin"));
if(origin.contains(ZoneType.Library)) {
sa.getActivatingPlayer().incLibrarySearched();
}
List<Card> cards = new ArrayList<Card>();
List<Player> tgtPlayers = getTargetPlayersEmptyAsDefault(sa);

View File

@@ -634,6 +634,11 @@ public class ChangeZoneEffect extends SpellAbilityEffect {
if (sa.hasParam("Origin")) {
origin = ZoneType.listValueOf(sa.getParam("Origin"));
}
if(origin.contains(ZoneType.Library)) {
sa.getActivatingPlayer().incLibrarySearched();
}
ZoneType destination = ZoneType.smartValueOf(sa.getParam("Destination"));
// this needs to be zero indexed. Top = 0, Third = 2
int libraryPos = sa.hasParam("LibraryPosition") ? Integer.parseInt(sa.getParam("LibraryPosition")) : 0;

View File

@@ -1374,6 +1374,8 @@ public class CardFactoryUtil {
return Aggregates.min(cc.getGame().getPlayers(), Player.Accessors.countCardsInZone(ZoneType.Library));
}
// Count$Chroma.<mana letter>
if (sq[0].contains("Chroma")) {
if (sq[0].contains("ChromaSource")) {

View File

@@ -633,6 +633,7 @@ public class PhaseHandler implements java.io.Serializable {
p.resetProwl();
p.setLifeLostThisTurn(0);
p.setLifeGainedThisTurn(0);
p.setLibrarySearched(0);
p.removeKeyword("At the beginning of this turn's end step, you lose the game.");
p.removeKeyword("Skip the untap step of this turn.");

View File

@@ -107,6 +107,9 @@ public class Player extends GameEntity implements Comparable<Player> {
/** The num power surge lands. */
private int numPowerSurgeLands;
/** The number of times this player has searched his library. */
private int numLibrarySearched = 0;
/** The prowl. */
private ArrayList<String> prowl = new ArrayList<String>();
@@ -2263,6 +2266,17 @@ public class Player extends GameEntity implements Comparable<Player> {
this.prowl = new ArrayList<String>();
}
public final void setLibrarySearched(final int l) {
this.numLibrarySearched = l;
}
public final int getLibrarySearched() {
return this.numLibrarySearched;
}
public final void incLibrarySearched() {
this.numLibrarySearched++;
}
/*
* (non-Javadoc)
*