Couple of bug fixes
This commit is contained in:
@@ -237,7 +237,8 @@
|
||||
"amount": {
|
||||
"type": "printedStrengthFromMemory",
|
||||
"memory": "discardedCard"
|
||||
}
|
||||
},
|
||||
"until": "start(regroup)"
|
||||
}
|
||||
}
|
||||
]
|
||||
|
||||
@@ -13,8 +13,8 @@ import com.gempukku.lotro.logic.effects.PlayoutDecisionEffect;
|
||||
import com.gempukku.lotro.logic.timing.Effect;
|
||||
import org.json.simple.JSONObject;
|
||||
|
||||
import java.util.LinkedHashSet;
|
||||
import java.util.Set;
|
||||
import java.util.TreeSet;
|
||||
|
||||
public class ChooseARace implements EffectAppenderProducer {
|
||||
@Override
|
||||
@@ -26,7 +26,7 @@ public class ChooseARace implements EffectAppenderProducer {
|
||||
return new DelayedAppender() {
|
||||
@Override
|
||||
protected Effect createEffect(boolean cost, CostToEffectAction action, ActionContext actionContext) {
|
||||
final Set<String> possibleRaces = new LinkedHashSet<String>();
|
||||
final Set<String> possibleRaces = new TreeSet<>();
|
||||
for (Race race : Race.values()) {
|
||||
possibleRaces.add(race.getHumanReadable());
|
||||
}
|
||||
|
||||
@@ -265,8 +265,16 @@ public class FilterFactory {
|
||||
return new FilterableSource() {
|
||||
@Override
|
||||
public Filterable getFilterable(ActionContext actionContext) {
|
||||
final String value = (String) actionContext.getSource().getWhileInZoneData();
|
||||
return Race.valueOf(value);
|
||||
return new Filter() {
|
||||
@Override
|
||||
public boolean accepts(LotroGame game, PhysicalCard physicalCard) {
|
||||
final String value = (String) actionContext.getSource().getWhileInZoneData();
|
||||
if (value == null)
|
||||
return false;
|
||||
else
|
||||
return Race.valueOf(value) == physicalCard.getBlueprint().getRace();
|
||||
}
|
||||
};
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
@@ -518,4 +518,25 @@ public class NewCardsAtTest extends AbstractAtTest {
|
||||
assertEquals(Zone.DISCARD, blackBreath.getZone());
|
||||
assertEquals(Zone.ATTACHED, blackBreath2.getZone());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void strengthBonus() throws DecisionResultInvalidException, CardNotFoundException {
|
||||
initializeSimplestGame();
|
||||
|
||||
final PhysicalCardImpl grimbeorn = createCard(P1, "14_6");
|
||||
final PhysicalCardImpl nazgulInHand = createCard(P1, "40_211");
|
||||
final PhysicalCardImpl nazgul = createCard(P2, "40_211");
|
||||
|
||||
_game.getGameState().addCardToZone(_game, grimbeorn, Zone.FREE_CHARACTERS);
|
||||
_game.getGameState().addCardToZone(_game, nazgul, Zone.SHADOW_CHARACTERS);
|
||||
_game.getGameState().addCardToZone(_game, nazgulInHand, Zone.HAND);
|
||||
|
||||
skipMulligans();
|
||||
|
||||
playerDecided(P1, "");
|
||||
playerDecided(P2, "");
|
||||
|
||||
playerDecided(P1, "0");
|
||||
playerDecided(P1, "");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user