- "Morgul Brute" and "Morgul Destroyer" optional "play" triggers now cannot be prevented by choosing to wound the Ring-bearer if the Ring-bearer cannot take a wound.

This commit is contained in:
marcins78@gmail.com
2011-12-05 16:17:00 +00:00
parent 55b9f3a126
commit 33a26ea177
5 changed files with 66 additions and 12 deletions

View File

@@ -10,7 +10,6 @@ import com.gempukku.lotro.cards.effects.RemoveBurdenEffect;
import com.gempukku.lotro.common.Culture;
import com.gempukku.lotro.common.Phase;
import com.gempukku.lotro.common.Race;
import com.gempukku.lotro.filters.Filters;
import com.gempukku.lotro.game.PhysicalCard;
import com.gempukku.lotro.game.state.LotroGame;
import com.gempukku.lotro.logic.actions.ActivateCardAction;
@@ -43,10 +42,10 @@ public class Card7_188 extends AbstractMinion {
}
@Override
public List<OptionalTriggerAction> getOptionalAfterTriggers(String playerId, LotroGame game, EffectResult effectResult, final PhysicalCard self) {
public List<OptionalTriggerAction> getOptionalAfterTriggers(String playerId, final LotroGame game, EffectResult effectResult, final PhysicalCard self) {
if (TriggerConditions.played(game, effectResult, self)
&& PlayConditions.canSpot(game, Race.NAZGUL)) {
OptionalTriggerAction action = new OptionalTriggerAction(self);
final OptionalTriggerAction action = new OptionalTriggerAction(self);
action.appendEffect(
new PreventableEffect(action,
new AddBurdenEffect(self, 1),
@@ -54,7 +53,7 @@ public class Card7_188 extends AbstractMinion {
new PreventableEffect.PreventionCost() {
@Override
public Effect createPreventionCostForPlayer(SubAction subAction, String playerId) {
return new WoundCharactersEffect(self, Filters.ringBearer) {
return new WoundCharactersEffect(self, game.getGameState().getRingBearer(playerId)) {
@Override
public String getText(LotroGame game) {
return "Wound Ring-bearer";

View File

@@ -8,7 +8,6 @@ import com.gempukku.lotro.cards.effects.PreventableEffect;
import com.gempukku.lotro.common.Culture;
import com.gempukku.lotro.common.Phase;
import com.gempukku.lotro.common.Race;
import com.gempukku.lotro.filters.Filters;
import com.gempukku.lotro.game.PhysicalCard;
import com.gempukku.lotro.game.state.LotroGame;
import com.gempukku.lotro.logic.actions.ActivateCardAction;
@@ -43,7 +42,7 @@ public class Card7_190 extends AbstractMinion {
}
@Override
public List<OptionalTriggerAction> getOptionalAfterTriggers(String playerId, LotroGame game, EffectResult effectResult, final PhysicalCard self) {
public List<OptionalTriggerAction> getOptionalAfterTriggers(String playerId, final LotroGame game, EffectResult effectResult, final PhysicalCard self) {
if (TriggerConditions.played(game, effectResult, self)
&& PlayConditions.canSpot(game, Race.NAZGUL)) {
OptionalTriggerAction action = new OptionalTriggerAction(self);
@@ -54,7 +53,7 @@ public class Card7_190 extends AbstractMinion {
new PreventableEffect.PreventionCost() {
@Override
public Effect createPreventionCostForPlayer(SubAction subAction, String playerId) {
return new WoundCharactersEffect(self, Filters.ringBearer) {
return new WoundCharactersEffect(self, game.getGameState().getRingBearer(playerId)) {
@Override
public String getText(LotroGame game) {
return "Wound Ring-bearer";

View File

@@ -7,11 +7,12 @@ import com.gempukku.lotro.logic.decisions.AwaitingDecision;
import com.gempukku.lotro.logic.decisions.DecisionResultInvalidException;
import com.gempukku.lotro.logic.timing.DefaultLotroGame;
import com.gempukku.lotro.logic.vo.LotroDeck;
import static org.junit.Assert.fail;
import org.junit.BeforeClass;
import java.util.*;
import static org.junit.Assert.fail;
public abstract class AbstractAtTest {
protected static LotroCardBlueprintLibrary _library;
@@ -40,14 +41,18 @@ public abstract class AbstractAtTest {
}
protected void initializeSimplestGame(Map<String, Collection<String>> additionalCardsInDeck) throws DecisionResultInvalidException {
MovieFormat format = new MovieFormat(_library);
Map<String, LotroDeck> decks = new HashMap<String, LotroDeck>();
addPlayerDeck(P1, decks, additionalCardsInDeck);
addPlayerDeck(P2, decks, additionalCardsInDeck);
initializeGameWithDecks(decks);
}
protected void initializeGameWithDecks(Map<String, LotroDeck> decks) throws DecisionResultInvalidException {
_userFeedback = new DefaultUserFeedback();
MovieFormat format = new MovieFormat(_library);
_game = new DefaultLotroGame(format, decks, _userFeedback, _library);
_userFeedback.setGame(_game);
_game.startGame();
@@ -110,7 +115,7 @@ public abstract class AbstractAtTest {
_game.carryOutPendingActionsUntilDecisionNeeded();
}
private LotroDeck createSimplestDeck() {
protected LotroDeck createSimplestDeck() {
LotroDeck lotroDeck = new LotroDeck();
// 10_121,1_2
lotroDeck.setRingBearer("10_121");

View File

@@ -7,7 +7,7 @@ import com.gempukku.lotro.game.PhysicalCardImpl;
import com.gempukku.lotro.logic.decisions.AwaitingDecision;
import com.gempukku.lotro.logic.decisions.AwaitingDecisionType;
import com.gempukku.lotro.logic.decisions.DecisionResultInvalidException;
import static junit.framework.Assert.assertEquals;
import com.gempukku.lotro.logic.vo.LotroDeck;
import org.junit.Test;
import java.util.Arrays;
@@ -15,6 +15,8 @@ import java.util.Collection;
import java.util.HashMap;
import java.util.Map;
import static junit.framework.Assert.assertEquals;
public class IndividualCardAtTest extends AbstractAtTest {
@Test
public void dwarvenAxeDoesNotFreeze() throws DecisionResultInvalidException {
@@ -129,4 +131,51 @@ public class IndividualCardAtTest extends AbstractAtTest {
assertEquals(2, _game.getGameState().getTwilightPool());
assertEquals(Zone.ATTACHED, asfaloth.getZone());
}
@Test
public void bilboRingBearerWithConsortingAndMorgulBrute() throws DecisionResultInvalidException {
Map<String, LotroDeck> decks = new HashMap<String, LotroDeck>();
final LotroDeck p1Deck = createSimplestDeck();
p1Deck.setRingBearer("9_49");
decks.put(P1, p1Deck);
final LotroDeck p2Deck = createSimplestDeck();
p2Deck.addCard("7_188");
decks.put(P2, p2Deck);
initializeGameWithDecks(decks);
skipMulligans();
PhysicalCard morgulBrute = _game.getGameState().getHand(P2).iterator().next();
PhysicalCardImpl consortingWithWizards = new PhysicalCardImpl(100, "2_97", P1, _library.getLotroCardBlueprint("2_97"));
PhysicalCardImpl ulaireEnquea = new PhysicalCardImpl(101, "1_231", P2, _library.getLotroCardBlueprint("1_231"));
_game.getGameState().attachCard(_game, consortingWithWizards, _game.getGameState().getRingBearer(P1));
_game.getGameState().addTwilight(3);
// End fellowship phase
playerDecided(P1, "");
_game.getGameState().addCardToZone(_game, ulaireEnquea, Zone.SHADOW_CHARACTERS);
final AwaitingDecision shadowDecision = _userFeedback.getAwaitingDecision(P2);
assertEquals(AwaitingDecisionType.CARD_ACTION_CHOICE, shadowDecision.getDecisionType());
validateContents(new String[]{"" + morgulBrute.getCardId()}, ((String[]) shadowDecision.getDecisionParameters().get("cardId")));
playerDecided(P2, "0");
final AwaitingDecision optionalPlayDecision = _userFeedback.getAwaitingDecision(P2);
assertEquals(AwaitingDecisionType.CARD_ACTION_CHOICE, optionalPlayDecision.getDecisionType());
validateContents(new String[]{"" + morgulBrute.getCardId()}, ((String[]) optionalPlayDecision.getDecisionParameters().get("cardId")));
assertEquals(1, _game.getGameState().getBurdens());
// User optional trigger of Morgul Brute
playerDecided(P2, "0");
// This should add burden without asking FP player for choice, since Bilbo can't be wounded, because of Consorting With Wizards
assertEquals(2, _game.getGameState().getBurdens());
}
}

View File

@@ -1,6 +1,8 @@
<pre style="font-size:80%">
<b>5 Dec. 2011</b>
- "Wisp of Pale Sheen" has now a Twilight keyword.
- "Morgul Brute" and "Morgul Destroyer" optional "play" triggers now cannot be prevented by choosing to wound the
Ring-bearer if the Ring-bearer cannot take a wound.
<b>4 Dec. 2011</b>
- The One Ring(s) no longer prevent the wound, so will work on Steward's Tomb.