*Added an "Inbound Token" list to Player. Tokens go there before they're put onto the battlefield to let their ETB Replacements be run.

This commit is contained in:
Hellfish
2013-05-12 08:51:20 +00:00
parent 07f7a1b9bc
commit 63fe69dbca
2 changed files with 21 additions and 0 deletions

View File

@@ -169,6 +169,9 @@ public class GameAction {
}
if (!suppress) {
if(zoneFrom == null)
copied.getOwner().addInboundToken(copied);
HashMap<String, Object> repParams = new HashMap<String, Object>();
repParams.put("Event", "Moved");
repParams.put("Affected", copied);
@@ -183,6 +186,8 @@ public class GameAction {
return c;
}
}
copied.getOwner().removeInboundToken(copied);
if (c.wasSuspendCast()) {
copied = GameAction.addSuspendTriggers(c);

View File

@@ -135,6 +135,11 @@ public class Player extends GameEntity implements Comparable<Player> {
/** The slowtrip list. */
private List<Card> slowtripList = new ArrayList<Card>();
/** A list of tokens not in play, but on their way.
* This list is kept in order to not break ETB-replacement
* on tokens. */
private List<Card> inboundTokens = new ArrayList<Card>();
/** The keywords. */
private ArrayList<String> keywords = new ArrayList<String>();
@@ -1517,6 +1522,7 @@ public class Player extends GameEntity implements Comparable<Player> {
public final List<Card> getAllCards() {
List<Card> allExcStack = this.getCardsIn(Player.ALL_ZONES);
allExcStack.addAll(getCardsIn(ZoneType.Stack));
allExcStack.addAll(inboundTokens);
return allExcStack;
}
@@ -3095,6 +3101,16 @@ public class Player extends GameEntity implements Comparable<Player> {
return false;
}
public void addInboundToken(Card c)
{
inboundTokens.add(c);
}
public void removeInboundToken(Card c)
{
inboundTokens.remove(c);
}
/**
* TODO: Write javadoc for this type.