Completed revamp for Gondor V1 cards, and completed missing V1 Gondor unit tests. Fixed card stacking using the wrong prompt.

This commit is contained in:
Christian 'ketura' McCarty
2022-07-22 04:40:03 -05:00
parent 71afad36c1
commit 1b14044ca9
10 changed files with 576 additions and 163 deletions

View File

@@ -136,24 +136,48 @@
}
},
{
"type": "modifier",
"modifier": {
"type": "modifyStrength",
"filter": "companion,signet(aragorn)",
"amount": 1
}
},
{
"type": "activated",
"phase": "regroup",
"cost": {
"type": "discard",
"filter": "self"
"type": "trigger",
"optional": false,
"trigger": {
"type": "killed",
"filter": "name(Aragorn)"
},
"effect": {
"type": "heal",
"filter": "choose(companion,signet(aragorn))"
"type": "discard",
"filter": "self"
}
},
{
"type": "activated",
"phase": "fellowship",
"cost": {
"type": "exert",
"filter": "choose(companion,signet(aragorn))"
},
"effect": [
{
"type": "removeBurdens",
"amount": 1
},
{
"type": "choice",
"texts": [
"Exert Aragorn",
"Discard Gilraen's Memorial"
],
"effects": [
{
"type": "exert",
"filter": "choose(name(Aragorn))"
},
{
"type": "discard",
"filter": "self"
}
]
}
]
}
]
},
@@ -245,7 +269,7 @@
"type": "choice",
"texts": [
"Exert Aragorn",
"Discard this condition"
"Discard You Have My Sword"
],
"effects": [
{

View File

@@ -25,7 +25,7 @@ public class DiscardStackedCards implements EffectAppenderProducer {
MultiEffectAppender result = new MultiEffectAppender();
result.addEffectAppender(
CardResolver.resolveStackedCards(filter, valueSource, onFilterSource, memory, "you", "Choose cards to discard", environment));
CardResolver.resolveStackedCards(filter, valueSource, onFilterSource, memory, "you", "Choose stacked cards to discard", environment));
result.addEffectAppender(
new DelayedAppender() {
@Override

View File

@@ -62,7 +62,7 @@ public abstract class ChooseStackedCardsEffect extends AbstractEffect {
cardsChosen(game, stackedCards);
} else {
game.getUserFeedback().sendAwaitingDecision(_playerId,
new CardsSelectionDecision(1, "Choose cards", stackedCards, _minimum, maximum) {
new CardsSelectionDecision(1, getText(game), stackedCards, _minimum, maximum) {
@Override
public void decisionMade(String result) throws DecisionResultInvalidException {
Set<PhysicalCard> stackedCards = getSelectedCardsByResponse(result);

View File

@@ -287,9 +287,11 @@ public class GenericCardTestHelper extends AbstractAtTest {
}
}
public void FreepsAttachCardsTo(PhysicalCardImpl bearer, PhysicalCardImpl...cards) { AttachCardsTo(bearer, cards); }
public void FreepsAttachCardsTo(PhysicalCardImpl bearer, String...names) {
Arrays.stream(names).forEach(name -> AttachCardsTo(bearer, GetFreepsCard(name)));
}
public void ShadowAttachCardsTo(PhysicalCardImpl bearer, PhysicalCardImpl...cards) { AttachCardsTo(bearer, cards); }
public void ShadowAttachCardsTo(PhysicalCardImpl bearer, String...names) {
Arrays.stream(names).forEach(name -> AttachCardsTo(bearer, GetShadowCard(name)));
}

View File

@@ -22,8 +22,14 @@ public class Card_V1_019_Tests
return new GenericCardTestHelper(
new HashMap<String, String>()
{{
put("card", "151_19");
// put other cards in here as needed for the test case
put("aragorn", "151_19");
put("elrond", "1_40");
put("galadriel", "1_45");
put("celeborn", "1_34");
put("orophin", "1_56");
put("defiance", "1_37");
put("runner", "1_178");
}},
GenericCardTestHelper.FellowshipSites,
GenericCardTestHelper.FOTRFrodo,
@@ -31,9 +37,7 @@ public class Card_V1_019_Tests
);
}
// Uncomment both @Test markers below once this is ready to be used
//@Test
@Test
public void AragornStatsAndKeywordsAreCorrect() throws DecisionResultInvalidException, CardNotFoundException {
/**
@@ -54,34 +58,81 @@ public class Card_V1_019_Tests
//Pre-game setup
GenericCardTestHelper scn = GetScenario();
PhysicalCardImpl card = scn.GetFreepsCard("card");
PhysicalCardImpl aragorn = scn.GetFreepsCard("aragorn");
assertTrue(card.getBlueprint().isUnique());
assertEquals(Side.FREE_PEOPLE, card.getBlueprint().getSide());
assertEquals(Culture.GONDOR, card.getBlueprint().getCulture());
assertEquals(CardType.COMPANION, card.getBlueprint().getCardType());
assertEquals(Race.CREATURE, card.getBlueprint().getRace());
assertTrue(scn.HasKeyword(card, Keyword.SUPPORT_AREA)); // test for keywords as needed
assertEquals(4, card.getBlueprint().getTwilightCost());
assertEquals(8, card.getBlueprint().getStrength());
assertEquals(4, card.getBlueprint().getVitality());
//assertEquals(, card.getBlueprint().getResistance());
assertEquals(Signet.GANDALF, card.getBlueprint().getSignet());
//assertEquals(, card.getBlueprint().getSiteNumber()); // Change this to getAllyHomeSiteNumbers for allies
assertTrue(aragorn.getBlueprint().isUnique());
assertEquals(Side.FREE_PEOPLE, aragorn.getBlueprint().getSide());
assertEquals(Culture.GONDOR, aragorn.getBlueprint().getCulture());
assertEquals(CardType.COMPANION, aragorn.getBlueprint().getCardType());
assertEquals(Race.MAN, aragorn.getBlueprint().getRace());
//assertTrue(scn.HasKeyword(aragorn, Keyword.SUPPORT_AREA)); // test for keywords as needed
assertEquals(4, aragorn.getBlueprint().getTwilightCost());
assertEquals(8, aragorn.getBlueprint().getStrength());
assertEquals(4, aragorn.getBlueprint().getVitality());
//assertEquals(, aragorn.getBlueprint().getResistance());
assertEquals(Signet.GANDALF, aragorn.getBlueprint().getSignet());
//assertEquals(, aragorn.getBlueprint().getSiteNumber()); // Change this to getAllyHomeSiteNumbers for allies
}
//@Test
public void AragornTest1() throws DecisionResultInvalidException, CardNotFoundException {
@Test
public void OnPlayTutorsAnElvenAllyOfCost2OrLess() throws DecisionResultInvalidException, CardNotFoundException {
//Pre-game setup
GenericCardTestHelper scn = GetScenario();
PhysicalCardImpl card = scn.GetFreepsCard("card");
scn.FreepsMoveCardToHand(card);
PhysicalCardImpl aragorn = scn.GetFreepsCard("aragorn");
PhysicalCardImpl elrond = scn.GetFreepsCard("elrond");
PhysicalCardImpl galadriel = scn.GetFreepsCard("galadriel");
PhysicalCardImpl celeborn = scn.GetFreepsCard("celeborn");
PhysicalCardImpl orophin = scn.GetFreepsCard("orophin");
scn.FreepsMoveCardToHand(aragorn);
scn.StartGame();
scn.FreepsPlayCard(card);
assertEquals(4, scn.GetTwilight());
scn.FreepsPlayCard(aragorn);
assertTrue(scn.FreepsHasOptionalTriggerAvailable());
scn.FreepsAcceptOptionalTrigger();
assertEquals(2, scn.GetFreepsCardChoiceCount());
assertEquals(Zone.DECK, orophin.getZone());
assertEquals(0, scn.GetFreepsHandCount());
assertEquals(6, scn.GetFreepsDeckCount());
scn.FreepsChooseCardBPFromSelection(orophin);
assertEquals(Zone.HAND, orophin.getZone());
assertEquals(1, scn.GetFreepsHandCount());
assertEquals(5, scn.GetFreepsDeckCount());
}
@Test
public void SkirmishAbilityDiscardsElvenEventToPumpAragorn() throws DecisionResultInvalidException, CardNotFoundException {
//Pre-game setup
GenericCardTestHelper scn = GetScenario();
PhysicalCardImpl aragorn = scn.GetFreepsCard("aragorn");
PhysicalCardImpl defiance = scn.GetFreepsCard("defiance");
scn.FreepsMoveCharToTable(aragorn);
scn.FreepsMoveCardToHand(defiance);
PhysicalCardImpl runner = scn.GetShadowCard("runner");
scn.ShadowMoveCharToTable(runner);
scn.StartGame();
scn.SkipToPhase(Phase.ASSIGNMENT);
scn.PassCurrentPhaseActions();
scn.FreepsAssignToMinions(aragorn, runner);
scn.FreepsResolveSkirmish(aragorn);
assertTrue(scn.FreepsCardActionAvailable(aragorn));
assertEquals(Zone.HAND, defiance.getZone());
assertEquals(8, scn.GetStrength(aragorn));
scn.FreepsUseCardAction(aragorn);
assertEquals(Zone.DISCARD, defiance.getZone());
assertEquals(10, scn.GetStrength(aragorn));
}
}

View File

@@ -22,8 +22,13 @@ public class Card_V1_020_Tests
return new GenericCardTestHelper(
new HashMap<String, String>()
{{
put("card", "151_20");
// put other cards in here as needed for the test case
put("boromir", "151_20");
put("sam", "1_311");
put("runner1", "1_178");
put("runner2", "1_178");
put("runner3", "1_178");
put("nelya", "1_233");
}},
GenericCardTestHelper.FellowshipSites,
GenericCardTestHelper.FOTRFrodo,
@@ -31,9 +36,7 @@ public class Card_V1_020_Tests
);
}
// Uncomment both @Test markers below once this is ready to be used
//@Test
@Test
public void BoromirStatsAndKeywordsAreCorrect() throws DecisionResultInvalidException, CardNotFoundException {
/**
@@ -54,34 +57,81 @@ public class Card_V1_020_Tests
//Pre-game setup
GenericCardTestHelper scn = GetScenario();
PhysicalCardImpl card = scn.GetFreepsCard("card");
PhysicalCardImpl boromir = scn.GetFreepsCard("boromir");
assertTrue(card.getBlueprint().isUnique());
assertEquals(Side.FREE_PEOPLE, card.getBlueprint().getSide());
assertEquals(Culture.GONDOR, card.getBlueprint().getCulture());
assertEquals(CardType.COMPANION, card.getBlueprint().getCardType());
assertEquals(Race.CREATURE, card.getBlueprint().getRace());
assertTrue(scn.HasKeyword(card, Keyword.SUPPORT_AREA)); // test for keywords as needed
assertEquals(3, card.getBlueprint().getTwilightCost());
assertEquals(5, card.getBlueprint().getStrength());
assertEquals(3, card.getBlueprint().getVitality());
//assertEquals(, card.getBlueprint().getResistance());
assertEquals(Signet.ARAGORN, card.getBlueprint().getSignet());
//assertEquals(, card.getBlueprint().getSiteNumber()); // Change this to getAllyHomeSiteNumbers for allies
assertTrue(boromir.getBlueprint().isUnique());
assertEquals(Side.FREE_PEOPLE, boromir.getBlueprint().getSide());
assertEquals(Culture.GONDOR, boromir.getBlueprint().getCulture());
assertEquals(CardType.COMPANION, boromir.getBlueprint().getCardType());
assertEquals(Race.MAN, boromir.getBlueprint().getRace());
//assertTrue(scn.HasKeyword(boromir, Keyword.SUPPORT_AREA)); // test for keywords as needed
assertEquals(3, boromir.getBlueprint().getTwilightCost());
assertEquals(5, boromir.getBlueprint().getStrength());
assertEquals(3, boromir.getBlueprint().getVitality());
//assertEquals(, boromir.getBlueprint().getResistance());
assertEquals(Signet.ARAGORN, boromir.getBlueprint().getSignet());
//assertEquals(, boromir.getBlueprint().getSiteNumber()); // Change this to getAllyHomeSiteNumbers for allies
}
//@Test
public void BoromirTest1() throws DecisionResultInvalidException, CardNotFoundException {
@Test
public void BoromirIsStrengthPlus2PerMinionHeIsSkirmishing() throws DecisionResultInvalidException, CardNotFoundException {
//Pre-game setup
GenericCardTestHelper scn = GetScenario();
PhysicalCardImpl card = scn.GetFreepsCard("card");
scn.FreepsMoveCardToHand(card);
PhysicalCardImpl boromir = scn.GetFreepsCard("boromir");
scn.FreepsMoveCharToTable(boromir);
PhysicalCardImpl runner1 = scn.GetShadowCard("runner1");
PhysicalCardImpl runner2 = scn.GetShadowCard("runner2");
PhysicalCardImpl runner3 = scn.GetShadowCard("runner3");
scn.ShadowMoveCharToTable(runner1, runner2, runner3);
scn.StartGame();
scn.FreepsPlayCard(card);
assertEquals(3, scn.GetTwilight());
scn.SkipToPhase(Phase.ASSIGNMENT);
scn.PassCurrentPhaseActions();
assertEquals(5, scn.GetStrength(boromir));
scn.FreepsAssignToMinions(boromir, runner1);
scn.ShadowAssignToMinions(boromir, runner2, runner3);
scn.FreepsResolveSkirmish(boromir);
assertEquals(11, scn.GetStrength(boromir));
}
@Test
public void AssignmentActionExertsAragornSignetToMakeBoromirDefenderPlus1() throws DecisionResultInvalidException, CardNotFoundException {
//Pre-game setup
GenericCardTestHelper scn = GetScenario();
PhysicalCardImpl boromir = scn.GetFreepsCard("boromir");
PhysicalCardImpl sam = scn.GetFreepsCard("sam");
scn.FreepsMoveCharToTable(boromir, sam);
PhysicalCardImpl nelya = scn.GetShadowCard("nelya");
scn.ShadowMoveCharToTable(nelya);
scn.StartGame();
scn.SkipToPhase(Phase.ASSIGNMENT);
assertTrue(scn.FreepsHasOptionalTriggerAvailable());
assertFalse(scn.HasKeyword(boromir, Keyword.DEFENDER));
assertEquals(0, scn.GetWoundsOn(sam));
scn.FreepsAcceptOptionalTrigger();
assertTrue(scn.HasKeyword(boromir, Keyword.DEFENDER));
assertEquals(1, scn.GetKeywordCount(boromir, Keyword.DEFENDER));
assertEquals(1, scn.GetWoundsOn(sam));
scn.PassCurrentPhaseActions();
scn.FreepsAssignToMinions(boromir, nelya);
scn.FreepsResolveSkirmish(boromir);
scn.PassCurrentPhaseActions();
assertEquals(Phase.ASSIGNMENT, scn.GetCurrentPhase());
assertTrue(scn.HasKeyword(boromir, Keyword.DEFENDER));
assertEquals(1, scn.GetKeywordCount(boromir, Keyword.DEFENDER));
}
}

View File

@@ -22,8 +22,14 @@ public class Card_V1_021_Tests
return new GenericCardTestHelper(
new HashMap<String, String>()
{{
put("card", "151_21");
// put other cards in here as needed for the test case
put("sons", "151_21");
put("aragorn", "1_89");
put("boromir", "1_97");
put("runner1", "1_178");
put("runner2", "1_178");
put("runner3", "1_178");
put("runner4", "1_178");
}},
GenericCardTestHelper.FellowshipSites,
GenericCardTestHelper.FOTRFrodo,
@@ -31,10 +37,8 @@ public class Card_V1_021_Tests
);
}
// Uncomment both @Test markers below once this is ready to be used
//@Test
public void TheSonsofGondorHaveReturnedStatsAndKeywordsAreCorrect() throws DecisionResultInvalidException, CardNotFoundException {
@Test
public void SonsStatsAndKeywordsAreCorrect() throws DecisionResultInvalidException, CardNotFoundException {
/**
* Set: V1
@@ -51,34 +55,51 @@ public class Card_V1_021_Tests
//Pre-game setup
GenericCardTestHelper scn = GetScenario();
PhysicalCardImpl card = scn.GetFreepsCard("card");
PhysicalCardImpl sons = scn.GetFreepsCard("sons");
assertTrue(card.getBlueprint().isUnique());
assertEquals(Side.FREE_PEOPLE, card.getBlueprint().getSide());
assertEquals(Culture.GONDOR, card.getBlueprint().getCulture());
assertEquals(CardType.CONDITION, card.getBlueprint().getCardType());
//assertEquals(Race.CREATURE, card.getBlueprint().getRace());
assertTrue(scn.HasKeyword(card, Keyword.SUPPORT_AREA)); // test for keywords as needed
assertEquals(2, 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
assertTrue(sons.getBlueprint().isUnique());
assertEquals(Side.FREE_PEOPLE, sons.getBlueprint().getSide());
assertEquals(Culture.GONDOR, sons.getBlueprint().getCulture());
assertEquals(CardType.CONDITION, sons.getBlueprint().getCardType());
//assertEquals(Race.CREATURE, sons.getBlueprint().getRace());
assertTrue(scn.HasKeyword(sons, Keyword.SUPPORT_AREA)); // test for keywords as needed
assertEquals(2, sons.getBlueprint().getTwilightCost());
//assertEquals(, sons.getBlueprint().getStrength());
//assertEquals(, sons.getBlueprint().getVitality());
//assertEquals(, sons.getBlueprint().getResistance());
//assertEquals(Signet., sons.getBlueprint().getSignet());
//assertEquals(, sons.getBlueprint().getSiteNumber()); // Change this to getAllyHomeSiteNumbers for allies
}
//@Test
public void TheSonsofGondorHaveReturnedTest1() throws DecisionResultInvalidException, CardNotFoundException {
@Test
public void SonsPumpsAragornAndBoromir() throws DecisionResultInvalidException, CardNotFoundException {
//Pre-game setup
GenericCardTestHelper scn = GetScenario();
PhysicalCardImpl card = scn.GetFreepsCard("card");
scn.FreepsMoveCardToHand(card);
PhysicalCardImpl sons = scn.GetFreepsCard("sons");
PhysicalCardImpl aragorn = scn.GetFreepsCard("aragorn");
PhysicalCardImpl boromir = scn.GetFreepsCard("boromir");
scn.FreepsMoveCharToTable(aragorn, boromir);
scn.FreepsMoveCardToSupportArea(sons);
PhysicalCardImpl runner1 = scn.GetShadowCard("runner1");
PhysicalCardImpl runner2 = scn.GetShadowCard("runner2");
PhysicalCardImpl runner3 = scn.GetShadowCard("runner3");
PhysicalCardImpl runner4 = scn.GetShadowCard("runner4");
scn.ShadowMoveCharToTable(runner1, runner2, runner3, runner4);
scn.StartGame();
scn.FreepsPlayCard(card);
assertEquals(2, scn.GetTwilight());
scn.SkipToPhase(Phase.ASSIGNMENT);
assertEquals(8, scn.GetStrength(aragorn));
assertEquals(7, scn.GetStrength(boromir));
scn.PassCurrentPhaseActions();
scn.FreepsPassCurrentPhaseAction();
scn.ShadowAssignToMinions(new PhysicalCardImpl[]{aragorn, runner1, runner2}, new PhysicalCardImpl[]{boromir, runner3, runner4});
assertEquals(11, scn.GetStrength(aragorn));
assertEquals(10, scn.GetStrength(boromir));
}
}

View File

@@ -9,7 +9,9 @@ import com.gempukku.lotro.logic.decisions.DecisionResultInvalidException;
import com.gempukku.lotro.logic.modifiers.MoveLimitModifier;
import org.junit.Test;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import static junit.framework.Assert.assertEquals;
import static junit.framework.Assert.assertFalse;
@@ -22,8 +24,9 @@ public class Card_V1_022_Tests
return new GenericCardTestHelper(
new HashMap<String, String>()
{{
put("card", "151_22");
// put other cards in here as needed for the test case
put("memorial", "151_22");
put("aragorn", "1_89");
put("sam", "1_311");
}},
GenericCardTestHelper.FellowshipSites,
GenericCardTestHelper.FOTRFrodo,
@@ -31,9 +34,7 @@ public class Card_V1_022_Tests
);
}
// Uncomment both @Test markers below once this is ready to be used
//@Test
@Test
public void GilraensMemorialStatsAndKeywordsAreCorrect() throws DecisionResultInvalidException, CardNotFoundException {
/**
@@ -52,34 +53,106 @@ public class Card_V1_022_Tests
//Pre-game setup
GenericCardTestHelper scn = GetScenario();
PhysicalCardImpl card = scn.GetFreepsCard("card");
PhysicalCardImpl memorial = scn.GetFreepsCard("memorial");
assertTrue(card.getBlueprint().isUnique());
assertEquals(Side.FREE_PEOPLE, card.getBlueprint().getSide());
assertEquals(Culture.GONDOR, card.getBlueprint().getCulture());
assertEquals(CardType.ARTIFACT, card.getBlueprint().getCardType());
//assertEquals(Race.CREATURE, card.getBlueprint().getRace());
assertTrue(scn.HasKeyword(card, Keyword.SUPPORT_AREA)); // test for keywords as needed
assertEquals(1, 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
assertTrue(memorial.getBlueprint().isUnique());
assertEquals(Side.FREE_PEOPLE, memorial.getBlueprint().getSide());
assertEquals(Culture.GONDOR, memorial.getBlueprint().getCulture());
assertEquals(CardType.ARTIFACT, memorial.getBlueprint().getCardType());
//assertEquals(Race.CREATURE, memorial.getBlueprint().getRace());
assertTrue(scn.HasKeyword(memorial, Keyword.SUPPORT_AREA)); // test for keywords as needed
assertEquals(1, memorial.getBlueprint().getTwilightCost());
//assertEquals(, memorial.getBlueprint().getStrength());
//assertEquals(, memorial.getBlueprint().getVitality());
//assertEquals(, memorial.getBlueprint().getResistance());
//assertEquals(Signet., memorial.getBlueprint().getSignet());
//assertEquals(, memorial.getBlueprint().getSiteNumber()); // Change this to getAllyHomeSiteNumbers for allies
}
//@Test
public void GilraensMemorialTest1() throws DecisionResultInvalidException, CardNotFoundException {
@Test
public void MemorialExertsAragornToPlay() throws DecisionResultInvalidException, CardNotFoundException {
//Pre-game setup
GenericCardTestHelper scn = GetScenario();
PhysicalCardImpl card = scn.GetFreepsCard("card");
scn.FreepsMoveCardToHand(card);
PhysicalCardImpl aragorn = scn.GetFreepsCard("aragorn");
PhysicalCardImpl memorial = scn.GetFreepsCard("memorial");
scn.FreepsMoveCardToHand(aragorn, memorial);
scn.StartGame();
scn.FreepsPlayCard(card);
assertEquals(1, scn.GetTwilight());
assertFalse(scn.FreepsCardPlayAvailable(memorial));
scn.FreepsPlayCard(aragorn);
assertTrue(scn.FreepsCardPlayAvailable(memorial));
assertEquals(0, scn.GetWoundsOn(aragorn));
scn.FreepsPlayCard(memorial);
assertEquals(1, scn.GetWoundsOn(aragorn));
}
@Test
public void MemorialSelfDiscardsWhenAragornDies() throws DecisionResultInvalidException, CardNotFoundException {
//Pre-game setup
GenericCardTestHelper scn = GetScenario();
PhysicalCardImpl aragorn = scn.GetFreepsCard("aragorn");
PhysicalCardImpl memorial = scn.GetFreepsCard("memorial");
scn.FreepsMoveCharToTable(aragorn);
scn.FreepsMoveCardToSupportArea(memorial);
scn.StartGame();
assertEquals(Zone.SUPPORT, memorial.getZone());
scn.AddWoundsToChar(aragorn, 4);
scn.PassCurrentPhaseActions();
assertEquals(Zone.DEAD, aragorn.getZone());
//There is a tie between evaluating a rule (threat rule?) and Gilraen's automatic trigger. Freeps chooses
// to evaluate the rule first (it shouldn't matter for our purposes).
scn.FreepsChoose("0");
assertEquals(Zone.DISCARD, memorial.getZone());
}
@Test
public void FellowshipActionExertsToRemoveBurdensAndExertsOrSelfDiscards() throws DecisionResultInvalidException, CardNotFoundException {
//Pre-game setup
GenericCardTestHelper scn = GetScenario();
PhysicalCardImpl aragorn = scn.GetFreepsCard("aragorn");
PhysicalCardImpl sam = scn.GetFreepsCard("sam");
PhysicalCardImpl memorial = scn.GetFreepsCard("memorial");
scn.FreepsMoveCharToTable(aragorn, sam);
scn.FreepsMoveCardToSupportArea(memorial);
scn.StartGame();
//There is already 1 burden from bidding, we add enough for 2 actions
scn.AddBurdens(1);
assertTrue(scn.FreepsCardActionAvailable(memorial));
assertEquals(2, scn.GetBurdens());
assertEquals(0, scn.GetWoundsOn(aragorn));
assertEquals(0, scn.GetWoundsOn(sam));
scn.FreepsUseCardAction(memorial);
assertEquals(1, scn.GetBurdens());
assertEquals(1, scn.GetWoundsOn(sam));
assertTrue(scn.FreepsDecisionAvailable("Choose action to perform"));
String[] choices = scn.FreepsGetMultipleChoices().toArray(new String[0]);
assertEquals(2, choices.length);
assertEquals("Exert Aragorn", choices[0]);
assertEquals("Discard Gilraen's Memorial", choices[1]);
scn.FreepsChooseMultipleChoiceOption("Exert");
assertEquals(1, scn.GetWoundsOn(aragorn));
scn.FreepsUseCardAction(memorial);
assertEquals(0, scn.GetBurdens());
assertEquals(2, scn.GetWoundsOn(sam));
scn.FreepsChooseMultipleChoiceOption("Discard");
assertEquals(1, scn.GetWoundsOn(aragorn));
assertEquals(Zone.DISCARD, memorial.getZone());
}
}

View File

@@ -22,8 +22,25 @@ public class Card_V1_023_Tests
return new GenericCardTestHelper(
new HashMap<String, String>()
{{
put("card", "151_23");
// put other cards in here as needed for the test case
put("gone", "151_23");
put("aragorn", "1_365");
put("arwen", "1_30");
put("gimli", "1_12");
put("gandalf", "2_122");
put("sam", "1_311");
put("dwarf-event", "1_3");
put("elf-event", "1_37");
put("gandalf-event", "1_78");
put("gondor-event", "1_116");
put("shire-event", "1_116");
put("runner1", "1_178");
put("runner2", "1_178");
put("runner3", "1_178");
put("runner4", "1_178");
put("runner5", "1_178");
put("runner6", "1_178");
}},
GenericCardTestHelper.FellowshipSites,
GenericCardTestHelper.FOTRFrodo,
@@ -31,9 +48,7 @@ public class Card_V1_023_Tests
);
}
// Uncomment both @Test markers below once this is ready to be used
//@Test
@Test
public void IWouldHaveGoneWithYoutotheEndStatsAndKeywordsAreCorrect() throws DecisionResultInvalidException, CardNotFoundException {
/**
@@ -51,34 +66,143 @@ public class Card_V1_023_Tests
//Pre-game setup
GenericCardTestHelper scn = GetScenario();
PhysicalCardImpl card = scn.GetFreepsCard("card");
PhysicalCardImpl gone = scn.GetFreepsCard("gone");
assertTrue(card.getBlueprint().isUnique());
assertEquals(Side.FREE_PEOPLE, card.getBlueprint().getSide());
assertEquals(Culture.GONDOR, card.getBlueprint().getCulture());
assertEquals(CardType.CONDITION, card.getBlueprint().getCardType());
//assertEquals(Race.CREATURE, card.getBlueprint().getRace());
assertTrue(scn.HasKeyword(card, Keyword.SUPPORT_AREA)); // test for keywords as needed
assertEquals(2, 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
assertTrue(gone.getBlueprint().isUnique());
assertEquals(Side.FREE_PEOPLE, gone.getBlueprint().getSide());
assertEquals(Culture.GONDOR, gone.getBlueprint().getCulture());
assertEquals(CardType.CONDITION, gone.getBlueprint().getCardType());
//assertEquals(Race.CREATURE, gone.getBlueprint().getRace());
assertTrue(scn.HasKeyword(gone, Keyword.SUPPORT_AREA)); // test for keywords as needed
assertEquals(2, gone.getBlueprint().getTwilightCost());
//assertEquals(, gone.getBlueprint().getStrength());
//assertEquals(, gone.getBlueprint().getVitality());
//assertEquals(, gone.getBlueprint().getResistance());
//assertEquals(Signet., gone.getBlueprint().getSignet());
//assertEquals(, gone.getBlueprint().getSiteNumber()); // Change this to getAllyHomeSiteNumbers for allies
}
//@Test
public void IWouldHaveGoneWithYoutotheEndTest1() throws DecisionResultInvalidException, CardNotFoundException {
@Test
public void GornSignetSkirmishEventsAreInterceptedAndUsedToPumpGornSignet() throws DecisionResultInvalidException, CardNotFoundException {
//Pre-game setup
GenericCardTestHelper scn = GetScenario();
PhysicalCardImpl card = scn.GetFreepsCard("card");
scn.FreepsMoveCardToHand(card);
PhysicalCardImpl gone = scn.GetFreepsCard("gone");
PhysicalCardImpl frodo = scn.GetRingBearer();
PhysicalCardImpl aragorn = scn.GetFreepsCard("aragorn");
PhysicalCardImpl gimli = scn.GetFreepsCard("gimli");
PhysicalCardImpl arwen = scn.GetFreepsCard("arwen");
PhysicalCardImpl gandalf = scn.GetFreepsCard("gandalf");
PhysicalCardImpl sam = scn.GetFreepsCard("sam");
PhysicalCardImpl dwarfE = scn.GetFreepsCard("dwarf-event");
PhysicalCardImpl elfE = scn.GetFreepsCard("elf-event");
PhysicalCardImpl gondorE = scn.GetFreepsCard("gondor-event");
PhysicalCardImpl gandalfE = scn.GetFreepsCard("gandalf-event");
PhysicalCardImpl shireE = scn.GetFreepsCard("shire-event");
scn.FreepsMoveCardToSupportArea(gone);
scn.FreepsMoveCharToTable(aragorn, gimli, arwen, gandalf, sam);
scn.FreepsMoveCardToHand(dwarfE, elfE, gondorE, gandalfE, shireE);
PhysicalCardImpl runner1 = scn.GetShadowCard("runner1");
PhysicalCardImpl runner2 = scn.GetShadowCard("runner2");
PhysicalCardImpl runner3 = scn.GetShadowCard("runner3");
PhysicalCardImpl runner4 = scn.GetShadowCard("runner4");
PhysicalCardImpl runner5 = scn.GetShadowCard("runner5");
PhysicalCardImpl runner6 = scn.GetShadowCard("runner6");
scn.ShadowMoveCharToTable(runner1, runner2, runner3, runner4, runner5, runner6);
scn.StartGame();
scn.FreepsPlayCard(card);
assertEquals(2, scn.GetTwilight());
scn.SkipToPhase(Phase.ASSIGNMENT);
scn.PassCurrentPhaseActions();
scn.FreepsAssignToMinions(
new PhysicalCardImpl[]{aragorn, runner1},
new PhysicalCardImpl[]{gimli, runner2},
new PhysicalCardImpl[]{arwen, runner3},
new PhysicalCardImpl[]{gandalf, runner4},
new PhysicalCardImpl[]{frodo, runner5},
new PhysicalCardImpl[]{sam, runner6});
assertEquals(0, scn.GetStackedCards(gone).size());
// Frodo is the only non-aragorn-signet in the fellowship, so let's test the lack of trigger
scn.FreepsResolveSkirmish(frodo);
scn.FreepsPlayCard(shireE);
scn.ShadowPassCurrentPhaseAction();
scn.FreepsPassCurrentPhaseAction();
assertFalse(scn.FreepsDecisionAvailable("I Would Have Gone With You to the End"));
// response from the one ring
scn.FreepsDeclineOptionalTrigger();
assertEquals(0, scn.GetStackedCards(gone).size());
// 1
scn.FreepsResolveSkirmish(aragorn);
assertFalse(scn.FreepsCardActionAvailable(gone)); // no stacks yet
scn.FreepsPlayCard(gondorE);
assertTrue(scn.FreepsHasOptionalTriggerAvailable());
scn.FreepsAcceptOptionalTrigger();
assertEquals(1, scn.GetStackedCards(gone).size());
// The convoluted checking here is because the old event has been deleted and recreated
// after going into the discard pile and getting redirected as a stacked item.
// But not for the other events??? no idea why tbh
assertTrue(scn.GetStackedCards(gone).stream().anyMatch(x -> x.getBlueprintId() == gondorE.getBlueprintId()));
scn.ShadowPassCurrentPhaseAction();
scn.FreepsPassCurrentPhaseAction();
// 2
scn.FreepsResolveSkirmish(gimli);
assertTrue(scn.FreepsCardActionAvailable(gone));
scn.FreepsPlayCard(dwarfE);
assertTrue(scn.FreepsHasOptionalTriggerAvailable());
scn.FreepsAcceptOptionalTrigger();
assertEquals(2, scn.GetStackedCards(gone).size());
assertEquals(Zone.STACKED, dwarfE.getZone());
scn.ShadowPassCurrentPhaseAction();
scn.FreepsPassCurrentPhaseAction();
// 3
scn.FreepsResolveSkirmish(arwen);
assertTrue(scn.FreepsCardActionAvailable(gone));
scn.FreepsPlayCard(elfE);
assertTrue(scn.FreepsHasOptionalTriggerAvailable());
scn.FreepsAcceptOptionalTrigger();
assertEquals(3, scn.GetStackedCards(gone).size());
assertEquals(Zone.STACKED, elfE.getZone());
scn.ShadowPassCurrentPhaseAction();
scn.FreepsPassCurrentPhaseAction();
// 4
scn.FreepsResolveSkirmish(gandalf);
assertTrue(scn.FreepsCardActionAvailable(gone));
scn.FreepsPlayCard(gandalfE);
assertTrue(scn.FreepsHasOptionalTriggerAvailable());
scn.FreepsAcceptOptionalTrigger();
assertEquals(4, scn.GetStackedCards(gone).size());
assertEquals(Zone.STACKED, gandalfE.getZone());
scn.ShadowPassCurrentPhaseAction();
scn.FreepsPassCurrentPhaseAction();
scn.FreepsResolveSkirmish(sam);
assertTrue(scn.FreepsCardActionAvailable(gone));
scn.FreepsUseCardAction(gone);
assertTrue(scn.FreepsDecisionAvailable("Choose stacked cards to discard"));
assertEquals(3, scn.GetStrength(sam));
scn.FreepsChooseCards(gandalfE, elfE, dwarfE);
assertEquals(5, scn.GetFreepsCardChoiceCount());
scn.FreepsChooseCard(sam);
assertEquals(6, scn.GetStrength(sam));
assertEquals(1, scn.GetStackedCards(gone).size());
assertTrue(scn.GetStackedCards(gone).stream().anyMatch(x -> x.getBlueprintId() == gondorE.getBlueprintId()));
assertEquals(Zone.DISCARD, gandalfE.getZone());
assertEquals(Zone.DISCARD, elfE.getZone());
assertEquals(Zone.DISCARD, dwarfE.getZone());
}
}

View File

@@ -22,8 +22,11 @@ public class Card_V1_024_Tests
return new GenericCardTestHelper(
new HashMap<String, String>()
{{
put("card", "151_24");
// put other cards in here as needed for the test case
put("mysword", "151_24");
put("aragorn", "1_365");
put("arwen", "1_30");
put("nazgul", "1_233");
}},
GenericCardTestHelper.FellowshipSites,
GenericCardTestHelper.FOTRFrodo,
@@ -31,9 +34,7 @@ public class Card_V1_024_Tests
);
}
// Uncomment both @Test markers below once this is ready to be used
//@Test
@Test
public void YouHaveMySwordStatsAndKeywordsAreCorrect() throws DecisionResultInvalidException, CardNotFoundException {
/**
@@ -52,34 +53,101 @@ public class Card_V1_024_Tests
//Pre-game setup
GenericCardTestHelper scn = GetScenario();
PhysicalCardImpl card = scn.GetFreepsCard("card");
PhysicalCardImpl mysword = scn.GetFreepsCard("mysword");
assertTrue(card.getBlueprint().isUnique());
assertEquals(Side.FREE_PEOPLE, card.getBlueprint().getSide());
assertEquals(Culture.GONDOR, card.getBlueprint().getCulture());
assertEquals(CardType.CONDITION, card.getBlueprint().getCardType());
//assertEquals(Race.CREATURE, card.getBlueprint().getRace());
assertTrue(scn.HasKeyword(card, Keyword.SUPPORT_AREA)); // test for keywords as needed
assertEquals(1, card.getBlueprint().getTwilightCost());
assertEquals(2, 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
assertTrue(mysword.getBlueprint().isUnique());
assertEquals(Side.FREE_PEOPLE, mysword.getBlueprint().getSide());
assertEquals(Culture.GONDOR, mysword.getBlueprint().getCulture());
assertEquals(CardType.CONDITION, mysword.getBlueprint().getCardType());
//assertEquals(Race.CREATURE, mysword.getBlueprint().getRace());
//assertTrue(scn.HasKeyword(mysword, Keyword.SUPPORT_AREA)); // test for keywords as needed
assertEquals(1, mysword.getBlueprint().getTwilightCost());
assertEquals(2, mysword.getBlueprint().getStrength());
//assertEquals(, mysword.getBlueprint().getVitality());
//assertEquals(, mysword.getBlueprint().getResistance());
//assertEquals(Signet., mysword.getBlueprint().getSignet());
//assertEquals(, mysword.getBlueprint().getSiteNumber()); // Change this to getAllyHomeSiteNumbers for allies
}
//@Test
public void YouHaveMySwordTest1() throws DecisionResultInvalidException, CardNotFoundException {
@Test
public void SpotsAragornToPlayOnGornSignetBesidesAragorn() throws DecisionResultInvalidException, CardNotFoundException {
//Pre-game setup
GenericCardTestHelper scn = GetScenario();
PhysicalCardImpl card = scn.GetFreepsCard("card");
scn.FreepsMoveCardToHand(card);
PhysicalCardImpl mysword = scn.GetFreepsCard("mysword");
PhysicalCardImpl aragorn = scn.GetFreepsCard("aragorn");
PhysicalCardImpl arwen = scn.GetFreepsCard("arwen");
scn.FreepsMoveCardToHand(mysword, aragorn, arwen);
scn.StartGame();
scn.FreepsPlayCard(card);
assertFalse(scn.FreepsCardPlayAvailable(mysword));
scn.FreepsPlayCard(aragorn);
assertFalse(scn.FreepsCardPlayAvailable(mysword));
scn.FreepsPlayCard(arwen);
assertTrue(scn.FreepsCardPlayAvailable(mysword));
scn.FreepsPlayCard(mysword);
assertEquals(1, scn.GetTwilight());
assertEquals(Zone.ATTACHED, mysword.getZone());
assertEquals(arwen, mysword.getAttachedTo());
}
@Test
public void BearerWinningSkirmishExertsAragornOrSelfDiscards() throws DecisionResultInvalidException, CardNotFoundException {
//Pre-game setup
GenericCardTestHelper scn = GetScenario();
PhysicalCardImpl mysword = scn.GetFreepsCard("mysword");
PhysicalCardImpl aragorn = scn.GetFreepsCard("aragorn");
PhysicalCardImpl arwen = scn.GetFreepsCard("arwen");
scn.FreepsMoveCharToTable(aragorn, arwen);
scn.FreepsAttachCardsTo(arwen, mysword);
PhysicalCardImpl nazgul = scn.GetShadowCard("nazgul");
scn.ShadowMoveCharToTable(nazgul);
scn.StartGame();
scn.SkipToPhase(Phase.ASSIGNMENT);
scn.PassCurrentPhaseActions();
scn.FreepsAssignToMinions(arwen, nazgul);
scn.FreepsResolveSkirmish(arwen);
// 6 base + 3 against nazgul + 2 from You Have My Sword
assertEquals(11, scn.GetStrength(arwen));
scn.PassCurrentPhaseActions();
//Freeps tiebreaker between resolving the skirmish or processing the required trigger for You Have My Sword.
scn.FreepsChoose("0");
assertTrue(scn.FreepsDecisionAvailable("Choose action to perform"));
String[] choices = scn.FreepsGetMultipleChoices().toArray(new String[0]);
assertEquals(2, choices.length);
assertEquals("Exert Aragorn", choices[0]);
assertEquals("Discard You Have My Sword", choices[1]);
scn.FreepsChooseMultipleChoiceOption("Exert");
assertEquals(1, scn.GetWoundsOn(aragorn));
//fierce skirmish
assertEquals(Phase.ASSIGNMENT, scn.GetCurrentPhase());
scn.PassCurrentPhaseActions();
scn.FreepsAssignToMinions(arwen, nazgul);
scn.FreepsResolveSkirmish(arwen);
// 6 base + 3 against nazgul + 2 from You Have My Sword
assertEquals(11, scn.GetStrength(arwen));
scn.PassCurrentPhaseActions();
//Freeps tiebreaker between resolving the skirmish or processing the required trigger for You Have My Sword.
scn.FreepsChoose("0");
assertTrue(scn.FreepsDecisionAvailable("Choose action to perform"));
choices = scn.FreepsGetMultipleChoices().toArray(new String[0]);
assertEquals(2, choices.length);
assertEquals("Exert Aragorn", choices[0]);
assertEquals("Discard You Have My Sword", choices[1]);
scn.FreepsChooseMultipleChoiceOption("Discard");
assertEquals(1, scn.GetWoundsOn(aragorn));
assertEquals(Zone.DISCARD, mysword.getZone());
}
}