Migrated sites in set 2 to hjson
This commit is contained in:
@@ -1,43 +0,0 @@
|
||||
package com.gempukku.lotro.cards.set2.site;
|
||||
|
||||
import com.gempukku.lotro.common.Phase;
|
||||
import com.gempukku.lotro.common.Race;
|
||||
import com.gempukku.lotro.common.SitesBlock;
|
||||
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.AbstractSite;
|
||||
import com.gempukku.lotro.logic.effects.choose.ChooseAndExertCharactersEffect;
|
||||
import com.gempukku.lotro.logic.effects.choose.ChooseAndPlayCardFromDeckEffect;
|
||||
import com.gempukku.lotro.logic.timing.PlayConditions;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Set: Mines of Moria
|
||||
* Type: Site
|
||||
* Site: 1
|
||||
* Game Text: Fellowship: Exert a Hobbit to play Bilbo from your draw deck.
|
||||
*/
|
||||
public class Card2_115 extends AbstractSite {
|
||||
public Card2_115() {
|
||||
super("Hobbiton Party Field", SitesBlock.FELLOWSHIP, 1, 0, Direction.LEFT);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<? extends ActivateCardAction> getPhaseActionsInPlay(String playerId, LotroGame game, PhysicalCard self) {
|
||||
if (PlayConditions.canUseSiteDuringPhase(game, Phase.FELLOWSHIP, self)
|
||||
&& PlayConditions.canExert(self, game, Race.HOBBIT)) {
|
||||
ActivateCardAction action = new ActivateCardAction(self);
|
||||
action.appendCost(
|
||||
new ChooseAndExertCharactersEffect(action, playerId, 1, 1, Race.HOBBIT));
|
||||
action.appendEffect(
|
||||
new ChooseAndPlayCardFromDeckEffect(playerId, Filters.name("Bilbo")));
|
||||
|
||||
return Collections.singletonList(action);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -1,43 +0,0 @@
|
||||
package com.gempukku.lotro.cards.set2.site;
|
||||
|
||||
import com.gempukku.lotro.common.Keyword;
|
||||
import com.gempukku.lotro.common.Phase;
|
||||
import com.gempukku.lotro.common.Race;
|
||||
import com.gempukku.lotro.common.SitesBlock;
|
||||
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.AbstractSite;
|
||||
import com.gempukku.lotro.logic.effects.PlaySiteEffect;
|
||||
import com.gempukku.lotro.logic.effects.choose.ChooseAndExertCharactersEffect;
|
||||
import com.gempukku.lotro.logic.timing.PlayConditions;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Set: Mines of Moria
|
||||
* Type: Site
|
||||
* Site: 1
|
||||
* Game Text: Forest. Fellowship: Exert a Hobbit to play your site 2 (replacing opponent's site if necessary).
|
||||
*/
|
||||
public class Card2_116 extends AbstractSite {
|
||||
public Card2_116() {
|
||||
super("Hobbiton Woods", SitesBlock.FELLOWSHIP, 1, 0, Direction.LEFT);
|
||||
addKeyword(Keyword.FOREST);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<? extends ActivateCardAction> getPhaseActionsInPlay(String playerId, LotroGame game, PhysicalCard self) {
|
||||
if (PlayConditions.canUseSiteDuringPhase(game, Phase.FELLOWSHIP, self)
|
||||
&& PlayConditions.canExert(self, game, Race.HOBBIT)) {
|
||||
ActivateCardAction action = new ActivateCardAction(self);
|
||||
action.appendCost(
|
||||
new ChooseAndExertCharactersEffect(action, playerId, 1, 1, Race.HOBBIT));
|
||||
action.appendEffect(
|
||||
new PlaySiteEffect(action, playerId, SitesBlock.FELLOWSHIP, 2));
|
||||
return Collections.singletonList(action);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -1,43 +0,0 @@
|
||||
package com.gempukku.lotro.cards.set2.site;
|
||||
|
||||
import com.gempukku.lotro.common.CardType;
|
||||
import com.gempukku.lotro.common.Culture;
|
||||
import com.gempukku.lotro.common.Phase;
|
||||
import com.gempukku.lotro.common.SitesBlock;
|
||||
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.AbstractSite;
|
||||
import com.gempukku.lotro.logic.effects.DrawCardsEffect;
|
||||
import com.gempukku.lotro.logic.effects.choose.ChooseAndPlayCardFromHandEffect;
|
||||
import com.gempukku.lotro.logic.timing.PlayConditions;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Set: Mines of Moria
|
||||
* Type: Site
|
||||
* Site: 1
|
||||
* Game Text: Fellowship: Play a [SHIRE] ally to draw a card.
|
||||
*/
|
||||
public class Card2_117 extends AbstractSite {
|
||||
public Card2_117() {
|
||||
super("Town Center", SitesBlock.FELLOWSHIP, 1, 0, Direction.LEFT);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<? extends ActivateCardAction> getPhaseActionsInPlay(String playerId, LotroGame game, PhysicalCard self) {
|
||||
if (PlayConditions.canUseSiteDuringPhase(game, Phase.FELLOWSHIP, self)
|
||||
&& Filters.filter(game.getGameState().getHand(playerId), game, Culture.SHIRE, CardType.ALLY, Filters.playable(game)).size() > 0) {
|
||||
ActivateCardAction action = new ActivateCardAction(self);
|
||||
action.appendCost(
|
||||
new ChooseAndPlayCardFromHandEffect(playerId, game, Filters.and(Culture.SHIRE, CardType.ALLY)));
|
||||
action.appendEffect(
|
||||
new DrawCardsEffect(action, playerId, 1));
|
||||
return Collections.singletonList(action);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -1,58 +0,0 @@
|
||||
package com.gempukku.lotro.cards.set2.site;
|
||||
|
||||
import com.gempukku.lotro.common.Culture;
|
||||
import com.gempukku.lotro.common.Keyword;
|
||||
import com.gempukku.lotro.common.Phase;
|
||||
import com.gempukku.lotro.common.SitesBlock;
|
||||
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.actions.RequiredTriggerAction;
|
||||
import com.gempukku.lotro.logic.cardtype.AbstractSite;
|
||||
import com.gempukku.lotro.logic.modifiers.Modifier;
|
||||
import com.gempukku.lotro.logic.modifiers.TwilightCostModifier;
|
||||
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: Mines of Moria
|
||||
* Twilight Cost: 4
|
||||
* Type: Site
|
||||
* Site: 4
|
||||
* Game Text: Underground. The twilight cost of the first [MORIA] archer played each Shadow phase is -2.
|
||||
*/
|
||||
public class Card2_118 extends AbstractSite {
|
||||
public Card2_118() {
|
||||
super("Great Chasm", SitesBlock.FELLOWSHIP, 4, 4, Direction.RIGHT);
|
||||
addKeyword(Keyword.UNDERGROUND);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<? extends Modifier> getInPlayModifiers(LotroGame game, final PhysicalCard self) {
|
||||
return Collections.singletonList(
|
||||
new TwilightCostModifier(self,
|
||||
Filters.and(
|
||||
Culture.MORIA,
|
||||
Keyword.ARCHER,
|
||||
new Filter() {
|
||||
@Override
|
||||
public boolean accepts(LotroGame game, PhysicalCard physicalCard) {
|
||||
return game.getGameState().getCurrentPhase() == Phase.SHADOW && game.getModifiersQuerying().getUntilEndOfPhaseLimitCounter(self, Phase.SHADOW).getUsedLimit() < 1;
|
||||
}
|
||||
}
|
||||
), -2));
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<RequiredTriggerAction> getRequiredAfterTriggers(LotroGame game, EffectResult effectResult, PhysicalCard self) {
|
||||
if (TriggerConditions.played(game, effectResult, Filters.and(Culture.MORIA, Keyword.ARCHER))
|
||||
&& PlayConditions.isPhase(game, Phase.SHADOW))
|
||||
game.getModifiersQuerying().getUntilEndOfPhaseLimitCounter(self, Phase.SHADOW).incrementToLimit(1, 1);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -1,33 +0,0 @@
|
||||
package com.gempukku.lotro.cards.set2.site;
|
||||
|
||||
import com.gempukku.lotro.common.Keyword;
|
||||
import com.gempukku.lotro.common.Race;
|
||||
import com.gempukku.lotro.common.SitesBlock;
|
||||
import com.gempukku.lotro.game.PhysicalCard;
|
||||
import com.gempukku.lotro.game.state.LotroGame;
|
||||
import com.gempukku.lotro.logic.cardtype.AbstractSite;
|
||||
import com.gempukku.lotro.logic.modifiers.Modifier;
|
||||
import com.gempukku.lotro.logic.modifiers.RemoveKeywordModifier;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Set: Mines of Moria
|
||||
* Twilight Cost: 3
|
||||
* Type: Site
|
||||
* Site: 4
|
||||
* Game Text: Plains. Uruk-hai are not roaming.
|
||||
*/
|
||||
public class Card2_119 extends AbstractSite {
|
||||
public Card2_119() {
|
||||
super("Hollin", SitesBlock.FELLOWSHIP, 4, 3, Direction.RIGHT);
|
||||
addKeyword(Keyword.PLAINS);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<? extends Modifier> getInPlayModifiers(LotroGame game, PhysicalCard self) {
|
||||
return Collections.singletonList(
|
||||
new RemoveKeywordModifier(self, Race.URUK_HAI, Keyword.ROAMING));
|
||||
}
|
||||
}
|
||||
@@ -1,48 +0,0 @@
|
||||
package com.gempukku.lotro.cards.set2.site;
|
||||
|
||||
import com.gempukku.lotro.common.SitesBlock;
|
||||
import com.gempukku.lotro.logic.cardtype.AbstractSite;
|
||||
import com.gempukku.lotro.logic.timing.TriggerConditions;
|
||||
import com.gempukku.lotro.common.CardType;
|
||||
import com.gempukku.lotro.common.Keyword;
|
||||
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.effects.ChooseAndHealCharactersEffect;
|
||||
import com.gempukku.lotro.logic.timing.EffectResult;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Set: Mines of Moria
|
||||
* Twilight Cost: 3
|
||||
* Type: Site
|
||||
* Site: 6
|
||||
* Game Text: River. Sanctuary. When the fellowship moves to Valley of the Silverlode, each Hobbit companion may heal.
|
||||
*/
|
||||
public class Card2_120 extends AbstractSite {
|
||||
public Card2_120() {
|
||||
super("Valley of the Silverlode", SitesBlock.FELLOWSHIP, 6, 3, Direction.LEFT);
|
||||
addKeyword(Keyword.RIVER);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<OptionalTriggerAction> getOptionalAfterTriggers(String playerId, LotroGame game, EffectResult effectResult, PhysicalCard self) {
|
||||
if (TriggerConditions.movesTo(game, effectResult, self)
|
||||
&& playerId.equals(game.getGameState().getCurrentPlayerId())) {
|
||||
Collection<PhysicalCard> hobbitCompanions = Filters.filterActive(game, Race.HOBBIT, CardType.COMPANION);
|
||||
if (hobbitCompanions.size() > 0) {
|
||||
OptionalTriggerAction action = new OptionalTriggerAction(self);
|
||||
action.appendEffect(
|
||||
new ChooseAndHealCharactersEffect(action, playerId, 0, hobbitCompanions.size(), Filters.in(hobbitCompanions)));
|
||||
return Collections.singletonList(action);
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,126 @@
|
||||
{
|
||||
2_115: {
|
||||
site: 1
|
||||
block: Fellowship
|
||||
title: Hobbiton Party Field
|
||||
type: site
|
||||
twilight: 0
|
||||
direction: left
|
||||
effects: {
|
||||
type: activated
|
||||
phase: fellowship
|
||||
cost: {
|
||||
type: exert
|
||||
filter: choose(hobbit)
|
||||
}
|
||||
effect: {
|
||||
type: playCardFromDrawDeck
|
||||
filter: choose(name(Bilbo))
|
||||
}
|
||||
}
|
||||
}
|
||||
2_116: {
|
||||
site: 1
|
||||
block: Fellowship
|
||||
title: Hobbiton Woods
|
||||
type: site
|
||||
keyword: Forest
|
||||
twilight: 0
|
||||
direction: left
|
||||
effects: {
|
||||
type: activated
|
||||
phase: fellowship
|
||||
cost: {
|
||||
type: exert
|
||||
filter: choose(hobbit)
|
||||
}
|
||||
effect: {
|
||||
type: playNextSite
|
||||
}
|
||||
}
|
||||
}
|
||||
2_117: {
|
||||
site: 1
|
||||
block: Fellowship
|
||||
title: Town Center
|
||||
type: site
|
||||
twilight: 0
|
||||
direction: left
|
||||
effects: {
|
||||
type: activated
|
||||
phase: fellowship
|
||||
cost: {
|
||||
type: play
|
||||
filter: choose(culture(shire),ally)
|
||||
}
|
||||
effect: {
|
||||
type: drawCards
|
||||
count: 1
|
||||
}
|
||||
}
|
||||
}
|
||||
2_118: {
|
||||
site: 4
|
||||
block: Fellowship
|
||||
title: Great Chasm
|
||||
type: site
|
||||
keyword: Underground
|
||||
twilight: 4
|
||||
direction: right
|
||||
effects: {
|
||||
type: modifier
|
||||
modifier: {
|
||||
type: modifyCost
|
||||
requires: {
|
||||
type: not
|
||||
requires: {
|
||||
type: playedCardThisPhase
|
||||
filter: culture(moria),archer
|
||||
}
|
||||
}
|
||||
filter: culture(moria),archer
|
||||
amount: -2
|
||||
}
|
||||
}
|
||||
}
|
||||
2_119: {
|
||||
site: 4
|
||||
block: Fellowship
|
||||
title: Hollin
|
||||
type: site
|
||||
keyword: Plains
|
||||
twilight: 3
|
||||
direction: right
|
||||
effects: {
|
||||
type: modifier
|
||||
modifier: {
|
||||
type: removeKeyword
|
||||
filter: urukHai
|
||||
keyword: roaming
|
||||
}
|
||||
}
|
||||
}
|
||||
2_120: {
|
||||
site: 6
|
||||
block: Fellowship
|
||||
title: Valley of the Silverlode
|
||||
type: site
|
||||
keyword: River
|
||||
twilight: 3
|
||||
direction: left
|
||||
effects: {
|
||||
type: trigger
|
||||
optional: true
|
||||
trigger: {
|
||||
type: movesTo
|
||||
filter: self
|
||||
}
|
||||
effect: {
|
||||
type: heal
|
||||
filter: choose(hobbit,companion)
|
||||
count: 1000
|
||||
}
|
||||
player: fp
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2,6 +2,7 @@ package com.gempukku.lotro.cards.build.field.effect;
|
||||
|
||||
import com.gempukku.lotro.cards.build.ActionContext;
|
||||
import com.gempukku.lotro.cards.build.ActionSource;
|
||||
import com.gempukku.lotro.cards.build.PlayerSource;
|
||||
import com.gempukku.lotro.cards.build.Requirement;
|
||||
import com.gempukku.lotro.logic.GameUtils;
|
||||
import com.gempukku.lotro.logic.actions.CostToEffectAction;
|
||||
@@ -15,9 +16,14 @@ public class DefaultActionSource implements ActionSource {
|
||||
private final List<EffectAppender> costs = new LinkedList<>();
|
||||
private final List<EffectAppender> effects = new LinkedList<>();
|
||||
|
||||
private PlayerSource playingPlayer;
|
||||
private boolean requiresRanger;
|
||||
private String text;
|
||||
|
||||
public void setPlayingPlayer(PlayerSource playingPlayer) {
|
||||
this.playingPlayer = playingPlayer;
|
||||
}
|
||||
|
||||
public void setRequiresRanger(boolean requiresRanger) {
|
||||
this.requiresRanger = requiresRanger;
|
||||
}
|
||||
@@ -45,6 +51,9 @@ public class DefaultActionSource implements ActionSource {
|
||||
|
||||
@Override
|
||||
public boolean isValid(ActionContext actionContext) {
|
||||
if (playingPlayer != null && !playingPlayer.getPlayer(actionContext).equals(actionContext.getPerformingPlayer()))
|
||||
return false;
|
||||
|
||||
for (Requirement requirement : requirements) {
|
||||
if (!requirement.accepts(actionContext))
|
||||
return false;
|
||||
|
||||
@@ -3,15 +3,17 @@ package com.gempukku.lotro.cards.build.field.effect;
|
||||
import com.gempukku.lotro.cards.build.BuiltLotroCardBlueprint;
|
||||
import com.gempukku.lotro.cards.build.CardGenerationEnvironment;
|
||||
import com.gempukku.lotro.cards.build.InvalidCardDefinitionException;
|
||||
import com.gempukku.lotro.cards.build.PlayerSource;
|
||||
import com.gempukku.lotro.cards.build.field.EffectProcessor;
|
||||
import com.gempukku.lotro.cards.build.field.FieldUtils;
|
||||
import com.gempukku.lotro.cards.build.field.effect.appender.resolver.PlayerResolver;
|
||||
import com.gempukku.lotro.cards.build.field.effect.trigger.TriggerChecker;
|
||||
import org.json.simple.JSONObject;
|
||||
|
||||
public class TriggerEffectProcessor implements EffectProcessor {
|
||||
@Override
|
||||
public void processEffect(JSONObject value, BuiltLotroCardBlueprint blueprint, CardGenerationEnvironment environment) throws InvalidCardDefinitionException {
|
||||
FieldUtils.validateAllowedFields(value, "trigger", "optional", "requires", "cost", "effect", "text");
|
||||
FieldUtils.validateAllowedFields(value, "trigger", "optional", "requires", "cost", "effect", "text", "player");
|
||||
|
||||
final String text = FieldUtils.getString(value.get("text"), "text", "");
|
||||
final JSONObject[] triggerArray = FieldUtils.getObjectArray(value.get("trigger"), "trigger");
|
||||
@@ -19,12 +21,18 @@ public class TriggerEffectProcessor implements EffectProcessor {
|
||||
throw new InvalidCardDefinitionException("Trigger effect without trigger definition");
|
||||
final boolean optional = FieldUtils.getBoolean(value.get("optional"), "optional", false);
|
||||
|
||||
final String player = FieldUtils.getString(value.get("player"), "player");
|
||||
PlayerSource playerSource = (player != null) ? PlayerResolver.resolvePlayer(player, environment) : null;
|
||||
|
||||
for (JSONObject trigger : triggerArray) {
|
||||
final TriggerChecker triggerChecker = environment.getTriggerCheckerFactory().getTriggerChecker(trigger, environment);
|
||||
final boolean before = triggerChecker.isBefore();
|
||||
|
||||
DefaultActionSource triggerActionSource = new DefaultActionSource();
|
||||
if(text != "") {
|
||||
if (playerSource != null) {
|
||||
triggerActionSource.setPlayingPlayer(playerSource);
|
||||
}
|
||||
if (!text.equals("")) {
|
||||
triggerActionSource.setText(text);
|
||||
}
|
||||
triggerActionSource.addPlayRequirement(triggerChecker);
|
||||
|
||||
Reference in New Issue
Block a user