Fixed Grond errata self-discarding if targeting a card attached to a card in the support area. Improved tests and minor improvements to Moria V1 cards.
This commit is contained in:
@@ -239,7 +239,7 @@
|
||||
"condition": {
|
||||
"type": "memorymatches",
|
||||
"memory": "chosenCard",
|
||||
"filter": "not(zone(SUPPORT))"
|
||||
"filter": "or(not(zone(SUPPORT),attachedTo(not(zone(SUPPORT)))))"
|
||||
},
|
||||
"effect": {
|
||||
"type": "discard",
|
||||
|
||||
@@ -138,9 +138,16 @@
|
||||
],
|
||||
"effects": [
|
||||
{
|
||||
"type": "stackCardsFromHand",
|
||||
"filter": "choose(tentacle)",
|
||||
"where": "self"
|
||||
"type": "conditional",
|
||||
"condition": {
|
||||
"type": "hasInHand",
|
||||
"filter": "tentacle"
|
||||
},
|
||||
"effect": {
|
||||
"type": "stackCardsFromHand",
|
||||
"filter": "choose(tentacle)",
|
||||
"where": "self"
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "playCardFromStacked",
|
||||
@@ -197,6 +204,18 @@
|
||||
"filter": "choose(culture(moria),item)",
|
||||
"where": "self"
|
||||
},
|
||||
{
|
||||
"type": "conditional",
|
||||
"condition": {
|
||||
"type": "hasInHand",
|
||||
"filter": "culture(moria),item"
|
||||
},
|
||||
"effect": {
|
||||
"type": "stackCardsFromHand",
|
||||
"filter": "choose(culture(moria),item)",
|
||||
"where": "self"
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "conditional",
|
||||
"condition": {
|
||||
@@ -259,7 +278,7 @@
|
||||
"type": "addKeyword",
|
||||
"filter": "choose(currentSite)",
|
||||
"keyword": "marsh",
|
||||
"until": "start(regroup)"
|
||||
"until": "endofturn"
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
package com.gempukku.lotro.cards.build.field.effect.requirement;
|
||||
|
||||
import com.gempukku.lotro.cards.build.*;
|
||||
import com.gempukku.lotro.cards.build.field.FieldUtils;
|
||||
import com.gempukku.lotro.cards.build.field.effect.appender.resolver.PlayerResolver;
|
||||
import com.gempukku.lotro.common.Filterable;
|
||||
import com.gempukku.lotro.logic.timing.PlayConditions;
|
||||
import org.json.simple.JSONObject;
|
||||
|
||||
public class HasInHand implements RequirementProducer {
|
||||
@Override
|
||||
public Requirement getPlayRequirement(JSONObject object, CardGenerationEnvironment environment) throws InvalidCardDefinitionException {
|
||||
FieldUtils.validateAllowedFields(object, "player", "count", "filter");
|
||||
|
||||
final String player = FieldUtils.getString(object.get("player"), "player", "you");
|
||||
final int count = FieldUtils.getInteger(object.get("count"), "count", 1);
|
||||
final String filter = FieldUtils.getString(object.get("filter"), "filter");
|
||||
|
||||
final PlayerSource playerSource = PlayerResolver.resolvePlayer(player, environment);
|
||||
|
||||
final FilterableSource filterableSource = environment.getFilterFactory().generateFilter(filter, environment);
|
||||
return (actionContext) -> {
|
||||
final Filterable filterable = filterableSource.getFilterable(actionContext);
|
||||
return !PlayConditions.hasCardInHand(actionContext.getGame(), playerSource.getPlayer(actionContext), count, filterable);
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -90,14 +90,16 @@ public class Card_V1_034_Tests
|
||||
assertEquals(1, scn.GetStackedCards(darkwaters).size());
|
||||
assertTrue(scn.ShadowActionAvailable("Dark Waters"));
|
||||
scn.ShadowUseCardAction(darkwaters);
|
||||
assertEquals(2, scn.ShadowGetMultipleChoices().size());
|
||||
scn.ShadowChooseMultipleChoiceOption("stack");
|
||||
assertEquals(5, scn.GetTwilight());
|
||||
assertEquals(2, scn.GetStackedCards(darkwaters).size());
|
||||
|
||||
|
||||
//for some reason, pulling cards stacked on a condition flat out doesn't work here in the test rig.
|
||||
assertTrue(scn.ShadowActionAvailable("Dark Waters"));
|
||||
scn.ShadowUseCardAction(darkwaters);
|
||||
scn.ShadowChooseCard(ftentacle1);
|
||||
assertEquals(1, scn.GetStackedCards(darkwaters).size());
|
||||
assertEquals(0, scn.GetTwilight()); // -1 for ability, -2 minion, -2 roaming
|
||||
}
|
||||
|
||||
|
||||
@@ -124,7 +126,7 @@ public class Card_V1_034_Tests
|
||||
scn.ShadowAcceptOptionalTrigger();
|
||||
scn.ShadowChooseCard(ftentacle1);
|
||||
assertEquals(Zone.DISCARD, ftentacle1.getZone());
|
||||
assertEquals(Zone.SUPPORT, darkwaters);
|
||||
assertEquals(Zone.SUPPORT, darkwaters.getZone());
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -92,4 +92,6 @@ public class Card_V1_035_Tests
|
||||
assertEquals(1, scn.GetStackedCards(darkness).size());
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -25,6 +25,14 @@ public class Card_V1_036_Tests
|
||||
{{
|
||||
put("vile", "151_36");
|
||||
put("spear", "1_182");
|
||||
|
||||
put("tent1", "2_58");
|
||||
put("tent2", "2_58");
|
||||
put("tent3", "2_66");
|
||||
put("tent4", "2_66");
|
||||
|
||||
put("watcher", "2_73");
|
||||
|
||||
}},
|
||||
GenericCardTestHelper.FellowshipSites,
|
||||
GenericCardTestHelper.FOTRFrodo,
|
||||
@@ -38,7 +46,7 @@ public class Card_V1_036_Tests
|
||||
/**
|
||||
* Set: V1
|
||||
* Title: Vile Tentacle
|
||||
* Side: Free Peoples
|
||||
* Side: Shadow
|
||||
* Culture: moria
|
||||
* Twilight Cost: 3
|
||||
* Type: minion
|
||||
@@ -57,7 +65,7 @@ public class Card_V1_036_Tests
|
||||
|
||||
assertFalse(vile.getBlueprint().isUnique());
|
||||
assertTrue(scn.HasKeyword(vile, Keyword.TENTACLE)); // test for keywords as needed
|
||||
assertEquals(3, vile.getBlueprint().getTwilightCost());
|
||||
assertEquals(2, vile.getBlueprint().getTwilightCost());
|
||||
assertEquals(7, vile.getBlueprint().getStrength());
|
||||
assertEquals(2, vile.getBlueprint().getVitality());
|
||||
assertEquals(4, vile.getBlueprint().getSiteNumber()); // Change this to getAllyHomeSiteNumbers for allies
|
||||
@@ -129,7 +137,7 @@ public class Card_V1_036_Tests
|
||||
assertTrue(scn.HasKeyword(scn.GetCurrentSite(), Keyword.MARSH));
|
||||
|
||||
scn.SkipToPhase(Phase.REGROUP);
|
||||
assertEquals(3, scn.GetStrength(vile));
|
||||
assertFalse(scn.HasKeyword(scn.GetCurrentSite(), Keyword.MARSH));
|
||||
assertTrue(scn.HasKeyword(scn.GetCurrentSite(), Keyword.MARSH));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user