Fixed Harrowdale not removing fierce properly.

This commit is contained in:
Christian 'ketura' McCarty
2025-01-01 22:20:58 -06:00
parent 3ba4c37867
commit ee7a27df37
3 changed files with 213 additions and 125 deletions

View File

@@ -644,32 +644,38 @@
{
type: Trigger
optional: false
trigger: {
type: constantlyCheck
}
requires: {
type: not
requires: {
type: phase
phase: regroup
trigger: [
{
type: MovesTo
filter: self
}
{
type: StartOfPhase
phase: Fellowship
}
]
requires: {
type: Location
filter: self
}
effect: {
type: addTrigger
trigger: {
type: constantlyCheck
type: StartOfSkirmishInvolving
filter: culture(rohan),companion
}
requires: {
type: canSpot
filter: minion,fierce,inSkirmishAgainst(culture(rohan),companion)
filter: minion,inSkirmishAgainst(culture(rohan),companion)
}
effect: {
type: addModifier
modifier: {
type: removeKeyword
filter: minion,fierce,inSkirmishAgainst(culture(rohan),companion)
keyword: fierce
type: RemoveKeyword
count: {
type: ForEachYouCanSpot
filter: minion,inSkirmishAgainst(culture(rohan),companion)
}
select: all(minion,inSkirmishAgainst(culture(rohan),companion))
keyword: fierce
until: regroup
}
until: regroup

View File

@@ -1,103 +0,0 @@
package com.gempukku.lotro.at;
import com.gempukku.lotro.common.Phase;
import com.gempukku.lotro.common.Zone;
import com.gempukku.lotro.game.CardNotFoundException;
import com.gempukku.lotro.game.PhysicalCardImpl;
import com.gempukku.lotro.game.state.actions.DefaultActionsEnvironment;
import com.gempukku.lotro.logic.decisions.DecisionResultInvalidException;
import org.junit.Test;
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNull;
public class HarrowdaleAtTest extends AbstractAtTest {
@Test
public void movesFromHarrowdale() throws DecisionResultInvalidException, CardNotFoundException {
Map<String, Collection<String>> extraCards = new HashMap<>();
initializeSimplestGame(extraCards);
PhysicalCardImpl harrowdale = new PhysicalCardImpl(100, "11_243", P1, _cardLibrary.getLotroCardBlueprint("11_243"));
harrowdale.setSiteNumber(1);
_game.getGameState().removeCardsFromZone(P1, Collections.singleton(_game.getGameState().getSite(1)));
_game.getGameState().addCardToZone(_game, harrowdale, Zone.ADVENTURE_PATH);
skipMulligans();
// Fellowship phase
assertEquals(Phase.FELLOWSHIP, _game.getGameState().getCurrentPhase());
assertEquals(1, ((DefaultActionsEnvironment) _game.getActionsEnvironment()).getUntilStartOfPhaseActionProxies(Phase.REGROUP).size());
playerDecided(P1, "");
// Move first time (from Harrowdale)
// Shadow phase
assertEquals(1, ((DefaultActionsEnvironment) _game.getActionsEnvironment()).getUntilStartOfPhaseActionProxies(Phase.REGROUP).size());
playerDecided(P2, "");
// End regroup phase
assertEquals(Phase.REGROUP, _game.getGameState().getCurrentPhase());
playerDecided(P1, "");
playerDecided(P2, "");
// Move again
playerDecided(P1, "0");
// Shadow phase
assertEquals(Phase.SHADOW, _game.getGameState().getCurrentPhase());
assertEquals(0, ((DefaultActionsEnvironment) _game.getActionsEnvironment()).getUntilStartOfPhaseActionProxies(Phase.REGROUP).size());
playerDecided(P2, "");
// End regroup phase
assertEquals(Phase.REGROUP, _game.getGameState().getCurrentPhase());
playerDecided(P1, "");
playerDecided(P2, "");
}
@Test
public void movesThroughHarrowdale() throws DecisionResultInvalidException, CardNotFoundException {
Map<String, Collection<String>> extraCards = new HashMap<>();
initializeSimplestGame(extraCards);
PhysicalCardImpl harrowdale = new PhysicalCardImpl(100, "11_243", P1, _cardLibrary.getLotroCardBlueprint("11_243"));
harrowdale.setSiteNumber(2);
_game.getGameState().addCardToZone(_game, harrowdale, Zone.ADVENTURE_PATH);
skipMulligans();
// Fellowship phase
assertEquals(Phase.FELLOWSHIP, _game.getGameState().getCurrentPhase());
assertNull(((DefaultActionsEnvironment) _game.getActionsEnvironment()).getUntilStartOfPhaseActionProxies(Phase.REGROUP));
playerDecided(P1, "");
// Move first time (to Harrowdale)
// Shadow phase
assertEquals(1, ((DefaultActionsEnvironment) _game.getActionsEnvironment()).getUntilStartOfPhaseActionProxies(Phase.REGROUP).size());
playerDecided(P2, "");
// End regroup phase
assertEquals(Phase.REGROUP, _game.getGameState().getCurrentPhase());
playerDecided(P1, "");
playerDecided(P2, "");
// Move again (from Harrowdale in regroup)
playerDecided(P1, "0");
// Shadow phase
assertEquals(Phase.SHADOW, _game.getGameState().getCurrentPhase());
assertEquals(0, ((DefaultActionsEnvironment) _game.getActionsEnvironment()).getUntilStartOfPhaseActionProxies(Phase.REGROUP).size());
playerDecided(P2, "");
// End regroup phase
assertEquals(Phase.REGROUP, _game.getGameState().getCurrentPhase());
assertEquals(0, ((DefaultActionsEnvironment) _game.getActionsEnvironment()).getUntilStartOfPhaseActionProxies(Phase.REGROUP).size());
playerDecided(P1, "");
playerDecided(P2, "");
}
}

View File

@@ -1,8 +1,12 @@
package com.gempukku.lotro.cards.official.set11;
import com.gempukku.lotro.cards.GenericCardTestHelper;
import com.gempukku.lotro.common.*;
import com.gempukku.lotro.common.CardType;
import com.gempukku.lotro.common.Keyword;
import com.gempukku.lotro.common.Phase;
import com.gempukku.lotro.game.CardNotFoundException;
import com.gempukku.lotro.game.PhysicalCardImpl;
import com.gempukku.lotro.game.state.actions.DefaultActionsEnvironment;
import com.gempukku.lotro.logic.decisions.DecisionResultInvalidException;
import org.junit.Test;
@@ -17,12 +21,26 @@ public class Card_11_243_Tests
return new GenericCardTestHelper(
new HashMap<>()
{{
put("card", "11_243");
// put other cards in here as needed for the test case
put("eomer", "4_267");
put("aragorn", "1_89");
put("pursuer", "4_190"); // 5/3
put("seeker", "4_195"); // 6/2
}},
new HashMap<>() {{
put("site1", "11_239");
put("harrowdale", "11_243");
put("site3", "11_234");
put("site4", "17_148");
put("site5", "18_138");
put("site6", "11_230");
put("site7", "12_187");
put("site8", "12_185");
put("site9", "17_146");
}},
GenericCardTestHelper.FellowshipSites,
GenericCardTestHelper.FOTRFrodo,
GenericCardTestHelper.RulingRing
GenericCardTestHelper.RulingRing,
GenericCardTestHelper.Shadows
);
}
@@ -45,8 +63,7 @@ public class Card_11_243_Tests
var scn = GetScenario();
//Use this once you have set the deck up properly
//var card = scn.GetFreepsSite();
var card = scn.GetFreepsCard("card");
var card = scn.GetFreepsSite("Harrowdale");
assertEquals("Harrowdale", card.getBlueprint().getTitle());
assertNull(card.getBlueprint().getSubtitle());
@@ -70,4 +87,172 @@ public class Card_11_243_Tests
assertEquals(3, scn.GetTwilight());
}
@Test
public void MovingFromHarrowdaleRemovesFierceAgainstSkirmishingRohirrim() throws DecisionResultInvalidException, CardNotFoundException {
//Pre-game setup
var scn = GetScenario();
var harrowdale = scn.GetFreepsSite("Harrowdale");
var shadowSite2 = scn.GetShadowSite("Crags of Emyn Muil");
var shadowSite3 = scn.GetShadowSite("Buckland Homestead");
var eomer = scn.GetFreepsCard("eomer");
var aragorn = scn.GetFreepsCard("aragorn");
scn.FreepsMoveCharToTable(eomer, aragorn);
var pursuer = scn.GetShadowCard("pursuer"); // 5/3
var seeker = scn.GetShadowCard("seeker"); // 6/2
scn.ShadowMoveCharToTable(pursuer, seeker);
scn.StartGame(harrowdale);
// Move during fellowship
scn.FreepsPassCurrentPhaseAction();
scn.ShadowChooseCardBPFromSelection(shadowSite2);
assertEquals(1, ((DefaultActionsEnvironment) scn._game.getActionsEnvironment()).getUntilStartOfPhaseActionProxies(Phase.REGROUP).size());
assertTrue(scn.hasKeyword(pursuer, Keyword.FIERCE));
assertTrue(scn.hasKeyword(seeker, Keyword.FIERCE));
scn.SkipToAssignments();
scn.FreepsAssignToMinions(
new PhysicalCardImpl[] { eomer, seeker},
new PhysicalCardImpl[] { aragorn, pursuer }
);
assertTrue(scn.hasKeyword(pursuer, Keyword.FIERCE));
assertTrue(scn.hasKeyword(seeker, Keyword.FIERCE));
scn.FreepsResolveSkirmish(eomer);
assertFalse(scn.hasKeyword(seeker, Keyword.FIERCE));
scn.PassCurrentPhaseActions();
scn.FreepsResolveSkirmish(aragorn);
assertTrue(scn.hasKeyword(pursuer, Keyword.FIERCE));
scn.PassCurrentPhaseActions();
assertEquals(Phase.ASSIGNMENT, scn.GetCurrentPhase());
scn.PassCurrentPhaseActions();
assertFalse(scn.hasKeyword(seeker, Keyword.FIERCE));
assertTrue(scn.hasKeyword(pursuer, Keyword.FIERCE));
scn.FreepsAssignToMinions(aragorn, pursuer);
scn.FreepsResolveSkirmish(aragorn);
assertTrue(scn.hasKeyword(pursuer, Keyword.FIERCE));
scn.PassCurrentPhaseActions();
//Fierce suppression should have worn off
assertEquals(Phase.REGROUP, scn.GetCurrentPhase());
assertTrue(scn.hasKeyword(seeker, Keyword.FIERCE));
assertTrue(scn.hasKeyword(pursuer, Keyword.FIERCE));
scn.PassCurrentPhaseActions();
scn.ShadowDeclineReconciliation();
scn.FreepsChooseToMove();
scn.ShadowChooseCardBPFromSelection(shadowSite3);
assertEquals(0, ((DefaultActionsEnvironment) scn._game.getActionsEnvironment()).getUntilStartOfPhaseActionProxies(Phase.REGROUP).size());
scn.SkipToAssignments();
scn.FreepsAssignToMinions(
new PhysicalCardImpl[] { eomer, pursuer},
new PhysicalCardImpl[] { aragorn, seeker}
);
assertTrue(scn.hasKeyword(pursuer, Keyword.FIERCE));
assertTrue(scn.hasKeyword(seeker, Keyword.FIERCE));
scn.FreepsResolveSkirmish(eomer);
assertTrue(scn.hasKeyword(pursuer, Keyword.FIERCE));
scn.PassCurrentPhaseActions();
scn.FreepsResolveSkirmish(aragorn);
assertTrue(scn.hasKeyword(seeker, Keyword.FIERCE));
scn.PassCurrentPhaseActions();
}
@Test
public void MovingToHarrowdaleRemovesFierceAgainstSkirmishingRohirrim() throws DecisionResultInvalidException, CardNotFoundException {
//Pre-game setup
var scn = GetScenario();
var harrowdale = scn.GetShadowSite("Harrowdale");
var freepsSite1 = scn.GetShadowSite("Crags of Emyn Muil");
var shadowSite3 = scn.GetShadowSite("Buckland Homestead");
var eomer = scn.GetFreepsCard("eomer");
var aragorn = scn.GetFreepsCard("aragorn");
scn.FreepsMoveCharToTable(eomer, aragorn);
var pursuer = scn.GetShadowCard("pursuer"); // 5/3
var seeker = scn.GetShadowCard("seeker"); // 6/2
scn.ShadowMoveCharToTable(pursuer, seeker);
scn.StartGame(freepsSite1);
// Move during fellowship
scn.FreepsPassCurrentPhaseAction();
scn.ShadowChooseCardBPFromSelection(harrowdale);
assertEquals(1, ((DefaultActionsEnvironment) scn._game.getActionsEnvironment()).getUntilStartOfPhaseActionProxies(Phase.REGROUP).size());
assertTrue(scn.hasKeyword(pursuer, Keyword.FIERCE));
assertTrue(scn.hasKeyword(seeker, Keyword.FIERCE));
scn.SkipToAssignments();
scn.FreepsAssignToMinions(
new PhysicalCardImpl[] { eomer, seeker},
new PhysicalCardImpl[] { aragorn, pursuer }
);
assertTrue(scn.hasKeyword(pursuer, Keyword.FIERCE));
assertTrue(scn.hasKeyword(seeker, Keyword.FIERCE));
scn.FreepsResolveSkirmish(eomer);
assertFalse(scn.hasKeyword(seeker, Keyword.FIERCE));
scn.PassCurrentPhaseActions();
scn.FreepsResolveSkirmish(aragorn);
assertTrue(scn.hasKeyword(pursuer, Keyword.FIERCE));
scn.PassCurrentPhaseActions();
assertEquals(Phase.ASSIGNMENT, scn.GetCurrentPhase());
scn.PassCurrentPhaseActions();
assertFalse(scn.hasKeyword(seeker, Keyword.FIERCE));
assertTrue(scn.hasKeyword(pursuer, Keyword.FIERCE));
scn.FreepsAssignToMinions(aragorn, pursuer);
scn.FreepsResolveSkirmish(aragorn);
assertTrue(scn.hasKeyword(pursuer, Keyword.FIERCE));
scn.PassCurrentPhaseActions();
//Fierce suppression should have worn off
assertEquals(Phase.REGROUP, scn.GetCurrentPhase());
assertTrue(scn.hasKeyword(seeker, Keyword.FIERCE));
assertTrue(scn.hasKeyword(pursuer, Keyword.FIERCE));
scn.PassCurrentPhaseActions();
scn.ShadowDeclineReconciliation();
scn.FreepsChooseToMove();
scn.ShadowChooseCardBPFromSelection(shadowSite3);
assertEquals(0, ((DefaultActionsEnvironment) scn._game.getActionsEnvironment()).getUntilStartOfPhaseActionProxies(Phase.REGROUP).size());
scn.SkipToAssignments();
scn.FreepsAssignToMinions(
new PhysicalCardImpl[] { eomer, pursuer},
new PhysicalCardImpl[] { aragorn, seeker}
);
assertTrue(scn.hasKeyword(pursuer, Keyword.FIERCE));
assertTrue(scn.hasKeyword(seeker, Keyword.FIERCE));
scn.FreepsResolveSkirmish(eomer);
assertTrue(scn.hasKeyword(pursuer, Keyword.FIERCE));
scn.PassCurrentPhaseActions();
scn.FreepsResolveSkirmish(aragorn);
assertTrue(scn.hasKeyword(seeker, Keyword.FIERCE));
scn.PassCurrentPhaseActions();
}
}