- "O Elbereth! Gilthoniel!" will not allow to cancel a skirmish now in formats that do not allow that.

This commit is contained in:
marcins78@gmail.com
2012-02-10 10:40:51 +00:00
parent beee3a5342
commit 320a77d680
3 changed files with 61 additions and 4 deletions

View File

@@ -10,7 +10,6 @@ import com.gempukku.lotro.common.*;
import com.gempukku.lotro.filters.Filters;
import com.gempukku.lotro.game.PhysicalCard;
import com.gempukku.lotro.game.state.LotroGame;
import com.gempukku.lotro.game.state.Skirmish;
import com.gempukku.lotro.logic.actions.ActivateCardAction;
import com.gempukku.lotro.logic.modifiers.Modifier;
import com.gempukku.lotro.logic.modifiers.StrengthModifier;
@@ -83,9 +82,9 @@ public class Card2_108 extends AbstractAttachable {
@Override
public boolean isPlayableInFull(LotroGame game) {
Skirmish skirmish = game.getGameState().getSkirmish();
return (skirmish != null && skirmish.getFellowshipCharacter() == _attachedTo
&& Filters.filter(skirmish.getShadowCharacters(), game.getGameState(), game.getModifiersQuerying(), Race.NAZGUL).size() > 0);
return super.isPlayableInFull(game)
&& Filters.canSpot(game.getGameState(), game.getModifiersQuerying(), Race.NAZGUL, Filters.inSkirmish)
&& Filters.canSpot(game.getGameState(), game.getModifiersQuerying(), Filters.ringBearer, Filters.inSkirmish);
}
}
}

View File

@@ -374,4 +374,59 @@ public class IndividualCardAtTest extends AbstractAtTest {
assertEquals(2, _game.getGameState().getBurdens());
assertEquals(1, _game.getGameState().getHand(P1).size());
}
@Test
public void oElberethGilthoniel() throws DecisionResultInvalidException {
Map<String, LotroDeck> decks = new HashMap<String, LotroDeck>();
final LotroDeck p1Deck = createSimplestDeck();
p1Deck.setRingBearer("9_49");
decks.put(P1, p1Deck);
decks.put(P2, createSimplestDeck());
initializeGameWithDecks(decks);
skipMulligans();
PhysicalCardImpl oElberethGilthoniel = new PhysicalCardImpl(100, "2_108", P1, _library.getLotroCardBlueprint("2_108"));
PhysicalCardImpl ulaireToldea = new PhysicalCardImpl(101, "1_236", P2, _library.getLotroCardBlueprint("1_236"));
_game.getGameState().attachCard(_game, oElberethGilthoniel, _game.getGameState().getRingBearer(P1));
_game.getGameState().addTwilight(3);
// End fellowship phase
playerDecided(P1, "");
_game.getGameState().addCardToZone(_game, ulaireToldea, Zone.SHADOW_CHARACTERS);
// End shadow phase
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() + " " + ulaireToldea.getCardId());
// Start skirmish
playerDecided(P1, String.valueOf(_game.getGameState().getRingBearer(P1).getCardId()));
AwaitingDecision playSkirmishEvent = _userFeedback.getAwaitingDecision(P1);
assertEquals(AwaitingDecisionType.CARD_ACTION_CHOICE, playSkirmishEvent.getDecisionType());
validateContents(new String[]{"" + oElberethGilthoniel.getCardId()}, ((String[]) playSkirmishEvent.getDecisionParameters().get("cardId")));
playerDecided(P1, "0");
// Should not cancel skirmish (since it's a ring-bearer)
assertEquals(Phase.SKIRMISH, _game.getGameState().getCurrentPhase());
}
}

View File

@@ -1,4 +1,7 @@
<pre style="font-size:80%">
<b>10 Feb. 2012</b>
- "O Elbereth! Gilthoniel!" will not allow to cancel a skirmish now in formats that do not allow that.
<b>8 Feb. 2012</b>
- "Pillage of Rohan" should now correctly prevent FP player from playing Skirmish events and special abilities.
- "Fall Back" should not discard attached cards.