Couple of Moria cards
This commit is contained in:
@@ -1,4 +1,89 @@
|
||||
{
|
||||
"40_153": {
|
||||
"title": "*Ancient Chieftain",
|
||||
"subtitle": "Elder Goblin",
|
||||
"culture": "moria",
|
||||
"type": "minion",
|
||||
"race": "goblin",
|
||||
"strength": 9,
|
||||
"vitality": 3,
|
||||
"site": 4,
|
||||
"effects": {
|
||||
"type": "modifier",
|
||||
"modifier": {
|
||||
"type": "modifyStrength",
|
||||
"filter": "self",
|
||||
"amount": {
|
||||
"type": "countStacked",
|
||||
"on": "culture(moria),condition",
|
||||
"filter": "goblin"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"40_154": {
|
||||
"title": "*Awoken in the Darkness",
|
||||
"culture": "moria",
|
||||
"cost": 3,
|
||||
"type": "condition",
|
||||
"keyword": "support area",
|
||||
"effects": [
|
||||
{
|
||||
"type": "trigger",
|
||||
"trigger": {
|
||||
"type": "played",
|
||||
"filter": "self"
|
||||
},
|
||||
"effect": {
|
||||
"type": "stackTopCardsOfDrawDeck",
|
||||
"count": 6,
|
||||
"where": "self"
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "activated",
|
||||
"phase": "shadow",
|
||||
"cost": {
|
||||
"type": "removeTwilight",
|
||||
"amount": 2
|
||||
},
|
||||
"effect": {
|
||||
"type": "playCardFromStacked",
|
||||
"filter": "choose(goblin)",
|
||||
"on": "self",
|
||||
"removedTwilight": 2
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"40_155": {
|
||||
"title": "*Balin's Fate",
|
||||
"culture": "moria",
|
||||
"cost": 2,
|
||||
"type": "condition",
|
||||
"keyword": "support area",
|
||||
"effects": [
|
||||
{
|
||||
"type": "extraCost",
|
||||
"cost": {
|
||||
"type": "exert",
|
||||
"filter": "choose(culture(moria),goblin)"
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "trigger",
|
||||
"trigger": {
|
||||
"type": "played",
|
||||
"filter": "culture(dwarven),skirmish,event"
|
||||
},
|
||||
"effect": {
|
||||
"type": "exert",
|
||||
"player": "fp",
|
||||
"filter": "choose(dwarf)"
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"40_156": {
|
||||
"title": "*The Balrog",
|
||||
"subtitle": "Demon of Might",
|
||||
|
||||
@@ -1,41 +0,0 @@
|
||||
package com.gempukku.lotro.cards.set40.moria;
|
||||
|
||||
import com.gempukku.lotro.common.CardType;
|
||||
import com.gempukku.lotro.common.Culture;
|
||||
import com.gempukku.lotro.common.Race;
|
||||
import com.gempukku.lotro.filters.Filters;
|
||||
import com.gempukku.lotro.game.PhysicalCard;
|
||||
import com.gempukku.lotro.game.state.LotroGame;
|
||||
import com.gempukku.lotro.logic.cardtype.AbstractMinion;
|
||||
import com.gempukku.lotro.logic.modifiers.Modifier;
|
||||
import com.gempukku.lotro.logic.modifiers.StrengthModifier;
|
||||
import com.gempukku.lotro.logic.modifiers.evaluator.CountStackedEvaluator;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Title: *Ancient Chieftain, Elder Goblin
|
||||
* Set: Second Edition
|
||||
* Side: Shadow
|
||||
* Culture: Moria
|
||||
* Twilight Cost: 4
|
||||
* Type: Minion - Goblin
|
||||
* Strength: 9
|
||||
* Vitality: 3
|
||||
* Home: 4
|
||||
* Card Number: 1R153
|
||||
* Game Text: This minion is strength +1 for each Goblin stacked on a [MORIA] condition.
|
||||
*/
|
||||
public class Card40_153 extends AbstractMinion {
|
||||
public Card40_153() {
|
||||
super(4, 9, 3, 4, Race.GOBLIN, Culture.MORIA, "Ancient Chieftain", "Elder Goblin", true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<? extends Modifier> getInPlayModifiers(LotroGame game, PhysicalCard self) {
|
||||
StrengthModifier strengthModifier = new StrengthModifier(self, self,null,
|
||||
new CountStackedEvaluator(Filters.and(Culture.MORIA, CardType.CONDITION), Race.GOBLIN));
|
||||
return Collections.singletonList(strengthModifier);
|
||||
}
|
||||
}
|
||||
@@ -1,59 +0,0 @@
|
||||
package com.gempukku.lotro.cards.set40.moria;
|
||||
|
||||
import com.gempukku.lotro.common.*;
|
||||
import com.gempukku.lotro.game.PhysicalCard;
|
||||
import com.gempukku.lotro.game.state.LotroGame;
|
||||
import com.gempukku.lotro.logic.actions.ActivateCardAction;
|
||||
import com.gempukku.lotro.logic.actions.RequiredTriggerAction;
|
||||
import com.gempukku.lotro.logic.cardtype.AbstractPermanent;
|
||||
import com.gempukku.lotro.logic.effects.RemoveTwilightEffect;
|
||||
import com.gempukku.lotro.logic.effects.StackTopCardsFromDeckEffect;
|
||||
import com.gempukku.lotro.logic.effects.choose.ChooseAndPlayCardFromStackedEffect;
|
||||
import com.gempukku.lotro.logic.timing.EffectResult;
|
||||
import com.gempukku.lotro.logic.timing.PlayConditions;
|
||||
import com.gempukku.lotro.logic.timing.TriggerConditions;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Title: *Awoken in the Darkness
|
||||
* Set: Second Edition
|
||||
* Side: Shadow
|
||||
* Culture: Moria
|
||||
* Twilight Cost: 3
|
||||
* Type: Condition - Support Area
|
||||
* Card Number: 1C154
|
||||
* Game Text: When you play this condition, reveal the top 6 cards of your draw deck and stack them here.
|
||||
* Shadow: Remove (2) to play a Goblin stacked here.
|
||||
*/
|
||||
public class Card40_154 extends AbstractPermanent {
|
||||
public Card40_154() {
|
||||
super(Side.SHADOW, 3, CardType.CONDITION, Culture.MORIA, "Awoken in the Darkness", null,true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<RequiredTriggerAction> getRequiredAfterTriggers(LotroGame game, EffectResult effectResult, PhysicalCard self) {
|
||||
if (TriggerConditions.played(game, effectResult, self)) {
|
||||
RequiredTriggerAction action = new RequiredTriggerAction(self);
|
||||
action.appendEffect(
|
||||
new StackTopCardsFromDeckEffect(self, self.getOwner(), 6, self));
|
||||
return Collections.singletonList(action);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<? extends ActivateCardAction> getPhaseActionsInPlay(String playerId, LotroGame game, PhysicalCard self) {
|
||||
if (PlayConditions.canUseShadowCardDuringPhase(game, Phase.SHADOW, self, 2)
|
||||
&& PlayConditions.canPlayFromStacked(playerId, game, 2, self, Race.GOBLIN)) {
|
||||
ActivateCardAction action = new ActivateCardAction(self);
|
||||
action.appendCost(
|
||||
new RemoveTwilightEffect(2));
|
||||
action.appendEffect(
|
||||
new ChooseAndPlayCardFromStackedEffect(playerId, self, Race.GOBLIN));
|
||||
return Collections.singletonList(action);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -1,50 +0,0 @@
|
||||
package com.gempukku.lotro.cards.set40.moria;
|
||||
|
||||
import com.gempukku.lotro.common.*;
|
||||
import com.gempukku.lotro.game.PhysicalCard;
|
||||
import com.gempukku.lotro.game.state.LotroGame;
|
||||
import com.gempukku.lotro.logic.GameUtils;
|
||||
import com.gempukku.lotro.logic.actions.RequiredTriggerAction;
|
||||
import com.gempukku.lotro.logic.cardtype.AbstractPermanent;
|
||||
import com.gempukku.lotro.logic.effects.choose.ChooseAndExertCharactersEffect;
|
||||
import com.gempukku.lotro.logic.modifiers.AbstractExtraPlayCostModifier;
|
||||
import com.gempukku.lotro.logic.modifiers.cost.ExertExtraPlayCostModifier;
|
||||
import com.gempukku.lotro.logic.timing.EffectResult;
|
||||
import com.gempukku.lotro.logic.timing.TriggerConditions;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Title: *Balin's Fate
|
||||
* Set: Second Edition
|
||||
* Side: Shadow
|
||||
* Culture: Moria
|
||||
* Twilight Cost: 2
|
||||
* Type: Condition - Support Area
|
||||
* Card Number: 1C155
|
||||
* Game Text: To play, exert a [MORIA] Goblin.
|
||||
* Each time the Free Peoples player plays a [DWARVEN] skirmish event, he or she must exert a Dwarf.
|
||||
*/
|
||||
public class Card40_155 extends AbstractPermanent {
|
||||
public Card40_155() {
|
||||
super(Side.SHADOW, 2, CardType.CONDITION, Culture.MORIA, "Balin's Fate", null, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<? extends AbstractExtraPlayCostModifier> getExtraCostToPlay(LotroGame game, PhysicalCard self) {
|
||||
return Collections.singletonList(
|
||||
new ExertExtraPlayCostModifier(self, self, null, Culture.MORIA, Race.GOBLIN));
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<RequiredTriggerAction> getRequiredAfterTriggers(LotroGame game, EffectResult effectResult, PhysicalCard self) {
|
||||
if (TriggerConditions.played(game, effectResult, Side.FREE_PEOPLE, Culture.DWARVEN, CardType.EVENT, Keyword.SKIRMISH)) {
|
||||
RequiredTriggerAction action = new RequiredTriggerAction(self);
|
||||
action.appendEffect(
|
||||
new ChooseAndExertCharactersEffect(action, GameUtils.getFreePeoplePlayer(game), 1, 1, Race.DWARF));
|
||||
return Collections.singletonList(action);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -24,10 +24,11 @@ import java.util.Collection;
|
||||
public class PlayCardFromStacked implements EffectAppenderProducer {
|
||||
@Override
|
||||
public EffectAppender createEffectAppender(JSONObject effectObject, CardGenerationEnvironment environment) throws InvalidCardDefinitionException {
|
||||
FieldUtils.validateAllowedFields(effectObject, "filter", "on");
|
||||
FieldUtils.validateAllowedFields(effectObject, "filter", "on", "removedTwilight");
|
||||
|
||||
final String filter = FieldUtils.getString(effectObject.get("filter"), "filter");
|
||||
final String onFilter = FieldUtils.getString(effectObject.get("on"), "on");
|
||||
final int removedTwilight = FieldUtils.getInteger(effectObject.get("removedTwilight"), "removedTwilight", 0);
|
||||
|
||||
final FilterableSource onFilterableSource = (onFilter != null) ? environment.getFilterFactory().generateFilter(onFilter, environment) : null;
|
||||
|
||||
@@ -35,7 +36,9 @@ public class PlayCardFromStacked implements EffectAppenderProducer {
|
||||
result.setPlayabilityCheckedForEffect(true);
|
||||
|
||||
result.addEffectAppender(
|
||||
CardResolver.resolveStackedCards(filter, actionContext -> Filters.playable(actionContext.getGame()),
|
||||
CardResolver.resolveStackedCards(filter,
|
||||
actionContext -> Filters.playable(actionContext.getGame()),
|
||||
actionContext -> Filters.playable(actionContext.getGame(), removedTwilight, 0, false, false),
|
||||
new ConstantEvaluator(1), onFilterableSource, "_temp", "you", "Choose card to play", environment));
|
||||
result.addEffectAppender(
|
||||
new DelayedAppender() {
|
||||
|
||||
@@ -32,6 +32,11 @@ public class CardResolver {
|
||||
|
||||
public static EffectAppender resolveStackedCards(String type, FilterableSource additionalFilter, ValueSource countSource, FilterableSource stackedOn,
|
||||
String memory, String choicePlayer, String choiceText, CardGenerationEnvironment environment) throws InvalidCardDefinitionException {
|
||||
return resolveStackedCards(type, additionalFilter, additionalFilter, countSource, stackedOn, memory, choicePlayer, choiceText, environment);
|
||||
}
|
||||
|
||||
public static EffectAppender resolveStackedCards(String type, FilterableSource choiceFilter, FilterableSource playabilityFilter, ValueSource countSource, FilterableSource stackedOn,
|
||||
String memory, String choicePlayer, String choiceText, CardGenerationEnvironment environment) throws InvalidCardDefinitionException {
|
||||
if (type.startsWith("memory(") && type.endsWith(")")) {
|
||||
String sourceMemory = type.substring(type.indexOf("(") + 1, type.lastIndexOf(")"));
|
||||
return new DelayedAppender() {
|
||||
@@ -62,8 +67,8 @@ public class CardResolver {
|
||||
final Filterable stackedOnFilter = stackedOn.getFilterable(actionContext);
|
||||
|
||||
Filterable additionalFilterable = Filters.any;
|
||||
if (additionalFilter != null)
|
||||
additionalFilterable = additionalFilter.getFilterable(actionContext);
|
||||
if (playabilityFilter != null)
|
||||
additionalFilterable = playabilityFilter.getFilterable(actionContext);
|
||||
|
||||
List<PhysicalCard> choice = new LinkedList<>();
|
||||
|
||||
@@ -85,8 +90,8 @@ public class CardResolver {
|
||||
int max = countSource.getMaximum(actionContext);
|
||||
|
||||
Filterable additionalFilterable = Filters.any;
|
||||
if (additionalFilter != null)
|
||||
additionalFilterable = additionalFilter.getFilterable(actionContext);
|
||||
if (choiceFilter != null)
|
||||
additionalFilterable = choiceFilter.getFilterable(actionContext);
|
||||
|
||||
return new ChooseStackedCardsEffect(action, choicePlayerId, min, max, stackedOnFilter, Filters.and(filterable, additionalFilterable)) {
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user