Migrated Shire cards in set 10 to hjson

This commit is contained in:
MarcinSc
2024-05-16 22:32:00 +07:00
parent 4618357597
commit d2229276c3
22 changed files with 372 additions and 933 deletions

View File

@@ -1,76 +0,0 @@
package com.gempukku.lotro.cards.set10.shire;
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.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.cardtype.AbstractPermanent;
import com.gempukku.lotro.logic.effects.AddBurdenEffect;
import com.gempukku.lotro.logic.effects.ChooseArbitraryCardsEffect;
import com.gempukku.lotro.logic.effects.PutCardFromDiscardIntoHandEffect;
import com.gempukku.lotro.logic.effects.choose.ChooseOpponentEffect;
import com.gempukku.lotro.logic.timing.PlayConditions;
import java.util.*;
/**
* Set: Mount Doom
* Side: Free
* Culture: Shire
* Twilight Cost: 1
* Type: Condition • Support Area
* Game Text: Fellowship: Add a burden to choose 2 [SHIRE] events with different card titles from your discard pile.
* Choose an opponent and make him or her choose 1 of those cards for you to take into hand.
*/
public class Card10_104 extends AbstractPermanent {
public Card10_104() {
super(Side.FREE_PEOPLE, 1, CardType.CONDITION, Culture.SHIRE, "Birthday Present");
}
@Override
public List<? extends ActivateCardAction> getPhaseActionsInPlay(final String playerId, LotroGame game, PhysicalCard self) {
if (PlayConditions.canUseFPCardDuringPhase(game, Phase.FELLOWSHIP, self)) {
final ActivateCardAction action = new ActivateCardAction(self);
action.appendCost(
new AddBurdenEffect(playerId, self, 1));
Collection<PhysicalCard> shireEvents = Filters.filter(game.getGameState().getDiscard(playerId), game, Culture.SHIRE, CardType.EVENT);
action.appendEffect(
new ChooseArbitraryCardsEffect(playerId, "Choose events", filterUniqueNames(shireEvents), 2, 2) {
@Override
protected void cardsSelected(LotroGame game, final Collection<PhysicalCard> selectedCards) {
if (selectedCards.size() > 0) {
action.appendEffect(
new ChooseOpponentEffect(playerId) {
@Override
protected void opponentChosen(String opponentId) {
action.appendEffect(
new ChooseArbitraryCardsEffect(opponentId, "Choose event Free People player should take into hand", selectedCards, 1, 1) {
@Override
protected void cardsSelected(LotroGame game, Collection<PhysicalCard> selectedCards) {
for (PhysicalCard selectedCard : selectedCards) {
action.appendEffect(
new PutCardFromDiscardIntoHandEffect(selectedCard));
}
}
});
}
});
}
}
});
return Collections.singletonList(action);
}
return null;
}
private Collection<PhysicalCard> filterUniqueNames(Collection<PhysicalCard> cards) {
Map<String, PhysicalCard> nameMap = new HashMap<>();
for (PhysicalCard card : cards)
nameMap.put(card.getBlueprint().getTitle(), card);
return nameMap.values();
}
}

View File

@@ -1,45 +0,0 @@
package com.gempukku.lotro.cards.set10.shire;
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.PlayEventAction;
import com.gempukku.lotro.logic.cardtype.AbstractEvent;
import com.gempukku.lotro.logic.effects.ReplaceInSkirmishEffect;
import com.gempukku.lotro.logic.effects.choose.ChooseAndExertCharactersEffect;
import com.gempukku.lotro.logic.timing.PlayConditions;
/**
* Set: Mount Doom
* Side: Free
* Culture: Shire
* Twilight Cost: 0
* Type: Event • Skirmish
* Game Text: If a Hobbit companion is not assigned to a skirmish, exert that Hobbit to have him or her replace
* a companion (except the Ring-bearer) in a skirmish.
*/
public class Card10_105 extends AbstractEvent {
public Card10_105() {
super(Side.FREE_PEOPLE, 0, Culture.SHIRE, "Brave and Loyal", Phase.SKIRMISH);
}
@Override
public boolean checkPlayRequirements(LotroGame game, PhysicalCard self) {
return PlayConditions.canExert(self, game, Race.HOBBIT, CardType.COMPANION, Filters.notAssignedToSkirmish);
}
@Override
public PlayEventAction getPlayEventCardAction(String playerId, LotroGame game, PhysicalCard self) {
final PlayEventAction action = new PlayEventAction(self);
action.appendCost(
new ChooseAndExertCharactersEffect(action, playerId, 1, 1, Race.HOBBIT, CardType.COMPANION, Filters.notAssignedToSkirmish) {
@Override
protected void forEachCardExertedCallback(PhysicalCard character) {
action.appendEffect(
new ReplaceInSkirmishEffect(character, CardType.COMPANION, Filters.not(Filters.ringBearer)));
}
});
return action;
}
}

View File

@@ -1,41 +0,0 @@
package com.gempukku.lotro.cards.set10.shire;
import com.gempukku.lotro.common.Culture;
import com.gempukku.lotro.common.Phase;
import com.gempukku.lotro.common.Race;
import com.gempukku.lotro.common.Side;
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.PlayEventAction;
import com.gempukku.lotro.logic.cardtype.AbstractEvent;
import com.gempukku.lotro.logic.effects.choose.ChooseAndAddUntilEOPStrengthBonusEffect;
import com.gempukku.lotro.logic.modifiers.evaluator.CountActiveEvaluator;
/**
* Set: Mount Doom
* Side: Free
* Culture: Shire
* Twilight Cost: 0
* Type: Event • Skirmish
* Game Text: If there are 4 or more [SHIRE] cards in your discard pile, make a Hobbit strength +1 for each Hobbit you
* can spot.
*/
public class Card10_106 extends AbstractEvent {
public Card10_106() {
super(Side.FREE_PEOPLE, 0, Culture.SHIRE, "Chance Observation", Phase.SKIRMISH);
}
@Override
public boolean checkPlayRequirements(LotroGame game, PhysicalCard self) {
return Filters.filter(game.getGameState().getDiscard(self.getOwner()), game, Culture.SHIRE).size() >= 4;
}
@Override
public PlayEventAction getPlayEventCardAction(String playerId, LotroGame game, PhysicalCard self) {
PlayEventAction action = new PlayEventAction(self);
action.appendEffect(
new ChooseAndAddUntilEOPStrengthBonusEffect(action, self, playerId, new CountActiveEvaluator(Race.HOBBIT), Race.HOBBIT));
return action;
}
}

View File

@@ -1,68 +0,0 @@
package com.gempukku.lotro.cards.set10.shire;
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.PlayUtils;
import com.gempukku.lotro.logic.actions.RequiredTriggerAction;
import com.gempukku.lotro.logic.cardtype.AbstractAttachable;
import com.gempukku.lotro.logic.effects.ChooseAndWoundCharactersEffect;
import com.gempukku.lotro.logic.timing.Action;
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;
/**
* Set: Mount Doom
* Side: Free
* Culture: Shire
* Twilight Cost: 1
* Type: Condition
* Vitality: -1
* Game Text: Play this condition only during a skirmish. Bearer must be a Hobbit. When this condition is played, wound
* a minion skirmishing bearer.
*/
public class Card10_107 extends AbstractAttachable {
public Card10_107() {
super(Side.FREE_PEOPLE, CardType.CONDITION, 1, Culture.SHIRE, null, "Great Heart");
}
@Override
public int getVitality() {
return -1;
}
@Override
public boolean checkPlayRequirements(LotroGame game, PhysicalCard self) {
return PlayConditions.isPhase(game, Phase.SKIRMISH);
}
@Override
public Filterable getValidTargetFilter(String playerId, LotroGame game, PhysicalCard self) {
return Race.HOBBIT;
}
@Override
public List<? extends Action> getPhaseActionsInHand(String playerId, LotroGame game, PhysicalCard self) {
if (PlayConditions.canPlayCardDuringPhase(game, Phase.SKIRMISH, self)
&& PlayUtils.checkPlayRequirements(game, self, Filters.any, 0, 0, false, false)) {
return Collections.singletonList(PlayUtils.getPlayCardAction(game, self, 0, Filters.any, false));
}
return null;
}
@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 ChooseAndWoundCharactersEffect(action, self.getOwner(), 1, 1, CardType.MINION, Filters.inSkirmishAgainst(Filters.hasAttached(self))));
return Collections.singletonList(action);
}
return null;
}
}

View File

@@ -1,42 +0,0 @@
package com.gempukku.lotro.cards.set10.shire;
import com.gempukku.lotro.logic.cardtype.AbstractPermanent;
import com.gempukku.lotro.logic.timing.PlayConditions;
import com.gempukku.lotro.logic.timing.TriggerConditions;
import com.gempukku.lotro.logic.effects.RemoveBurdenEffect;
import com.gempukku.lotro.common.CardType;
import com.gempukku.lotro.common.Culture;
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.OptionalTriggerAction;
import com.gempukku.lotro.logic.timing.EffectResult;
import java.util.Collections;
import java.util.List;
/**
* Set: Mount Doom
* Side: Free
* Culture: Shire
* Twilight Cost: 0
* Type: Condition • Support Area
* Game Text: Each time you lose initiative, you may spot 2 [SHIRE] companions to remove a burden.
*/
public class Card10_108 extends AbstractPermanent {
public Card10_108() {
super(Side.FREE_PEOPLE, 0, CardType.CONDITION, Culture.SHIRE, "A Light in his Mind", null, true);
}
@Override
public List<OptionalTriggerAction> getOptionalAfterTriggers(String playerId, LotroGame game, EffectResult effectResult, PhysicalCard self) {
if (TriggerConditions.losesInitiative(effectResult, Side.FREE_PEOPLE)
&& PlayConditions.canSpot(game, 2, Culture.SHIRE, CardType.COMPANION)) {
OptionalTriggerAction action = new OptionalTriggerAction(self);
action.appendEffect(
new RemoveBurdenEffect(playerId, self));
return Collections.singletonList(action);
}
return null;
}
}

View File

@@ -1,64 +0,0 @@
package com.gempukku.lotro.cards.set10.shire;
import com.gempukku.lotro.common.*;
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.ChoiceEffect;
import com.gempukku.lotro.logic.effects.RemoveTwilightEffect;
import com.gempukku.lotro.logic.effects.choose.ChooseAndDiscardCardsFromPlayEffect;
import com.gempukku.lotro.logic.effects.choose.ChooseAndReturnCardsToHandEffect;
import com.gempukku.lotro.logic.effects.choose.ChooseOpponentEffect;
import com.gempukku.lotro.logic.timing.Effect;
import com.gempukku.lotro.logic.timing.PlayConditions;
import java.util.LinkedList;
import java.util.List;
/**
* Set: Mount Doom
* Side: Free
* Culture: Shire
* Twilight Cost: 0
* Type: Event • Maneuver
* Game Text: Stealth. Spot a [SHIRE] companion and return him or her to your hand to make a Shadow player choose
* to remove (2) or discard a minion.
*/
public class Card10_109 extends AbstractEvent {
public Card10_109() {
super(Side.FREE_PEOPLE, 0, Culture.SHIRE, "Make Haste", Phase.MANEUVER);
addKeyword(Keyword.STEALTH);
}
@Override
public boolean checkPlayRequirements(LotroGame game, PhysicalCard self) {
return PlayConditions.canSpot(game, Culture.SHIRE, CardType.COMPANION);
}
@Override
public PlayEventAction getPlayEventCardAction(String playerId, LotroGame game, PhysicalCard self) {
final PlayEventAction action = new PlayEventAction(self);
action.appendCost(
new ChooseAndReturnCardsToHandEffect(action, playerId, 1, 1, Culture.SHIRE, CardType.COMPANION));
action.appendEffect(
new ChooseOpponentEffect(playerId) {
@Override
protected void opponentChosen(String opponentId) {
List<Effect> possibleEffects = new LinkedList<>();
possibleEffects.add(
new RemoveTwilightEffect(2));
possibleEffects.add(
new ChooseAndDiscardCardsFromPlayEffect(action, opponentId, 1, 1, CardType.MINION) {
@Override
public String getText(LotroGame game) {
return "Discard a minion";
}
});
action.appendEffect(
new ChoiceEffect(action, opponentId, possibleEffects));
}
});
return action;
}
}

View File

@@ -1,47 +0,0 @@
package com.gempukku.lotro.cards.set10.shire;
import com.gempukku.lotro.common.Culture;
import com.gempukku.lotro.common.Phase;
import com.gempukku.lotro.common.Race;
import com.gempukku.lotro.common.Side;
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.PlayEventAction;
import com.gempukku.lotro.logic.cardtype.AbstractEvent;
import com.gempukku.lotro.logic.effects.choose.ChooseAndAddUntilEOPStrengthBonusEffect;
import com.gempukku.lotro.logic.effects.choose.ChooseAndExertCharactersEffect;
import com.gempukku.lotro.logic.timing.PlayConditions;
/**
* Set: Mount Doom
* Side: Free
* Culture: Shire
* Twilight Cost: 1
* Type: Event • Skirmish
* Game Text: Exert a Hobbit to make another Hobbit strength +3.
*/
public class Card10_110 extends AbstractEvent {
public Card10_110() {
super(Side.FREE_PEOPLE, 1, Culture.SHIRE, "A Marvel", Phase.SKIRMISH);
}
@Override
public boolean checkPlayRequirements(LotroGame game, PhysicalCard self) {
return PlayConditions.canExert(self, game, Race.HOBBIT);
}
@Override
public PlayEventAction getPlayEventCardAction(final String playerId, LotroGame game, final PhysicalCard self) {
final PlayEventAction action = new PlayEventAction(self);
action.appendCost(
new ChooseAndExertCharactersEffect(action, playerId, 1, 1, Race.HOBBIT) {
@Override
protected void forEachCardExertedCallback(PhysicalCard character) {
action.appendEffect(
new ChooseAndAddUntilEOPStrengthBonusEffect(action, self, playerId, 3, Filters.not(character), Race.HOBBIT));
}
});
return action;
}
}

View File

@@ -1,45 +0,0 @@
package com.gempukku.lotro.cards.set10.shire;
import com.gempukku.lotro.common.*;
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.ChooseAndDiscardCardsFromPlayEffect;
import com.gempukku.lotro.logic.effects.choose.ChooseOpponentEffect;
import com.gempukku.lotro.logic.timing.PlayConditions;
/**
* Set: Mount Doom
* Side: Free
* Culture: Shire
* Twilight Cost: 0
* Type: Event • Regroup
* Game Text: Spot 2 Hobbit companions to make a Shadow player discard a minion (or spot 4 Hobbit companions to make
* that player discard 2 minions).
*/
public class Card10_111 extends AbstractEvent {
public Card10_111() {
super(Side.FREE_PEOPLE, 0, Culture.SHIRE, "Narrow Escape", Phase.REGROUP);
}
@Override
public boolean checkPlayRequirements(LotroGame game, PhysicalCard self) {
return PlayConditions.canSpot(game, 2, Race.HOBBIT, CardType.COMPANION);
}
@Override
public PlayEventAction getPlayEventCardAction(String playerId, LotroGame game, PhysicalCard self) {
final PlayEventAction action = new PlayEventAction(self);
final int discardCount = (PlayConditions.canSpot(game, 4, Race.HOBBIT, CardType.COMPANION)) ? 2 : 1;
action.appendEffect(
new ChooseOpponentEffect(playerId) {
@Override
protected void opponentChosen(String opponentId) {
action.appendEffect(
new ChooseAndDiscardCardsFromPlayEffect(action, opponentId, discardCount, discardCount, CardType.MINION));
}
});
return action;
}
}

View File

@@ -1,65 +0,0 @@
package com.gempukku.lotro.cards.set10.shire;
import com.gempukku.lotro.common.Culture;
import com.gempukku.lotro.common.Keyword;
import com.gempukku.lotro.common.Phase;
import com.gempukku.lotro.common.Side;
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.PlayEventAction;
import com.gempukku.lotro.logic.cardtype.AbstractEvent;
import com.gempukku.lotro.logic.effects.ChoiceEffect;
import com.gempukku.lotro.logic.effects.RemoveBurdenEffect;
import com.gempukku.lotro.logic.effects.RemoveThreatsEffect;
import com.gempukku.lotro.logic.effects.choose.ChooseAndExertCharactersEffect;
import com.gempukku.lotro.logic.timing.Effect;
import com.gempukku.lotro.logic.timing.PlayConditions;
import java.util.LinkedList;
import java.util.List;
/**
* Set: Mount Doom
* Side: Free
* Culture: Shire
* Twilight Cost: 0
* Type: Event • Skirmish
* Game Text: Tale. Exert a [SHIRE] character to remove a burden or 2 threats.
*/
public class Card10_112 extends AbstractEvent {
public Card10_112() {
super(Side.FREE_PEOPLE, 0, Culture.SHIRE, "Nine-fingered Frodo and the Ring of Doom", Phase.SKIRMISH);
addKeyword(Keyword.TALE);
}
@Override
public boolean checkPlayRequirements(LotroGame game, PhysicalCard self) {
return PlayConditions.canExert(self, game, Culture.SHIRE, Filters.character);
}
@Override
public PlayEventAction getPlayEventCardAction(String playerId, LotroGame game, PhysicalCard self) {
PlayEventAction action = new PlayEventAction(self);
action.appendCost(
new ChooseAndExertCharactersEffect(action, playerId, 1, 1, Culture.SHIRE, Filters.character));
List<Effect> possibleEffects = new LinkedList<>();
possibleEffects.add(
new RemoveBurdenEffect(playerId, self));
if (game.getGameState().getThreats() > 1) {
possibleEffects.add(
new RemoveThreatsEffect(self, 2) {
@Override
public String getText(LotroGame game) {
return "Remove 2 threats";
}
});
} else if (game.getGameState().getBurdens() == 0) {
possibleEffects.add(
new RemoveThreatsEffect(self, 1));
}
action.appendEffect(
new ChoiceEffect(action, playerId, possibleEffects));
return action;
}
}

View File

@@ -1,40 +0,0 @@
package com.gempukku.lotro.cards.set10.shire;
import com.gempukku.lotro.common.Culture;
import com.gempukku.lotro.common.Filterable;
import com.gempukku.lotro.common.PossessionClass;
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.AbstractAttachableFPPossession;
import com.gempukku.lotro.logic.modifiers.Modifier;
import com.gempukku.lotro.logic.modifiers.StrengthModifier;
import java.util.Collections;
import java.util.List;
/**
* Set: Mount Doom
* Side: Free
* Culture: Shire
* Twilight Cost: 1
* Type: Possession • Armor
* Game Text: Bearer must be a Hobbit. Each Orc and each Uruk-hai skirmishing bearer is strength -1.
*/
public class Card10_113 extends AbstractAttachableFPPossession {
public Card10_113() {
super(1, 0, 0, Culture.SHIRE, PossessionClass.ARMOR, "Orc Armor");
}
@Override
public Filterable getValidTargetFilter(String playerId, LotroGame game, PhysicalCard self) {
return Race.HOBBIT;
}
@Override
public List<? extends Modifier> getInPlayModifiers(LotroGame game, PhysicalCard self) {
return Collections.singletonList(
new StrengthModifier(self, Filters.and(Filters.or(Race.ORC, Race.URUK_HAI), Filters.inSkirmishAgainst(Filters.hasAttached(self))), -1));
}
}

View File

@@ -1,58 +0,0 @@
package com.gempukku.lotro.cards.set10.shire;
import com.gempukku.lotro.common.CardType;
import com.gempukku.lotro.common.Culture;
import com.gempukku.lotro.common.Race;
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.OptionalTriggerAction;
import com.gempukku.lotro.logic.cardtype.AbstractPermanent;
import com.gempukku.lotro.logic.effects.CheckTurnLimitEffect;
import com.gempukku.lotro.logic.effects.ExertCharactersEffect;
import com.gempukku.lotro.logic.effects.choose.ChooseAndExertCharactersEffect;
import com.gempukku.lotro.logic.timing.EffectResult;
import com.gempukku.lotro.logic.timing.PlayConditions;
import com.gempukku.lotro.logic.timing.TriggerConditions;
import com.gempukku.lotro.logic.timing.results.PlayCardResult;
import java.util.Collections;
import java.util.List;
/**
* Set: Mount Doom
* Side: Free
* Culture: Shire
* Twilight Cost: 1
* Type: Condition • Support Area
* Game Text: To play, spot 2 [SHIRE] companions. Each time a minion is played, you may exert a Hobbit companion
* to exert that minion (limit once per turn).
*/
public class Card10_114 extends AbstractPermanent {
public Card10_114() {
super(Side.FREE_PEOPLE, 1, CardType.CONDITION, Culture.SHIRE, "Shadowplay");
}
@Override
public boolean checkPlayRequirements(LotroGame game, PhysicalCard self) {
return PlayConditions.canSpot(game, 2, Culture.SHIRE, CardType.COMPANION);
}
@Override
public List<OptionalTriggerAction> getOptionalAfterTriggers(String playerId, LotroGame game, EffectResult effectResult, final PhysicalCard self) {
if (TriggerConditions.played(game, effectResult, CardType.MINION)
&& PlayConditions.canExert(self, game, Race.HOBBIT, CardType.COMPANION)) {
PlayCardResult playResult = (PlayCardResult) effectResult;
PhysicalCard playedCard = playResult.getPlayedCard();
OptionalTriggerAction action = new OptionalTriggerAction(self);
action.appendCost(
new ChooseAndExertCharactersEffect(action, playerId, 1, 1, Race.HOBBIT, CardType.COMPANION));
action.appendEffect(
new CheckTurnLimitEffect(action, self, 1,
new ExertCharactersEffect(action, self, playedCard)));
return Collections.singletonList(action);
}
return null;
}
}

View File

@@ -1,47 +0,0 @@
package com.gempukku.lotro.cards.set10.shire;
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.game.state.Skirmish;
import com.gempukku.lotro.logic.actions.PlayEventAction;
import com.gempukku.lotro.logic.cardtype.AbstractEvent;
import com.gempukku.lotro.logic.effects.AddUntilStartOfPhaseModifierEffect;
import com.gempukku.lotro.logic.effects.CancelSkirmishEffect;
import com.gempukku.lotro.logic.modifiers.KeywordModifier;
/**
* Set: Mount Doom
* Side: Free
* Culture: Shire
* Twilight Cost: 1
* Type: Event • Skirmish
* Game Text: Stealth. If there are 6 or more [SHIRE] cards in your discard pile, cancel a skirmish involving your
* Hobbit and a minion who is not fierce. Each minion in that skirmish is fierce until the regroup phase.
*/
public class Card10_115 extends AbstractEvent {
public Card10_115() {
super(Side.FREE_PEOPLE, 1, Culture.SHIRE, "Slunk Out of Sight", Phase.SKIRMISH);
addKeyword(Keyword.STEALTH);
}
@Override
public boolean checkPlayRequirements(LotroGame game, PhysicalCard self) {
return Filters.filter(game.getGameState().getDiscard(self.getOwner()), game, Culture.SHIRE).size() >= 6;
}
@Override
public PlayEventAction getPlayEventCardAction(String playerId, LotroGame game, PhysicalCard self) {
PlayEventAction action = new PlayEventAction(self);
Skirmish skirmish = game.getGameState().getSkirmish();
if (Filters.canSpot(game, Filters.inSkirmish, Filters.owner(playerId), Race.HOBBIT)
&& Filters.canSpot(game, Filters.inSkirmish, CardType.MINION, Filters.not(Keyword.FIERCE)))
action.appendEffect(
new CancelSkirmishEffect());
action.appendEffect(
new AddUntilStartOfPhaseModifierEffect(
new KeywordModifier(self, Filters.in(skirmish.getShadowCharacters()), Keyword.FIERCE), Phase.REGROUP));
return action;
}
}

View File

@@ -1,54 +0,0 @@
package com.gempukku.lotro.cards.set10.shire;
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.cardtype.AbstractPermanent;
import com.gempukku.lotro.logic.effects.AddUntilEndOfPhaseModifierEffect;
import com.gempukku.lotro.logic.effects.ChooseActiveCardEffect;
import com.gempukku.lotro.logic.effects.SelfDiscardEffect;
import com.gempukku.lotro.logic.modifiers.CantBeOverwhelmedModifier;
import com.gempukku.lotro.logic.modifiers.condition.CardPlayedInCurrentPhaseCondition;
import com.gempukku.lotro.logic.modifiers.condition.NotCondition;
import com.gempukku.lotro.logic.timing.PlayConditions;
import java.util.Collections;
import java.util.List;
/**
* Set: Mount Doom
* Side: Free
* Culture: Shire
* Twilight Cost: 0
* Type: Condition • Support Area
* Game Text: Tale. Skirmish: Prevent a Hobbit from being overwhelmed unless a Shadow event is (or was) played during
* this skirmish. Discard this condition.
*/
public class Card10_116 extends AbstractPermanent {
public Card10_116() {
super(Side.FREE_PEOPLE, 0, CardType.CONDITION, Culture.SHIRE, "The Tale of the Great Ring", null, true);
addKeyword(Keyword.TALE);
}
@Override
public List<? extends ActivateCardAction> getPhaseActionsInPlay(String playerId, LotroGame game, final PhysicalCard self) {
if (PlayConditions.canUseFPCardDuringPhase(game, Phase.SKIRMISH, self)) {
final ActivateCardAction action = new ActivateCardAction(self);
action.appendEffect(
new ChooseActiveCardEffect(self, playerId, "Choose a Hobbit", Race.HOBBIT) {
@Override
protected void cardSelected(final LotroGame game, PhysicalCard card) {
action.insertEffect(
new AddUntilEndOfPhaseModifierEffect(
new CantBeOverwhelmedModifier(self, card,
new NotCondition(new CardPlayedInCurrentPhaseCondition(Side.SHADOW, CardType.EVENT)))));
}
});
action.appendEffect(
new SelfDiscardEffect(self));
return Collections.singletonList(action);
}
return null;
}
}

View File

@@ -1,26 +0,0 @@
package com.gempukku.lotro.cards.set10.shire;
import com.gempukku.lotro.logic.cardtype.AbstractCompanion;
import com.gempukku.lotro.common.Culture;
import com.gempukku.lotro.common.Keyword;
import com.gempukku.lotro.common.Race;
import com.gempukku.lotro.common.Signet;
/**
* Set: Mount Doom
* Side: Free
* Culture: Shire
* Twilight Cost: 0
* Type: Companion • Hobbit
* Strength: 3
* Vitality: 4
* Resistance: 12
* Signet: Frodo
* Game Text: Ring-bearer (resistance 12).
*/
public class Card10_121 extends AbstractCompanion {
public Card10_121() {
super(0, 3, 4, 12, Culture.SHIRE, Race.HOBBIT, Signet.FRODO, "Frodo", "Resolute Hobbit", true);
addKeyword(Keyword.CAN_START_WITH_RING);
}
}

View File

@@ -1,54 +0,0 @@
package com.gempukku.lotro.cards.set10.shire;
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.OptionalTriggerAction;
import com.gempukku.lotro.logic.cardtype.AbstractCompanion;
import com.gempukku.lotro.logic.effects.MakeRingBearerEffect;
import com.gempukku.lotro.logic.modifiers.Modifier;
import com.gempukku.lotro.logic.modifiers.StrengthModifier;
import com.gempukku.lotro.logic.modifiers.evaluator.CountActiveEvaluator;
import com.gempukku.lotro.logic.timing.EffectResult;
import com.gempukku.lotro.logic.timing.TriggerConditions;
import java.util.Collections;
import java.util.List;
/**
* Set: Mount Doom
* Side: Free
* Culture: Shire
* Twilight Cost: 2
* Type: Companion • Hobbit
* Strength: 3
* Vitality: 4
* Resistance: 6
* Signet: Gandalf
* Game Text: Ring-bound. Sam is strength +1 for each [SHIRE] companion you can spot. Response: If Frodo dies, make
* Sam the Ring-bearer (resistance 5).
*/
public class Card10_122 extends AbstractCompanion {
public Card10_122() {
super(2, 3, 4, 5, Culture.SHIRE, Race.HOBBIT, Signet.GANDALF, "Sam", "Great Elf Warrior", true);
addKeyword(Keyword.RING_BOUND);
}
@Override
public List<? extends Modifier> getInPlayModifiers(LotroGame game, PhysicalCard self) {
return Collections.singletonList(
new StrengthModifier(self, self, null, new CountActiveEvaluator(Culture.SHIRE, CardType.COMPANION)));
}
@Override
public List<OptionalTriggerAction> getOptionalAfterTriggers(String playerId, LotroGame game, EffectResult effectResult, PhysicalCard self) {
if (TriggerConditions.forEachKilled(game, effectResult, Filters.frodo, Filters.ringBearer)) {
OptionalTriggerAction action = new OptionalTriggerAction(self);
action.appendEffect(new MakeRingBearerEffect(self));
return Collections.singletonList(action);
}
return null;
}
}

View File

@@ -22,17 +22,41 @@
twilight: 1
type: Condition
keywords: Support Area
/*requires: {
}
effects: [
{
}
{
}
]*/
{
type: activated
phase: fellowship
cost: {
type: addBurdens
}
effect: [
{
type: memorizeDiscard
filter: culture(shire),event
uniqueTitles: true
memory: shireEvents
}
{
type: chooseArbitraryCards
text: Choose cards to give to opponent to choose
fromMemory: shireEvents
count: 2
memorize: chosenCards
}
{
type: chooseArbitraryCards
text: Choose card to return to opponent's hand
player: shadow
fromMemory: chosenCards
memorize: cardToReturn
}
{
type: putCardsFromDiscardIntoHand
filter: memory(cardToReturn)
}
]
}
]
gametext: <b>Fellowship:</b> Add a burden to choose 2 [shire] events with different card titles from your discard pile. Choose an opponent and make him or her choose 1 of those cards for you to take into hand.
lore: ...he caught Déagol by the throat and strangled him, because the gold looked so bright and beautiful.'
promotext: ""
@@ -66,20 +90,18 @@
twilight: 0
type: Event
keywords: Skirmish
/*requires: {
}
*/
effects: {
type: event
cost: {
type: SendMessage
text: Placeholder effect for development.
type: exert
filter: choose(hobbit,companion,notAssignedToSkirmish)
memorize: exertedHobbit
},
effect: [
{
type: SendMessage
text: Placeholder effect for development.
type: replaceInSkirmish
filter: companion,not(ringBearer)
with: memory(exertedHobbit)
}
]
}
@@ -116,20 +138,21 @@
twilight: 0
type: Event
keywords: Skirmish
/*requires: {
}
*/
effects: {
type: event
cost: {
type: SendMessage
text: Placeholder effect for development.
requires: {
type: hasCardInDiscard
filter: your,culture(shire)
count: 4
},
effect: [
{
type: SendMessage
text: Placeholder effect for development.
type: modifyStrength
filter: choose(hobbit)
amount: {
type: forEachYouCanSpot
filter: hobbit
}
}
]
}
@@ -166,18 +189,31 @@
twilight: 1
type: Condition
vitality: -1
#target: a Hobbit
/*requires: {
}
target: hobbit
effects: [
{
}
{
}
]*/
{
type: toPlay
requires: {
type: phase
phase: skirmish
}
}
{
type: playedInOtherPhase
phase: skirmish
}
{
type: trigger
trigger: {
type: played
filter: self
}
effect: {
type: wound
filter: choose(minion,inSkirmishAgainst(bearer))
}
}
]
gametext: Play this condition only during a skirmish. Bearer must be a Hobbit.<br>When this condition is played, wound a minion skirmishing bearer.
lore: And there stood Meriadoc the hobbit in the midst of the slain, blinking like an owl in the daylight, for tears blinded him....
promotext: ""
@@ -211,17 +247,24 @@
twilight: 0
type: Condition
keywords: Support Area
/*requires: {
}
effects: [
{
}
{
}
]*/
{
type: trigger
optional: true
trigger: {
type: losesInitiative
side: free people
}
requires: {
type: canSpot
filter: culture(shire),companion
count: 2
}
effect: {
type: removeBurdens
}
}
]
gametext: Each time you lose initiative, you may spot 2 [shire] companions to remove a burden.
lore: Far off, as in a little picture drawn by elven-fingers, he saw the Lady Galadriel standing on the grass in Lórien, and gifts were in her hands.
promotext: ""
@@ -258,20 +301,30 @@
Stealth
Maneuver
]
/*requires: {
}
*/
effects: {
type: event
cost: {
type: SendMessage
text: Placeholder effect for development.
type: returnToHand
filter: choose(culture(shire),companion)
},
effect: [
{
type: SendMessage
text: Placeholder effect for development.
type: choice
player: shadow
texts: [
Remove 2 twilight
Discard a minion
]
effects: [
{
type: removeTwilight
amount: 2
}
{
type: discard
filter: choose(minion)
}
]
}
]
}
@@ -308,20 +361,18 @@
twilight: 1
type: Event
keywords: Skirmish
/*requires: {
}
*/
effects: {
type: event
cost: {
type: SendMessage
text: Placeholder effect for development.
type: exert
filter: choose(hobbit)
memorize: exertedHobbit
},
effect: [
{
type: SendMessage
text: Placeholder effect for development.
type: modifyStrength
filter: choose(hobbit,not(memory(exertedHobbit)))
amount: 3
}
]
}
@@ -358,20 +409,28 @@
twilight: 0
type: Event
keywords: Regroup
/*requires: {
}
*/
effects: {
type: event
cost: {
type: SendMessage
text: Placeholder effect for development.
requires: {
type: canSpot
filter: hobbit,companion
count: 2
},
effect: [
{
type: SendMessage
text: Placeholder effect for development.
type: discard
player: shadow
filter: choose(minion)
count: {
type: condition
condition: {
type: canSpot
filter: hobbit,companion
count: 4
}
true: 2
false: 1
}
}
]
}
@@ -411,20 +470,28 @@
Tale
Skirmish
]
/*requires: {
}
*/
effects: {
type: event
cost: {
type: SendMessage
text: Placeholder effect for development.
},
type: exert
filter: choose(culture(shire),character)
}
effect: [
{
type: SendMessage
text: Placeholder effect for development.
type: choice
texts: [
Remove a burden
Remove 2 threats
]
effects: [
{
type: removeBurdens
}
{
type: removeThreats
amount: 2
}
]
}
]
}
@@ -461,18 +528,17 @@
twilight: 1
type: Possession
itemclass: Armor
#target: a Hobbit
/*requires: {
}
target: hobbit
effects: [
{
}
{
}
]*/
{
type: modifier
modifier: {
type: modifyStrength
filter: or(orc,urukHai),inSkirmishAgainst(bearer)
amount: -1
}
}
]
gametext: Bearer must be a Hobbit.<br>Each Orc and each Uruk-hai skirmishing bearer is strength -1.
lore: Well, there you are, Mr. Frodo. A perfect little orc, if I may make so bold....'
promotext: ""
@@ -506,17 +572,34 @@
twilight: 1
type: Condition
keywords: Support Area
/*requires: {
}
effects: [
{
}
{
}
]*/
{
type: toPlay
requires: {
type: canSpot
filter: culture(shire),companion
count: 2
}
}
{
type: trigger
optional: true
trigger: {
type: played
filter: minion
memorize: playedMinion
}
cost: {
type: exert
filter: choose(hobbit,companion)
}
effect: {
type: exert
filter: memory(playedMinion)
}
limitPerTurn: 1
}
]
gametext: To play, spot 2 [shire] companions.<br>Each time a minion is played, you may exert a Hobbit companion to exert that minion (limit once per turn).
lore: ...it saw a great silent shape, cloaked in a grey shadow, looming against the wavering light behind....
promotext: ""
@@ -553,20 +636,42 @@
Stealth
Skirmish
]
/*requires: {
}
*/
effects: {
type: event
cost: {
type: SendMessage
text: Placeholder effect for development.
requires: {
type: hasCardInDiscard
filter: culture(shire)
count: 6
},
effect: [
{
type: SendMessage
text: Placeholder effect for development.
type: conditional
requires: [
{
type: canSpot
filter: minion,not(fierce),inSkirmish
}
{
type: canSpot
filter: your,hobbit,inSkirmish
}
]
effect: [
{
type: memorizeActive
filter: minion,inSkirmish
memory: minionsInSkirmish
}
{
type: cancelSkirmish
}
{
type: addKeyword
filter: memory(minionsInSkirmish)
keyword: fierce
until: regroup
}
]
}
]
}
@@ -606,17 +711,38 @@
Tale
Support Area
]
/*requires: {
}
effects: [
{
}
{
}
]*/
{
type: activated
phase: skirmish
effect: [
{
type: chooseActiveCards
filter: choose(hobbit)
text: Choose a Hobbit
memorize: chosenHobbit
}
{
type: addModifier
modifier: {
type: cantBeOverwhelmed
requires: {
type: not
requires: {
type: playedCardThisPhase
filter: side(shadow),event
}
}
filter: memory(chosenHobbit)
}
}
{
type: discard
filter: self
}
]
}
]
gametext: <b>Tale</b>.<br><b>Skirmish:</b> Prevent a Hobbit from being overwhelmed unless a Shadow event is (or was) played during this skirmish. Discard this condition.
lore: I have quite finished, Sam,' said Frodo. 'The last pages are for you.'
promotext: ""
@@ -646,7 +772,6 @@
title: Frodo
subtitle: Resolute Hobbit
unique: true
side: Free Peoples
culture: Shire
twilight: 0
type: Companion
@@ -655,17 +780,6 @@
vitality: 4
signet: Frodo
resistance: 12
/*requires: {
}
effects: [
{
}
{
}
]*/
gametext: <b>Ring-bearer (resistance 12).</b>
lore: ...if it's the only way, we must take it.'
promotext: ""
@@ -705,17 +819,30 @@
signet: Gandalf
resistance: 5
keywords: Ring-bound
/*requires: {
}
effects: [
{
type: modifier
modifier: {
type: modifyStrength
filter: self
amount: {
type: forEachYouCanSpot
filter: culture(shire),companion
}
}
}
{
type: trigger
optional: true
trigger: {
type: killed
filter: name(Frodo),ring bearer
}
effect: {
type: makeSelfRingBearer
}
}
{
}
]*/
]
gametext: <b>Ring-bound</b>.<br>Sam is strength +1 for each [shire] companion you can spot.<br><b>Response:</b> If Frodo dies, make Sam the <b>Ring-bearer (resistance 5)</b>.
lore: ...I'd say there's a large warrior on the loose, Elf most likely, with an elf-sword anyway....'
promotext: ""

View File

@@ -1,16 +0,0 @@
{
10_121: {
title: Frodo
subtitle: Resolute Hobbit
unique: true
culture: shire
twilight: 0
type: companion
race: hobbit
strength: 3
vitality: 4
resistance: 12
signet: frodo
keyword: can start with ring
}
}

View File

@@ -88,6 +88,7 @@ public class EffectAppenderFactory {
effectAppenderProducers.put("makeselfringbearer", new MakeSelfRingBearer());
effectAppenderProducers.put("memorize", new MemorizeActive());
effectAppenderProducers.put("memorizeactive", new MemorizeActive());
effectAppenderProducers.put("memorizediscard", new MemorizeDiscard());
effectAppenderProducers.put("memorizenumber", new MemorizeNumber());
effectAppenderProducers.put("memorizestacked", new MemorizeStacked());
effectAppenderProducers.put("memorizevalue", new MemorizeValue());

View File

@@ -4,6 +4,7 @@ import com.gempukku.lotro.cards.build.*;
import com.gempukku.lotro.cards.build.field.FieldUtils;
import com.gempukku.lotro.cards.build.field.effect.EffectAppender;
import com.gempukku.lotro.cards.build.field.effect.EffectAppenderProducer;
import com.gempukku.lotro.cards.build.field.effect.appender.resolver.PlayerResolver;
import com.gempukku.lotro.cards.build.field.effect.appender.resolver.ValueResolver;
import com.gempukku.lotro.filters.Filters;
import com.gempukku.lotro.game.PhysicalCard;
@@ -20,20 +21,23 @@ import java.util.Collection;
public class ChooseArbitraryCards implements EffectAppenderProducer {
@Override
public EffectAppender createEffectAppender(JSONObject effectObject, CardGenerationEnvironment environment) throws InvalidCardDefinitionException {
FieldUtils.validateAllowedFields(effectObject, "fromMemory", "count", "filter", "memorize", "text");
FieldUtils.validateAllowedFields(effectObject, "fromMemory", "count", "filter", "memorize", "text", "player");
final String fromMemory = FieldUtils.getString(effectObject.get("fromMemory"), "fromMemory");
if (fromMemory == null)
throw new InvalidCardDefinitionException("You need to define fromMemory to display arbitrary cards");
final ValueSource valueSource = ValueResolver.resolveEvaluator(effectObject.get("count"), 1, environment);
final String filter = FieldUtils.getString(effectObject.get("filter"), "filter", "choose(any)");
final String filter = FieldUtils.getString(effectObject.get("filter"), "filter", "any");
final String memorize = FieldUtils.getString(effectObject.get("memorize"), "memorize");
if (memorize == null)
throw new InvalidCardDefinitionException("You need to define what memory to use to store chosen cards");
final String text = FieldUtils.getString(effectObject.get("text"), "text");
if (text == null)
throw new InvalidCardDefinitionException("You need to define text to show");
final String player = FieldUtils.getString(effectObject.get("player"), "player", "you");
FilterableSource filterableSource = environment.getFilterFactory().generateFilter(filter, environment);
final PlayerSource playerSource = PlayerResolver.resolvePlayer(player, environment);
return new DelayedAppender() {
@Override
@@ -44,7 +48,9 @@ public class ChooseArbitraryCards implements EffectAppenderProducer {
int minimum = Math.min(selectableCards.size(), valueSource.getMinimum(actionContext));
int maximum = Math.min(selectableCards.size(), valueSource.getMaximum(actionContext));
return new PlayoutDecisionEffect(actionContext.getPerformingPlayer(),
String choosingPlayer = playerSource.getPlayer(actionContext);
return new PlayoutDecisionEffect(choosingPlayer,
new ArbitraryCardsSelectionDecision(1, GameUtils.SubstituteText(text, actionContext),
cards, selectableCards, minimum, maximum) {
@Override

View File

@@ -0,0 +1,62 @@
package com.gempukku.lotro.cards.build.field.effect.appender;
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.cards.build.field.effect.EffectAppender;
import com.gempukku.lotro.cards.build.field.effect.EffectAppenderProducer;
import com.gempukku.lotro.common.Filterable;
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.CostToEffectAction;
import com.gempukku.lotro.logic.timing.Effect;
import com.gempukku.lotro.logic.timing.UnrespondableEffect;
import org.json.simple.JSONObject;
import java.util.Collection;
import java.util.HashMap;
import java.util.Map;
public class MemorizeDiscard implements EffectAppenderProducer {
@Override
public EffectAppender createEffectAppender(JSONObject effectObject, CardGenerationEnvironment environment) throws InvalidCardDefinitionException {
FieldUtils.validateAllowedFields(effectObject, "filter", "memory", "uniqueTitles");
final String filter = FieldUtils.getString(effectObject.get("filter"), "filter");
final String memory = FieldUtils.getString(effectObject.get("memory"), "memory");
final boolean uniqueTitles = FieldUtils.getBoolean(effectObject.get("uniqueTitles"), "uniqueTitles", false);
if (memory == null)
throw new InvalidCardDefinitionException("Memory is required for a Memorize effect.");
final FilterableSource filterSource = environment.getFilterFactory().generateFilter(filter, environment);
return new DelayedAppender() {
@Override
protected Effect createEffect(boolean cost, CostToEffectAction action, ActionContext actionContext) {
return new UnrespondableEffect() {
@Override
protected void doPlayEffect(LotroGame game) {
final Filterable filterable = filterSource.getFilterable(actionContext);
Collection<? extends PhysicalCard> discard = game.getGameState().getDiscard(actionContext.getPerformingPlayer());
if (uniqueTitles) {
discard = filterUniqueTitles(discard);
}
final Collection<PhysicalCard> physicalCards = Filters.filter(discard, game, filterable);
actionContext.setCardMemory(memory, physicalCards);
}
};
}
};
}
private Collection<PhysicalCard> filterUniqueTitles(Collection<? extends PhysicalCard> cards) {
Map<String, PhysicalCard> nameMap = new HashMap<>();
for (PhysicalCard card : cards)
nameMap.put(card.getBlueprint().getTitle(), card);
return nameMap.values();
}
}

View File

@@ -0,0 +1,30 @@
package com.gempukku.lotro.cards.build.field.effect.modifier;
import com.gempukku.lotro.cards.build.*;
import com.gempukku.lotro.cards.build.field.FieldUtils;
import com.gempukku.lotro.common.Filterable;
import com.gempukku.lotro.logic.modifiers.CantBeOverwhelmedModifier;
import com.gempukku.lotro.logic.modifiers.Modifier;
import org.json.simple.JSONObject;
public class CantBeOverwhelmed implements ModifierSourceProducer {
@Override
public ModifierSource getModifierSource(JSONObject object, CardGenerationEnvironment environment) throws InvalidCardDefinitionException {
FieldUtils.validateAllowedFields(object, "filter", "requires");
final String filter = FieldUtils.getString(object.get("filter"), "filter");
final JSONObject[] conditionArray = FieldUtils.getObjectArray(object.get("requires"), "requires");
final FilterableSource filterableSource = environment.getFilterFactory().generateFilter(filter, environment);
final Requirement[] requirements = environment.getRequirementFactory().getRequirements(conditionArray, environment);
return new ModifierSource() {
@Override
public Modifier getModifier(ActionContext actionContext) {
final Filterable filterable = filterableSource.getFilterable(actionContext);
return new CantBeOverwhelmedModifier(actionContext.getSource(), filterable,
new RequirementCondition(requirements, actionContext));
}
};
}
}

View File

@@ -33,6 +33,7 @@ public class ModifierSourceFactory {
modifierProducers.put("cantbeassignedtoskirmishagainst", new CantBeAssignedToSkirmishAgainst());
modifierProducers.put("cantbediscarded", new CantBeDiscarded());
modifierProducers.put("cantbeexerted", new CantBeExerted());
modifierProducers.put("cantbeoverwhelmed", new CantBeOverwhelmed());
modifierProducers.put("cantbeoverwhelmedmultiplier", new CantBeOverwhelmedMultiplier());
modifierProducers.put("cantbetransferred", new CantBeTransferred());
modifierProducers.put("cantcancelskirmish", new CantCancelSkirmish());