Merge local branch
This commit is contained in:
@@ -241,6 +241,54 @@
|
||||
}
|
||||
]
|
||||
},
|
||||
"31_7": {
|
||||
"title": "*The Arkenstone",
|
||||
"culture": "dwarven",
|
||||
"cost": 2,
|
||||
"type": "artifact",
|
||||
"keyword": "support area",
|
||||
"effects": [
|
||||
{
|
||||
"type": "activated",
|
||||
"phase": "fellowship",
|
||||
"cost": {
|
||||
"type": "addTwilight"
|
||||
},
|
||||
"effect": {
|
||||
"type": "putStackedCardsIntoHand",
|
||||
"filter": "choose(any)",
|
||||
"on": "self"
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "activated",
|
||||
"phase": "regroup",
|
||||
"cost": {
|
||||
"type": "exert",
|
||||
"filter": "choose(culture(dwarven),companion)"
|
||||
},
|
||||
"effect": {
|
||||
"type": "conditional",
|
||||
"condition": {
|
||||
"type": "perPhaseLimit",
|
||||
"limit": 1
|
||||
},
|
||||
"effect": [
|
||||
{
|
||||
"type": "incrementPerPhaseLimit",
|
||||
"limit": 1
|
||||
},
|
||||
{
|
||||
"type": "stackCardsFromDeck",
|
||||
"filter": "choose(culture(dwarven),event)",
|
||||
"where": "self",
|
||||
"shuffle": true
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"31_8": {
|
||||
"title": "*Elf Army",
|
||||
"culture": "elven",
|
||||
@@ -657,6 +705,29 @@
|
||||
]
|
||||
}
|
||||
},
|
||||
"31_39": {
|
||||
"title": "An Invisible Ring",
|
||||
"culture": "shire",
|
||||
"type": "event",
|
||||
"keyword": "skirmish",
|
||||
"cost": 1,
|
||||
"condition": {
|
||||
"type": "ringIsOn"
|
||||
},
|
||||
"effects": {
|
||||
"type": "event",
|
||||
"effect": [
|
||||
{
|
||||
"type": "wound",
|
||||
"filter": "all(minion,inSkirmishAgainst(ring bearer))"
|
||||
},
|
||||
{
|
||||
"type": "removefromthegame",
|
||||
"filter": "self"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"31_40": {
|
||||
"title": "Barrels",
|
||||
"culture": "shire",
|
||||
|
||||
@@ -1,82 +0,0 @@
|
||||
package com.gempukku.lotro.cards.set31.dwarven;
|
||||
|
||||
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.cardtype.AbstractPermanent;
|
||||
import com.gempukku.lotro.logic.effects.AddTwilightEffect;
|
||||
import com.gempukku.lotro.logic.effects.ChooseArbitraryCardsEffect;
|
||||
import com.gempukku.lotro.logic.effects.IncrementPhaseLimitEffect;
|
||||
import com.gempukku.lotro.logic.effects.PutCardFromStackedIntoHandEffect;
|
||||
import com.gempukku.lotro.logic.effects.choose.ChooseAndExertCharactersEffect;
|
||||
import com.gempukku.lotro.logic.effects.choose.ChooseCardsFromDeckEffect;
|
||||
import com.gempukku.lotro.logic.modifiers.Modifier;
|
||||
import com.gempukku.lotro.logic.modifiers.TwilightCostModifier;
|
||||
import com.gempukku.lotro.logic.timing.Action;
|
||||
import com.gempukku.lotro.logic.timing.PlayConditions;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Set: The Short Rest
|
||||
* Side: Free
|
||||
* Culture: Dwarven
|
||||
* Twilight Cost: 2
|
||||
* Type: Artifact • Support Area
|
||||
* Game Text: Fellowship: Add (1) to take a card stacked here into hand. Regroup: Exert a
|
||||
* [DWARVEN] companion to stack a [DWARVEN] event from your draw deck on The Arkenstone (limit
|
||||
* once per phase).
|
||||
*/
|
||||
public class Card31_007 extends AbstractPermanent {
|
||||
public Card31_007() {
|
||||
super(Side.FREE_PEOPLE, 2, CardType.ARTIFACT, Culture.DWARVEN, "The Arkenstone", null, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<? extends ActivateCardAction> getPhaseActionsInPlay(String playerId, LotroGame game, final PhysicalCard self) {
|
||||
if (PlayConditions.canUseFPCardDuringPhase(game, Phase.FELLOWSHIP, self)) {
|
||||
List<PhysicalCard> stackedCards = game.getGameState().getStackedCards(self);
|
||||
if (stackedCards.size() > 0) {
|
||||
final ActivateCardAction action = new ActivateCardAction(self);
|
||||
action.appendCost(
|
||||
new AddTwilightEffect(self, 1));
|
||||
action.appendEffect(
|
||||
new ChooseArbitraryCardsEffect(playerId, "Choose card", stackedCards, 1, 1) {
|
||||
@Override
|
||||
protected void cardsSelected(LotroGame game, Collection<PhysicalCard> selectedCards) {
|
||||
for (PhysicalCard selectedCard : selectedCards) {
|
||||
action.appendEffect(
|
||||
new PutCardFromStackedIntoHandEffect(selectedCard));
|
||||
}
|
||||
}
|
||||
});
|
||||
return Collections.singletonList(action);
|
||||
}
|
||||
}
|
||||
if (PlayConditions.canUseFPCardDuringPhase(game, Phase.REGROUP, self)
|
||||
&& PlayConditions.checkPhaseLimit(game, self, 1)) {
|
||||
final ActivateCardAction action = new ActivateCardAction(self);
|
||||
action.appendCost(
|
||||
new IncrementPhaseLimitEffect(self, 1));
|
||||
action.appendCost(
|
||||
new ChooseAndExertCharactersEffect(action, playerId, 1, 1, Race.DWARF));
|
||||
action.appendEffect(
|
||||
new ChooseCardsFromDeckEffect(playerId, 1, 1, CardType.EVENT, Culture.DWARVEN) {
|
||||
@Override
|
||||
protected void cardsSelected(LotroGame game, Collection<PhysicalCard> cards) {
|
||||
for (PhysicalCard card : cards) {
|
||||
game.getGameState().removeCardsFromZone(playerId, Collections.singleton(card));
|
||||
game.getGameState().stackCard(game, card, self);
|
||||
}
|
||||
}
|
||||
});
|
||||
return Collections.singletonList(action);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -1,43 +0,0 @@
|
||||
package com.gempukku.lotro.cards.set31.shire;
|
||||
|
||||
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.PlayEventAction;
|
||||
import com.gempukku.lotro.logic.cardtype.AbstractEvent;
|
||||
import com.gempukku.lotro.logic.effects.RemovePlayedEventFromGameEffect;
|
||||
import com.gempukku.lotro.logic.effects.WoundCharactersEffect;
|
||||
import com.gempukku.lotro.logic.timing.PlayConditions;
|
||||
|
||||
/**
|
||||
* Set: The Short Rest
|
||||
* Side: Free
|
||||
* Culture: Shire
|
||||
* Twilight Cost: 1
|
||||
* Type: Event • Skirmish
|
||||
* Game Text: If Bilbo wears The One Ring, wound each minion he is skirmishing. Then remove this
|
||||
* event from the game.
|
||||
*/
|
||||
public class Card31_039 extends AbstractEvent {
|
||||
public Card31_039() {
|
||||
super(Side.FREE_PEOPLE, 1, Culture.SHIRE, "An Invisible Ring", Phase.SKIRMISH);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean checkPlayRequirements(LotroGame game, PhysicalCard self) {
|
||||
return game.getGameState().isWearingRing();
|
||||
}
|
||||
|
||||
@Override
|
||||
public PlayEventAction getPlayEventCardAction(String playerId, LotroGame game, PhysicalCard self) {
|
||||
PlayEventAction action = new PlayEventAction(self);
|
||||
action.appendEffect(
|
||||
new WoundCharactersEffect(self, Filters.inSkirmishAgainst(Filters.name("Bilbo"))));
|
||||
action.appendEffect(
|
||||
new RemovePlayedEventFromGameEffect(action));
|
||||
return action;
|
||||
}
|
||||
}
|
||||
@@ -132,6 +132,7 @@ public class EffectAppenderFactory {
|
||||
effectAppenderProducers.put("shufflehandintodrawdeck", new ShuffleHandIntoDrawDeck());
|
||||
effectAppenderProducers.put("getcardsfromtopofdeck", new GetCardsFromTopOfDeck());
|
||||
effectAppenderProducers.put("removetext", new RemoveText());
|
||||
effectAppenderProducers.put("stackcardsfromdeck", new StackCardsFromDeck());
|
||||
}
|
||||
|
||||
public EffectAppender getEffectAppender(JSONObject effectObject, CardGenerationEnvironment environment) throws InvalidCardDefinitionException {
|
||||
|
||||
@@ -23,10 +23,11 @@ import java.util.List;
|
||||
public class PutCardsFromDeckIntoHand implements EffectAppenderProducer {
|
||||
@Override
|
||||
public EffectAppender createEffectAppender(JSONObject effectObject, CardGenerationEnvironment environment) throws InvalidCardDefinitionException {
|
||||
FieldUtils.validateAllowedFields(effectObject, "count", "filter");
|
||||
FieldUtils.validateAllowedFields(effectObject, "count", "filter", "shuffle");
|
||||
|
||||
final ValueSource valueSource = ValueResolver.resolveEvaluator(effectObject.get("count"), 1, environment);
|
||||
final String filter = FieldUtils.getString(effectObject.get("filter"), "filter", "choose(any)");
|
||||
final boolean shuffle = FieldUtils.getBoolean(effectObject.get("shuffle"), "shuffle", false);
|
||||
|
||||
MultiEffectAppender result = new MultiEffectAppender();
|
||||
|
||||
@@ -46,13 +47,14 @@ public class PutCardsFromDeckIntoHand implements EffectAppenderProducer {
|
||||
return result;
|
||||
}
|
||||
});
|
||||
result.addEffectAppender(
|
||||
new DelayedAppender() {
|
||||
@Override
|
||||
protected Effect createEffect(boolean cost, CostToEffectAction action, ActionContext actionContext) {
|
||||
return new ShuffleDeckEffect(actionContext.getPerformingPlayer());
|
||||
}
|
||||
});
|
||||
if (shuffle)
|
||||
result.addEffectAppender(
|
||||
new DelayedAppender() {
|
||||
@Override
|
||||
protected Effect createEffect(boolean cost, CostToEffectAction action, ActionContext actionContext) {
|
||||
return new ShuffleDeckEffect(actionContext.getPerformingPlayer());
|
||||
}
|
||||
});
|
||||
|
||||
return result;
|
||||
|
||||
|
||||
@@ -0,0 +1,69 @@
|
||||
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.InvalidCardDefinitionException;
|
||||
import com.gempukku.lotro.cards.build.ValueSource;
|
||||
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.CardResolver;
|
||||
import com.gempukku.lotro.cards.build.field.effect.appender.resolver.ValueResolver;
|
||||
import com.gempukku.lotro.game.PhysicalCard;
|
||||
import com.gempukku.lotro.logic.actions.CostToEffectAction;
|
||||
import com.gempukku.lotro.logic.effects.ShuffleDeckEffect;
|
||||
import com.gempukku.lotro.logic.effects.StackCardFromDeckEffect;
|
||||
import com.gempukku.lotro.logic.timing.Effect;
|
||||
import org.json.simple.JSONObject;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
|
||||
public class StackCardsFromDeck implements EffectAppenderProducer {
|
||||
@Override
|
||||
public EffectAppender createEffectAppender(JSONObject effectObject, CardGenerationEnvironment environment) throws InvalidCardDefinitionException {
|
||||
FieldUtils.validateAllowedFields(effectObject, "filter", "where", "count", "shuffle");
|
||||
|
||||
final String filter = FieldUtils.getString(effectObject.get("filter"), "filter", "choose(any)");
|
||||
final String where = FieldUtils.getString(effectObject.get("where"), "where");
|
||||
final ValueSource valueSource = ValueResolver.resolveEvaluator(effectObject.get("count"), 1, environment);
|
||||
final boolean shuffle = FieldUtils.getBoolean(effectObject.get("shuffle"), "shuffle", false);
|
||||
|
||||
MultiEffectAppender result = new MultiEffectAppender();
|
||||
|
||||
result.addEffectAppender(
|
||||
CardResolver.resolveCard(where, "_temp1", "you", "Choose card to stack on", environment));
|
||||
result.addEffectAppender(
|
||||
CardResolver.resolveCardsInDeck(filter, null, valueSource, "_temp2", "you", "Choose cards to stack", environment));
|
||||
result.addEffectAppender(
|
||||
new DelayedAppender() {
|
||||
@Override
|
||||
protected List<? extends Effect> createEffects(boolean cost, CostToEffectAction action, ActionContext actionContext) {
|
||||
final PhysicalCard card = actionContext.getCardFromMemory("_temp1");
|
||||
if (card != null) {
|
||||
final Collection<? extends PhysicalCard> cardsInDeck = actionContext.getCardsFromMemory("_temp2");
|
||||
|
||||
List<Effect> result = new LinkedList<>();
|
||||
for (PhysicalCard physicalCard : cardsInDeck) {
|
||||
result.add(new StackCardFromDeckEffect(physicalCard, card));
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
});
|
||||
if (shuffle)
|
||||
result.addEffectAppender(
|
||||
new DelayedAppender() {
|
||||
@Override
|
||||
protected Effect createEffect(boolean cost, CostToEffectAction action, ActionContext actionContext) {
|
||||
return new ShuffleDeckEffect(actionContext.getPerformingPlayer());
|
||||
}
|
||||
});
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
package com.gempukku.lotro.logic.effects;
|
||||
|
||||
import com.gempukku.lotro.common.Zone;
|
||||
import com.gempukku.lotro.game.PhysicalCard;
|
||||
import com.gempukku.lotro.game.state.LotroGame;
|
||||
import com.gempukku.lotro.logic.GameUtils;
|
||||
import com.gempukku.lotro.logic.timing.AbstractEffect;
|
||||
import com.gempukku.lotro.logic.timing.Effect;
|
||||
|
||||
import java.util.Collections;
|
||||
|
||||
public class StackCardFromDeckEffect extends AbstractEffect {
|
||||
private PhysicalCard _card;
|
||||
private PhysicalCard _stackOn;
|
||||
|
||||
public StackCardFromDeckEffect(PhysicalCard card, PhysicalCard stackOn) {
|
||||
_card = card;
|
||||
_stackOn = stackOn;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isPlayableInFull(LotroGame game) {
|
||||
return _card.getZone() == Zone.DECK && _stackOn.getZone().isInPlay();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getText(LotroGame game) {
|
||||
return "Stack " + GameUtils.getFullName(_card) + " from deck on " + GameUtils.getFullName(_stackOn);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Effect.Type getType() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected FullEffectResult playEffectReturningResult(LotroGame game) {
|
||||
if (isPlayableInFull(game)) {
|
||||
game.getGameState().sendMessage(_card.getOwner() + " stacks " + GameUtils.getCardLink(_card) + " from deck on " + GameUtils.getCardLink(_stackOn));
|
||||
game.getGameState().removeCardsFromZone(_card.getOwner(), Collections.singleton(_card));
|
||||
game.getGameState().stackCard(game, _card, _stackOn);
|
||||
return new FullEffectResult(true);
|
||||
}
|
||||
return new FullEffectResult(false);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user