Added more ATs
This commit is contained in:
@@ -751,6 +751,7 @@
|
||||
{
|
||||
type: ShuffleCardsFromPlayIntoDrawDeck
|
||||
select: choose(culture(dwarven),condition)
|
||||
includeStacked: true
|
||||
count: any
|
||||
}
|
||||
]
|
||||
@@ -794,6 +795,7 @@
|
||||
{
|
||||
type: ShuffleCardsFromPlayIntoDrawDeck
|
||||
select: choose(culture(dwarven),condition)
|
||||
includeStacked: true
|
||||
memorizeStacked: stackedCards
|
||||
}
|
||||
{
|
||||
|
||||
@@ -161,7 +161,7 @@
|
||||
filter: culture(men)
|
||||
}
|
||||
cost: {
|
||||
type: revealCards
|
||||
type: revealCardsFromHand
|
||||
select: self
|
||||
}
|
||||
effect: {
|
||||
|
||||
@@ -606,7 +606,7 @@
|
||||
against: culture(orc),minion
|
||||
}
|
||||
cost: {
|
||||
type: revealCards
|
||||
type: revealCardsFromHand
|
||||
select: self
|
||||
}
|
||||
effect: {
|
||||
|
||||
@@ -187,9 +187,9 @@ public class CardResolver {
|
||||
}
|
||||
|
||||
public static EffectAppender resolveCardsInAdventureDeck(String type, FilterableSource additionalFilter, ValueSource countSource, String memory, String adventureDeckPlayer, CardGenerationEnvironment environment) throws InvalidCardDefinitionException {
|
||||
final PlayerSource handSource = PlayerResolver.resolvePlayer(adventureDeckPlayer);
|
||||
final PlayerSource playerDeckSource = PlayerResolver.resolvePlayer(adventureDeckPlayer);
|
||||
Function<ActionContext, Iterable<? extends PhysicalCard>> cardSource = actionContext -> {
|
||||
String handPlayer1 = handSource.getPlayer(actionContext);
|
||||
String handPlayer1 = playerDeckSource.getPlayer(actionContext);
|
||||
return actionContext.getGame().getGameState().getAdventureDeck(handPlayer1);
|
||||
};
|
||||
|
||||
@@ -198,19 +198,19 @@ public class CardResolver {
|
||||
return new DelayedAppender() {
|
||||
@Override
|
||||
public boolean isPlayableInFull(ActionContext actionContext) {
|
||||
final String handPlayer = handSource.getPlayer(actionContext);
|
||||
return actionContext.getGame().getGameState().getHand(handPlayer).size() >= count;
|
||||
final String playerDeck = playerDeckSource.getPlayer(actionContext);
|
||||
return actionContext.getGame().getGameState().getHand(playerDeck).size() >= count;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Effect createEffect(boolean cost, CostToEffectAction action, ActionContext actionContext) {
|
||||
final String handPlayer = handSource.getPlayer(actionContext);
|
||||
final String playerDeck = playerDeckSource.getPlayer(actionContext);
|
||||
return new UnrespondableEffect() {
|
||||
@Override
|
||||
protected void doPlayEffect(LotroGame game) {
|
||||
List<? extends PhysicalCard> hand = game.getGameState().getHand(handPlayer);
|
||||
List<PhysicalCard> randomCardsFromHand = GameUtils.getRandomCards(hand, 2);
|
||||
actionContext.setCardMemory(memory, randomCardsFromHand);
|
||||
List<? extends PhysicalCard> adventureDeck = game.getGameState().getAdventureDeck(playerDeck);
|
||||
List<PhysicalCard> randomCardsFromAdventureDeck = GameUtils.getRandomCards(adventureDeck, count);
|
||||
actionContext.setCardMemory(memory, randomCardsFromAdventureDeck);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
@@ -672,4 +672,28 @@ public class AssignmentAtTest extends AbstractAtTest {
|
||||
} catch (DecisionResultInvalidException e) {
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
public void setupExtraAssignmentAndSkirmishes() throws Exception {
|
||||
initializeSimplestGame();
|
||||
|
||||
PhysicalCard witchKing = addToZone(createCard(P2, "12_183"), Zone.SHADOW_CHARACTERS);
|
||||
PhysicalCard fellBeast = attachTo(createCard(P2, "12_184"), witchKing);
|
||||
|
||||
passUntil(Phase.ASSIGNMENT);
|
||||
// Normal skirmishes
|
||||
pass(P1);
|
||||
pass(P2);
|
||||
pass(P1);
|
||||
pass(P2);
|
||||
// Fierce skirmishes
|
||||
pass(P1);
|
||||
pass(P2);
|
||||
pass(P1);
|
||||
pass(P2);
|
||||
selectCardAction(P2, fellBeast);
|
||||
assertEquals(2, getWounds(witchKing));
|
||||
assertEquals(Phase.ASSIGNMENT, getPhase());
|
||||
assertTrue(_game.getGameState().isExtraSkirmishes());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,6 +16,7 @@ import org.junit.Test;
|
||||
import java.util.HashMap;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertNotNull;
|
||||
|
||||
public class ConcealedExposedAtTest extends AbstractAtTest {
|
||||
protected GenericCardTestHelper GetScenario() throws CardNotFoundException, DecisionResultInvalidException {
|
||||
@@ -160,4 +161,40 @@ public class ConcealedExposedAtTest extends AbstractAtTest {
|
||||
selectCardAction(P1, questionsThatNeedAnswering);
|
||||
assertEquals(AwaitingDecisionType.ARBITRARY_CARDS, getAwaitingDecision(P1).getDecisionType());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void revealBottomCardsOfDrawDeck() throws Exception {
|
||||
initializeSimplestGame();
|
||||
|
||||
PhysicalCard shepherdOfTheTrees = addToZone(createCard(P1, "15_36"), Zone.FREE_CHARACTERS);
|
||||
PhysicalCard goblinRunner = addToZone(createCard(P2, "1_178"), Zone.SHADOW_CHARACTERS);
|
||||
|
||||
passUntil(Phase.FELLOWSHIP);
|
||||
PhysicalCard topCard = addToZone(createCard(P1, "1_3"), Zone.DECK);
|
||||
PhysicalCard middleCard = addToZone(createCard(P1, "1_4"), Zone.DECK);
|
||||
PhysicalCard bottomCard = addToZone(createCard(P1, "1_5"), Zone.DECK);
|
||||
|
||||
passUntil(Phase.MANEUVER);
|
||||
selectCardAction(P1, shepherdOfTheTrees);
|
||||
assertNotNull(getArbitraryCardId(P1, "1_5"));
|
||||
assertNotNull(getArbitraryCardId(P2, "1_5"));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void revealCardsFromAdventureDeck() throws Exception {
|
||||
initializeSimplestGame();
|
||||
|
||||
PhysicalCard destroyedHomestead = addToZone(createCard(P2, "15_76"), Zone.HAND);
|
||||
PhysicalCard easterlingScout1 = addToZone(createCard(P2, "15_77"), Zone.SHADOW_CHARACTERS);
|
||||
PhysicalCard easterlingScout2 = addToZone(createCard(P2, "15_77"), Zone.SHADOW_CHARACTERS);
|
||||
|
||||
passUntil(Phase.FELLOWSHIP);
|
||||
setTwilightPool(10);
|
||||
passUntil(Phase.SHADOW);
|
||||
selectCardAction(P2, destroyedHomestead);
|
||||
assertEquals("Revealed card(s)", getAwaitingDecision(P1).getText());
|
||||
assertEquals(1, getAwaitingDecision(P1).getDecisionParameters().get("cardId").length);
|
||||
assertEquals("Revealed card(s)", getAwaitingDecision(P2).getText());
|
||||
assertEquals(1, getAwaitingDecision(P2).getDecisionParameters().get("cardId").length);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,6 +9,7 @@ import com.gempukku.lotro.logic.decisions.AwaitingDecision;
|
||||
import com.gempukku.lotro.logic.decisions.AwaitingDecisionType;
|
||||
import com.gempukku.lotro.logic.decisions.DecisionResultInvalidException;
|
||||
import com.gempukku.lotro.logic.timing.DefaultLotroGame;
|
||||
import com.gempukku.lotro.logic.timing.RuleUtils;
|
||||
import com.gempukku.lotro.logic.vo.LotroDeck;
|
||||
import org.junit.Test;
|
||||
|
||||
@@ -1317,4 +1318,60 @@ public class IndividualCardAtTest extends AbstractAtTest {
|
||||
assertTrue(_game.isFinished());
|
||||
assertEquals(P2, _game.getWinnerPlayerId());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void reorderTopCardsOfDrawDeck() throws Exception {
|
||||
initializeSimplestGame();
|
||||
|
||||
PhysicalCard gandalf = addToZone(createCard(P1, "1_72"), Zone.FREE_CHARACTERS);
|
||||
PhysicalCard discoveries = addToZone(createCard(P1, "12_26"), Zone.HAND);
|
||||
PhysicalCard gimli = addToZone(createCard(P1, "5_7"), Zone.FREE_CHARACTERS);
|
||||
|
||||
passUntil(Phase.FELLOWSHIP);
|
||||
PhysicalCard topCard = addToZone(createCard(P1, "1_3"), Zone.DECK);
|
||||
PhysicalCard middleCard = addToZone(createCard(P1, "1_4"), Zone.DECK);
|
||||
PhysicalCard bottomCard = addToZone(createCard(P1, "1_5"), Zone.DECK);
|
||||
selectCardAction(P1, discoveries);
|
||||
pass(P1);
|
||||
playerDecided(P1, "3");
|
||||
selectArbitraryCards(P1, getArbitraryCardId(P1, "1_3"));
|
||||
|
||||
List<? extends PhysicalCard> deck = _game.getGameState().getDeck(P1);
|
||||
assertEquals(middleCard, deck.get(0));
|
||||
assertEquals(topCard, deck.get(1));
|
||||
assertEquals(bottomCard, deck.get(2));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void setStrengthOverride() throws Exception {
|
||||
initializeSimplestGame();
|
||||
|
||||
PhysicalCard ringBearer = getRingBearer(P1);
|
||||
PhysicalCard finalTriumph = addToZone(createCard(P2, "18_115"), Zone.HAND);
|
||||
PhysicalCard whiteHandExorciser = addToZone(createCard(P2, "18_125"), Zone.SHADOW_CHARACTERS);
|
||||
|
||||
passUntil(Phase.ASSIGNMENT);
|
||||
pass(P1);
|
||||
pass(P2);
|
||||
setTwilightPool(4);
|
||||
playerDecided(P1, ringBearer.getCardId()+" "+whiteHandExorciser.getCardId());
|
||||
selectCard(P1, ringBearer);
|
||||
pass(P1);
|
||||
selectCardAction(P2, finalTriumph);
|
||||
assertEquals(4, RuleUtils.getFellowshipSkirmishStrength(_game));
|
||||
assertEquals(1, RuleUtils.getShadowSkirmishStrength(_game));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void shuffleCardsFromPlayIntoDrawDeck() throws Exception {
|
||||
initializeSimplestGame();
|
||||
|
||||
PhysicalCard restByBlindNight = addToZone(createCard(P1, "4_54"), Zone.HAND);
|
||||
PhysicalCard stoutAndStrong = addToZone(createCard(P1, "4_57"), Zone.SUPPORT);
|
||||
|
||||
passUntil(Phase.REGROUP);
|
||||
selectCardAction(P1, restByBlindNight);
|
||||
selectCard(P1, stoutAndStrong);
|
||||
assertEquals(Zone.DECK, stoutAndStrong.getZone());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,63 @@
|
||||
package com.gempukku.lotro.at.effects;
|
||||
|
||||
import com.gempukku.lotro.at.AbstractAtTest;
|
||||
import com.gempukku.lotro.common.Keyword;
|
||||
import com.gempukku.lotro.common.Phase;
|
||||
import com.gempukku.lotro.common.Zone;
|
||||
import com.gempukku.lotro.game.PhysicalCard;
|
||||
import org.junit.Test;
|
||||
|
||||
import static org.junit.Assert.assertFalse;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
public class KeywordAtTest extends AbstractAtTest {
|
||||
@Test
|
||||
public void removeKeyword() throws Exception{
|
||||
initializeSimplestGame();
|
||||
|
||||
PhysicalCard blendedRace = addToZone(createCard(P1, "2_16"), Zone.SUPPORT);
|
||||
PhysicalCard lurtz = addToZone(createCard(P2, "1_127"), Zone.SHADOW_CHARACTERS);
|
||||
|
||||
passUntil(Phase.FELLOWSHIP);
|
||||
assertFalse(hasKeyword(lurtz, Keyword.DAMAGE));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void removeKeywordEffect() throws Exception {
|
||||
initializeSimplestGame();
|
||||
|
||||
PhysicalCard merry = addToZone(createCard(P1, "1_302"), Zone.FREE_CHARACTERS);
|
||||
PhysicalCard seekAndHide = addToZone(createCard(P1, "3_112"), Zone.HAND);
|
||||
PhysicalCard urukHaiRaidingParty = addToZone(createCard(P2, "1_158"), Zone.SHADOW_CHARACTERS);
|
||||
|
||||
passUntil(Phase.ASSIGNMENT);
|
||||
pass(P1);
|
||||
pass(P2);
|
||||
playerDecided(P1, merry.getCardId()+" "+urukHaiRaidingParty.getCardId());
|
||||
selectCard(P1, merry);
|
||||
|
||||
assertTrue(hasKeyword(urukHaiRaidingParty, Keyword.DAMAGE));
|
||||
selectCardAction(P1, seekAndHide);
|
||||
assertFalse(hasKeyword(urukHaiRaidingParty, Keyword.DAMAGE));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void removeGameText() throws Exception {
|
||||
initializeSimplestGame();
|
||||
|
||||
PhysicalCard ringBearer = getRingBearer(P1);
|
||||
PhysicalCard vialOfGaladriel = attachTo(createCard(P1, "10_13"), ringBearer);
|
||||
|
||||
PhysicalCard urukHaiRaidingParty = addToZone(createCard(P2, "1_158"), Zone.SHADOW_CHARACTERS);
|
||||
|
||||
passUntil(Phase.ASSIGNMENT);
|
||||
pass(P1);
|
||||
pass(P2);
|
||||
playerDecided(P1, ringBearer.getCardId()+" "+urukHaiRaidingParty.getCardId());
|
||||
selectCard(P1, ringBearer);
|
||||
|
||||
assertTrue(hasKeyword(urukHaiRaidingParty, Keyword.DAMAGE));
|
||||
selectCardAction(P1, vialOfGaladriel);
|
||||
assertFalse(hasKeyword(urukHaiRaidingParty, Keyword.DAMAGE));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user