Fixed removing burdens
This commit is contained in:
@@ -36,7 +36,10 @@ public class DefaultActionContext implements ActionContext {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getValueFromMemory(String memory) {
|
public String getValueFromMemory(String memory) {
|
||||||
return valueMemory.get(memory);
|
final String result = valueMemory.get(memory);
|
||||||
|
if (result == null)
|
||||||
|
throw new IllegalArgumentException("Memory not found - " + memory);
|
||||||
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ public class RemoveBurdens implements EffectAppenderProducer {
|
|||||||
@Override
|
@Override
|
||||||
protected Effect createEffect(boolean cost, CostToEffectAction action, ActionContext actionContext) {
|
protected Effect createEffect(boolean cost, CostToEffectAction action, ActionContext actionContext) {
|
||||||
final String removingPlayer = playerSource.getPlayer(actionContext);
|
final String removingPlayer = playerSource.getPlayer(actionContext);
|
||||||
final Evaluator evaluator = valueSource.getEvaluator(null);
|
final Evaluator evaluator = valueSource.getEvaluator(actionContext);
|
||||||
return new RemoveBurdenEffect(removingPlayer, actionContext.getSource(), evaluator.evaluateExpression(actionContext.getGame(), null));
|
return new RemoveBurdenEffect(removingPlayer, actionContext.getSource(), evaluator.evaluateExpression(actionContext.getGame(), null));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -588,4 +588,22 @@ public class NewCardsAtTest extends AbstractAtTest {
|
|||||||
playerDecided(P1, getCardActionId(P1, "Use Bilbo's Pipe"));
|
playerDecided(P1, getCardActionId(P1, "Use Bilbo's Pipe"));
|
||||||
assertEquals("2", _userFeedback.getAwaitingDecision(P1).getDecisionParameters().get("max"));
|
assertEquals("2", _userFeedback.getAwaitingDecision(P1).getDecisionParameters().get("max"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void removeBurdens() throws DecisionResultInvalidException, CardNotFoundException {
|
||||||
|
initializeSimplestGame();
|
||||||
|
|
||||||
|
final PhysicalCardImpl samsPipe = createCard(P1, "40_269");
|
||||||
|
final PhysicalCardImpl pipeweed = createCard(P1, "40_255");
|
||||||
|
|
||||||
|
_game.getGameState().addCardToZone(_game, pipeweed, Zone.SUPPORT);
|
||||||
|
_game.getGameState().attachCard(_game, samsPipe, _game.getGameState().getRingBearer(P1));
|
||||||
|
|
||||||
|
skipMulligans();
|
||||||
|
|
||||||
|
playerDecided(P1, getCardActionId(P1, "Use Sam's Pipe"));
|
||||||
|
playerDecided(P1, "1");
|
||||||
|
|
||||||
|
assertEquals(0, _game.getGameState().getBurdens());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user