Couple of Moria cards
This commit is contained in:
@@ -139,6 +139,186 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"40_158": {
|
||||
"title": "*Cave Troll's Hammer",
|
||||
"culture": "moria",
|
||||
"cost": 1,
|
||||
"type": "possession",
|
||||
"possession": "hand weapon",
|
||||
"strength": 3,
|
||||
"target": "name(Cave Troll of Moria)",
|
||||
"effects": {
|
||||
"type": "modifier",
|
||||
"modifier": {
|
||||
"type": "addKeyword",
|
||||
"filter": "bearer",
|
||||
"keyword": "damage+1"
|
||||
}
|
||||
}
|
||||
},
|
||||
"40_159": {
|
||||
"title": "Foul Things",
|
||||
"culture": "moria",
|
||||
"cost": 3,
|
||||
"type": "event",
|
||||
"keyword": "shadow",
|
||||
"effects": {
|
||||
"type": "event",
|
||||
"effect": {
|
||||
"type": "playCardFromDiscard",
|
||||
"filter": "choose(culture(moria),minion)"
|
||||
}
|
||||
}
|
||||
},
|
||||
"40_160": {
|
||||
"title": "Goblin Armory",
|
||||
"culture": "moria",
|
||||
"cost": 0,
|
||||
"type": "condition",
|
||||
"keyword": "support area",
|
||||
"effects": [
|
||||
{
|
||||
"type": "trigger",
|
||||
"trigger": {
|
||||
"type": "played",
|
||||
"filter": "your,culture(moria),weapon"
|
||||
},
|
||||
"effect": {
|
||||
"type": "addTwilight",
|
||||
"amount": 1
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "activatedTrigger",
|
||||
"trigger": {
|
||||
"type": "aboutToTakeWound",
|
||||
"filter": "culture(moria),goblin"
|
||||
},
|
||||
"cost": {
|
||||
"type": "discard",
|
||||
"filter": "self"
|
||||
},
|
||||
"effect": {
|
||||
"type": "preventWound",
|
||||
"filter": "choose(culture(moria),goblin)"
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"40_161": {
|
||||
"title": "Goblin Grudgebearer",
|
||||
"culture": "moria",
|
||||
"cost": 3,
|
||||
"type": "minion",
|
||||
"race": "goblin",
|
||||
"strength": 8,
|
||||
"vitality": 1,
|
||||
"site": 4,
|
||||
"effects": {
|
||||
"type": "modifier",
|
||||
"modifier": {
|
||||
"type": "modifyStrength",
|
||||
"filter": "self",
|
||||
"amount": {
|
||||
"type": "forEachYouCanSpot",
|
||||
"filter": "dwarf"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"40_162": {
|
||||
"title": "Goblin Howler",
|
||||
"culture": "moria",
|
||||
"cost": 2,
|
||||
"type": "minion",
|
||||
"race": "goblin",
|
||||
"strength": 5,
|
||||
"vitality": 2,
|
||||
"site": 4,
|
||||
"effects": {
|
||||
"type": "trigger",
|
||||
"optional": true,
|
||||
"trigger": {
|
||||
"type": "playedFromStacked",
|
||||
"filter": "culture(moria),minion",
|
||||
"from": "culture(moria),condition"
|
||||
},
|
||||
"effect": {
|
||||
"type": "modifyStrength",
|
||||
"filter": "self",
|
||||
"until": "start(regroup)",
|
||||
"amount": 1
|
||||
}
|
||||
}
|
||||
},
|
||||
"40_163": {
|
||||
"title": "*Goblin Messenger",
|
||||
"culture": "moria",
|
||||
"cost": 2,
|
||||
"type": "minion",
|
||||
"race": "goblin",
|
||||
"strength": 5,
|
||||
"vitality": 2,
|
||||
"site": 4,
|
||||
"effects": {
|
||||
"type": "trigger",
|
||||
"optional": true,
|
||||
"trigger": {
|
||||
"type": "played",
|
||||
"filter": "self"
|
||||
},
|
||||
"effect": {
|
||||
"type": "stackCards",
|
||||
"filter": "choose(goblin)",
|
||||
"where": "choose(culture(moria),condition)"
|
||||
}
|
||||
}
|
||||
},
|
||||
"40_164": {
|
||||
"title": "Goblin Patrol",
|
||||
"culture": "moria",
|
||||
"cost": 5,
|
||||
"type": "minion",
|
||||
"race": "goblin",
|
||||
"strength": 11,
|
||||
"vitality": 3,
|
||||
"site": 4,
|
||||
"effects": {
|
||||
"type": "modifyOwnCost",
|
||||
"amount": {
|
||||
"type": "multiply",
|
||||
"multiplier": -1,
|
||||
"source": {
|
||||
"type": "countStacked",
|
||||
"on": "culture(moria),condition",
|
||||
"filter": "goblin"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"40_165": {
|
||||
"title": "Goblin Rallyer",
|
||||
"culture": "moria",
|
||||
"cost": 1,
|
||||
"type": "minion",
|
||||
"race": "goblin",
|
||||
"strength": 5,
|
||||
"vitality": 1,
|
||||
"site": 4,
|
||||
"effects": {
|
||||
"type": "trigger",
|
||||
"optional": true,
|
||||
"trigger": {
|
||||
"type": "played",
|
||||
"filter": "self"
|
||||
},
|
||||
"effect": {
|
||||
"type": "playCardFromStacked",
|
||||
"filter": "choose(goblin)",
|
||||
"on": "culture(moria),condition"
|
||||
}
|
||||
}
|
||||
},
|
||||
"40_166": {
|
||||
"title": "*Goblin Ransacker",
|
||||
"culture": "moria",
|
||||
|
||||
@@ -1,47 +0,0 @@
|
||||
package com.gempukku.lotro.cards.set40.moria;
|
||||
|
||||
import com.gempukku.lotro.common.*;
|
||||
import com.gempukku.lotro.filters.Filter;
|
||||
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.AbstractAttachable;
|
||||
import com.gempukku.lotro.logic.modifiers.KeywordModifier;
|
||||
import com.gempukku.lotro.logic.modifiers.Modifier;
|
||||
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Title: *Cave Troll's Hammer
|
||||
* Set: Second Edition
|
||||
* Side: Shadow
|
||||
* Culture: Moria
|
||||
* Twilight Cost: 1
|
||||
* Type: Possession - Hand Weapon
|
||||
* Strength: +3
|
||||
* Card Number: 1R158
|
||||
* Game Text: Bearer must be Cave Troll of Moria. Cave Troll of Moria is damage +1.
|
||||
*/
|
||||
public class Card40_158 extends AbstractAttachable {
|
||||
public Card40_158() {
|
||||
super(Side.SHADOW, CardType.POSSESSION, 1, Culture.MORIA, PossessionClass.HAND_WEAPON, "Cave Troll's Hammer", null, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Filter getValidTargetFilter(String playerId, LotroGame game, PhysicalCard self) {
|
||||
return Filters.name("Cave Troll of Moria");
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getStrength() {
|
||||
return 3;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<? extends Modifier> getInPlayModifiers(LotroGame game, PhysicalCard self) {
|
||||
List<Modifier> modifiers = new LinkedList<Modifier>();
|
||||
modifiers.add(new KeywordModifier(self, Filters.hasAttached(self), Keyword.DAMAGE));
|
||||
return modifiers;
|
||||
}
|
||||
}
|
||||
@@ -1,42 +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.Phase;
|
||||
import com.gempukku.lotro.common.Side;
|
||||
import com.gempukku.lotro.game.PhysicalCard;
|
||||
import com.gempukku.lotro.game.state.LotroGame;
|
||||
import com.gempukku.lotro.logic.actions.PlayEventAction;
|
||||
import com.gempukku.lotro.logic.cardtype.AbstractEvent;
|
||||
import com.gempukku.lotro.logic.effects.choose.ChooseAndPlayCardFromDiscardEffect;
|
||||
import com.gempukku.lotro.logic.timing.PlayConditions;
|
||||
|
||||
/**
|
||||
* Title: Foul Things
|
||||
* Set: Second Edition
|
||||
* Side: Shadow
|
||||
* Culture: Moria
|
||||
* Twilight Cost: 2
|
||||
* Type: Event - Shadow
|
||||
* Card Number: 1U159
|
||||
* Game Text: Play a [MORIA] minion from your discard pile.
|
||||
*/
|
||||
public class Card40_159 extends AbstractEvent {
|
||||
public Card40_159() {
|
||||
super(Side.SHADOW, 2, Culture.MORIA, "Foul Things", Phase.SHADOW);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean checkPlayRequirements(LotroGame game, PhysicalCard self) {
|
||||
return PlayConditions.canPlayFromDiscard(self.getOwner(), game, Culture.MORIA, CardType.MINION);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PlayEventAction getPlayEventCardAction(String playerId, LotroGame game, PhysicalCard self) {
|
||||
PlayEventAction action = new PlayEventAction(self);
|
||||
action.appendEffect(
|
||||
new ChooseAndPlayCardFromDiscardEffect(playerId, game, Culture.MORIA, CardType.MINION));
|
||||
|
||||
return action;
|
||||
}
|
||||
}
|
||||
@@ -1,59 +0,0 @@
|
||||
package com.gempukku.lotro.cards.set40.moria;
|
||||
|
||||
import com.gempukku.lotro.logic.cardtype.AbstractPermanent;
|
||||
import com.gempukku.lotro.logic.timing.TriggerConditions;
|
||||
import com.gempukku.lotro.logic.effects.SelfDiscardEffect;
|
||||
import com.gempukku.lotro.logic.effects.choose.ChooseAndPreventCardEffect;
|
||||
import com.gempukku.lotro.common.*;
|
||||
import com.gempukku.lotro.filters.Filters;
|
||||
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.effects.AddTwilightEffect;
|
||||
import com.gempukku.lotro.logic.effects.WoundCharactersEffect;
|
||||
import com.gempukku.lotro.logic.timing.Effect;
|
||||
import com.gempukku.lotro.logic.timing.EffectResult;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Title: Goblin Armory
|
||||
* Set: Second Edition
|
||||
* Side: Shadow
|
||||
* Culture: Moria
|
||||
* Twilight Cost: 0
|
||||
* Type: Condition - Support Area
|
||||
* Card Number: 1R160
|
||||
* Game Text: Each time you play a [MORIA] weapon, add (1). Response: If a [MORIA] Goblin is about to take a wound, discard this condition to prevent that wound.
|
||||
*/
|
||||
public class Card40_160 extends AbstractPermanent {
|
||||
public Card40_160() {
|
||||
super(Side.SHADOW, 0, CardType.CONDITION, Culture.MORIA, "Goblin Armory");
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<RequiredTriggerAction> getRequiredAfterTriggers(LotroGame game, EffectResult effectResult, PhysicalCard self) {
|
||||
if (TriggerConditions.played(game, effectResult, Filters.and(Filters.owner(self.getOwner()), Culture.MORIA, Filters.weapon))) {
|
||||
RequiredTriggerAction action = new RequiredTriggerAction(self);
|
||||
action.appendEffect(new AddTwilightEffect(self, 1));
|
||||
return Collections.singletonList(action);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<? extends ActivateCardAction> getOptionalInPlayBeforeActions(String playerId, LotroGame game, final Effect effect, final PhysicalCard self) {
|
||||
if (TriggerConditions.isGettingWounded(effect, game, Culture.MORIA, Race.GOBLIN)) {
|
||||
final WoundCharactersEffect woundEffect = (WoundCharactersEffect) effect;
|
||||
final ActivateCardAction action = new ActivateCardAction(self);
|
||||
action.appendCost(
|
||||
new SelfDiscardEffect(self));
|
||||
action.appendEffect(
|
||||
new ChooseAndPreventCardEffect(self, woundEffect, playerId, "Choose MORIA Goblin", Culture.MORIA, Race.GOBLIN));
|
||||
return Collections.singletonList(action);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -1,39 +0,0 @@
|
||||
package com.gempukku.lotro.cards.set40.moria;
|
||||
|
||||
import com.gempukku.lotro.common.Culture;
|
||||
import com.gempukku.lotro.common.Race;
|
||||
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.CountSpottableEvaluator;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Title: Goblin Grudgebearer
|
||||
* Set: Second Edition
|
||||
* Side: Shadow
|
||||
* Culture: Moria
|
||||
* Twilight Cost: 3
|
||||
* Type: Minion - Goblin
|
||||
* Strength: 8
|
||||
* Vitality: 1
|
||||
* Home: 4
|
||||
* Card Number: 1C161
|
||||
* Game Text: This minion is strength +1 for each Dwarf you can spot.
|
||||
*/
|
||||
public class Card40_161 extends AbstractMinion {
|
||||
public Card40_161() {
|
||||
super(3, 8, 1, 4, Race.GOBLIN, Culture.MORIA, "Goblin Grudgebearer");
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<? extends Modifier> getInPlayModifiers(LotroGame game, PhysicalCard self) {
|
||||
StrengthModifier modifier = new StrengthModifier(self, self, null,
|
||||
new CountSpottableEvaluator(Race.DWARF));
|
||||
return Collections.singletonList(modifier);
|
||||
}
|
||||
}
|
||||
@@ -1,49 +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.Phase;
|
||||
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.actions.OptionalTriggerAction;
|
||||
import com.gempukku.lotro.logic.cardtype.AbstractMinion;
|
||||
import com.gempukku.lotro.logic.effects.AddUntilStartOfPhaseModifierEffect;
|
||||
import com.gempukku.lotro.logic.modifiers.StrengthModifier;
|
||||
import com.gempukku.lotro.logic.timing.EffectResult;
|
||||
import com.gempukku.lotro.logic.timing.TriggerConditions;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Title: Goblin Howler
|
||||
* Set: Second Edition
|
||||
* Side: Shadow
|
||||
* Culture: Moria
|
||||
* Twilight Cost: 2
|
||||
* Type: Minion - Goblin
|
||||
* Strength: 5
|
||||
* Vitality: 2
|
||||
* Home: 4
|
||||
* Card Number: 1U162
|
||||
* Game Text: Each time you play a [MORIA] minion from a [MORIA] condition, you may make this minion strength +1 until the regroup phase.
|
||||
*/
|
||||
public class Card40_162 extends AbstractMinion {
|
||||
public Card40_162() {
|
||||
super(2, 5, 2, 4, Race.GOBLIN, Culture.MORIA, "Goblin Howler");
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<OptionalTriggerAction> getOptionalAfterTriggers(String playerId, LotroGame game, EffectResult effectResult, PhysicalCard self) {
|
||||
if (TriggerConditions.playedFromStacked(game, effectResult, Filters.and(Culture.MORIA, CardType.CONDITION), Culture.MORIA, CardType.MINION)) {
|
||||
OptionalTriggerAction action = new OptionalTriggerAction(self);
|
||||
action.appendEffect(
|
||||
new AddUntilStartOfPhaseModifierEffect(
|
||||
new StrengthModifier(self, self, 1), Phase.REGROUP));
|
||||
return Collections.singletonList(action);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -1,46 +0,0 @@
|
||||
package com.gempukku.lotro.cards.set40.moria;
|
||||
|
||||
import com.gempukku.lotro.logic.cardtype.AbstractMinion;
|
||||
import com.gempukku.lotro.logic.timing.TriggerConditions;
|
||||
import com.gempukku.lotro.logic.effects.choose.ChooseAndStackCardFromPlayEffect;
|
||||
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.actions.OptionalTriggerAction;
|
||||
import com.gempukku.lotro.logic.timing.EffectResult;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Title: *Goblin Messenger
|
||||
* Set: Second Edition
|
||||
* Side: Shadow
|
||||
* Culture: Moria
|
||||
* Twilight Cost: 2
|
||||
* Type: Minion - Goblin
|
||||
* Strength: 5
|
||||
* Vitality: 2
|
||||
* Home: 4
|
||||
* Card Number: 1U163
|
||||
* Game Text: When you play this minion, you may stack a Goblin on a [MORIA] condition.
|
||||
*/
|
||||
public class Card40_163 extends AbstractMinion {
|
||||
public Card40_163() {
|
||||
super(2, 5, 2, 4, Race.GOBLIN, Culture.MORIA, "Goblin Messenger", null, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<OptionalTriggerAction> getOptionalAfterTriggers(String playerId, LotroGame game, EffectResult effectResult, PhysicalCard self) {
|
||||
if (TriggerConditions.played(game, effectResult, self)) {
|
||||
OptionalTriggerAction action = new OptionalTriggerAction(self);
|
||||
action.appendEffect(
|
||||
new ChooseAndStackCardFromPlayEffect(action, playerId, Filters.and(Culture.MORIA, CardType.CONDITION), Race.GOBLIN));
|
||||
return Collections.singletonList(action);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -1,38 +0,0 @@
|
||||
package com.gempukku.lotro.cards.set40.moria;
|
||||
|
||||
import com.gempukku.lotro.game.state.LotroGame;
|
||||
import com.gempukku.lotro.logic.cardtype.AbstractMinion;
|
||||
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;
|
||||
|
||||
/**
|
||||
* Title: Goblin Parol
|
||||
* Set: Second Edition
|
||||
* Side: Shadow
|
||||
* Culture: Moria
|
||||
* Twilight Cost: 5
|
||||
* Type: Minion - Goblin
|
||||
* Strength: 11
|
||||
* Vitality: 3
|
||||
* Home: 4
|
||||
* Card Number: 1C164
|
||||
* Game Text: This minion's twilight cost is -1 for each Goblin stacked on a [MORIA] condition.
|
||||
*/
|
||||
public class Card40_164 extends AbstractMinion {
|
||||
public Card40_164() {
|
||||
super(5, 11, 3, 4, Race.GOBLIN, Culture.MORIA, "Goblin Patrol");
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getTwilightCostModifier(LotroGame game, PhysicalCard self) {
|
||||
int count = 0;
|
||||
for (PhysicalCard physicalCard : Filters.filterActive(game, Culture.MORIA, CardType.CONDITION)) {
|
||||
count += Filters.filter(game.getGameState().getStackedCards(physicalCard), game, Race.GOBLIN).size();
|
||||
}
|
||||
|
||||
return -count;
|
||||
}
|
||||
}
|
||||
@@ -1,48 +0,0 @@
|
||||
package com.gempukku.lotro.cards.set40.moria;
|
||||
|
||||
import com.gempukku.lotro.logic.cardtype.AbstractMinion;
|
||||
import com.gempukku.lotro.logic.timing.PlayConditions;
|
||||
import com.gempukku.lotro.logic.timing.TriggerConditions;
|
||||
import com.gempukku.lotro.logic.effects.choose.ChooseAndPlayCardFromStackedEffect;
|
||||
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.actions.OptionalTriggerAction;
|
||||
import com.gempukku.lotro.logic.timing.EffectResult;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Title: Goblin Rallyer
|
||||
* Set: Second Edition
|
||||
* Side: Shadow
|
||||
* Culture: Moria
|
||||
* Twilight Cost: 1
|
||||
* Type: Minion - Goblin
|
||||
* Strength: 5
|
||||
* Vitality: 1
|
||||
* Home: 4
|
||||
* Card Number: 1C165
|
||||
* Game Text: When you play this minion, you may play a Goblin stacked on a [MORIA] condition.
|
||||
*/
|
||||
public class Card40_165 extends AbstractMinion {
|
||||
public Card40_165() {
|
||||
super(1, 5, 1, 4, Race.GOBLIN, Culture.MORIA, "Goblin Rallyer");
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<OptionalTriggerAction> getOptionalAfterTriggers(String playerId, LotroGame game, EffectResult effectResult, PhysicalCard self) {
|
||||
if (TriggerConditions.played(game, effectResult, self)
|
||||
&& PlayConditions.canPlayFromStacked(playerId, game, Filters.and(Culture.MORIA, CardType.CONDITION), Race.GOBLIN)) {
|
||||
OptionalTriggerAction action = new OptionalTriggerAction(self);
|
||||
action.appendEffect(
|
||||
new ChooseAndPlayCardFromStackedEffect(playerId, Filters.and(Culture.MORIA, CardType.CONDITION), Race.GOBLIN));
|
||||
return Collections.singletonList(action);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
package com.gempukku.lotro.cards.build.field.effect.trigger;
|
||||
|
||||
import com.gempukku.lotro.cards.build.ActionContext;
|
||||
import com.gempukku.lotro.cards.build.CardGenerationEnvironment;
|
||||
import com.gempukku.lotro.cards.build.FilterableSource;
|
||||
import com.gempukku.lotro.cards.build.InvalidCardDefinitionException;
|
||||
import com.gempukku.lotro.cards.build.field.FieldUtils;
|
||||
import com.gempukku.lotro.common.Filterable;
|
||||
import com.gempukku.lotro.game.PhysicalCard;
|
||||
import com.gempukku.lotro.logic.timing.TriggerConditions;
|
||||
import com.gempukku.lotro.logic.timing.results.PlayCardResult;
|
||||
import org.json.simple.JSONObject;
|
||||
|
||||
public class PlayedFromStacked implements TriggerCheckerProducer {
|
||||
@Override
|
||||
public TriggerChecker getTriggerChecker(JSONObject value, CardGenerationEnvironment environment) throws InvalidCardDefinitionException {
|
||||
FieldUtils.validateAllowedFields(value, "filter", "from", "memorize");
|
||||
|
||||
final String filterString = FieldUtils.getString(value.get("filter"), "filter");
|
||||
final String fromString = FieldUtils.getString(value.get("filter"), "filter");
|
||||
final String memorize = FieldUtils.getString(value.get("memorize"), "memorize");
|
||||
final FilterableSource filter = environment.getFilterFactory().generateFilter(filterString, environment);
|
||||
final FilterableSource fromFilter = environment.getFilterFactory().generateFilter(fromString, environment);
|
||||
return new TriggerChecker() {
|
||||
@Override
|
||||
public boolean accepts(ActionContext actionContext) {
|
||||
final Filterable filterable = filter.getFilterable(actionContext);
|
||||
final Filterable from = fromFilter.getFilterable(actionContext);
|
||||
final boolean played = TriggerConditions.playedFromStacked(actionContext.getGame(), actionContext.getEffectResult(), from, filterable);
|
||||
if (played && memorize != null) {
|
||||
PhysicalCard playedCard = ((PlayCardResult) actionContext.getEffectResult()).getPlayedCard();
|
||||
actionContext.setCardMemory(memorize, playedCard);
|
||||
}
|
||||
return played;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isBefore() {
|
||||
return false;
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -13,6 +13,7 @@ public class TriggerCheckerFactory {
|
||||
|
||||
public TriggerCheckerFactory() {
|
||||
triggerCheckers.put("played", new PlayedTriggerCheckerProducer());
|
||||
triggerCheckers.put("playedfromstacked", new PlayedFromStacked());
|
||||
triggerCheckers.put("abouttodiscard", new AboutToDiscardFromPlay());
|
||||
triggerCheckers.put("losesskirmish", new LosesSkirmish());
|
||||
triggerCheckers.put("winsskirmish", new WinsSkirmish());
|
||||
|
||||
Reference in New Issue
Block a user