Fixed Palantir of Orthanc errata not putting the revealed card on the draw deck

This commit is contained in:
Christian 'ketura' McCarty
2023-01-02 15:07:37 -06:00
parent 5842fd34a5
commit d7c5ef3ed2
3 changed files with 193 additions and 32 deletions

View File

@@ -373,14 +373,15 @@
{
type: revealRandomCardsFromHand
forced: true
hand: fp
hand: freeps
count: 1
memorize: revealedCard
}
{
type: putCardsFromHandOnTopOfDeck
filter: choose(memory(revealedCard))
player: fp
filter: all(memory(revealedCard))
player: shadow
hand: freeps
}
]
}

View File

@@ -0,0 +1,121 @@
package com.gempukku.lotro.cards.official.set03;
import com.gempukku.lotro.cards.GenericCardTestHelper;
import com.gempukku.lotro.common.*;
import com.gempukku.lotro.game.CardNotFoundException;
import com.gempukku.lotro.game.PhysicalCardImpl;
import com.gempukku.lotro.logic.decisions.DecisionResultInvalidException;
import org.junit.Test;
import java.util.HashMap;
import static org.junit.Assert.*;
public class Card_03_067_Tests
{
protected GenericCardTestHelper GetScenario() throws CardNotFoundException, DecisionResultInvalidException {
return new GenericCardTestHelper(
new HashMap<>()
{{
put("palantir", "3_67");
put("uruk1", "1_151");
put("uruk2", "1_151");
}},
GenericCardTestHelper.FellowshipSites,
GenericCardTestHelper.FOTRFrodo,
GenericCardTestHelper.FOTRRing
);
}
@Test
public void ThePalantirofOrthancStatsAndKeywordsAreCorrect() throws DecisionResultInvalidException, CardNotFoundException {
/**
* Set: 3
* Title: *The Palantir of Orthanc
* Side: Free Peoples
* Culture: Isengard
* Twilight Cost: 0
* Type: artifact
* Subtype: Palantir
* Game Text: To play, spot an [isengard] minion. Plays to your support area.
* <b>Shadow:</b> Spot an [isengard] minions and remove (1) to reveal a card at random from the Free Peoples player's hand. Place that card on top of that player's draw deck.
*/
//Pre-game setup
GenericCardTestHelper scn = GetScenario();
PhysicalCardImpl palantir = scn.GetFreepsCard("palantir");
assertTrue(palantir.getBlueprint().isUnique());
assertEquals(Side.SHADOW, palantir.getBlueprint().getSide());
assertEquals(Culture.ISENGARD, palantir.getBlueprint().getCulture());
assertEquals(CardType.ARTIFACT, palantir.getBlueprint().getCardType());
assertTrue(scn.HasKeyword(palantir, Keyword.SUPPORT_AREA));
//Uncomment this once this has been converted to JSON; java cards don't support support area items with classes
//assertTrue(palantir.getBlueprint().getPossessionClasses().contains(PossessionClass.PALANTIR));
assertEquals(0, palantir.getBlueprint().getTwilightCost());
}
@Test
public void PalantirRequires1IsengardMinionToPlayAnd1ToActivate() throws DecisionResultInvalidException, CardNotFoundException {
//Pre-game setup
GenericCardTestHelper scn = GetScenario();
scn.FreepsMoveCardToHand("palantir", "uruk1", "uruk2");
PhysicalCardImpl palantir = scn.GetShadowCard("palantir");
PhysicalCardImpl uruk1 = scn.GetShadowCard("uruk1");
PhysicalCardImpl uruk2 = scn.GetShadowCard("uruk2");
scn.ShadowMoveCardToHand(palantir, uruk1, uruk2);
scn.StartGame();
scn.SetTwilight(20);
scn.FreepsPassCurrentPhaseAction();
assertEquals(23, scn.GetTwilight());
assertFalse(scn.ShadowPlayAvailable(palantir));
scn.ShadowPlayCard(uruk1);
assertTrue(scn.ShadowPlayAvailable(palantir));
scn.ShadowPlayCard(palantir);
assertTrue(scn.ShadowActionAvailable(palantir));
}
@Test
public void PalantirRemoves2ToRevealCardFromFreepsHandAndPlacesOnDrawDeck() throws DecisionResultInvalidException, CardNotFoundException {
//Pre-game setup
GenericCardTestHelper scn = GetScenario();
scn.FreepsMoveCardToHand("palantir", "uruk1", "uruk2");
PhysicalCardImpl palantir = scn.GetShadowCard("palantir");
PhysicalCardImpl uruk1 = scn.GetShadowCard("uruk1");
PhysicalCardImpl uruk2 = scn.GetShadowCard("uruk2");
scn.ShadowMoveCharToTable(uruk1, uruk2);
scn.ShadowMoveCardToSupportArea(palantir);
scn.StartGame();
scn.SetTwilight(20);
scn.FreepsPassCurrentPhaseAction();
assertEquals(23, scn.GetTwilight());
assertEquals(3, scn.GetFreepsHandCount());
assertEquals(0, scn.GetFreepsDeckCount());
scn.ShadowUseCardAction(palantir);
assertEquals(22, scn.GetTwilight());
assertEquals(1, scn.GetShadowCardChoiceCount());
scn.FreepsDismissRevealedCards();
scn.ShadowDismissRevealedCards();
assertEquals(2, scn.GetFreepsHandCount());
assertEquals(1, scn.GetFreepsDeckCount());
}
}

View File

@@ -5,14 +5,11 @@ import com.gempukku.lotro.common.*;
import com.gempukku.lotro.game.CardNotFoundException;
import com.gempukku.lotro.game.PhysicalCardImpl;
import com.gempukku.lotro.logic.decisions.DecisionResultInvalidException;
import com.gempukku.lotro.logic.modifiers.MoveLimitModifier;
import org.junit.Test;
import java.util.HashMap;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.*;
public class Card_03_067_ErrataTests
{
@@ -21,8 +18,9 @@ public class Card_03_067_ErrataTests
return new GenericCardTestHelper(
new HashMap<String, String>()
{{
put("card", "73_67");
// put other cards in here as needed for the test case
put("palantir", "53_67");
put("uruk1", "1_151");
put("uruk2", "1_151");
}},
GenericCardTestHelper.FellowshipSites,
GenericCardTestHelper.FOTRFrodo,
@@ -30,9 +28,7 @@ public class Card_03_067_ErrataTests
);
}
// Uncomment both @Test markers below once this is ready to be used
//@Test
@Test
public void ThePalantirofOrthancStatsAndKeywordsAreCorrect() throws DecisionResultInvalidException, CardNotFoundException {
/**
@@ -50,34 +46,77 @@ public class Card_03_067_ErrataTests
//Pre-game setup
GenericCardTestHelper scn = GetScenario();
PhysicalCardImpl card = scn.GetFreepsCard("card");
assertTrue(card.getBlueprint().isUnique());
assertEquals(Side.FREE_PEOPLE, card.getBlueprint().getSide());
assertEquals(Culture.ISENGARD, card.getBlueprint().getCulture());
assertEquals(CardType.ARTIFACT, card.getBlueprint().getCardType());
//assertEquals(Race.CREATURE, card.getBlueprint().getRace());
assertTrue(scn.HasKeyword(card, Keyword.SUPPORT_AREA));
assertEquals(0, card.getBlueprint().getTwilightCost());
//assertEquals(, card.getBlueprint().getStrength());
//assertEquals(, card.getBlueprint().getVitality());
//assertEquals(, card.getBlueprint().getResistance());
//assertEquals(Signet., card.getBlueprint().getSignet());
//assertEquals(, card.getBlueprint().getSiteNumber()); // Change this to getAllyHomeSiteNumbers for allies
PhysicalCardImpl palantir = scn.GetFreepsCard("palantir");
assertTrue(palantir.getBlueprint().isUnique());
assertEquals(Side.SHADOW, palantir.getBlueprint().getSide());
assertEquals(Culture.ISENGARD, palantir.getBlueprint().getCulture());
assertEquals(CardType.ARTIFACT, palantir.getBlueprint().getCardType());
assertTrue(scn.HasKeyword(palantir, Keyword.SUPPORT_AREA));
assertTrue(palantir.getBlueprint().getPossessionClasses().contains(PossessionClass.PALANTIR));
assertEquals(0, palantir.getBlueprint().getTwilightCost());
}
//@Test
public void ThePalantirofOrthancTest1() throws DecisionResultInvalidException, CardNotFoundException {
@Test
public void PalantirRequires1IsengardMinionToPlayBut2ToActivate() throws DecisionResultInvalidException, CardNotFoundException {
//Pre-game setup
GenericCardTestHelper scn = GetScenario();
PhysicalCardImpl card = scn.GetFreepsCard("card");
scn.FreepsMoveCardToHand(card);
scn.FreepsMoveCardToHand("palantir", "uruk1", "uruk2");
PhysicalCardImpl palantir = scn.GetShadowCard("palantir");
PhysicalCardImpl uruk1 = scn.GetShadowCard("uruk1");
PhysicalCardImpl uruk2 = scn.GetShadowCard("uruk2");
scn.ShadowMoveCardToHand(palantir, uruk1, uruk2);
scn.StartGame();
scn.FreepsPlayCard(card);
assertEquals(0, scn.GetTwilight());
scn.SetTwilight(20);
scn.FreepsPassCurrentPhaseAction();
assertEquals(23, scn.GetTwilight());
assertFalse(scn.ShadowPlayAvailable(palantir));
scn.ShadowPlayCard(uruk1);
assertTrue(scn.ShadowPlayAvailable(palantir));
scn.ShadowPlayCard(palantir);
assertFalse(scn.ShadowActionAvailable(palantir));
scn.ShadowPlayCard(uruk2);
assertTrue(scn.ShadowActionAvailable(palantir));
}
@Test
public void PalantirRemoves2ToRevealCardFromFreepsHandAndPlacesOnDrawDeck() throws DecisionResultInvalidException, CardNotFoundException {
//Pre-game setup
GenericCardTestHelper scn = GetScenario();
scn.FreepsMoveCardToHand("palantir", "uruk1", "uruk2");
PhysicalCardImpl palantir = scn.GetShadowCard("palantir");
PhysicalCardImpl uruk1 = scn.GetShadowCard("uruk1");
PhysicalCardImpl uruk2 = scn.GetShadowCard("uruk2");
scn.ShadowMoveCharToTable(uruk1, uruk2);
scn.ShadowMoveCardToSupportArea(palantir);
scn.StartGame();
scn.SetTwilight(20);
scn.FreepsPassCurrentPhaseAction();
assertEquals(23, scn.GetTwilight());
assertEquals(3, scn.GetFreepsHandCount());
assertEquals(0, scn.GetFreepsDeckCount());
scn.ShadowUseCardAction(palantir);
assertEquals(21, scn.GetTwilight());
assertEquals(1, scn.GetShadowCardChoiceCount());
scn.FreepsDismissRevealedCards();
scn.ShadowDismissRevealedCards();
assertEquals(2, scn.GetFreepsHandCount());
assertEquals(1, scn.GetFreepsDeckCount());
}
}