Fixed removing burdens
This commit is contained in:
@@ -36,7 +36,10 @@ public class DefaultActionContext implements ActionContext {
|
||||
|
||||
@Override
|
||||
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
|
||||
|
||||
@@ -26,7 +26,7 @@ public class RemoveBurdens implements EffectAppenderProducer {
|
||||
@Override
|
||||
protected Effect createEffect(boolean cost, CostToEffectAction action, ActionContext 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));
|
||||
}
|
||||
|
||||
|
||||
@@ -588,4 +588,22 @@ public class NewCardsAtTest extends AbstractAtTest {
|
||||
playerDecided(P1, getCardActionId(P1, "Use Bilbo's Pipe"));
|
||||
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