Fixed Grond self-discarding when he shouldn't
This commit is contained in:
@@ -72,11 +72,13 @@
|
||||
effect: [
|
||||
{
|
||||
type: conditional
|
||||
requires: {
|
||||
type: memorymatches
|
||||
memory: chosenCard
|
||||
filter: or(not(zone(SUPPORT),attachedTo(not(zone(SUPPORT)))))
|
||||
}
|
||||
requires: [
|
||||
{
|
||||
type: MemoryMatches
|
||||
memory: chosenCard
|
||||
filter: not(or(zone(SUPPORT),and(zone(ATTACHED),attachedTo(zone(SUPPORT)))))
|
||||
}
|
||||
]
|
||||
effect: {
|
||||
type: discard
|
||||
filter: self
|
||||
|
||||
@@ -5,13 +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;
|
||||
|
||||
public class Card_08_103_ErrataTests
|
||||
@@ -21,8 +19,16 @@ public class Card_08_103_ErrataTests
|
||||
return new GenericCardTestHelper(
|
||||
new HashMap<String, String>()
|
||||
{{
|
||||
put("card", "78_103");
|
||||
// put other cards in here as needed for the test case
|
||||
put("grond", "58_103");
|
||||
put("soldier1", "1_271");
|
||||
put("soldier2", "1_271");
|
||||
put("soldier3", "1_271");
|
||||
|
||||
put("arwen", "3_7");
|
||||
put("elrond", "1_40");
|
||||
put("gwemegil", "1_47");
|
||||
put("bow", "1_41");
|
||||
|
||||
}},
|
||||
GenericCardTestHelper.FellowshipSites,
|
||||
GenericCardTestHelper.FOTRFrodo,
|
||||
@@ -30,9 +36,7 @@ public class Card_08_103_ErrataTests
|
||||
);
|
||||
}
|
||||
|
||||
// Uncomment both @Test markers below once this is ready to be used
|
||||
|
||||
//@Test
|
||||
@Test
|
||||
public void GrondStatsAndKeywordsAreCorrect() throws DecisionResultInvalidException, CardNotFoundException {
|
||||
|
||||
/**
|
||||
@@ -44,40 +48,90 @@ public class Card_08_103_ErrataTests
|
||||
* Type: possession
|
||||
* Subtype: Support Area
|
||||
* Game Text: <b>Engine.</b> <b>Shadow:</b> Play a [sauron] minion to add a [sauron] token here.
|
||||
* Regroup: Discard a [sauron] minion and remove X [sauron] tokens here to discard a Free Peoples card (except a companion) with a twilight cost of X. If that card is not in the support area, discard this possession.
|
||||
* Regroup: Discard a [sauron] minion and remove X [sauron] tokens here to discard a Free Peoples grond (except a companion) with a twilight cost of X. If that grond is not in the support area, discard this possession.
|
||||
*/
|
||||
|
||||
//Pre-game setup
|
||||
GenericCardTestHelper scn = GetScenario();
|
||||
|
||||
PhysicalCardImpl card = scn.GetFreepsCard("card");
|
||||
|
||||
assertTrue(card.getBlueprint().isUnique());
|
||||
assertEquals(Side.SHADOW, card.getBlueprint().getSide());
|
||||
assertEquals(Culture.SAURON, card.getBlueprint().getCulture());
|
||||
assertEquals(CardType.POSSESSION, card.getBlueprint().getCardType());
|
||||
//assertEquals(Race.CREATURE, card.getBlueprint().getRace());
|
||||
assertTrue(scn.HasKeyword(card, Keyword.SUPPORT_AREA));
|
||||
assertEquals(3, 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 grond = scn.GetFreepsCard("grond");
|
||||
|
||||
assertTrue(grond.getBlueprint().isUnique());
|
||||
assertEquals(Side.SHADOW, grond.getBlueprint().getSide());
|
||||
assertEquals(Culture.SAURON, grond.getBlueprint().getCulture());
|
||||
assertEquals(CardType.POSSESSION, grond.getBlueprint().getCardType());
|
||||
assertTrue(scn.HasKeyword(grond, Keyword.SUPPORT_AREA));
|
||||
assertEquals(3, grond.getBlueprint().getTwilightCost());
|
||||
}
|
||||
|
||||
//@Test
|
||||
public void GrondTest1() throws DecisionResultInvalidException, CardNotFoundException {
|
||||
@Test
|
||||
public void GrondAddsTokensWhenAbilityUsed() throws DecisionResultInvalidException, CardNotFoundException {
|
||||
//Pre-game setup
|
||||
GenericCardTestHelper scn = GetScenario();
|
||||
|
||||
PhysicalCardImpl card = scn.GetFreepsCard("card");
|
||||
scn.FreepsMoveCardToHand(card);
|
||||
PhysicalCardImpl grond = scn.GetShadowCard("grond");
|
||||
PhysicalCardImpl soldier1 = scn.GetShadowCard("soldier1");
|
||||
PhysicalCardImpl soldier2 = scn.GetShadowCard("soldier2");
|
||||
PhysicalCardImpl soldier3 = scn.GetShadowCard("soldier3");
|
||||
scn.ShadowMoveCardToSupportArea(grond);
|
||||
scn.ShadowMoveCharToTable(soldier1, soldier2, soldier3);
|
||||
|
||||
PhysicalCardImpl arwen = scn.GetFreepsCard("arwen");
|
||||
PhysicalCardImpl elrond = scn.GetFreepsCard("elrond");
|
||||
PhysicalCardImpl gwemegil = scn.GetFreepsCard("gwemegil");
|
||||
PhysicalCardImpl bow = scn.GetFreepsCard("bow");
|
||||
|
||||
scn.FreepsMoveCardToHand(arwen, elrond, gwemegil, bow);
|
||||
|
||||
scn.StartGame();
|
||||
scn.FreepsPlayCard(card);
|
||||
|
||||
assertEquals(3, scn.GetTwilight());
|
||||
scn.FreepsMoveCharToTable(arwen);
|
||||
scn.FreepsMoveCardToSupportArea(elrond);
|
||||
scn.FreepsAttachCardsTo(arwen, gwemegil);
|
||||
scn.FreepsAttachCardsTo(elrond, bow);
|
||||
|
||||
scn.AddTokensToCard(grond, 10);
|
||||
|
||||
scn.FreepsPassCurrentPhaseAction();
|
||||
scn.SkipToPhase(Phase.ASSIGNMENT);
|
||||
scn.PassCurrentPhaseActions();
|
||||
scn.FreepsDeclineAssignments();
|
||||
scn.ShadowDeclineAssignments();
|
||||
|
||||
//Regroup, round 1
|
||||
scn.FreepsPassCurrentPhaseAction();
|
||||
assertTrue(scn.ShadowActionAvailable(grond));
|
||||
scn.ShadowUseCardAction(grond);
|
||||
assertEquals(Zone.SUPPORT, grond.getZone());
|
||||
assertEquals(Zone.ATTACHED, bow.getZone());
|
||||
scn.ShadowChoose("1");
|
||||
scn.ShadowChooseCard(soldier1);
|
||||
//Only one possible card matches the above cost
|
||||
assertEquals(Zone.SUPPORT, grond.getZone());
|
||||
assertEquals(Zone.DISCARD, bow.getZone());
|
||||
|
||||
//Regroup, round 2
|
||||
scn.FreepsPassCurrentPhaseAction();
|
||||
assertTrue(scn.ShadowActionAvailable(grond));
|
||||
scn.ShadowUseCardAction(grond);
|
||||
assertEquals(Zone.SUPPORT, grond.getZone());
|
||||
assertEquals(Zone.SUPPORT, elrond.getZone());
|
||||
scn.ShadowChoose("4");
|
||||
scn.ShadowChooseCard(soldier2);
|
||||
//Only one possible card matches the above cost
|
||||
assertEquals(Zone.SUPPORT, grond.getZone());
|
||||
assertEquals(Zone.DISCARD, elrond.getZone());
|
||||
|
||||
//Regroup, round 3
|
||||
scn.FreepsPassCurrentPhaseAction();
|
||||
assertTrue(scn.ShadowActionAvailable(grond));
|
||||
scn.ShadowUseCardAction(grond);
|
||||
assertEquals(Zone.SUPPORT, grond.getZone());
|
||||
assertEquals(Zone.ATTACHED, gwemegil.getZone());
|
||||
scn.ShadowChoose("2");
|
||||
//scn.ShadowChooseCard(soldier3);
|
||||
//Only one possible card matches the above cost
|
||||
assertEquals(Zone.DISCARD, grond.getZone());
|
||||
assertEquals(Zone.DISCARD, gwemegil.getZone());
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user