Fixing issues with HasInHand
This commit is contained in:
@@ -150,10 +150,17 @@
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "playCardFromStacked",
|
||||
"filter": "choose(tentacle)",
|
||||
"on": "self"
|
||||
}
|
||||
"type": "conditional",
|
||||
"condition": {
|
||||
"type": "canSpot",
|
||||
"filter": "self,hasStacked(any)"
|
||||
},
|
||||
"effect": {
|
||||
"type": "playCardFromStacked",
|
||||
"filter": "choose(tentacle)",
|
||||
"on": "self"
|
||||
}
|
||||
},
|
||||
]
|
||||
}
|
||||
},
|
||||
@@ -192,18 +199,26 @@
|
||||
{
|
||||
"type": "activated",
|
||||
"phase": "shadow",
|
||||
"condition": {
|
||||
"type": "or",
|
||||
"condition": [
|
||||
{
|
||||
"type": "hasInHand",
|
||||
"filter": "culture(moria),item"
|
||||
},
|
||||
{
|
||||
"type": "canSpot",
|
||||
"filter": "name(The Balrog)"
|
||||
}
|
||||
]
|
||||
},
|
||||
"effect": {
|
||||
"type": "choice",
|
||||
"texts": [
|
||||
"Stack a [Moria] item here.",
|
||||
"Take a [Moria] item stacked here into hand."
|
||||
"Take a [Moria] card stacked here into hand."
|
||||
],
|
||||
"effects": [
|
||||
{
|
||||
"type": "stackCardsFromHand",
|
||||
"filter": "choose(culture(moria),item)",
|
||||
"where": "self"
|
||||
},
|
||||
{
|
||||
"type": "conditional",
|
||||
"condition": {
|
||||
@@ -218,13 +233,19 @@
|
||||
},
|
||||
{
|
||||
"type": "conditional",
|
||||
"condition": {
|
||||
"type": "canSpot",
|
||||
"filter": "name(The Balrog)"
|
||||
},
|
||||
"condition": [
|
||||
{
|
||||
"type": "canSpot",
|
||||
"filter": "title(The Balrog)"
|
||||
},
|
||||
{
|
||||
"type": "canSpot",
|
||||
"filter": "self,hasStacked(any)"
|
||||
},
|
||||
],
|
||||
"effect": {
|
||||
"type": "putStackedCardsIntoHand",
|
||||
"filter": "choose(culture(moria),item)",
|
||||
"filter": "choose(culture(moria))",
|
||||
"on": "self"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,7 +21,7 @@ public class HasInHand implements RequirementProducer {
|
||||
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);
|
||||
return PlayConditions.hasCardInHand(actionContext.getGame(), playerSource.getPlayer(actionContext), count, filterable);
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -28,6 +28,7 @@ public class RequirementFactory {
|
||||
requirementProducers.put("controlssite", new ControlsSite());
|
||||
requirementProducers.put("didwinskirmish", new DidWinSkirmish());
|
||||
requirementProducers.put("fierceskirmish", new FierceSkirmish());
|
||||
requirementProducers.put("hasinhand", new HasInHand());
|
||||
requirementProducers.put("hasinzonedata", new HasInZoneData());
|
||||
requirementProducers.put("haveinitiative", new HaveInitiative());
|
||||
requirementProducers.put("ismore", new IsMore());
|
||||
|
||||
@@ -3,9 +3,11 @@ package com.gempukku.lotro.cards.unofficial.pc.vset1.vpack1;
|
||||
|
||||
import com.gempukku.lotro.cards.GenericCardTestHelper;
|
||||
import com.gempukku.lotro.common.*;
|
||||
import com.gempukku.lotro.filters.Filters;
|
||||
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.KeywordModifier;
|
||||
import org.junit.Test;
|
||||
|
||||
import java.util.HashMap;
|
||||
@@ -71,24 +73,32 @@ public class Card_V1_035_Tests
|
||||
PhysicalCardImpl spear = scn.GetShadowCard("spear");
|
||||
scn.ShadowMoveCardToHand(darkness, balrog, whip, spear);
|
||||
|
||||
//so the balrog doesn't self-discard
|
||||
scn.ApplyAdHocModifier(new KeywordModifier(null, Filters.siteNumber(2), Keyword.UNDERGROUND));
|
||||
|
||||
scn.StartGame();
|
||||
scn.SetTwilight(17);
|
||||
scn.FreepsPassCurrentPhaseAction();
|
||||
|
||||
scn.ShadowPlayCard(darkness);
|
||||
assertTrue(scn.ShadowActionAvailable("Darkness Grew"));
|
||||
assertTrue(scn.ShadowCardActionAvailable(darkness));
|
||||
assertEquals(0, scn.GetStackedCards(darkness).size());
|
||||
scn.ShadowUseCardAction(darkness);
|
||||
scn.ShadowChooseCard(whip);
|
||||
assertEquals(1, scn.GetStackedCards(darkness).size());
|
||||
assertEquals(Zone.STACKED, whip.getZone());
|
||||
scn.ShadowUseCardAction(darkness);
|
||||
assertEquals(2, scn.GetStackedCards(darkness).size());
|
||||
assertFalse(scn.ShadowActionAvailable("Darkness Grew"));
|
||||
assertEquals(Zone.STACKED, spear.getZone());
|
||||
|
||||
assertFalse(scn.ShadowCardActionAvailable(darkness));
|
||||
|
||||
//for some reason, pulling cards stacked on a condition flat out doesn't work here in the test rig.
|
||||
scn.ShadowPlayCard(balrog);
|
||||
assertTrue(scn.ShadowActionAvailable("Darkness Grew"));
|
||||
assertTrue(scn.ShadowCardActionAvailable(darkness));
|
||||
scn.ShadowUseCardAction(darkness);
|
||||
assertTrue(scn.ShadowDecisionAvailable("Choose cards to take into hand"));
|
||||
assertEquals(2, scn.GetShadowCardChoiceCount());
|
||||
scn.ShadowChooseCard(whip);
|
||||
assertEquals(1, scn.GetStackedCards(darkness).size());
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user