Fixing spot modifier

This commit is contained in:
marcin.sciesinski
2019-09-10 10:41:18 -07:00
parent 6e70a544bb
commit f9559c9ecf
3 changed files with 24 additions and 2 deletions

View File

@@ -33,7 +33,7 @@ public class ChooseHowManyToSpot implements EffectAppenderProducer {
@Override @Override
protected Effect createEffect(boolean cost, CostToEffectAction action, ActionContext actionContext) { protected Effect createEffect(boolean cost, CostToEffectAction action, ActionContext actionContext) {
final Filterable filterable = filterableSource.getFilterable(actionContext); final Filterable filterable = filterableSource.getFilterable(actionContext);
final int count = Filters.countActive(actionContext.getGame(), filterable); final int count = Filters.countSpottable(actionContext.getGame(), filterable);
return new PlayoutDecisionEffect(actionContext.getPerformingPlayer(), return new PlayoutDecisionEffect(actionContext.getPerformingPlayer(),
new IntegerAwaitingDecision(1, "Choose how many to spot", 0, count, count) { new IntegerAwaitingDecision(1, "Choose how many to spot", 0, count, count) {
@Override @Override

View File

@@ -87,7 +87,7 @@ public class AttachPermanentAction extends AbstractCostToEffectAction {
@Override @Override
public String getText(LotroGame game) { public String getText(LotroGame game) {
return "Attach " + GameUtils.getFullName(_cardToAttach); return "Play " + GameUtils.getFullName(_cardToAttach);
} }
@Override @Override

View File

@@ -566,4 +566,26 @@ public class NewCardsAtTest extends AbstractAtTest {
assertEquals(Zone.SHADOW_CHARACTERS, orcAssassin1.getZone()); assertEquals(Zone.SHADOW_CHARACTERS, orcAssassin1.getZone());
assertEquals(Zone.SHADOW_CHARACTERS, orcAssassin2.getZone()); assertEquals(Zone.SHADOW_CHARACTERS, orcAssassin2.getZone());
} }
@Test
public void spotCountChange() throws DecisionResultInvalidException, CardNotFoundException {
initializeSimplestGame();
final PhysicalCardImpl merry = createCard(P1, "40_257");
final PhysicalCardImpl bilbosPipe = createCard(P1, "40_244");
final PhysicalCardImpl pipeweed = createCard(P1, "40_255");
_game.getGameState().addCardToZone(_game, merry, Zone.HAND);
_game.getGameState().addCardToZone(_game, pipeweed, Zone.SUPPORT);
_game.getGameState().addCardToZone(_game, bilbosPipe, Zone.HAND);
skipMulligans();
playerDecided(P1, getCardActionId(P1, "Play Merry"));
playerDecided(P1, getCardActionId(P1, "Play Bilbo's Pipe"));
playerDecided(P1, "" + merry.getCardId());
playerDecided(P1, getCardActionId(P1, "Use Bilbo's Pipe"));
assertEquals("2", _userFeedback.getAwaitingDecision(P1).getDecisionParameters().get("max"));
}
} }