Hobbit Fixes, New Deckbuild Filter

This commit is contained in:
Phallen Cassidy
2019-11-10 11:17:54 -05:00
parent 603e98c217
commit 6b2e0d3ac3
13 changed files with 339 additions and 115 deletions

View File

@@ -477,7 +477,7 @@
}
},
"1_84": {
"title": "Sleep Caradhas",
"title": "Sleep, Caradhras",
"culture": "gandalf",
"cost": 3,
"type": "event",

View File

@@ -185,13 +185,23 @@
"type": "follower",
"race": "dwarf",
"strength": 2,
"effects": {
"type": "aidCost",
"cost": {
"type": "exert",
"filter": "choose(culture(dwarven),companion)"
"effects": [
{
"type": "aidCost",
"cost": {
"type": "exert",
"filter": "choose(culture(dwarven),companion)"
}
},
{
"type": "modifier",
"modifier": {
"type": "addKeyword",
"filter": "bearer",
"keyword": "damage+1",
}
}
}
]
},
"30_8": {
"title": "*Dori",
@@ -299,7 +309,7 @@
"effect": {
"type": "modifyStrength",
"filter": "self",
"amount": 2
"amount": 3
}
}
},
@@ -686,18 +696,18 @@
"effect": {
"type": "choice",
"texts": [
"Wound a minion twice",
"Discard a Troll"
"Discard a Troll",
"Wound a minion twice"
],
"effects": [
{
"type": "discard",
"filter": "choose(troll)"
},
{
"type": "wound",
"filter": "choose(minion)",
"times": 2
},
{
"type": "discard",
"filter": "choose(troll)"
}
]
}
@@ -707,7 +717,7 @@
"title": "*Gandalf",
"subtitle": "Leader of Dwarves",
"culture": "gandalf",
"cost": 4,
"cost": 2,
"type": "companion",
"race": "wizard",
"strength": 7,
@@ -788,7 +798,7 @@
"type": "cantBeDiscarded",
"condition": {
"type": "canSpot",
"filter": "dwarf,follower",
"filter": "culture(dwarven),follower",
"count": 2
},
"filter": "self"
@@ -800,7 +810,7 @@
"cost": [
{
"type": "discard",
"filter": "choose(dwarf,follower)"
"filter": "choose(culture(dwarven),follower)"
},
{
"type": "addBurdens",
@@ -835,7 +845,7 @@
},
"effect": {
"type": "wound",
"filter": "choose(minion)"
"filter": "choose(minion,not(name(Smaug)))"
}
},
{
@@ -1267,4 +1277,4 @@
}
]
}
}
}

View File

@@ -398,6 +398,10 @@
"type": "location",
"filter": "not(mountain)"
}
},
"effect": {
"type": "discard",
"filter": "self"
}
},
{
@@ -428,4 +432,4 @@
}
]
}
}
}

View File

@@ -25,45 +25,60 @@
"culture": "dwarven",
"cost": 3,
"type": "event",
"keyword": "regroup",
"keyword": "fellowship",
"effects": {
"type": "event",
"cost": {
"type": "discard",
"filter": "choose(culture(dwarven),follower,attachedTo(any))",
"memorize": "discardedFollower"
},
"effect": {
"type": "choice",
"texts": [
"Play possessions",
"Play artifacts"
],
"effects": [
{
"type": "duplicate",
"effect": {
"type": "playCardFromDrawDeck",
"filter": "choose(culture(dwarven),possession)"
},
"amount": {
"type": "twilightCostInMemory",
"memory": "discardedFollower"
}
"cost": [
{
"type": "conditional",
"condition": {
"type": "location",
"filter": "siteNumber(1-5),siteBlock(hobbit)"
},
{
"cost": {
"type": "discard",
"filter": "choose(culture(dwarven),follower,attachedTo(any))",
"memorize": "discardedFollower"
}
}
],
"effect": [
{
"type": "conditional",
"condition": {
"type": "location",
"filter": "siteNumber(1-5),siteBlock(hobbit)"
},
"effect": {
"type": "duplicate",
"effect": {
"type": "playCardFromDrawDeck",
"filter": "choose(culture(dwarven),artifact)"
"filter": "choose(culture(dwarven),not(event))"
},
"amount": {
"type": "twilightCostInMemory",
"memory": "discardedFollower"
}
}
]
}
},
{
"type": "conditional",
"condition": {
"type": "location",
"filter": "not(siteNumber(1-5)),siteBlock(hobbit)"
},
"effect": [
{
"type": "heal",
"choose": "name(Thorin)"
},
{
"type": "heal",
"choose": "name(Thorin)"
}
]
}
]
}
},
"31_3": {
@@ -91,11 +106,11 @@
"phase": "regroup",
"cost": {
"type": "exert",
"filter": "choose(ally)"
"filter": "choose(culture(elven),ally)"
},
"effect": {
"type": "stackCardsFromHand",
"filter": "choose(culture(dwarven),event)",
"type": "stackCardsFromDiscard",
"filter": "choose(or(and(culture(elven),event),name(Lore of Imladris)))",
"where": "self"
}
}
@@ -443,7 +458,11 @@
"modifier": {
"type": "cantBeDiscarded",
"filter": "self",
"by": "side(shadow)"
"by": "side(shadow)",
"condition": {
"type": "canSpot",
"filter": "self,attachedTo(any)"
}
}
},
{
@@ -564,33 +583,23 @@
],
"effects": {
"type": "event",
"cost": {
"type": "choice",
"texts": [
"Discard Beorn",
"Discard 2 DWARVEN followers"
],
"effects": [
{
"type": "discard",
"filter": "choose(name(Beorn))"
"effect": [
{
"type": "addModifier",
"modifier": {
"type": "modifyStrength",
"amount": 2,
"filter": "culture(dwarven),companion,hasStacked(follower)"
},
{
"type": "discard",
"count": 2,
"filter": "choose(culture(dwarven),follower)"
}
]
},
"effect": {
"type": "duplicate",
"amount": 3,
"effect": {
"type": "wound",
"player": "shadowPlayer",
"filter": "choose(minion,not(name(Smaug)))"
"until": "start(regroup)"
},
{
"type": "addKeyword",
"keyword": "defender+1",
"filter": "culture(dwarven),companion,hasStacked(follower)",
"until": "start(regroup)"
}
}
]
}
},
"31_17": {
@@ -850,4 +859,4 @@
}
}
}
}
}

View File

@@ -245,6 +245,7 @@
"strength": 9,
"vitality": 3,
"site": 3,
"keyword": "damage+1",
"effects": {
"type": "trigger",
"optional": true,
@@ -259,7 +260,7 @@
},
"effect": {
"type": "addBurdens",
"amount": 2
"amount": 1
}
}
},
@@ -1103,7 +1104,9 @@
"type": "canSpot",
"count": 6,
"filter": "companion"
}
},
"true":5,
"false":3
},
"until": "start(regroup)"
}
@@ -1141,6 +1144,7 @@
"optional": true,
"trigger": {
"type": "discarded",
"filter": "condition",
"player": "fp"
},
"effect": {
@@ -1329,4 +1333,4 @@
}
]
}
}
}

View File

@@ -256,6 +256,13 @@
"filter": "orc",
"memorize": "playedOrc"
},
"condition": {
"type": "not",
"condition": {
"type": "hasInZoneData",
"filter": "self"
}
},
"effect": {
"type": "appendCardIdsToWhileInZone",
"memory": "playedOrc"
@@ -278,7 +285,7 @@
"type": "site",
"block": "hobbit",
"site": 7,
"keyword": "river",
"keyword": "mountain",
"effects": {
"type": "activated",
"phase": "regroup",
@@ -345,4 +352,4 @@
}
}
}
}
}

View File

@@ -211,7 +211,7 @@
]
},
"32_8": {
"title": "*Roäc",
"title": "*Roac",
"subtitle": "Son of Carc",
"culture": "dwarven",
"cost": 1,
@@ -271,7 +271,7 @@
"type": "aidCost",
"cost": [
{
"type": "exert",
"type": "spot",
"filter": "choose(name(Gandalf))"
},
{
@@ -550,7 +550,7 @@
},
"effect": {
"type": "allyCanParticipateInArcheryFireAndSkirmishes",
"filter": "self",
"filter": "choose(name(Bard))",
"until": "start(regroup)"
}
}
@@ -784,7 +784,7 @@
"filter": "choose(minion)",
"amount": {
"type": "forEachYouCanSpot",
"filter": "or(name(Gandalf),name(Elrond),name(Galadriel))"
"filter": "or(name(Gandalf),name(Elrond),name(Galadriel))",
"multiplier": -1
}
}
@@ -874,4 +874,4 @@
}
]
}
}
}

View File

@@ -157,7 +157,7 @@
"32_29": {
"title": "*Azog's Mace",
"culture": "moria",
"cost": 2,
"cost": 1,
"type": "possession",
"possession": "hand weapon",
"strength": 2,
@@ -357,7 +357,7 @@
"type": "minion",
"race": "orc",
"strength": 10,
"vitality": 4,
"vitality": 3,
"site": 4,
"effects": {
"type": "trigger",
@@ -943,6 +943,58 @@
}
]
},
"32_59": {
"title": "*Dragon's Malice",
"culture": "smaug",
"cost": 0,
"type": "condition",
"keyword": "support area",
"effects": [
{
"type": "trigger",
"optional": true,
"trigger": {
"type": "losesSkirmish",
"filter": "or(companion,ally)",
"against": "name(Smaug)"
},
"effect": {
"type": "addBurdens",
"amount": 1
}
},
{
"type": "trigger",
"optional": true,
"trigger": {
"type": "killed",
"filter": "companion,culture(dwarven)"
},
"effect": {
"type": "addBurdens",
"amount": 1
}
},
{
"type": "modifier",
"modifier": {
"type": "cantTakeWounds",
"filter": "name(Bilbo)",
"condition": [
{
"type": "ringIsOn",
},
{
"type": "canSpot",
"filter": "name(Bilbo),inSkirmishAgainst(name(Smaug))"
}
]
}
}
]
},
"32_60": {
"title": "Smaug's Awakening",
"culture": "smaug",
@@ -1576,4 +1628,4 @@
}
]
}
}
}

View File

@@ -39,6 +39,9 @@ var CardFilter = Class.extend({
$("#culture2").buttonset("option", "disabled", !enable);
$("#cardType").prop("disabled", !enable);
$("#keyword").prop("disabled", !enable);
$("#race").prop("disabled", !enable);
$("#itemClass").prop("disabled", !enable);
$("#phase").prop("disabled", !enable);
},
setFilter: function (filter) {
@@ -168,6 +171,7 @@ var CardFilter = Class.extend({
+ "<option value='P'>Promo</option>"
+ "<option value='X'>Rare+</option>"
+ "<option value='S'>Fixed</option>"
+ "<option value='C,U,P,S'>Poorman's</option>"
+ "</select>");
this.fullFilterDiv.append(this.setSelect);
@@ -273,6 +277,61 @@ var CardFilter = Class.extend({
+ "<option value='nonFoil'>Non-foils</option>"
+ "<option value='tengwar'>Tengwar</option>"
+ "</select>");
combos.append(" <select id ='race' style='font-size: 80%'>"
+ "<option value=''>All races</option>"
+ "<option value='BALROG'>Balrog</option>"
+ "<option value='CREATURE'>Creature</option>"
+ "<option value='DWARF'>Dwarf</option>"
+ "<option value='ELF'>Elf</option>"
+ "<option value='ENT'>Ent</option>"
+ "<option value='HALF_TROLL'>Half-troll</option>"
+ "<option value='HOBBIT'>Hobbit</option>"
+ "<option value='MAIA'>Maia</option>"
+ "<option value='MAN'>Man</option>"
+ "<option value='NAZGUL'>Nazgul</option>"
+ "<option value='ORC'>Orc</option>"
+ "<option value='SPIDER'>Spider</option>"
+ "<option value='TREE'>Tree</option>"
+ "<option value='TROLL'>Troll</option>"
+ "<option value='URUK_HAI'>Uruk-hai</option>"
+ "<option value='WIZARD'>Wizard</option>"
+ "<option value='WRAITH'>Wraith</option>"
+ "<option value='DRAGON'>Dragon</option>"
+ "<option value='EAGLE'>Eagle</option>"
+ "</select>");
combos.append(" <select id ='itemClass' style='font-size: 80%'>"
+ "<option value=''>All classes</option>"
+ "<option value='ARMOR'>Armor</option>"
+ "<option value='BOX'>Box</option>"
+ "<option value='BRACERS'>Bracers</option>"
+ "<option value='BROOCH'>Brooch</option>"
+ "<option value='CLOAK'>Cloak</option>"
+ "<option value='GAUNTLETS'>Gauntlets</option>"
+ "<option value='HAND_WEAPON'>Hand Weapon</option>"
+ "<option value='HELM'>Helm</option>"
+ "<option value='HORN'>Horn</option>"
+ "<option value='MOUNT'>Mount</option>"
+ "<option value='PALANTIR'>Palantir</option>"
+ "<option value='PHIAL'>Phial</option>"
+ "<option value='PIPE'>Pipe</option>"
+ "<option value='RANGED_WEAPON'>Ranged Weapon</option>"
+ "<option value='RING'>Ring</option>"
+ "<option value='SHIELD'>Shield</option>"
+ "<option value='STAFF'>Staff</option>"
+ "<option value='CLASSLESS'>Classless</option>"
+ "</select>");
combos.append(" <select id ='phase' style='font-size: 80%'>"
+ "<option value=''>All Phases</option>"
+ "<option value='FELLOWSHIP'>Fellowship</option>"
+ "<option value='SHADOW'>Shadow</option>"
+ "<option value='MANEUVER'>Maneuver</option>"
+ "<option value='ARCHERY'>Archery</option>"
+ "<option value='ASSIGNMENT'>Assignment</option>"
+ "<option value='SKIRMISH'>Skirmish</option>"
+ "<option value='REGROUP'>Regroup</option>"
+ "<option value='RESPONSE'>Response</option>"
+ "</select>");
this.filterDiv.append(combos);
elem.append(this.filterDiv);
@@ -297,10 +356,53 @@ var CardFilter = Class.extend({
that.getCollection();
return true;
};
//Hide dynamic filters by default
$("#race").hide();
$("#itemClass").hide();
$("#phase").hide();
var changeDynamicFilters = function () {
var cardType = $("#cardType option:selected").prop("value");
if (cardType.includes("COMPANION") || cardType.includes("ALLY") || cardType.includes("MINION")) {
$("#race").show();
$("#itemClass").hide();
$("#itemClass").val("");
$("#phase").hide();
$("#phase").val("");
} else if (cardType.includes("POSSESSION") || cardType.includes("ARTIFACT")) {
$("#race").hide();
$("#race").val("");
$("#itemClass").show();
$("#phase").hide();
$("#phase").val("");
} else if (cardType.includes("EVENT")) {
$("#race").hide();
$("#race").val("");
$("#itemClass").hide();
$("#itemClass").val("");
$("#phase").show();
} else {
$("#race").hide();
$("#race").val("");
$("#itemClass").hide();
$("#itemClass").val("");
$("#phase").hide();
$("#phase").val("")
}
that.filter = that.calculateNormalFilter();
that.start = 0;
that.getCollection();
return true;
};
$("#cardType").change(filterOut);
$("#cardType").change(changeDynamicFilters);
$("#keyword").change(filterOut);
$("#type").change(filterOut);
$("#race").change(filterOut);
$("#itemClass").change(filterOut);
$("#phase").change(filterOut);
//Additional Hobbit Draft labels
$("#labelDWARVEN,#labelELVEN,#labelGANDALF,#labelGONDOR,#labelROHAN,#labelSHIRE,#labelGOLLUM,#labelDUNLAND,#labelISENGARD,#labelMEN,#labelMORIA,#labelORC,#labelRAIDER,#labelSAURON,#labelURUK_HAI,#labelWRAITH,#labelESGAROTH,#labelGUNDABAD").click(filterOut);
@@ -351,10 +453,22 @@ var CardFilter = Class.extend({
if (type != "")
type = " type:" + type;
var race = $("#race option:selected").prop("value");
if (race != "")
race = " race:" + race;
var itemClass = $("#itemClass option:selected").prop("value");
if (itemClass != "")
itemClass = " itemClass:" + itemClass
var phase = $("#phase option:selected").prop("value");
if (phase != "")
phase = " phase:" + phase;
if (cultures.length > 0)
return cardType + " culture:" + cultures + keyword + type;
return cardType + " culture:" + cultures + keyword + type + race + itemClass + phase;
else
return cardType + keyword + type;
return cardType + keyword + type + race + itemClass + phase;
},
calculateFullFilterPostfix: function () {

View File

@@ -24,8 +24,8 @@ var hobbit = {
'30_23': 'http://hobbitdraftgame.free.fr/Cards_Good_def/A_wizard_is_never_late.png',
'30_24': 'http://hobbitdraftgame.free.fr/Cards_Good_def/Dawn_take_you_all.png',
'30_25': 'http://hobbitdraftgame.free.fr/Cards_Good_def/New_Gandalf.png',
'30_26': 'http://hobbitdraftgame.free.fr/Cards_Good_def/Gandalf2.png',
'30_27': 'http://hobbitdraftgame.free.fr/Cards_Good_def/Gandalf3.png',
'30_26': 'http://hobbitdraftgame.free.fr/Cards_Good_def/New_Gandalf2.png',
'30_27': 'http://hobbitdraftgame.free.fr/Cards_Good_def/New_Gandalf3.png',
'30_28': 'http://hobbitdraftgame.free.fr/Cards_Good_def/Gandalf4.png',
'30_29': 'http://hobbitdraftgame.free.fr/Cards_Good_def/Glamdring.png',
'30_30': 'http://hobbitdraftgame.free.fr/Cards_Good_def/He_gives_me_courage.png',
@@ -58,8 +58,8 @@ var hobbit = {
'30_57': 'http://hobbitdraftgame.free.fr/Cards_Good_def/9_Battle_of_the_five_armies.png',
'30_58': 'http://hobbitdraftgame.free.fr/Cards_Good_def/Smaug.png',
'31_1': 'http://hobbitdraftgame.free.fr/Cards_Good_def/Dwarven_Axe.png',
'31_2': 'http://hobbitdraftgame.free.fr/Cards_Good_def/Dwarven_Song.png',
'31_3': 'http://hobbitdraftgame.free.fr/Cards_Good_def/New_Emeralds_of_Girion.png',
'31_2': 'http://hobbitdraftgame.free.fr/Cards_Good_def/New_Dwarven_Song.png',
'31_3': 'http://hobbitdraftgame.free.fr/Cards_Good_def/New_Emeralds_of_Girion2.png',
'31_4': 'http://hobbitdraftgame.free.fr/Cards_Good_def/Great_Barricade.png',
'31_5': 'http://hobbitdraftgame.free.fr/Cards_Good_def/Mithril_Coat.png',
'31_6': 'http://hobbitdraftgame.free.fr/Cards_Good_def/Oakenshield.png',
@@ -72,7 +72,7 @@ var hobbit = {
'31_13': 'http://hobbitdraftgame.free.fr/Cards_Good_def/Beorn.png',
'31_14': 'http://hobbitdraftgame.free.fr/Cards_Good_def/Eagles_Are_Coming.png',
'31_15': 'http://hobbitdraftgame.free.fr/Cards_Good_def/Gwaihir.png',
'31_16': 'http://hobbitdraftgame.free.fr/Cards_Good_def/His_Wrath_Was_Redoubled.png',
'31_16': 'http://hobbitdraftgame.free.fr/Cards_Good_def/New_His_Wrath_Was_Redoubled.png',
'31_17': 'http://hobbitdraftgame.free.fr/Cards_Good_def/Radagast.png',
'31_18': 'http://hobbitdraftgame.free.fr/Cards_Good_def/Wizard_Staff.png',
'31_19': 'http://hobbitdraftgame.free.fr/Cards_Good_def/New_Gollum_Better_Than_Nothing.png',
@@ -134,7 +134,7 @@ var hobbit = {
'32_6': 'http://hobbitdraftgame.free.fr/Cards_Good_def/King_Under_the_Mountain.png',
'32_7': 'http://hobbitdraftgame.free.fr/Cards_Good_def/Ring_of_Thror.png',
'32_8': 'http://hobbitdraftgame.free.fr/Cards_Good_def/Roac.png',
'32_9': 'http://hobbitdraftgame.free.fr/Cards_Good_def/Thrain.png',
'32_9': 'http://hobbitdraftgame.free.fr/Cards_Good_def/New_Thrain.png',
'32_10': 'http://hobbitdraftgame.free.fr/Cards_Good_def/Thror_s_Heirlooms.png',
'32_11': 'http://hobbitdraftgame.free.fr/Cards_Good_def/Thror_s_Key.png',
'32_12': 'http://hobbitdraftgame.free.fr/Cards_Good_def/Thror_s_Map.png',
@@ -154,7 +154,7 @@ var hobbit = {
'32_26': 'http://hobbitdraftgame.free.fr/Cards_Good_def/War_for_Gold.png',
'32_27': 'http://hobbitdraftgame.free.fr/Cards_Good_def/Assaulting_Goblin.png',
'32_28': 'http://hobbitdraftgame.free.fr/Cards_Good_def/Azog_Commander.png',
'32_29': 'http://hobbitdraftgame.free.fr/Cards_Good_def/Azog_s_Mace.png',
'32_29': 'http://hobbitdraftgame.free.fr/Cards_Good_def/New_Azog_s_Mace.png',
'32_30': 'http://hobbitdraftgame.free.fr/Cards_Good_def/Dark_Bats.png',
'32_31': 'http://hobbitdraftgame.free.fr/Cards_Good_def/Demolition_Troll.png',
'32_32': 'http://hobbitdraftgame.free.fr/Cards_Good_def/Vicious_Warg.png',
@@ -184,7 +184,7 @@ var hobbit = {
'32_56': 'http://hobbitdraftgame.free.fr/Cards_Good_def/9_Northern_Slopes.png',
'32_57': 'http://hobbitdraftgame.free.fr/Cards_Good_def/9_Ravenhill.png',
'32_58': 'http://hobbitdraftgame.free.fr/Cards_Good_def/Dissension.png',
'32_59': 'http://hobbitdraftgame.free.fr/Cards_Good_def/Dragon_Malice.png',
'32_59': 'http://hobbitdraftgame.free.fr/Cards_Good_def/New_Dragon_Malice.png',
'32_60': 'http://hobbitdraftgame.free.fr/Cards_Good_def/Smaug_s_Awakening.png',
'32_61': 'http://hobbitdraftgame.free.fr/Cards_Good_def/New_Terrifying_Legend.png',
'32_62': 'http://hobbitdraftgame.free.fr/Cards_Good_def/Twisted_Gold_of_Dragon.png',

View File

@@ -23,8 +23,8 @@ import java.util.List;
* Culture: Smaug
* Twilight Cost: 0
* Type: Condition • Support area
* Game Text: Each time Smaug wins a skirmish, you may add a doubt (or 2 doubts if a Dwarven companion he was
* skirmishing is killed).
* Game Text: Each time Smaug wins a skirmish or kills a [Dwarven] companion in a skirmish, you may add a doubt.
* While Bilbo wears The One Ring, he cannot be wounded by Smaug.
*/
public class Card32_059 extends AbstractPermanent {
public Card32_059() {
@@ -33,15 +33,12 @@ public class Card32_059 extends AbstractPermanent {
@Override
public List<OptionalTriggerAction> getOptionalAfterTriggers(String playerId, LotroGame game, EffectResult effectResult, PhysicalCard self) {
if (PlayConditions.checkPhaseLimit(game, self, 1)
&& (TriggerConditions.forEachKilledBy(game, effectResult, Filters.name("Smaug"), Filters.and(CardType.COMPANION, Culture.DWARVEN))
|| TriggerConditions.losesSkirmishInvolving(game, effectResult, Filters.or(CardType.COMPANION, CardType.ALLY), Filters.name("Smaug")))) {
if (TriggerConditions.forEachKilledBy(game, effectResult, Filters.name("Smaug"), Filters.and(CardType.COMPANION, Culture.DWARVEN))
|| TriggerConditions.losesSkirmishInvolving(game, effectResult, Filters.or(CardType.COMPANION, CardType.ALLY), Filters.name("Smaug"))) {
OptionalTriggerAction action = new OptionalTriggerAction(self);
action.appendEffect(
new IncrementPhaseLimitEffect(self, 1));
if (TriggerConditions.forEachKilledBy(game, effectResult, Filters.name("Smaug"), Filters.and(CardType.COMPANION, Culture.DWARVEN))) {
action.appendEffect(
new AddBurdenEffect(game.getGameState().getCurrentPlayerId(), self, 2));
new AddBurdenEffect(game.getGameState().getCurrentPlayerId(), self, 1));
} else if (TriggerConditions.losesSkirmishInvolving(game, effectResult, Filters.or(CardType.COMPANION, CardType.ALLY), Filters.name("Smaug"))) {
action.appendEffect(
new AddBurdenEffect(game.getGameState().getCurrentPlayerId(), self, 1));

View File

@@ -3,8 +3,9 @@ package com.gempukku.lotro.common;
public enum PossessionClass implements Filterable {
HAND_WEAPON("Hand Weapon"), ARMOR("Armor"), HELM("Helm"), MOUNT("Mount"), RANGED_WEAPON("Ranged Weapon"),
CLOAK("Cloak"), PIPE("Pipe"), SHIELD("Shield"), BRACERS("Bracers"), STAFF("Staff"), RING("Ring"),
BROOCH("Brooch"), GAUNTLETS("Gauntlets"), BOX("Box"), PALANTIR("Palantir"), PHIAL("Phial"), HORN("Horn");
BROOCH("Brooch"), GAUNTLETS("Gauntlets"), BOX("Box"), PALANTIR("Palantir"), PHIAL("Phial"), HORN("Horn"),
CLASSLESS("Classless");
private String _humanReadable;
private PossessionClass(String humanReadable) {

View File

@@ -23,6 +23,9 @@ public class SortAndFilterCards {
Set<Culture> cultures = getEnumFilter(Culture.values(), Culture.class, "culture", null, filterParams);
Set<Keyword> keywords = getEnumFilter(Keyword.values(), Keyword.class, "keyword", Collections.<Keyword>emptySet(), filterParams);
Integer siteNumber = getSiteNumber(filterParams);
Set<Race> races = getEnumFilter(Race.values(), Race.class, "race", null, filterParams);
Set<PossessionClass> itemClasses = getEnumFilter(PossessionClass.values(), PossessionClass.class, "itemClass", Collections.<PossessionClass>emptySet(), filterParams);
Set<Keyword> phases = getEnumFilter(Keyword.values(),Keyword.class, "phase", Collections.<Keyword>emptySet(), filterParams);
List<T> result = new ArrayList<T>();
Map<String, LotroCardBlueprint> cardBlueprintMap = new HashMap<>();
@@ -30,12 +33,12 @@ public class SortAndFilterCards {
for (T item : items) {
String blueprintId = item.getBlueprintId();
if (isPack(blueprintId)) {
if (acceptsFilters(cardLibrary, cardBlueprintMap, formatLibrary, rarities, blueprintId, side, type, rarity, sets, cardTypes, cultures, keywords, words, siteNumber))
if (acceptsFilters(cardLibrary, cardBlueprintMap, formatLibrary, rarities, blueprintId, side, type, rarity, sets, cardTypes, cultures, keywords, words, siteNumber, races, itemClasses, phases))
result.add(item);
} else {
try {
cardBlueprintMap.put(blueprintId, cardLibrary.getLotroCardBlueprint(blueprintId));
if (acceptsFilters(cardLibrary, cardBlueprintMap, formatLibrary, rarities, blueprintId, side, type, rarity, sets, cardTypes, cultures, keywords, words, siteNumber))
if (acceptsFilters(cardLibrary, cardBlueprintMap, formatLibrary, rarities, blueprintId, side, type, rarity, sets, cardTypes, cultures, keywords, words, siteNumber, races, itemClasses, phases))
result.add(item);
} catch (CardNotFoundException e) {
// Ignore the card
@@ -74,7 +77,7 @@ public class SortAndFilterCards {
private boolean acceptsFilters(
LotroCardBlueprintLibrary library, Map<String, LotroCardBlueprint> cardBlueprint, LotroFormatLibrary formatLibrary, Map<String, SetDefinition> rarities, 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<CardType> cardTypes, Set<Culture> cultures, Set<Keyword> keywords, List<String> words, Integer siteNumber, Set<Race> races, Set<PossessionClass> itemClasses, Set<Keyword> phases) {
if (isPack(blueprintId)) {
if (type == null || type.equals("pack"))
return true;
@@ -93,7 +96,10 @@ public class SortAndFilterCards {
if (containsAllKeywords(blueprint, keywords))
if (containsAllWords(blueprint, words))
if (siteNumber == null || blueprint.getSiteNumber() == siteNumber)
return true;
if (races == null || races.contains(blueprint.getRace()))
if (containsAllClasses(blueprint, itemClasses))
if (containsAllKeywords(blueprint, phases))
return true;
}
}
return false;
@@ -240,6 +246,26 @@ public class SortAndFilterCards {
return true;
}
private boolean containsAllClasses(LotroCardBlueprint blueprint, Set<PossessionClass> possessionClasses) {
for (PossessionClass filterPossessionClass : possessionClasses) {
if (blueprint == null)
return false;
else {
if (blueprint.getPossessionClasses() == null) {
if (filterPossessionClass == PossessionClass.CLASSLESS)
return true;
return false;
}
for (PossessionClass blueprintPossessionClass : blueprint.getPossessionClasses()) {
if (filterPossessionClass == blueprintPossessionClass)
return true;
}
return false;
}
}
return true;
}
private boolean containsAllWords(LotroCardBlueprint blueprint, List<String> words) {
for (String word : words) {
if (blueprint == null || !replaceSpecialCharacters(GameUtils.getFullName(blueprint).toLowerCase()).contains(word))