mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-18 19:58:00 +00:00
*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:
@@ -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);
|
||||
|
||||
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user