Fixed add/remove culture token triggers having the source and target filters reversed. Fixes V2 Now for Ruin failing to trigger when its tokens are reinforced.
This commit is contained in:
@@ -24,7 +24,7 @@ public class AddsCultureToken implements TriggerCheckerProducer {
|
||||
public boolean accepts(ActionContext actionContext) {
|
||||
String playerId = playerSource != null ? playerSource.getPlayer(actionContext) : null;
|
||||
return TriggerConditions.addedCultureToken(actionContext.getGame(), playerId, actionContext.getEffectResult(),
|
||||
onSourceFilter.getFilterable(actionContext), sourceFilter.getFilterable(actionContext));
|
||||
sourceFilter.getFilterable(actionContext), onSourceFilter.getFilterable(actionContext));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -24,7 +24,7 @@ public class RemovesCultureToken implements TriggerCheckerProducer {
|
||||
public boolean accepts(ActionContext actionContext) {
|
||||
String playerId = playerSource != null ? playerSource.getPlayer(actionContext) : null;
|
||||
return TriggerConditions.removedCultureToken(actionContext.getGame(), playerId, actionContext.getEffectResult(),
|
||||
onSourceFilter.getFilterable(actionContext), sourceFilter.getFilterable(actionContext));
|
||||
sourceFilter.getFilterable(actionContext), onSourceFilter.getFilterable(actionContext));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -71,7 +71,7 @@ public class TriggerConditions {
|
||||
if (playerId != null && !playerId.equals(tokenResult.getPerformingPlayer()))
|
||||
return false;
|
||||
return Filters.accepts(game, from, tokenResult.getSource())
|
||||
&& Filters.and(targetFilters).accepts(game, tokenResult.getSource());
|
||||
&& Filters.and(targetFilters).accepts(game, tokenResult.getTarget());
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@@ -82,7 +82,7 @@ public class TriggerConditions {
|
||||
if (playerId != null && !playerId.equals(tokenResult.getPerformingPlayer()))
|
||||
return false;
|
||||
return Filters.accepts(game, from, tokenResult.getSource())
|
||||
&& Filters.and(targetFilters).accepts(game, tokenResult.getSource());
|
||||
&& Filters.and(targetFilters).accepts(game, tokenResult.getTarget());
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -3,7 +3,6 @@ package com.gempukku.lotro.cards.unofficial.pc.vsets.set_v02;
|
||||
import com.gempukku.lotro.cards.GenericCardTestHelper;
|
||||
import com.gempukku.lotro.common.*;
|
||||
import com.gempukku.lotro.game.CardNotFoundException;
|
||||
import com.gempukku.lotro.game.PhysicalCardImpl;
|
||||
import com.gempukku.lotro.logic.decisions.DecisionResultInvalidException;
|
||||
import org.junit.Test;
|
||||
|
||||
@@ -18,8 +17,10 @@ public class Card_V2_052_Tests
|
||||
return new GenericCardTestHelper(
|
||||
new HashMap<>()
|
||||
{{
|
||||
put("card", "102_52");
|
||||
// put other cards in here as needed for the test case
|
||||
put("ruin", "102_52");
|
||||
put("eowyn", "13_124");
|
||||
put("arrowslits", "5_80");
|
||||
|
||||
}},
|
||||
GenericCardTestHelper.FellowshipSites,
|
||||
GenericCardTestHelper.FOTRFrodo,
|
||||
@@ -45,7 +46,7 @@ public class Card_V2_052_Tests
|
||||
|
||||
var scn = GetScenario();
|
||||
|
||||
var card = scn.GetFreepsCard("card");
|
||||
var card = scn.GetFreepsCard("ruin");
|
||||
|
||||
assertEquals("Now for Ruin", card.getBlueprint().getTitle());
|
||||
assertNull(card.getBlueprint().getSubtitle());
|
||||
@@ -57,18 +58,26 @@ public class Card_V2_052_Tests
|
||||
assertEquals(1, card.getBlueprint().getTwilightCost());
|
||||
}
|
||||
|
||||
// Uncomment any @Test markers below once this is ready to be used
|
||||
//@Test
|
||||
public void NowforRuinTest1() throws DecisionResultInvalidException, CardNotFoundException {
|
||||
@Test
|
||||
public void NowforRuinTriggersOnReinforceOfSecondToken() throws DecisionResultInvalidException, CardNotFoundException {
|
||||
//Pre-game setup
|
||||
var scn = GetScenario();
|
||||
|
||||
var card = scn.GetFreepsCard("card");
|
||||
scn.FreepsMoveCardToHand(card);
|
||||
var ruin = scn.GetFreepsCard("ruin");
|
||||
var arrowslits = scn.GetFreepsCard("arrowslits");
|
||||
scn.FreepsMoveCardToSupportArea(ruin);
|
||||
scn.FreepsMoveCardToDiscard(arrowslits);
|
||||
scn.FreepsMoveCharToTable("eowyn"); // On a regroup move, reinforces a Rohan token
|
||||
|
||||
scn.StartGame();
|
||||
scn.FreepsPlayCard(card);
|
||||
scn.AddTokensToCard(ruin, 2);
|
||||
scn.SkipToMovementDecision();
|
||||
|
||||
assertEquals(1, scn.GetTwilight());
|
||||
assertEquals(2, scn.GetCultureTokensOn(ruin));
|
||||
assertEquals(Zone.DISCARD, arrowslits.getZone());
|
||||
scn.FreepsChooseToMove();
|
||||
scn.FreepsAcceptOptionalTrigger(); //Eowyn's reinforcement
|
||||
assertEquals(0, scn.GetCultureTokensOn(ruin));
|
||||
assertEquals(Zone.SUPPORT, arrowslits.getZone());
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user