Some FotR cards

This commit is contained in:
marcin.sciesinski
2019-09-13 15:03:04 -07:00
parent 3a8b58370c
commit 0c5eede8de
3 changed files with 189 additions and 140 deletions

View File

@@ -0,0 +1,167 @@
{
"1_29": {
"title": "Ancient Enmity",
"culture": "elven",
"cost": 0,
"type": "event",
"keyword": "skirmish",
"effects": {
"type": "event",
"effect": [
{
"type": "modifyStrength",
"filter": "choose(elf)",
"amount": 1,
"memorize": "chosenElf"
},
{
"type": "addTrigger",
"trigger": {
"type": "losesSkirmish",
"filter": "minion",
"against": "memory(chosenElf)",
"memorize": "losingMinion"
},
"effect": {
"type": "discardCardAtRandomFromHand",
"player": "ownerFromMemory(losingMinion)",
"count": 2,
"forced": true
}
}
]
}
},
"1_30": {
"title": "*Arwen",
"subtitle": "Daughter of Elrond",
"culture": "elven",
"cost": 2,
"type": "companion",
"race": "elf",
"strength": 6,
"vitality": 3,
"resistance": 6,
"signet": "aragorn",
"keyword": "ranger",
"effects": {
"type": "modifier",
"modifier": {
"type": "modifyStrength",
"amount": 3,
"filter": "self,inSkirmishAgainst(nazgul)"
}
}
},
"1_38": {
"title": "Double Shot",
"culture": "elven",
"cost": 0,
"type": "event",
"keyword": "archery",
"condition": {
"type": "canSpot",
"filter": "elf,archer,companion"
},
"effects": {
"type": "event",
"effect": {
"type": "modifyArcheryTotal",
"side": "free people",
"amount": 1
}
}
},
"1_48": {
"title": "*Haldir",
"subtitle": "Elf of the Golden Wood",
"culture": "elven",
"cost": 2,
"type": "companion",
"race": "elf",
"strength": 5,
"vitality": 3,
"resistance": 6,
"condition": {
"type": "canSpot",
"filter": "elf"
},
"effects": {
"type": "modifier",
"modifier": {
"type": "modifyStrength",
"amount": 2,
"condition": {
"type": "location",
"filter": "siteBlock(fellowship),or(siteNumber(6),siteNumber(7),siteNumber(8))"
}
}
}
},
"1_50": {
"title": "*Legolas",
"subtitle": "Greenleaf",
"culture": "elven",
"cost": 2,
"type": "companion",
"race": "elf",
"strength": 6,
"vitality": 3,
"resistance": 6,
"signet": "frodo",
"keyword": "archer",
"effects": {
"type": "activated",
"phase": "archery",
"cost": {
"type": "exert",
"filter": "self"
},
"effect": [
{
"type": "wound",
"filter": "choose(minion)"
},
{
"type": "doesNotAddToArcheryTotal",
"filter": "self"
}
]
}
},
"1_51": {
"title": "*Legolas",
"subtitle": "Prince of Mirkwood",
"culture": "elven",
"cost": 2,
"type": "companion",
"race": "elf",
"strength": 6,
"vitality": 3,
"resistance": 6,
"signet": "gandalf",
"keyword": "archer",
"effects": {
"type": "modifier",
"modifier": {
"type": "modifyStrength",
"filter": "self,inSkirmishAgainst(nazgul)",
"amount": 3
}
}
},
"1_53": {
"title": "Lorien Elf",
"culture": "elven",
"cost": 1,
"type": "companion",
"race": "elf",
"strength": 4,
"vitality": 2,
"resistance": 6,
"condition": {
"type": "canSpot",
"filter": "elf"
}
}
}

View File

@@ -1,136 +1,4 @@
{
"1_30": {
"title": "*Arwen",
"subtitle": "Daughter of Elrond",
"culture": "elven",
"cost": 2,
"type": "companion",
"race": "elf",
"strength": 6,
"vitality": 3,
"resistance": 6,
"signet": "aragorn",
"keyword": "ranger",
"effects": {
"type": "modifier",
"modifier": {
"type": "modifyStrength",
"amount": 3,
"filter": "self,inSkirmishAgainst(nazgul)"
}
}
},
"1_38": {
"title": "Double Shot",
"culture": "elven",
"cost": 0,
"type": "event",
"keyword": "archery",
"condition": {
"type": "canSpot",
"filter": "elf,archer,companion"
},
"effects": {
"type": "event",
"effect": {
"type": "modifyArcheryTotal",
"side": "free people",
"amount": 1
}
}
},
"1_48": {
"title": "*Haldir",
"subtitle": "Elf of the Golden Wood",
"culture": "elven",
"cost": 2,
"type": "companion",
"race": "elf",
"strength": 5,
"vitality": 3,
"resistance": 6,
"condition": {
"type": "canSpot",
"filter": "elf"
},
"effects": {
"type": "modifier",
"modifier": {
"type": "modifyStrength",
"amount": 2,
"condition": {
"type": "location",
"filter": "siteBlock(fellowship),or(siteNumber(6),siteNumber(7),siteNumber(8))"
}
}
}
},
"1_50": {
"title": "*Legolas",
"subtitle": "Greenleaf",
"culture": "elven",
"cost": 2,
"type": "companion",
"race": "elf",
"strength": 6,
"vitality": 3,
"resistance": 6,
"signet": "frodo",
"keyword": "archer",
"effects": {
"type": "activated",
"phase": "archery",
"cost": {
"type": "exert",
"filter": "self"
},
"effect": [
{
"type": "wound",
"filter": "choose(minion)"
},
{
"type": "doesNotAddToArcheryTotal",
"filter": "self"
}
]
}
},
"1_51": {
"title": "*Legolas",
"subtitle": "Prince of Mirkwood",
"culture": "elven",
"cost": 2,
"type": "companion",
"race": "elf",
"strength": 6,
"vitality": 3,
"resistance": 6,
"signet": "gandalf",
"keyword": "archer",
"effects": {
"type": "modifier",
"modifier": {
"type": "modifyStrength",
"filter": "self,inSkirmishAgainst(nazgul)",
"amount": 3
}
}
},
"1_53": {
"title": "Lorien Elf",
"culture": "elven",
"cost": 1,
"type": "companion",
"race": "elf",
"strength": 4,
"vitality": 2,
"resistance": 6,
"condition": {
"type": "canSpot",
"filter": "elf"
}
},
"1_94": {
"title": "Athelas",
"culture": "gondor",

View File

@@ -1,35 +1,49 @@
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.*;
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.game.state.LotroGame;
import com.gempukku.lotro.logic.actions.CostToEffectAction;
import com.gempukku.lotro.logic.effects.DiscardCardAtRandomFromHandEffect;
import com.gempukku.lotro.logic.timing.Effect;
import org.json.simple.JSONObject;
import java.util.LinkedList;
import java.util.List;
public class DiscardCardAtRandomFromHand implements EffectAppenderProducer {
@Override
public EffectAppender createEffectAppender(JSONObject effectObject, CardGenerationEnvironment environment) throws InvalidCardDefinitionException {
FieldUtils.validateAllowedFields(effectObject, "forced");
FieldUtils.validateAllowedFields(effectObject, "player", "count", "forced");
final String player = FieldUtils.getString(effectObject.get("player"), "player", "you");
final PlayerSource playerSource = PlayerResolver.resolvePlayer(player, environment);
final ValueSource countSource = ValueResolver.resolveEvaluator(effectObject.get("count"), 1, environment);
final boolean forced = FieldUtils.getBoolean(effectObject.get("forced"), "forced");
return new DelayedAppender() {
@Override
protected Effect createEffect(boolean cost, CostToEffectAction action, ActionContext actionContext) {
return new DiscardCardAtRandomFromHandEffect(actionContext.getSource(), actionContext.getPerformingPlayer(), forced);
protected List<Effect> createEffects(boolean cost, CostToEffectAction action, ActionContext actionContext) {
final String playerId = playerSource.getPlayer(actionContext);
final int count = countSource.getEvaluator(actionContext).evaluateExpression(actionContext.getGame(), null);
List<Effect> result = new LinkedList<>();
for (int i = 0; i < count; i++)
result.add(new DiscardCardAtRandomFromHandEffect(actionContext.getSource(), playerId, forced));
return result;
}
@Override
public boolean isPlayableInFull(ActionContext actionContext) {
final LotroGame game = actionContext.getGame();
final String playerId = actionContext.getPerformingPlayer();
return game.getGameState().getHand(playerId).size() >= 1
final String playerId = playerSource.getPlayer(actionContext);
final int count = countSource.getEvaluator(actionContext).evaluateExpression(game, null);
return game.getGameState().getHand(playerId).size() >= count
&& (!forced || game.getModifiersQuerying().canDiscardCardsFromHand(game, playerId, actionContext.getSource()));
}
};