Talent for Not Being Seen errata 2 + tests

This commit is contained in:
Christian 'ketura' McCarty
2023-05-22 21:23:27 -05:00
parent 49e43da522
commit 1793a67268
3 changed files with 265 additions and 76 deletions

View File

@@ -317,4 +317,69 @@
}
}
}
71_316: {
cardInfo: {
//Either a full URL, or a subpath for the PC image server
imagePath: errata/LOTR-EN01E316.2_card.jpg
//If this is true, then all gameplay-related info outside this cardInfo definition
// will be ignored and the java class loaded instead.
javaClass: false
//This instructs the blueprint generator to insert this card as an alt of the listed
// parent blueprint. Can of course be ommitted if not an errata or promo.
parent: 1_316
//This is the tree path to use within the alts structure on the parent.
// Can of course be ommitted if parent is null.
parentPath: errata/pc
//Versioning differentiates releases within a particular alt path, such as PC errata
// version 1 vs version 2. PC version 2 will not conflict with, say, Decipher version 2.
//Top-level cards should always be version 0.
version: 2
collInfo: 1U316
rarity: U
setNum: "1"
cardNum: 316
// Standard, Masterwork, Tengwar, FullArt, etc. Top-level cards are always Standard.
style: Standard
}
title: A Talent for Not Being Seen
unique: false
side: Free Peoples
culture: Shire
twilight: 0
type: Condition
target: or(name(Merry),name(Pippin)),not(hasAttached(name(A Talent for Not Being Seen)))
keyword: [
stealth
]
effects: [
{
type: ExtraCost
cost: {
type: exert
filter: choose(or(title(Merry),title(Pippin)))
}
}
{
type: modifier
modifier: {
type: modifyCost
filter: site
amount: -1
}
}
]
gametext: <b>Stealth.</b> To play, exert Merry or Pippin. Bearer must be Merry or Pippin.<br>Each site's Shadow number is -1.
lore: With their small size, Hobbits use any hole to hide in, and their trail is difficult to detect.
promotext: ""
alts: {
//These are just CardInfo objects
promos: {
}
//These are full card definitions, with redundant info that is the same as the original card ommitted
errata: {
}
}
}
}

View File

@@ -1,108 +1,124 @@
package com.gempukku.lotro.cards.unofficial.pc.errata.set01;
import com.gempukku.lotro.cards.GenericCardTestHelper;
import com.gempukku.lotro.common.*;
import com.gempukku.lotro.common.CardType;
import com.gempukku.lotro.common.Culture;
import com.gempukku.lotro.common.Keyword;
import com.gempukku.lotro.common.Side;
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.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.*;
public class Card_01_316_ErrataTests
{
protected GenericCardTestHelper GetScenario() throws CardNotFoundException, DecisionResultInvalidException {
return new GenericCardTestHelper(
new HashMap<>() {{
put("talent", "51_316");
put("sam", "1_311");
put("merry", "1_302");
put("pippin", "1_307");
put("boromir", "1_97");
}}
);
}
@Test
public void TalentStatsAndKeywordsAreCorrect() throws DecisionResultInvalidException, CardNotFoundException {
protected GenericCardTestHelper GetScenario() throws CardNotFoundException, DecisionResultInvalidException {
return new GenericCardTestHelper(
new HashMap<>()
{{
put("talent1", "71_316");
put("talent2", "71_316");
put("sam", "1_311");
put("merry", "1_302");
put("pippin", "1_306");
}},
GenericCardTestHelper.FellowshipSites,
GenericCardTestHelper.FOTRFrodo,
GenericCardTestHelper.FOTRRing
);
}
/**
* Set: 1E
* Title: A Talent for Not Being Seen
* Side: Free Peoples
* Culture: Shire
* Twilight Cost: 0
* Type: Condition
* Errata Game Text: Stealth. Bearer must be Merry or Pippin. Limit 1 per character.
* Each site's Shadow number is -1.
*/
@Test
public void ATalentforNotBeingSeenStatsAndKeywordsAreCorrect() throws DecisionResultInvalidException, CardNotFoundException {
//Pre-game setup
GenericCardTestHelper scn = GetScenario();
/**
* Set: 1
* Title: A Talent for Not Being Seen
* Unique: True
* Side: FREE_PEOPLE
* Culture: Shire
* Twilight Cost: 0
* Type: condition
* Subtype:
* Game Text: <b>Stealth.</b> To play, exert Merry or Pippin. Bearer must be Merry or Pippin.
* Each site's Shadow number is -1.
*/
var talent = scn.GetFreepsCard("talent");
//Pre-game setup
var scn = GetScenario();
assertFalse(talent.getBlueprint().isUnique());
assertEquals(Side.FREE_PEOPLE, talent.getBlueprint().getSide());
assertEquals(Culture.SHIRE, talent.getBlueprint().getCulture());
assertEquals(CardType.CONDITION, talent.getBlueprint().getCardType());
assertEquals(0, talent.getBlueprint().getTwilightCost());
var card = scn.GetFreepsCard("talent1");
assertTrue(scn.HasKeyword(talent, Keyword.STEALTH));
assertFalse(scn.HasKeyword(talent, Keyword.SUPPORT_AREA));
}
assertFalse(card.getBlueprint().isUnique());
assertEquals(Side.FREE_PEOPLE, card.getBlueprint().getSide());
assertEquals(Culture.SHIRE, card.getBlueprint().getCulture());
assertEquals(CardType.CONDITION, card.getBlueprint().getCardType());
assertFalse(scn.HasKeyword(card, Keyword.SUPPORT_AREA));
assertEquals(0, card.getBlueprint().getTwilightCost());
}
@Test
public void TalentOnlyPlaysOnMerryOrPippin() throws DecisionResultInvalidException, CardNotFoundException {
//Pre-game setup
GenericCardTestHelper scn = GetScenario();
@Test
public void TalentExertsAndPlaysOnMerryOrPippin() throws DecisionResultInvalidException, CardNotFoundException {
//Pre-game setup
GenericCardTestHelper scn = GetScenario();
PhysicalCardImpl frodo = scn.GetRingBearer();
PhysicalCardImpl sam = scn.GetFreepsCard("sam");
PhysicalCardImpl merry = scn.GetFreepsCard("merry");
PhysicalCardImpl pippin = scn.GetFreepsCard("pippin");
PhysicalCardImpl talent = scn.GetFreepsCard("talent");
var frodo = scn.GetRingBearer();
var sam = scn.GetFreepsCard("sam");
var merry = scn.GetFreepsCard("merry");
var pippin = scn.GetFreepsCard("pippin");
var talent1 = scn.GetFreepsCard("talent1");
var talent2 = scn.GetFreepsCard("talent2");
scn.FreepsMoveCharToTable(sam);
scn.FreepsMoveCharToTable(merry);
scn.FreepsMoveCharToTable(pippin);
scn.FreepsMoveCardToHand(talent);
scn.FreepsMoveCardToHand(talent1,talent2, sam, merry, pippin);
scn.StartGame();
scn.StartGame();
scn.FreepsPlayCard(talent);
assertFalse(scn.FreepsPlayAvailable(talent1));
scn.FreepsPlayCard(sam);
assertFalse(scn.FreepsPlayAvailable(talent1));
//There are 4 companions in play, but only 2 valid targets
assertEquals(2, scn.FreepsGetADParamAsList("cardId").size());
}
scn.FreepsPlayCard(merry);
assertTrue(scn.FreepsPlayAvailable(talent1));
assertEquals(0, scn.GetWoundsOn(merry));
scn.FreepsPlayCard(talent1);
assertEquals(1, scn.GetWoundsOn(merry));
assertSame(merry, talent1.getAttachedTo());
scn.FreepsPlayCard(pippin);
scn.FreepsPlayCard(talent2);
//There are 4 companions in play, but only 2 valid targets for the exert
assertEquals(2, scn.GetFreepsCardChoiceCount());
scn.FreepsChooseCard(merry);
//plays automatically on pippin, since merry is already bearing one
assertEquals(2, scn.GetWoundsOn(merry));
assertEquals(0, scn.GetWoundsOn(pippin));
assertSame(pippin, talent2.getAttachedTo());
}
@Test
public void TalentReducesTwilightIfOnlyHobbits() throws DecisionResultInvalidException, CardNotFoundException {
//Pre-game setup
GenericCardTestHelper scn = GetScenario();
@Test
public void TalentReducesShadowBy1() throws DecisionResultInvalidException, CardNotFoundException {
//Pre-game setup
GenericCardTestHelper scn = GetScenario();
PhysicalCardImpl frodo = scn.GetRingBearer();
PhysicalCardImpl merry = scn.GetFreepsCard("merry");
PhysicalCardImpl talent = scn.GetFreepsCard("talent");
var frodo = scn.GetRingBearer();
var merry = scn.GetFreepsCard("merry");
var talent1 = scn.GetFreepsCard("talent1");
scn.FreepsMoveCharToTable(merry);
scn.FreepsMoveCardToHand(talent);
scn.StartGame();
scn.FreepsPlayCard(talent);
scn.FreepsPassCurrentPhaseAction();
// 2 for Frodo/Merry, 1 for the site, -1 for Talent
assertEquals(2, scn.GetTwilight());
}
scn.FreepsMoveCharToTable(merry);
scn.FreepsAttachCardsTo(merry, talent1);
scn.StartGame();
scn.FreepsPassCurrentPhaseAction();
// 2 for Frodo/Merry, 2 for the site, -1 for Talent
assertEquals(3, scn.GetTwilight());
}
}

View File

@@ -0,0 +1,108 @@
package com.gempukku.lotro.cards.unofficial.pc.errata.set01;
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.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
public class Card_01_316_ErrataTests
{
protected GenericCardTestHelper GetScenario() throws CardNotFoundException, DecisionResultInvalidException {
return new GenericCardTestHelper(
new HashMap<>() {{
put("talent", "51_316");
put("sam", "1_311");
put("merry", "1_302");
put("pippin", "1_307");
put("boromir", "1_97");
}}
);
}
@Test
public void TalentStatsAndKeywordsAreCorrect() throws DecisionResultInvalidException, CardNotFoundException {
/**
* Set: 1E
* Title: A Talent for Not Being Seen
* Side: Free Peoples
* Culture: Shire
* Twilight Cost: 0
* Type: Condition
* Errata Game Text: Stealth. Bearer must be Merry or Pippin. Limit 1 per character.
* Each site's Shadow number is -1.
*/
//Pre-game setup
GenericCardTestHelper scn = GetScenario();
var talent = scn.GetFreepsCard("talent");
assertFalse(talent.getBlueprint().isUnique());
assertEquals(Side.FREE_PEOPLE, talent.getBlueprint().getSide());
assertEquals(Culture.SHIRE, talent.getBlueprint().getCulture());
assertEquals(CardType.CONDITION, talent.getBlueprint().getCardType());
assertEquals(0, talent.getBlueprint().getTwilightCost());
assertTrue(scn.HasKeyword(talent, Keyword.STEALTH));
assertFalse(scn.HasKeyword(talent, Keyword.SUPPORT_AREA));
}
@Test
public void TalentOnlyPlaysOnMerryOrPippin() throws DecisionResultInvalidException, CardNotFoundException {
//Pre-game setup
GenericCardTestHelper scn = GetScenario();
PhysicalCardImpl frodo = scn.GetRingBearer();
PhysicalCardImpl sam = scn.GetFreepsCard("sam");
PhysicalCardImpl merry = scn.GetFreepsCard("merry");
PhysicalCardImpl pippin = scn.GetFreepsCard("pippin");
PhysicalCardImpl talent = scn.GetFreepsCard("talent");
scn.FreepsMoveCharToTable(sam);
scn.FreepsMoveCharToTable(merry);
scn.FreepsMoveCharToTable(pippin);
scn.FreepsMoveCardToHand(talent);
scn.StartGame();
scn.FreepsPlayCard(talent);
//There are 4 companions in play, but only 2 valid targets
assertEquals(2, scn.FreepsGetADParamAsList("cardId").size());
}
@Test
public void TalentReducesTwilightIfOnlyHobbits() throws DecisionResultInvalidException, CardNotFoundException {
//Pre-game setup
GenericCardTestHelper scn = GetScenario();
PhysicalCardImpl frodo = scn.GetRingBearer();
PhysicalCardImpl merry = scn.GetFreepsCard("merry");
PhysicalCardImpl talent = scn.GetFreepsCard("talent");
scn.FreepsMoveCharToTable(merry);
scn.FreepsMoveCardToHand(talent);
scn.StartGame();
scn.FreepsPlayCard(talent);
scn.FreepsPassCurrentPhaseAction();
// 2 for Frodo/Merry, 1 for the site, -1 for Talent
assertEquals(2, scn.GetTwilight());
}
}