Fixed issue with cards creating assignments
This commit is contained in:
@@ -40,7 +40,7 @@ public class Card7_174 extends AbstractPermanent {
|
||||
@Override
|
||||
protected void cardSelected(LotroGame game, final PhysicalCard nazgul) {
|
||||
action.insertEffect(
|
||||
new ChooseActiveCardEffect(self, playerId, "Choose a companion", CardType.COMPANION, Filters.not(Filters.ringBearer), Filters.assignableToSkirmishAgainst(Side.SHADOW, nazgul)) {
|
||||
new ChooseActiveCardEffect(self, playerId, "Choose a companion", CardType.COMPANION, Filters.not(Filters.ringBearer), Filters.assignableToSkirmishAgainst(Side.SHADOW, nazgul, false, false)) {
|
||||
@Override
|
||||
protected void cardSelected(final LotroGame game, final PhysicalCard card) {
|
||||
action.appendEffect(
|
||||
|
||||
@@ -27,7 +27,7 @@ public class ChooseAndAssignMinionToCompanionEffect extends ChooseActiveCardEffe
|
||||
@Override
|
||||
protected Filter getExtraFilterForPlaying(final LotroGame game) {
|
||||
final Side side = game.getGameState().getCurrentPlayerId().equals(_playerId) ? Side.FREE_PEOPLE : Side.SHADOW;
|
||||
return Filters.assignableToSkirmishAgainst(side, _companion);
|
||||
return Filters.assignableToSkirmishAgainst(side, _companion, false, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -49,7 +49,7 @@ public class ChooseAndDoAssignmentEffect extends AbstractSubActionEffect {
|
||||
}
|
||||
|
||||
private Collection<PhysicalCard> getAssignableMinions(LotroGame game) {
|
||||
return Filters.filterActive(game, CardType.MINION, _minionFilter, Filters.assignableToSkirmishAgainst(getDecidingPlayerSide(game), _fpFilter));
|
||||
return Filters.filterActive(game, CardType.MINION, _minionFilter, Filters.assignableToSkirmishAgainst(getDecidingPlayerSide(game), _fpFilter, false, false));
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -70,7 +70,7 @@ public class ChooseAndDoAssignmentEffect extends AbstractSubActionEffect {
|
||||
}
|
||||
|
||||
private void minionSelected(final LotroGame game, final PhysicalCard minion) {
|
||||
Collection<PhysicalCard> assignableFpCharacters = Filters.filterActive(game, Filters.or(CardType.COMPANION, CardType.ALLY), _fpFilter, Filters.assignableToSkirmishAgainst(getDecidingPlayerSide(game), minion));
|
||||
Collection<PhysicalCard> assignableFpCharacters = Filters.filterActive(game, Filters.or(CardType.COMPANION, CardType.ALLY), _fpFilter, Filters.assignableToSkirmishAgainst(getDecidingPlayerSide(game), minion, false, false));
|
||||
if (assignableFpCharacters.size() == 1)
|
||||
assignmentSelected(game, assignableFpCharacters.iterator().next(), minion);
|
||||
else
|
||||
|
||||
@@ -1200,159 +1200,4 @@ public class IndividualCardAtTest extends AbstractAtTest {
|
||||
assertEquals(Zone.DISCARD, morgulBlade.getZone());
|
||||
assertEquals(Zone.ATTACHED, bladeTip.getZone());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void returnToItsMaster() throws DecisionResultInvalidException, CardNotFoundException {
|
||||
LotroDeck p1Deck = createSimplestDeck();
|
||||
p1Deck.setRing("4_1");
|
||||
LotroDeck p2Deck = createSimplestDeck();
|
||||
|
||||
Map<String, LotroDeck> decks = new HashMap<>();
|
||||
decks.put(P1, p1Deck);
|
||||
decks.put(P2, p2Deck);
|
||||
|
||||
initializeGameWithDecks(decks);
|
||||
|
||||
skipMulligans();
|
||||
|
||||
PhysicalCardImpl returnToItsMaster = new PhysicalCardImpl(102, "1_224", P2, _cardLibrary.getLotroCardBlueprint("1_224"));
|
||||
_game.getGameState().addCardToZone(_game, returnToItsMaster, Zone.HAND);
|
||||
|
||||
PhysicalCardImpl nelya = new PhysicalCardImpl(102, "1_233", P2, _cardLibrary.getLotroCardBlueprint("1_233"));
|
||||
_game.getGameState().addCardToZone(_game, nelya, Zone.SHADOW_CHARACTERS);
|
||||
|
||||
PhysicalCardImpl hobbitSword = new PhysicalCardImpl(102, "1_299", P1, _cardLibrary.getLotroCardBlueprint("1_299"));
|
||||
_game.getGameState().attachCard(_game, hobbitSword, _game.getGameState().getRingBearer(P1));
|
||||
|
||||
// End fellowship
|
||||
playerDecided(P1, "");
|
||||
|
||||
// End shadow
|
||||
playerDecided(P2, "");
|
||||
|
||||
// End maneuvers phase
|
||||
playerDecided(P1, "");
|
||||
playerDecided(P2, "");
|
||||
|
||||
// End archery phase
|
||||
playerDecided(P1, "");
|
||||
playerDecided(P2, "");
|
||||
|
||||
// End assignment phase
|
||||
playerDecided(P1, "");
|
||||
playerDecided(P2, "");
|
||||
|
||||
// Assign
|
||||
playerDecided(P1, _game.getGameState().getRingBearer(P1).getCardId() + " " + nelya.getCardId());
|
||||
|
||||
// Choose skirmish to resolve
|
||||
playerDecided(P1, "" + _game.getGameState().getRingBearer(P1).getCardId());
|
||||
|
||||
// Skirmish phase
|
||||
AwaitingDecision skirmishAction = _userFeedback.getAwaitingDecision(P1);
|
||||
playerDecided(P1, getCardActionId(skirmishAction, "Use The One"));
|
||||
|
||||
assertTrue(_game.getGameState().isWearingRing());
|
||||
|
||||
// End skirmish phase
|
||||
playerDecided(P2, "");
|
||||
playerDecided(P1, "");
|
||||
|
||||
// Don't use Return to Its Master
|
||||
playerDecided(P2, "");
|
||||
|
||||
// End assignment phase
|
||||
playerDecided(P1, "");
|
||||
playerDecided(P2, "");
|
||||
|
||||
// Assign
|
||||
playerDecided(P1, _game.getGameState().getRingBearer(P1).getCardId() + " " + nelya.getCardId());
|
||||
|
||||
// Choose skirmish to resolve
|
||||
playerDecided(P1, "" + _game.getGameState().getRingBearer(P1).getCardId());
|
||||
|
||||
// End fierce skirmish phase
|
||||
playerDecided(P1, "");
|
||||
playerDecided(P2, "");
|
||||
|
||||
AwaitingDecision playeReturnDecision = _userFeedback.getAwaitingDecision(P2);
|
||||
playerDecided(P2, getCardActionId(playeReturnDecision, "Play Return"));
|
||||
|
||||
// Choose skirmish to resolve
|
||||
playerDecided(P1, "" + _game.getGameState().getRingBearer(P1).getCardId());
|
||||
|
||||
assertEquals(_game.getGameState().getRingBearer(P1), _game.getGameState().getSkirmish().getFellowshipCharacter());
|
||||
assertEquals(1, _game.getGameState().getSkirmish().getShadowCharacters().size());
|
||||
assertEquals(nelya, _game.getGameState().getSkirmish().getShadowCharacters().iterator().next());
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
public void returnToItsMasterNonFierceNazgul() throws DecisionResultInvalidException, CardNotFoundException {
|
||||
LotroDeck p1Deck = createSimplestDeck();
|
||||
p1Deck.setRing("4_1");
|
||||
LotroDeck p2Deck = createSimplestDeck();
|
||||
|
||||
Map<String, LotroDeck> decks = new HashMap<>();
|
||||
decks.put(P1, p1Deck);
|
||||
decks.put(P2, p2Deck);
|
||||
|
||||
initializeGameWithDecks(decks);
|
||||
|
||||
skipMulligans();
|
||||
|
||||
PhysicalCardImpl returnToItsMaster = new PhysicalCardImpl(102, "1_224", P2, _cardLibrary.getLotroCardBlueprint("1_224"));
|
||||
_game.getGameState().addCardToZone(_game, returnToItsMaster, Zone.HAND);
|
||||
|
||||
PhysicalCardImpl nonFierceNazgul = new PhysicalCardImpl(102, "2_83", P2, _cardLibrary.getLotroCardBlueprint("1_233"));
|
||||
_game.getGameState().addCardToZone(_game, nonFierceNazgul, Zone.SHADOW_CHARACTERS);
|
||||
|
||||
PhysicalCardImpl hobbitSword = new PhysicalCardImpl(102, "1_299", P1, _cardLibrary.getLotroCardBlueprint("1_299"));
|
||||
_game.getGameState().attachCard(_game, hobbitSword, _game.getGameState().getRingBearer(P1));
|
||||
|
||||
// End fellowship
|
||||
playerDecided(P1, "");
|
||||
|
||||
// End shadow
|
||||
playerDecided(P2, "");
|
||||
|
||||
// End maneuvers phase
|
||||
playerDecided(P1, "");
|
||||
playerDecided(P2, "");
|
||||
|
||||
// End archery phase
|
||||
playerDecided(P1, "");
|
||||
playerDecided(P2, "");
|
||||
|
||||
// End assignment phase
|
||||
playerDecided(P1, "");
|
||||
playerDecided(P2, "");
|
||||
|
||||
// Assign
|
||||
playerDecided(P1, _game.getGameState().getRingBearer(P1).getCardId() + " " + nonFierceNazgul.getCardId());
|
||||
|
||||
// Choose skirmish to resolve
|
||||
playerDecided(P1, "" + _game.getGameState().getRingBearer(P1).getCardId());
|
||||
|
||||
// Skirmish phase
|
||||
AwaitingDecision skirmishAction = _userFeedback.getAwaitingDecision(P1);
|
||||
playerDecided(P1, getCardActionId(skirmishAction, "Use The One"));
|
||||
|
||||
assertTrue(_game.getGameState().isWearingRing());
|
||||
|
||||
// End skirmish phase
|
||||
playerDecided(P2, "");
|
||||
playerDecided(P1, "");
|
||||
|
||||
AwaitingDecision playeReturnDecision = _userFeedback.getAwaitingDecision(P2);
|
||||
playerDecided(P2, getCardActionId(playeReturnDecision, "Play Return"));
|
||||
|
||||
// Choose skirmish to resolve
|
||||
playerDecided(P1, "" + _game.getGameState().getRingBearer(P1).getCardId());
|
||||
|
||||
assertEquals(_game.getGameState().getRingBearer(P1), _game.getGameState().getSkirmish().getFellowshipCharacter());
|
||||
assertEquals(1, _game.getGameState().getSkirmish().getShadowCharacters().size());
|
||||
assertEquals(nonFierceNazgul, _game.getGameState().getSkirmish().getShadowCharacters().iterator().next());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user