From c4d8edc05a6dd314ca3975ffa7883e8e11d5385d Mon Sep 17 00:00:00 2001 From: Agetian Date: Fri, 25 Sep 2015 18:31:26 +0000 Subject: [PATCH] - Experimental: make getThisTurnEntered and getLastTurnEntered return information based on the latest state of the card instead of on the pristine state of the card. Fixes e.g. the interaction of Flesh Allergy and Awaken. Let me know if this breaks anything. --- .../main/java/forge/game/card/CardUtil.java | 20 ++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/forge-game/src/main/java/forge/game/card/CardUtil.java b/forge-game/src/main/java/forge/game/card/CardUtil.java index bcd8d8e7f2e..71ae0daca92 100644 --- a/forge-game/src/main/java/forge/game/card/CardUtil.java +++ b/forge-game/src/main/java/forge/game/card/CardUtil.java @@ -155,7 +155,7 @@ public final class CardUtil { * @return a CardCollection that matches the given criteria */ public static CardCollection getThisTurnEntered(final ZoneType to, final ZoneType from, final String valid, final Card src) { - return getThisTurnEntered(to, from, valid, src, false); + return getThisTurnEntered(to, from, valid, src, true); } /** @@ -193,15 +193,29 @@ public final class CardUtil { * @return a CardCollection that matches the given criteria */ public static CardCollection getLastTurnEntered(final ZoneType to, final ZoneType from, final String valid, final Card src) { + return getLastTurnEntered(to, from, valid, src, true); + } + + /** + * getLastTurnEntered. + * + * @param to zone going to + * @param from zone coming from + * @param valid a isValid expression + * @param src a Card object + * @param checkLatestState a boolean, true if the latest state of the card as it left the original zone needs to be checked + * @return a CardCollection that matches the given criteria + */ + public static CardCollection getLastTurnEntered(final ZoneType to, final ZoneType from, final String valid, final Card src, final boolean checkLatestState) { CardCollection res = new CardCollection(); final Game game = src.getGame(); if (to != ZoneType.Stack) { for (Player p : game.getPlayers()) { - res.addAll(p.getZone(to).getCardsAddedLastTurn(from)); + res.addAll(p.getZone(to).getCardsAddedLastTurn(from, checkLatestState)); } } else { - res.addAll(game.getStackZone().getCardsAddedLastTurn(from)); + res.addAll(game.getStackZone().getCardsAddedLastTurn(from, checkLatestState)); } res = CardLists.getValidCards(res, valid, src.getController(), src); return res;