Removed the "can_star_with_ring" keyword - replaced with proper flag
This commit is contained in:
@@ -5,7 +5,6 @@ import com.gempukku.lotro.async.HttpProcessingException;
|
||||
import com.gempukku.lotro.async.ResponseWriter;
|
||||
import com.gempukku.lotro.collection.CollectionsManager;
|
||||
import com.gempukku.lotro.common.CardType;
|
||||
import com.gempukku.lotro.common.Keyword;
|
||||
import com.gempukku.lotro.common.Side;
|
||||
import com.gempukku.lotro.db.vo.CollectionType;
|
||||
import com.gempukku.lotro.db.vo.League;
|
||||
@@ -19,7 +18,8 @@ import io.netty.handler.codec.http.HttpRequest;
|
||||
import io.netty.handler.codec.http.QueryStringDecoder;
|
||||
import io.netty.handler.codec.http.multipart.HttpPostRequestDecoder;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;import org.w3c.dom.Document;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.w3c.dom.Document;
|
||||
import org.w3c.dom.Element;
|
||||
|
||||
import javax.xml.parsers.DocumentBuilder;
|
||||
@@ -281,7 +281,7 @@ public class CollectionRequestHandler extends LotroServerRequestHandler implemen
|
||||
group = "site";
|
||||
else if (blueprint.getCardType() == CardType.MAP)
|
||||
group = "map";
|
||||
else if (blueprint.hasKeyword(Keyword.CAN_START_WITH_RING))
|
||||
else if (blueprint.canStartWithRing())
|
||||
group = "ringBearer";
|
||||
else if (blueprint.getSide() == Side.FREE_PEOPLE)
|
||||
group = "fp";
|
||||
|
||||
@@ -210,7 +210,7 @@ var GempLotrDeckBuildingUI = Class.extend({
|
||||
this.ringBearerDiv.click(
|
||||
function () {
|
||||
if ($(".card", that.ringBearerDiv).length == 0) {
|
||||
that.showPredefinedFilter("keyword:CAN_START_WITH_RING type:card", that.ringBearerDiv);
|
||||
that.showPredefinedFilter("canStartWithRing:true type:card", that.ringBearerDiv);
|
||||
}
|
||||
});
|
||||
this.ringBearerGroup = new NormalCardGroup(this.ringBearerDiv, function (card) {
|
||||
|
||||
@@ -187,7 +187,7 @@ var GempLotrDeckBuildingUI = Class.extend({
|
||||
this.ringBearerDiv.click(
|
||||
function () {
|
||||
if ($(".card", that.ringBearerDiv).length == 0) {
|
||||
that.showPredefinedFilter("keyword:CAN_START_WITH_RING type:card", that.ringBearerDiv);
|
||||
that.showPredefinedFilter("canStartWithRing:true type:card", that.ringBearerDiv);
|
||||
}
|
||||
});
|
||||
this.ringBearerGroup = new NormalFlexGroup(this.ringBearerDiv, function (card) {
|
||||
|
||||
@@ -279,7 +279,7 @@
|
||||
vitality: 4
|
||||
resistance: 10
|
||||
signet: gandalf
|
||||
keyword: can start with ring
|
||||
canStartWithRing: true
|
||||
effects: {
|
||||
type: modifier
|
||||
modifier: {
|
||||
|
||||
@@ -134,7 +134,7 @@
|
||||
vitality: 4
|
||||
resistance: 10
|
||||
signet: gandalf
|
||||
keyword: can start with ring
|
||||
canStartWithRing: true
|
||||
effects: {
|
||||
type: trigger
|
||||
optional: true
|
||||
@@ -159,7 +159,7 @@
|
||||
vitality: 4
|
||||
resistance: 10
|
||||
signet: frodo
|
||||
keyword: can start with ring
|
||||
canStartWithRing: true
|
||||
effects: {
|
||||
type: activated
|
||||
phase: fellowship
|
||||
|
||||
@@ -210,7 +210,7 @@
|
||||
title: Frodo
|
||||
unique: true
|
||||
type: companion
|
||||
keyword: can start with ring
|
||||
canStartWithRing: true
|
||||
twilight: 0
|
||||
resistance: 10
|
||||
effects: {
|
||||
|
||||
@@ -193,7 +193,7 @@
|
||||
vitality: 4
|
||||
signet: Frodo
|
||||
resistance: 10
|
||||
keyword: can start with ring
|
||||
canStartWithRing: true
|
||||
effects: [
|
||||
{
|
||||
type: modifier
|
||||
@@ -246,9 +246,9 @@
|
||||
vitality: 4
|
||||
signet: Gandalf
|
||||
resistance: 10
|
||||
canStartWithRing: true
|
||||
keywords: [
|
||||
Ring-bound
|
||||
can start with ring
|
||||
]
|
||||
effects: [
|
||||
{
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
vitality: 4
|
||||
signet: Aragorn
|
||||
resistance: 10
|
||||
keyword: can start with ring
|
||||
canStartWithRing: true
|
||||
effects: [
|
||||
{
|
||||
type: activated
|
||||
|
||||
@@ -27,9 +27,9 @@
|
||||
vitality: 4
|
||||
signet: Aragorn
|
||||
resistance: 10
|
||||
canStartWithRing: true
|
||||
keywords: [
|
||||
Ring-bound
|
||||
Can start with ring
|
||||
]
|
||||
effects: [
|
||||
{
|
||||
@@ -85,9 +85,9 @@
|
||||
vitality: 4
|
||||
signet: Gandalf
|
||||
resistance: 10
|
||||
canStartWithRing: true
|
||||
keywords: [
|
||||
Ring-bound
|
||||
Can start with ring
|
||||
]
|
||||
effects: [
|
||||
{
|
||||
|
||||
@@ -151,9 +151,9 @@
|
||||
strength: 6
|
||||
vitality: 3
|
||||
resistance: 4
|
||||
canStartWithRing: true
|
||||
keyword: [
|
||||
damage+1
|
||||
can_start_with_ring
|
||||
]
|
||||
effects: [
|
||||
{
|
||||
@@ -550,7 +550,7 @@
|
||||
strength: 3
|
||||
vitality: 3
|
||||
resistance: 3
|
||||
keyword: can start with ring
|
||||
canStartWithRing: true
|
||||
effects: {
|
||||
type: modifier
|
||||
modifier: {
|
||||
|
||||
@@ -137,9 +137,9 @@
|
||||
strength: 3
|
||||
vitality: 4
|
||||
resistance: 7
|
||||
canStartWithRing: true
|
||||
keyword: [
|
||||
ring-bound
|
||||
can start with ring
|
||||
]
|
||||
effects: [
|
||||
{
|
||||
@@ -187,7 +187,7 @@
|
||||
strength: 7
|
||||
vitality: 3
|
||||
resistance: 6
|
||||
keyword: can start with ring
|
||||
canStartWithRing: true
|
||||
effects: [
|
||||
{
|
||||
type: trigger
|
||||
@@ -292,7 +292,7 @@
|
||||
strength: 7
|
||||
vitality: 3
|
||||
resistance: 6
|
||||
keyword: can start with ring
|
||||
canStartWithRing: true
|
||||
effects: [
|
||||
{
|
||||
type: trigger
|
||||
@@ -996,8 +996,8 @@
|
||||
strength: 3
|
||||
vitality: 4
|
||||
resistance: 8
|
||||
canStartWithRing: true
|
||||
keyword: [
|
||||
can start with ring
|
||||
ring-bound
|
||||
]
|
||||
effects: [
|
||||
|
||||
@@ -780,7 +780,7 @@
|
||||
vitality: 4
|
||||
signet: Frodo
|
||||
resistance: 12
|
||||
keywords: Can start with ring
|
||||
canStartWithRing: true
|
||||
gametext: <b>Ring-bearer (resistance 12).</b>
|
||||
lore: ...if it's the only way, we must take it.'
|
||||
promotext: ""
|
||||
|
||||
@@ -180,9 +180,9 @@
|
||||
strength: 3
|
||||
vitality: 4
|
||||
resistance: 10
|
||||
canStartWithRing: true
|
||||
keywords: [
|
||||
Ring-Bound
|
||||
Can Start With Ring
|
||||
]
|
||||
effects: [
|
||||
{
|
||||
|
||||
@@ -331,7 +331,7 @@
|
||||
strength: 7
|
||||
vitality: 4
|
||||
resistance: 5
|
||||
keywords: CAN_START_WITH_RING
|
||||
canStartWithRing: true
|
||||
effects: [
|
||||
{
|
||||
type: trigger
|
||||
|
||||
@@ -991,9 +991,9 @@
|
||||
strength: 3
|
||||
vitality: 4
|
||||
resistance: 5
|
||||
canStartWithRing: true
|
||||
keywords: [
|
||||
Ring-bound
|
||||
CAN_START_WITH_RING
|
||||
]
|
||||
effects: [
|
||||
{
|
||||
|
||||
@@ -74,9 +74,9 @@
|
||||
strength: 3
|
||||
vitality: 4
|
||||
resistance: 10
|
||||
canStartWithRing: true
|
||||
keywords: [
|
||||
Ring-bound
|
||||
CAN_START_WITH_RING
|
||||
]
|
||||
effects: [
|
||||
{
|
||||
|
||||
@@ -102,7 +102,7 @@
|
||||
strength: 7
|
||||
vitality: 3
|
||||
resistance: 6
|
||||
keywords: CAN_START_WITH_RING
|
||||
canStartWithRing: true
|
||||
effects: [
|
||||
{
|
||||
type: trigger
|
||||
|
||||
@@ -1087,9 +1087,9 @@
|
||||
strength: 3
|
||||
vitality: 4
|
||||
resistance: 10
|
||||
canStartWithRing: true
|
||||
keyword: [
|
||||
fellowship
|
||||
can start with ring
|
||||
]
|
||||
effects: {
|
||||
type: modifier
|
||||
|
||||
@@ -1069,9 +1069,9 @@
|
||||
strength: 3
|
||||
vitality: 4
|
||||
resistance: 8
|
||||
canStartWithRing: true
|
||||
keyword: [
|
||||
burglar
|
||||
can start with ring
|
||||
]
|
||||
effects: [
|
||||
{
|
||||
@@ -1143,9 +1143,9 @@
|
||||
strength: 3
|
||||
vitality: 4
|
||||
resistance: 8
|
||||
canStartWithRing: true
|
||||
keyword: [
|
||||
burglar
|
||||
can start with ring
|
||||
]
|
||||
effects: [
|
||||
{
|
||||
@@ -1195,9 +1195,9 @@
|
||||
strength: 3
|
||||
vitality: 4
|
||||
resistance: 8
|
||||
canStartWithRing: true
|
||||
keyword: [
|
||||
burglar
|
||||
can start with ring
|
||||
]
|
||||
effects: [
|
||||
{
|
||||
@@ -1236,9 +1236,9 @@
|
||||
strength: 3
|
||||
vitality: 4
|
||||
resistance: 8
|
||||
canStartWithRing: true
|
||||
keyword: [
|
||||
burglar
|
||||
can start with ring
|
||||
]
|
||||
effects: [
|
||||
{
|
||||
|
||||
@@ -23,9 +23,9 @@
|
||||
strength: 6
|
||||
vitality: 3
|
||||
resistance: 5
|
||||
canStartWithRing: true
|
||||
keyword: [
|
||||
damage+1
|
||||
can_start_with_ring
|
||||
]
|
||||
effects: [
|
||||
{
|
||||
|
||||
@@ -97,7 +97,7 @@
|
||||
strength: 3
|
||||
vitality: 3
|
||||
resistance: 4
|
||||
keyword: can start with ring
|
||||
canStartWithRing: true
|
||||
effects: {
|
||||
type: modifier
|
||||
modifier: {
|
||||
|
||||
@@ -24,9 +24,9 @@
|
||||
strength: 3
|
||||
vitality: 4
|
||||
resistance: 8
|
||||
canStartWithRing: true
|
||||
keyword: [
|
||||
ring-bound
|
||||
can start with ring
|
||||
]
|
||||
effects: [
|
||||
{
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
strength: 7
|
||||
vitality: 3
|
||||
resistance: 7
|
||||
keyword: can start with ring
|
||||
canStartWithRing: true
|
||||
effects: [
|
||||
{
|
||||
type: trigger
|
||||
@@ -103,7 +103,7 @@
|
||||
strength: 7
|
||||
vitality: 3
|
||||
resistance: 7
|
||||
keyword: can start with ring
|
||||
canStartWithRing: true
|
||||
effects: [
|
||||
{
|
||||
type: trigger
|
||||
|
||||
@@ -24,8 +24,8 @@
|
||||
strength: 3
|
||||
vitality: 4
|
||||
resistance: 9
|
||||
canStartWithRing: true
|
||||
keyword: [
|
||||
can start with ring
|
||||
ring-bound
|
||||
]
|
||||
effects: [
|
||||
|
||||
@@ -151,7 +151,7 @@
|
||||
strength: 3
|
||||
vitality: 4
|
||||
resistance: 10
|
||||
keyword: can start with ring
|
||||
canStartWithRing: true
|
||||
effects: {
|
||||
type: trigger
|
||||
optional: true
|
||||
@@ -176,7 +176,7 @@
|
||||
strength: 3
|
||||
vitality: 4
|
||||
resistance: 10
|
||||
keyword: can start with ring
|
||||
canStartWithRing: true
|
||||
effects: {
|
||||
type: trigger
|
||||
optional: true
|
||||
|
||||
@@ -10,9 +10,6 @@ public enum Keyword implements Filterable {
|
||||
ASSIGNMENT("Assignment", false, false, false, false),
|
||||
REGROUP("Regroup", false, false, false, false),
|
||||
|
||||
// TODO: Fake keyword for purpose of marking cards that can start with ring - refactor out to separate flag
|
||||
CAN_START_WITH_RING("Can-bear-ring", false, false, false, false),
|
||||
|
||||
// TODO: not a real keyword - count be refactored out to separate systems
|
||||
ROAMING("Roaming", true, false, false, false),
|
||||
MOUNTED("Mounted", false, false, false, false),
|
||||
|
||||
@@ -24,6 +24,7 @@ public class BuiltLotroCardBlueprint implements LotroCardBlueprint {
|
||||
private String title;
|
||||
private String sanitizedTitle;
|
||||
private String subtitle;
|
||||
private boolean canStartWithRing;
|
||||
private boolean unique;
|
||||
private Side side;
|
||||
private CardType cardType;
|
||||
@@ -100,6 +101,10 @@ public class BuiltLotroCardBlueprint implements LotroCardBlueprint {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public void setCanStartWithRing(boolean canStartWithRing) {
|
||||
this.canStartWithRing = canStartWithRing;
|
||||
}
|
||||
|
||||
public void setDeckValidation(PreGameDeckValidation validation) {
|
||||
this.deckValidation = validation;
|
||||
}
|
||||
@@ -429,6 +434,11 @@ public class BuiltLotroCardBlueprint implements LotroCardBlueprint {
|
||||
return subtitle;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canStartWithRing() {
|
||||
return canStartWithRing;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Signet getSignet() {
|
||||
return signet;
|
||||
@@ -1110,7 +1120,7 @@ public class BuiltLotroCardBlueprint implements LotroCardBlueprint {
|
||||
throw new InvalidCardDefinitionException("Possession, condition or artifact without a filter needs a SUPPORT_AREA keyword");
|
||||
if (cardType == CardType.FOLLOWER && aidCostSource == null)
|
||||
throw new InvalidCardDefinitionException("Follower requires an aid cost");
|
||||
if (title.equals("Frodo") && (keywords == null || !keywords.containsKey(Keyword.CAN_START_WITH_RING)) && !frodosThatCantStartWithRing.contains(subtitle)) {
|
||||
if (title.equals("Frodo") && !canStartWithRing && !frodosThatCantStartWithRing.contains(subtitle)) {
|
||||
throw new InvalidCardDefinitionException("Frodo (except some permitted) must be able to start with ring");
|
||||
}
|
||||
if (title.equals("Frodo") && resistance != 10 && !frodosWithNon10Resistance.contains(subtitle)) {
|
||||
|
||||
@@ -44,6 +44,7 @@ public class LotroCardBlueprintBuilder implements CardGenerationEnvironment {
|
||||
fieldProcessors.put("direction", new DirectionFieldProcessor());
|
||||
fieldProcessors.put("target", new TargetFieldProcessor());
|
||||
fieldProcessors.put("effects", new EffectFieldProcessor());
|
||||
fieldProcessors.put("canstartwithring", new CanStartWithRing());
|
||||
|
||||
fieldProcessors.put("gametext", new GameTextFieldProcessor());
|
||||
fieldProcessors.put("lore", new LoreFieldProcessor());
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
package com.gempukku.lotro.cards.build.field;
|
||||
|
||||
import com.gempukku.lotro.cards.build.BuiltLotroCardBlueprint;
|
||||
import com.gempukku.lotro.cards.build.CardGenerationEnvironment;
|
||||
import com.gempukku.lotro.cards.build.FieldProcessor;
|
||||
import com.gempukku.lotro.cards.build.InvalidCardDefinitionException;
|
||||
|
||||
public class CanStartWithRing implements FieldProcessor {
|
||||
@Override
|
||||
public void processField(String key, Object value, BuiltLotroCardBlueprint blueprint, CardGenerationEnvironment environment) throws InvalidCardDefinitionException {
|
||||
boolean canStartWithRing = FieldUtils.getBoolean(value, key);
|
||||
blueprint.setCanStartWithRing(canStartWithRing);
|
||||
}
|
||||
}
|
||||
@@ -22,6 +22,8 @@ public interface LotroCardBlueprint {
|
||||
|
||||
String getId();
|
||||
|
||||
boolean canStartWithRing();
|
||||
|
||||
//This isn't ideal, but there's 2,000 java cards that already exist.
|
||||
// Adding the argument to their constructors would be a chore.
|
||||
void setId(String id);
|
||||
|
||||
@@ -181,7 +181,7 @@ public class PlayUtils {
|
||||
PhysicalCard ringBearer = game.getGameState().getRingBearer(game.getGameState().getCurrentPlayerId());
|
||||
boolean ringBearerIsNotFrodo = ringBearer != null && !ringBearer.getBlueprint().getTitle().equals("Frodo");
|
||||
if (ringBearerIsNotFrodo) {
|
||||
boolean isRingBearerFrodo = self.getBlueprint().getTitle().equals("Frodo") && self.getBlueprint().hasKeyword(Keyword.CAN_START_WITH_RING);
|
||||
boolean isRingBearerFrodo = self.getBlueprint().getTitle().equals("Frodo") && self.getBlueprint().canStartWithRing();
|
||||
return !isRingBearerFrodo;
|
||||
}
|
||||
return true;
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.gempukku.lotro.logic.timing.rules;
|
||||
|
||||
import com.gempukku.lotro.common.Keyword;
|
||||
import com.gempukku.lotro.filters.Filter;
|
||||
import com.gempukku.lotro.filters.Filters;
|
||||
import com.gempukku.lotro.logic.modifiers.AddKeywordModifier;
|
||||
import com.gempukku.lotro.logic.modifiers.CantPlayCardsModifier;
|
||||
@@ -17,7 +18,8 @@ public class RingRelatedRule {
|
||||
_modifiersLogic.addAlwaysOnModifier(
|
||||
new AddKeywordModifier(null, Filters.or(Filters.frodo, Filters.sam), null, Keyword.RING_BOUND));
|
||||
_modifiersLogic.addAlwaysOnModifier(
|
||||
new CantPlayCardsModifier(null, null, Filters.frodo, Keyword.CAN_START_WITH_RING));
|
||||
new CantPlayCardsModifier(null, null, Filters.frodo,
|
||||
(Filter) (game, physicalCard) -> physicalCard.getBlueprint().canStartWithRing()));
|
||||
_modifiersLogic.addAlwaysOnModifier(
|
||||
new AddKeywordModifier(null, Filters.ringBearer, null, Keyword.RING_BOUND));
|
||||
}
|
||||
|
||||
@@ -6,7 +6,6 @@ import com.gempukku.lotro.game.packs.SetDefinition;
|
||||
import com.gempukku.lotro.logic.GameUtils;
|
||||
import com.gempukku.util.MultipleComparator;
|
||||
|
||||
import java.text.Normalizer;
|
||||
import java.util.*;
|
||||
|
||||
public class SortAndFilterCards {
|
||||
@@ -20,6 +19,7 @@ public class SortAndFilterCards {
|
||||
String[] rarity = getRarityFilter(filterParams);
|
||||
String[] sets = getSetFilter(filterParams);
|
||||
List<String> words = getWords(filterParams);
|
||||
Boolean canStartWithRing = getBoolean(filterParams, false);
|
||||
Set<CardType> cardTypes = getEnumFilter(CardType.values(), CardType.class, "cardType", null, filterParams);
|
||||
Set<Culture> cultures = getEnumFilter(Culture.values(), Culture.class, "culture", null, filterParams);
|
||||
Set<Keyword> keywords = getEnumFilter(Keyword.values(), Keyword.class, "keyword", Collections.emptySet(), filterParams);
|
||||
@@ -34,12 +34,12 @@ public class SortAndFilterCards {
|
||||
for (T item : items) {
|
||||
String blueprintId = item.getBlueprintId();
|
||||
if (isPack(blueprintId)) {
|
||||
if (acceptsFilters(cardLibrary, cardBlueprintMap, formatLibrary, blueprintId, side, type, rarity, sets, cardTypes, cultures, keywords, words, siteNumber, races, itemClasses, phases))
|
||||
if (acceptsFilters(cardLibrary, cardBlueprintMap, formatLibrary, blueprintId, side, type, rarity, sets, cardTypes, cultures, keywords, words, canStartWithRing, siteNumber, races, itemClasses, phases))
|
||||
result.add(item);
|
||||
} else {
|
||||
try {
|
||||
cardBlueprintMap.put(blueprintId, cardLibrary.getLotroCardBlueprint(blueprintId));
|
||||
if (acceptsFilters(cardLibrary, cardBlueprintMap, formatLibrary, blueprintId, side, type, rarity, sets, cardTypes, cultures, keywords, words, siteNumber, races, itemClasses, phases))
|
||||
if (acceptsFilters(cardLibrary, cardBlueprintMap, formatLibrary, blueprintId, side, type, rarity, sets, cardTypes, cultures, keywords, words, canStartWithRing, siteNumber, races, itemClasses, phases))
|
||||
result.add(item);
|
||||
} catch (CardNotFoundException e) {
|
||||
// Ignore the card
|
||||
@@ -80,7 +80,7 @@ public class SortAndFilterCards {
|
||||
|
||||
private boolean acceptsFilters(
|
||||
LotroCardBlueprintLibrary library, Map<String, LotroCardBlueprint> cardBlueprint, LotroFormatLibrary formatLibrary, String blueprintId, Side side, String type, String[] rarity, String[] sets,
|
||||
Set<CardType> cardTypes, Set<Culture> cultures, Set<Keyword> keywords, List<String> words, Integer siteNumber, Set<Race> races, Set<PossessionClass> itemClasses, Set<Keyword> phases) {
|
||||
Set<CardType> cardTypes, Set<Culture> cultures, Set<Keyword> keywords, List<String> words, Boolean canStartWithRing, Integer siteNumber, Set<Race> races, Set<PossessionClass> itemClasses, Set<Keyword> phases) {
|
||||
if (isPack(blueprintId)) {
|
||||
if (type == null || type.equals("pack"))
|
||||
return true;
|
||||
@@ -98,11 +98,12 @@ public class SortAndFilterCards {
|
||||
if (cultures == null || cultures.contains(blueprint.getCulture()))
|
||||
if (containsAllKeywords(blueprint, keywords))
|
||||
if (containsAllWords(blueprint, words))
|
||||
if (siteNumber == null || blueprint.getSiteNumber() == siteNumber)
|
||||
if (races == null || races.contains(blueprint.getRace()))
|
||||
if (containsAllClasses(blueprint, itemClasses))
|
||||
if (containsAllKeywords(blueprint, phases))
|
||||
return true;
|
||||
if (canStartWithRing == null || blueprint.canStartWithRing() == canStartWithRing)
|
||||
if (siteNumber == null || blueprint.getSiteNumber() == siteNumber)
|
||||
if (races == null || races.contains(blueprint.getRace()))
|
||||
if (containsAllClasses(blueprint, itemClasses))
|
||||
if (containsAllKeywords(blueprint, phases))
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
@@ -220,6 +221,15 @@ public class SortAndFilterCards {
|
||||
return null;
|
||||
}
|
||||
|
||||
private Boolean getBoolean(String[] filterParams) {
|
||||
Boolean result = null;
|
||||
for (String filterParam : filterParams) {
|
||||
if (filterParam.startsWith("canStartWithRing:"))
|
||||
result = Boolean.parseBoolean(filterParam.substring("canStartWithRing:".length()));
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
private List<String> getWords(String[] filterParams) {
|
||||
List<String> result = new LinkedList<>();
|
||||
for (String filterParam : filterParams) {
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
package com.gempukku.lotro.game.formats;
|
||||
|
||||
import com.gempukku.lotro.common.*;
|
||||
import com.gempukku.lotro.common.CardType;
|
||||
import com.gempukku.lotro.common.JSONDefs;
|
||||
import com.gempukku.lotro.common.Side;
|
||||
import com.gempukku.lotro.common.SitesBlock;
|
||||
import com.gempukku.lotro.game.*;
|
||||
import com.gempukku.lotro.logic.GameUtils;
|
||||
import com.gempukku.lotro.logic.vo.LotroDeck;
|
||||
@@ -732,7 +735,7 @@ public class DefaultLotroFormat implements LotroFormat {
|
||||
return "Deck doesn't have a Ring-bearer";
|
||||
try{
|
||||
LotroCardBlueprint ringBearer = _library.getLotroCardBlueprint(rb);
|
||||
if (!ringBearer.hasKeyword(Keyword.CAN_START_WITH_RING))
|
||||
if (!ringBearer.canStartWithRing())
|
||||
return "Card assigned as Ring-bearer cannot bear the ring";
|
||||
}
|
||||
catch(CardNotFoundException exception)
|
||||
|
||||
@@ -3,13 +3,13 @@ package com.gempukku.lotro.cards.official.set09;
|
||||
import com.gempukku.lotro.cards.GenericCardTestHelper;
|
||||
import com.gempukku.lotro.common.*;
|
||||
import com.gempukku.lotro.game.CardNotFoundException;
|
||||
import com.gempukku.lotro.game.PhysicalCardImpl;
|
||||
import com.gempukku.lotro.logic.decisions.DecisionResultInvalidException;
|
||||
import org.junit.Test;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
public class Card_09_004_Tests
|
||||
{
|
||||
@@ -58,7 +58,7 @@ public class Card_09_004_Tests
|
||||
assertEquals(Race.DWARF, card.getBlueprint().getRace());
|
||||
assertTrue(scn.HasKeyword(card, Keyword.DAMAGE));
|
||||
assertEquals(1, scn.GetKeywordCount(card, Keyword.DAMAGE));
|
||||
assertTrue(scn.HasKeyword(card, Keyword.CAN_START_WITH_RING));
|
||||
assertTrue(card.getBlueprint().canStartWithRing());
|
||||
assertEquals(2, card.getBlueprint().getTwilightCost());
|
||||
assertEquals(6, card.getBlueprint().getStrength());
|
||||
assertEquals(3, card.getBlueprint().getVitality());
|
||||
|
||||
@@ -1,15 +1,18 @@
|
||||
package com.gempukku.lotro.cards.official.set09;
|
||||
|
||||
import com.gempukku.lotro.cards.GenericCardTestHelper;
|
||||
import com.gempukku.lotro.common.*;
|
||||
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.CardNotFoundException;
|
||||
import com.gempukku.lotro.game.PhysicalCardImpl;
|
||||
import com.gempukku.lotro.logic.decisions.DecisionResultInvalidException;
|
||||
import org.junit.Test;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
public class Card_09_014_Tests
|
||||
{
|
||||
@@ -56,7 +59,7 @@ public class Card_09_014_Tests
|
||||
assertEquals(Culture.ELVEN, card.getBlueprint().getCulture());
|
||||
assertEquals(CardType.COMPANION, card.getBlueprint().getCardType());
|
||||
assertEquals(Race.ELF, card.getBlueprint().getRace());
|
||||
assertTrue(scn.HasKeyword(card, Keyword.CAN_START_WITH_RING));
|
||||
assertTrue(card.getBlueprint().canStartWithRing());
|
||||
assertEquals(3, card.getBlueprint().getTwilightCost());
|
||||
assertEquals(3, card.getBlueprint().getStrength());
|
||||
assertEquals(3, card.getBlueprint().getVitality());
|
||||
|
||||
@@ -1,15 +1,18 @@
|
||||
package com.gempukku.lotro.cards.official.set09;
|
||||
|
||||
import com.gempukku.lotro.cards.GenericCardTestHelper;
|
||||
import com.gempukku.lotro.common.*;
|
||||
import com.gempukku.lotro.common.CardType;
|
||||
import com.gempukku.lotro.common.Culture;
|
||||
import com.gempukku.lotro.common.Keyword;
|
||||
import com.gempukku.lotro.common.Side;
|
||||
import com.gempukku.lotro.game.CardNotFoundException;
|
||||
import com.gempukku.lotro.game.PhysicalCardImpl;
|
||||
import com.gempukku.lotro.logic.decisions.DecisionResultInvalidException;
|
||||
import org.junit.Test;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
public class Card_09_030_Tests
|
||||
{
|
||||
@@ -56,7 +59,7 @@ public class Card_09_030_Tests
|
||||
assertEquals(Culture.GOLLUM, card.getBlueprint().getCulture());
|
||||
assertEquals(CardType.COMPANION, card.getBlueprint().getCardType());
|
||||
assertTrue(scn.HasKeyword(card, Keyword.RING_BOUND));
|
||||
assertTrue(scn.HasKeyword(card, Keyword.CAN_START_WITH_RING));
|
||||
assertTrue(card.getBlueprint().canStartWithRing());
|
||||
assertEquals(0, card.getBlueprint().getTwilightCost());
|
||||
assertEquals(3, card.getBlueprint().getStrength());
|
||||
assertEquals(4, card.getBlueprint().getVitality());
|
||||
|
||||
@@ -1,15 +1,18 @@
|
||||
package com.gempukku.lotro.cards.official.set09;
|
||||
|
||||
import com.gempukku.lotro.cards.GenericCardTestHelper;
|
||||
import com.gempukku.lotro.common.*;
|
||||
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.CardNotFoundException;
|
||||
import com.gempukku.lotro.game.PhysicalCardImpl;
|
||||
import com.gempukku.lotro.logic.decisions.DecisionResultInvalidException;
|
||||
import org.junit.Test;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
public class Card_09_031_Tests
|
||||
{
|
||||
@@ -56,7 +59,7 @@ public class Card_09_031_Tests
|
||||
assertEquals(Culture.GONDOR, card.getBlueprint().getCulture());
|
||||
assertEquals(CardType.COMPANION, card.getBlueprint().getCardType());
|
||||
assertEquals(Race.MAN, card.getBlueprint().getRace());
|
||||
assertTrue(scn.HasKeyword(card, Keyword.CAN_START_WITH_RING));
|
||||
assertTrue(card.getBlueprint().canStartWithRing());
|
||||
assertEquals(3, card.getBlueprint().getTwilightCost());
|
||||
assertEquals(7, card.getBlueprint().getStrength());
|
||||
assertEquals(3, card.getBlueprint().getVitality());
|
||||
|
||||
@@ -1,15 +1,18 @@
|
||||
package com.gempukku.lotro.cards.official.set09;
|
||||
|
||||
import com.gempukku.lotro.cards.GenericCardTestHelper;
|
||||
import com.gempukku.lotro.common.*;
|
||||
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.CardNotFoundException;
|
||||
import com.gempukku.lotro.game.PhysicalCardImpl;
|
||||
import com.gempukku.lotro.logic.decisions.DecisionResultInvalidException;
|
||||
import org.junit.Test;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
public class Card_09_033_Tests
|
||||
{
|
||||
@@ -56,7 +59,7 @@ public class Card_09_033_Tests
|
||||
assertEquals(Culture.GONDOR, card.getBlueprint().getCulture());
|
||||
assertEquals(CardType.COMPANION, card.getBlueprint().getCardType());
|
||||
assertEquals(Race.MAN, card.getBlueprint().getRace());
|
||||
assertTrue(scn.HasKeyword(card, Keyword.CAN_START_WITH_RING));
|
||||
assertTrue(card.getBlueprint().canStartWithRing());
|
||||
assertEquals(3, card.getBlueprint().getTwilightCost());
|
||||
assertEquals(7, card.getBlueprint().getStrength());
|
||||
assertEquals(3, card.getBlueprint().getVitality());
|
||||
|
||||
@@ -3,13 +3,13 @@ package com.gempukku.lotro.cards.official.set09;
|
||||
import com.gempukku.lotro.cards.GenericCardTestHelper;
|
||||
import com.gempukku.lotro.common.*;
|
||||
import com.gempukku.lotro.game.CardNotFoundException;
|
||||
import com.gempukku.lotro.game.PhysicalCardImpl;
|
||||
import com.gempukku.lotro.logic.decisions.DecisionResultInvalidException;
|
||||
import org.junit.Test;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
public class Card_09_049_Tests
|
||||
{
|
||||
@@ -57,7 +57,7 @@ public class Card_09_049_Tests
|
||||
assertEquals(CardType.COMPANION, card.getBlueprint().getCardType());
|
||||
assertEquals(Race.HOBBIT, card.getBlueprint().getRace());
|
||||
assertTrue(scn.HasKeyword(card, Keyword.RING_BOUND));
|
||||
assertTrue(scn.HasKeyword(card, Keyword.CAN_START_WITH_RING));
|
||||
assertTrue(card.getBlueprint().canStartWithRing());
|
||||
assertEquals(2, card.getBlueprint().getTwilightCost());
|
||||
assertEquals(3, card.getBlueprint().getStrength());
|
||||
assertEquals(4, card.getBlueprint().getVitality());
|
||||
|
||||
@@ -3,13 +3,13 @@ package com.gempukku.lotro.cards.official.set11;
|
||||
import com.gempukku.lotro.cards.GenericCardTestHelper;
|
||||
import com.gempukku.lotro.common.*;
|
||||
import com.gempukku.lotro.game.CardNotFoundException;
|
||||
import com.gempukku.lotro.game.PhysicalCardImpl;
|
||||
import com.gempukku.lotro.logic.decisions.DecisionResultInvalidException;
|
||||
import org.junit.Test;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
public class Card_11_164_Tests
|
||||
{
|
||||
@@ -57,7 +57,7 @@ public class Card_11_164_Tests
|
||||
assertEquals(CardType.COMPANION, card.getBlueprint().getCardType());
|
||||
assertEquals(Race.HOBBIT, card.getBlueprint().getRace());
|
||||
assertTrue(scn.HasKeyword(card, Keyword.RING_BOUND));
|
||||
assertTrue(scn.HasKeyword(card, Keyword.CAN_START_WITH_RING));
|
||||
assertTrue(card.getBlueprint().canStartWithRing());
|
||||
assertEquals(0, card.getBlueprint().getTwilightCost());
|
||||
assertEquals(3, card.getBlueprint().getStrength());
|
||||
assertEquals(4, card.getBlueprint().getVitality());
|
||||
|
||||
@@ -1,15 +1,18 @@
|
||||
package com.gempukku.lotro.cards.official.set13;
|
||||
|
||||
import com.gempukku.lotro.cards.GenericCardTestHelper;
|
||||
import com.gempukku.lotro.common.*;
|
||||
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.CardNotFoundException;
|
||||
import com.gempukku.lotro.game.PhysicalCardImpl;
|
||||
import com.gempukku.lotro.logic.decisions.DecisionResultInvalidException;
|
||||
import org.junit.Test;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
public class Card_13_033_Tests
|
||||
{
|
||||
@@ -56,7 +59,7 @@ public class Card_13_033_Tests
|
||||
assertEquals(Culture.GANDALF, card.getBlueprint().getCulture());
|
||||
assertEquals(CardType.COMPANION, card.getBlueprint().getCardType());
|
||||
assertEquals(Race.WIZARD, card.getBlueprint().getRace());
|
||||
assertTrue(scn.HasKeyword(card, Keyword.CAN_START_WITH_RING));
|
||||
assertTrue(card.getBlueprint().canStartWithRing());
|
||||
assertEquals(4, card.getBlueprint().getTwilightCost());
|
||||
assertEquals(7, card.getBlueprint().getStrength());
|
||||
assertEquals(4, card.getBlueprint().getVitality());
|
||||
|
||||
@@ -3,13 +3,13 @@ package com.gempukku.lotro.cards.official.set13;
|
||||
import com.gempukku.lotro.cards.GenericCardTestHelper;
|
||||
import com.gempukku.lotro.common.*;
|
||||
import com.gempukku.lotro.game.CardNotFoundException;
|
||||
import com.gempukku.lotro.game.PhysicalCardImpl;
|
||||
import com.gempukku.lotro.logic.decisions.DecisionResultInvalidException;
|
||||
import org.junit.Test;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
public class Card_13_156_Tests
|
||||
{
|
||||
@@ -57,7 +57,7 @@ public class Card_13_156_Tests
|
||||
assertEquals(CardType.COMPANION, card.getBlueprint().getCardType());
|
||||
assertEquals(Race.HOBBIT, card.getBlueprint().getRace());
|
||||
assertTrue(scn.HasKeyword(card, Keyword.RING_BOUND));
|
||||
assertTrue(scn.HasKeyword(card, Keyword.CAN_START_WITH_RING));
|
||||
assertTrue(card.getBlueprint().canStartWithRing());
|
||||
assertEquals(2, card.getBlueprint().getTwilightCost());
|
||||
assertEquals(3, card.getBlueprint().getStrength());
|
||||
assertEquals(4, card.getBlueprint().getVitality());
|
||||
|
||||
@@ -3,13 +3,13 @@ package com.gempukku.lotro.cards.official.set15;
|
||||
import com.gempukku.lotro.cards.GenericCardTestHelper;
|
||||
import com.gempukku.lotro.common.*;
|
||||
import com.gempukku.lotro.game.CardNotFoundException;
|
||||
import com.gempukku.lotro.game.PhysicalCardImpl;
|
||||
import com.gempukku.lotro.logic.decisions.DecisionResultInvalidException;
|
||||
import org.junit.Test;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
public class Card_15_144_Tests
|
||||
{
|
||||
@@ -57,7 +57,7 @@ public class Card_15_144_Tests
|
||||
assertEquals(CardType.COMPANION, card.getBlueprint().getCardType());
|
||||
assertEquals(Race.HOBBIT, card.getBlueprint().getRace());
|
||||
assertTrue(scn.HasKeyword(card, Keyword.RING_BOUND));
|
||||
assertTrue(scn.HasKeyword(card, Keyword.CAN_START_WITH_RING));
|
||||
assertTrue(card.getBlueprint().canStartWithRing());
|
||||
assertEquals(0, card.getBlueprint().getTwilightCost());
|
||||
assertEquals(3, card.getBlueprint().getStrength());
|
||||
assertEquals(4, card.getBlueprint().getVitality());
|
||||
|
||||
@@ -1,15 +1,18 @@
|
||||
package com.gempukku.lotro.cards.official.set17;
|
||||
|
||||
import com.gempukku.lotro.cards.GenericCardTestHelper;
|
||||
import com.gempukku.lotro.common.*;
|
||||
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.CardNotFoundException;
|
||||
import com.gempukku.lotro.game.PhysicalCardImpl;
|
||||
import com.gempukku.lotro.logic.decisions.DecisionResultInvalidException;
|
||||
import org.junit.Test;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
public class Card_17_028_Tests
|
||||
{
|
||||
@@ -56,7 +59,7 @@ public class Card_17_028_Tests
|
||||
assertEquals(Culture.GONDOR, card.getBlueprint().getCulture());
|
||||
assertEquals(CardType.COMPANION, card.getBlueprint().getCardType());
|
||||
assertEquals(Race.MAN, card.getBlueprint().getRace());
|
||||
assertTrue(scn.HasKeyword(card, Keyword.CAN_START_WITH_RING));
|
||||
assertTrue(card.getBlueprint().canStartWithRing());
|
||||
assertEquals(3, card.getBlueprint().getTwilightCost());
|
||||
assertEquals(7, card.getBlueprint().getStrength());
|
||||
assertEquals(3, card.getBlueprint().getVitality());
|
||||
|
||||
@@ -3,13 +3,13 @@ package com.gempukku.lotro.cards.official.set19;
|
||||
import com.gempukku.lotro.cards.GenericCardTestHelper;
|
||||
import com.gempukku.lotro.common.*;
|
||||
import com.gempukku.lotro.game.CardNotFoundException;
|
||||
import com.gempukku.lotro.game.PhysicalCardImpl;
|
||||
import com.gempukku.lotro.logic.decisions.DecisionResultInvalidException;
|
||||
import org.junit.Test;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
public class Card_19_028_Tests
|
||||
{
|
||||
@@ -58,7 +58,7 @@ public class Card_19_028_Tests
|
||||
assertEquals(Race.HOBBIT, card.getBlueprint().getRace());
|
||||
assertTrue(scn.HasKeyword(card, Keyword.RING_BOUND));
|
||||
assertTrue(scn.HasKeyword(card, Keyword.FELLOWSHIP));
|
||||
assertTrue(scn.HasKeyword(card, Keyword.CAN_START_WITH_RING));
|
||||
assertTrue(card.getBlueprint().canStartWithRing());
|
||||
assertEquals(0, card.getBlueprint().getTwilightCost());
|
||||
assertEquals(3, card.getBlueprint().getStrength());
|
||||
assertEquals(4, card.getBlueprint().getVitality());
|
||||
|
||||
Reference in New Issue
Block a user