mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-18 03:38:01 +00:00
*Added Archive Trap
This commit is contained in:
@@ -1199,6 +1199,17 @@ public class AbilityUtils {
|
||||
return CardFactoryUtil.doXMath(Integer.parseInt(sq[2]), expr, c); // not Kicked
|
||||
}
|
||||
}
|
||||
|
||||
//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")) {
|
||||
|
||||
@@ -1089,6 +1089,10 @@ public class ChangeZoneAi extends SpellAbilityAi {
|
||||
if (sa.hasParam("Origin")) {
|
||||
origin = ZoneType.listValueOf(sa.getParam("Origin"));
|
||||
}
|
||||
|
||||
if(origin.contains(ZoneType.Library)) {
|
||||
sa.getActivatingPlayer().incLibrarySearched();
|
||||
}
|
||||
|
||||
String type = sa.getParam("ChangeType");
|
||||
if (type == null) {
|
||||
|
||||
@@ -40,6 +40,10 @@ public class ChangeZoneAllEffect extends SpellAbilityEffect {
|
||||
public void resolve(SpellAbility sa) {
|
||||
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>();
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -1373,6 +1373,8 @@ public class CardFactoryUtil {
|
||||
if (sq[0].contains("LowestLibrary")) {
|
||||
return Aggregates.min(cc.getGame().getPlayers(), Player.Accessors.countCardsInZone(ZoneType.Library));
|
||||
}
|
||||
|
||||
|
||||
|
||||
// Count$Chroma.<mana letter>
|
||||
if (sq[0].contains("Chroma")) {
|
||||
|
||||
@@ -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.");
|
||||
|
||||
@@ -106,6 +106,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>();
|
||||
@@ -2262,6 +2265,17 @@ public class Player extends GameEntity implements Comparable<Player> {
|
||||
public final void resetProwl() {
|
||||
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)
|
||||
|
||||
Reference in New Issue
Block a user