diff --git a/forge-game/src/main/java/forge/game/GameAction.java b/forge-game/src/main/java/forge/game/GameAction.java index 061fa82ceef..953cfd297ea 100644 --- a/forge-game/src/main/java/forge/game/GameAction.java +++ b/forge-game/src/main/java/forge/game/GameAction.java @@ -258,6 +258,7 @@ public class GameAction { if (!c.isToken() && !toBattlefield) { copied.getCurrentState().resetCardColor(); copied.clearDevoured(); + copied.clearDelved(); } if (fromBattlefield) { diff --git a/forge-game/src/main/java/forge/game/card/Card.java b/forge-game/src/main/java/forge/game/card/Card.java index da98653df97..bd01ee4f0be 100644 --- a/forge-game/src/main/java/forge/game/card/Card.java +++ b/forge-game/src/main/java/forge/game/card/Card.java @@ -108,7 +108,7 @@ public class Card extends GameEntity implements Comparable { private final CopyOnWriteArrayList hiddenExtrinsicKeyword = new CopyOnWriteArrayList(); // cards attached or otherwise linked to this card - private CardCollection equippedBy, fortifiedBy, hauntedBy, devouredCards, imprintedCards, encodedCards; + private CardCollection equippedBy, fortifiedBy, hauntedBy, devouredCards, delvedCards, imprintedCards, encodedCards; private CardCollection mustBlockCards, clones, gainControlTargets, chosenCards, blockedThisTurn, blockedByThisTurn; // if this card is attached or linked to something, what card is it currently attached to @@ -491,10 +491,25 @@ public class Card extends GameEntity implements Comparable { } devouredCards.add(c); } + public final void clearDevoured() { devouredCards = null; } + public final CardCollectionView getDelved() { + return CardCollection.getView(delvedCards); + } + public final void addDelved(final Card c) { + if (delvedCards == null) { + delvedCards = new CardCollection(); + } + delvedCards.add(c); + } + + public final void clearDelved() { + delvedCards = null; + } + public MapOfLists getRememberMap() { return rememberMap; } @@ -4644,7 +4659,10 @@ public class Card extends GameEntity implements Comparable { || !(getCounters(CounterType.getType("TIME")) >= 1)) { return false; } - + } else if (property.startsWith("delved")) { + if (!source.getDelved().contains(this)) { + return false; + } } else if (property.startsWith("power") || property.startsWith("toughness") || property.startsWith("cmc") || property.startsWith("totalPT")) { int x = 0; diff --git a/forge-game/src/main/java/forge/game/mana/ManaCostAdjustment.java b/forge-game/src/main/java/forge/game/mana/ManaCostAdjustment.java index 544d605df7a..ed9bda887f1 100644 --- a/forge-game/src/main/java/forge/game/mana/ManaCostAdjustment.java +++ b/forge-game/src/main/java/forge/game/mana/ManaCostAdjustment.java @@ -94,6 +94,7 @@ public class ManaCostAdjustment { for (final Card c : toExile) { cost.decreaseColorlessMana(1); if (!test) { + sa.getHostCard().addDelved(c); pc.getGame().getAction().exile(c); } }