Deckbuilder Format Overhaul

- Fleshed out deckbuilder format/block/set selection.  The deck format selection now filters what block/set will show up in the card filters in the right pane.
- Fixed Ring-bearer/One Ring filtering not working.  Further fleshed out Ring/Bearer interaction so that other filters may now be used.
This commit is contained in:
Christian 'ketura' McCarty
2024-11-12 19:03:36 -06:00
parent 17e779c33f
commit f096b0d4e1
15 changed files with 3213 additions and 2732 deletions

View File

@@ -108,13 +108,12 @@ public class DeckRequestHandler extends LotroServerRequestHandler implements Uri
json = JsonUtils.Serialize(data);
}
else {
Map<String, LotroFormat> formats = _formatLibrary.getHallFormats();
JSONDefs.FullFormatReadout data = new JSONDefs.FullFormatReadout();
data.Formats = _formatLibrary.getAllFormats().values().stream()
.map(LotroFormat::Serialize)
.collect(Collectors.toMap(x-> x.code, x-> x));
Object[] output = formats.entrySet().stream()
.map(x -> new JSONDefs.ItemStub(x.getKey(), x.getValue().getName()))
.toArray();
json = JsonUtils.Serialize(output);
json = JsonUtils.Serialize(data);
}
responseWriter.writeJsonResponse(json);

View File

@@ -351,8 +351,8 @@ public class HallRequestHandler extends LotroServerRequestHandler implements Uri
result.append("<b>" + lotroFormat.getName() + "</b>");
result.append("<ul>");
result.append("<li>valid sets: ");
for (Integer integer : lotroFormat.getValidSets())
result.append(integer + ", ");
for (String setCode : lotroFormat.getValidSets())
result.append(setCode + ", ");
result.append("</li>");
result.append("<li>sites from block: " + lotroFormat.getSiteBlock().getHumanReadable() + "</li>");
result.append("<li>Ring-bearer skirmish can be cancelled: " + (lotroFormat.canCancelRingBearerSkirmish() ? "yes" : "no") + "</li>");

View File

@@ -8,6 +8,14 @@
font-size: 80%;
}
.filterInput {
max-width: 100px;
}
#nameInput, #gametextInput {
max-width: 230px;
}
#resetAdvancedFiltersButton, #resetAllFiltersButton {
font-size: 95% !important;
}

View File

@@ -97,7 +97,7 @@
</button>
<select id="formatSelect" style="float: right; width: 200px;">
<option value="fotr_block">Fellowship Block</option>
<option value="rev_tow_sta">Anything Goes</option>
</select>
<button id="notesBut" title="Add/Edit Notes" class="menu-button">

View File

@@ -300,6 +300,8 @@ class Card {
return (cardNo == 1);
if (setNo == 101 || setNo == 151)
return (cardNo >= 57 && cardNo <= 64);
if (setNo == 102)
return (cardNo >= 67 && cardNo <= 73);
return false;
}

View File

@@ -4,20 +4,53 @@
code: debug
sites: MULTIPATH
maximumSameName: 100
set: [
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 101, 151
minDeckSize: 1
blocks: [
fotr_block
]
sets: [
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19,
30, 31, 32, 33
51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69
70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 200
100, 101, 102
]
hall: false
}
{
name: Anything Goes
code: rev_tow_sta
order: -1
sites: MULTIPATH
cancelRingBearerSkirmish: true
sets: [
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19
30, 31, 32, 33
50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69
100, 101, 102
]
blocks: [
Promotional|Promotional:0
fotr_block
ttt_block
king_block
war_block
hunter_block
Additional Sets|Reflections:9,Expanded Middle-earth:14,The Wraith Collection:16,Age's End:19
Player's Council V-sets|V0 - PC Kitchen Sink:100,V1 - Shadow of the Past:101,V2 - King of the Golden Hall:102
Player's Council Errata|Promotional Errata:50,The Fellowship of the Ring Errata:51,Mines of Moria Errata:52,Realms of the Elf-lords Errata:53,The Two Towers Errata:54,Battle of Helm's Deep Errata:55,Ents of Fangorn Errata:56,Return of the King Errata:57,Siege of Gondor Errata:58,Reflections Errata:59,Mount Doom Errata:60,Shadows Errata:61,Black Rider Errata:62,Bloodlines Errata:63,Expanded Middle-earth Errata:64,The Hunters Errata:65,The Wraith Collection Errata:66,Rise of Saruman Errata:67,Treachery & Deceit Errata:68,Age's End Errata:69
hobbit
]
}
{
name: Fellowship Block
code: fotr_block
order: 1
sites: FELLOWSHIP
cancelRingBearerSkirmish: true
set: [
blocks: [
fotr_block
]
sets: [
1, 2, 3
]
}
@@ -29,7 +62,12 @@
cancelRingBearerSkirmish: true
winAtEndOfRegroup: true
discardPileIsPublic: true
set: [
blocks: [
fotr_block
Player's Council V-sets|V1 - Shadow of the Past:101
Player's Council Errata|The Fellowship of the Ring Errata:51,Mines of Moria Errata:52,Realms of the Elf-lords Errata:53
]
sets: [
1, 2, 3, 101
]
errataSets: [
@@ -45,7 +83,13 @@
"8_1", "3_38", "3_106", "1_40", "2_32", "1_248", "3_108", "1_45", "7_96", "3_42",
"10_2", "10_91", "1_108", "1_80", "3_67", "1_195", "3_68", "1_139", "7_49", "1_313", "1_234"
]
set: [
blocks: [
fotr_block
ttt_block
king_block
Additional Sets|Reflections:9
]
sets: [
1, 2, 3, 4, 5, 6, 7, 8, 9, 10
]
}
@@ -57,11 +101,16 @@
usesMaps: true
winAtEndOfRegroup: true
discardPileIsPublic: true
set: [
sets: [
1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 100, 101, 102
]
banned: [
"100_1"
blocks: [
Fellowship Block|The Fellowship of the Ring:1,Mines of Moria:2,Realms of the Elf-lords:3,V1 - Shadow of the Past:101
Towers Block|The Two Towers:4,Battle of Helm's Deep:5,Ents of Fangorn:6,V2 - King of the Golden Hall:102
king_block
Additional Sets|Reflections:9
Player's Council V-sets|V1 - Shadow of the Past:101,V2 - King of the Golden Hall:102
Player's Council Errata|The Fellowship of the Ring Errata:51,Mines of Moria Errata:52,Realms of the Elf-lords Errata:53,The Two Towers Errata:54,Battle of Helm's Deep Errata:55,Ents of Fangorn Errata:56,Return of the King Errata:57,Siege of Gondor Errata:58,Reflections Errata:59,Mount Doom Errata:60
]
errataSets: [
51,52,53,54,55,56,57,58,59,60
@@ -80,9 +129,18 @@
restricted: [
"1_40", "1_80", "1_108", "1_139", "1_195", "1_248", "2_32", "2_75", "3_106", "4_276", "4_304"
]
set: [
sets: [
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19
]
blocks: [
Promotional|Promotional:0
fotr_block
ttt_block
king_block
war_block
hunter_block
Additional Sets|Reflections:9,Expanded Middle-earth:14,The Wraith Collection:16,Age's End:19
]
}
{
name: Expanded (PC)
@@ -91,9 +149,20 @@
sites: SHADOWS
winAtEndOfRegroup: true
discardPileIsPublic: true
set: [
sets: [
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 100, 101, 102
]
blocks: [
Promotional|Promotional:0
fotr_block
ttt_block
king_block
war_block
hunter_block
Additional Sets|Reflections:9,Expanded Middle-earth:14,The Wraith Collection:16,Age's End:19
Player's Council V-sets|V0 - PC Kitchen Sink:100,V1 - Shadow of the Past:101,V2 - King of the Golden Hall:102
Player's Council Errata|Promotional Errata:50,The Fellowship of the Ring Errata:51,Mines of Moria Errata:52,Realms of the Elf-lords Errata:53,The Two Towers Errata:54,Battle of Helm's Deep Errata:55,Ents of Fangorn Errata:56,Return of the King Errata:57,Siege of Gondor Errata:58,Reflections Errata:59,Mount Doom Errata:60,Shadows Errata:61,Black Rider Errata:62,Bloodlines Errata:63,Expanded Middle-earth Errata:64,The Hunters Errata:65,The Wraith Collection Errata:66,Rise of Saruman Errata:67,Treachery & Deceit Errata:68,Age's End Errata:69
]
errataSets: [
51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69
]
@@ -104,9 +173,12 @@
order: 7
sites: FELLOWSHIP
cancelRingBearerSkirmish: true
set: [
sets: [
1
]
block: [
Fellowship Block|The Fellowship of the Ring:1
]
hall: false
}
{
@@ -115,9 +187,12 @@
order: 8
sites: FELLOWSHIP
cancelRingBearerSkirmish: true
set: [
sets: [
1, 2
]
block: [
Fellowship Block|The Fellowship of the Ring:1,Mines of Moria:2
]
hall: false
}
{
@@ -126,9 +201,12 @@
order: 9
sites: TWO_TOWERS
cancelRingBearerSkirmish: true
set: [
sets: [
4, 5, 6
]
blocks: [
ttt_block
]
}
{
name: Towers Open - Sets 1-4
@@ -136,9 +214,13 @@
order: 10
sites: TWO_TOWERS
cancelRingBearerSkirmish: true
set: [
sets: [
1, 2, 3, 4
]
blocks: [
fotr_block
Towers Block|The Two Towers:4
]
hall: false
}
{
@@ -147,9 +229,12 @@
order: 11
sites: TWO_TOWERS
cancelRingBearerSkirmish: true
set: [
sets: [
4
]
blocks: [
Towers Block|The Two Towers:4
]
hall: false
}
{
@@ -158,9 +243,12 @@
order: 12
sites: TWO_TOWERS
cancelRingBearerSkirmish: true
set: [
sets: [
4, 5
]
blocks: [
Towers Block|The Two Towers:4,Battle of Helm's Deep:5
]
hall: false
}
@@ -174,9 +262,13 @@
"1_40", "1_45", "1_80", "1_108", "1_139", "1_234", "1_248", "1_313", "2_32",
"2_101", "2_108", "3_38", "3_42", "3_68", "4_192"
]
set: [
sets: [
1, 2, 3, 4, 5, 6
]
blocks: [
fotr_block
ttt_block
]
}
{
name: Towers Standard - Sets 1-4
@@ -188,9 +280,13 @@
"1_40", "1_45", "1_80", "1_108", "1_139", "1_234", "1_248", "1_313", "2_32",
"2_101", "2_108", "3_38", "3_42", "3_68", "4_192"
]
set: [
sets: [
1, 2, 3, 4
]
blocks: [
fotr_block
Towers Block|The Two Towers:4
]
hall: false
}
{
@@ -203,9 +299,13 @@
"1_40", "1_45", "1_80", "1_108", "1_139", "1_234", "1_248", "1_313", "2_32",
"2_101", "2_108", "3_38", "3_42", "3_68", "4_192"
]
set: [
sets: [
1, 2, 3, 4, 5
]
blocks: [
fotr_block
Towers Block|The Two Towers:4,Battle of Helm's Deep:5
]
hall: false
}
{
@@ -218,9 +318,13 @@
"1_40", "1_45", "1_80", "1_108", "1_139", "1_234", "1_248", "1_313", "2_32",
"2_101", "2_108", "3_38", "3_42", "3_68", "4_192"
]
set: [
sets: [
2, 3, 4, 5, 6
]
blocks: [
fotr_block
ttt_block
]
hall: false
}
{
@@ -233,9 +337,14 @@
"1_40", "1_45", "1_80", "1_108", "1_139", "1_234", "1_248", "1_313", "2_32",
"2_101", "2_108", "3_38", "3_42", "3_68", "4_192"
]
set: [
sets: [
1, 2, 3, 4, 5, 6, 9, 14, 16
]
blocks: [
fotr_block
ttt_block
Additional Sets|Reflections:9,Expanded Middle-earth:14,The Wraith Collection:16
]
hall: true
}
{
@@ -247,9 +356,12 @@
restricted: [
"7_49"
]
set: [
sets: [
7, 8, 10
]
blocks: [
king_block
]
}
{
name: King Block - Set 7
@@ -260,9 +372,12 @@
restricted: [
"7_49"
]
set: [
sets: [
7
]
block: [
King Block|The Return of the King:7
]
hall: false
}
{
@@ -274,9 +389,12 @@
restricted: [
"7_49"
]
set: [
sets: [
7, 8
]
block: [
King Block|The Return of the King:7,Siege of Gondor:8
]
hall: false
}
{
@@ -289,9 +407,14 @@
"1_40", "1_45","1_80", "1_108", "1_139", "1_195", "1_234", "1_248", "1_313",
"2_32", "2_101", "2_108", "3_38", "3_42", "3_67", "3_68", "3_106", "3_108"
]
set: [
sets: [
1, 2, 3, 4, 5, 6, 7
]
blocks: [
fotr_block
ttt_block
King Block|The Return of the King:7
]
}
{
name: Movie Block - Sets 1-7
@@ -303,9 +426,14 @@
"3_42", "10_2", "10_91", "1_108", "1_80", "3_67", "1_195", "3_68", "1_139",
"7_49", "1_313", "1_234"
]
set: [
sets: [
1, 2, 3, 4, 5, 6, 7
]
blocks: [
fotr_block
ttt_block
King Block|The Return of the King:7
]
hall: false
}
{
@@ -318,9 +446,14 @@
"3_42", "10_2", "10_91", "1_108", "1_80", "3_67", "1_195", "3_68", "1_139",
"7_49", "1_313", "1_234"
]
set: [
sets: [
1, 2, 3, 4, 5, 6, 7, 8
]
blocks: [
fotr_block
ttt_block
King Block|The Return of the King:7,Siege of Gondor:8
]
hall: false
}
{
@@ -333,9 +466,15 @@
"3_42", "10_2", "10_91", "1_108", "1_80", "3_67", "1_195", "3_68", "1_139",
"7_49", "1_313", "1_234"
]
set: [
sets: [
1, 2, 3, 4, 5, 6, 7, 8, 9
]
blocks: [
fotr_block
ttt_block
King Block|The Return of the King:7,Siege of Gondor:8
Additional Sets|Reflections:9
]
hall: false
}
{
@@ -348,9 +487,14 @@
"3_42", "10_2", "10_91", "1_108", "1_80", "3_67", "1_195", "3_68", "1_139",
"7_49", "1_313", "1_234"
]
set: [
sets: [
1, 2, 3, 4, 5, 6, 7, 8, 10
]
blocks: [
fotr_block
ttt_block
king_block
]
hall: false
}
{
@@ -363,9 +507,15 @@
"7_96", "3_42", "10_2", "10_91", "1_108", "1_80", "3_67", "1_195", "3_68",
"1_139", "7_49", "1_313", "1_234"
]
set: [
sets: [
1, 2, 3, 4, 5, 6, 7, 8, 9, 10
]
blocks: [
fotr_block
ttt_block
king_block
Additional Sets|Reflections:9
]
hall: false
}
{
@@ -383,9 +533,15 @@
valid: [
"0_56-60"
]
set: [
sets: [
1, 2, 3, 4, 5, 6, 7, 8, 9, 10
]
blocks: [
fotr_block
ttt_block
king_block
Additional Sets|Reflections:9
]
}
{
name: War of the Ring Block
@@ -395,9 +551,12 @@
restricted: [
"11_132", "11_100"
]
set: [
sets: [
11, 12, 13
]
blocks: [
war_block
]
}
{
name: War of the Ring Block - Set 11
@@ -407,9 +566,12 @@
restricted: [
"11_132", "11_100"
]
set: [
sets: [
11
]
blocks: [
war_block
]
hall: false
}
{
@@ -420,9 +582,12 @@
restricted: [
"11_132", "11_100"
]
set: [
sets: [
11, 12
]
blocks: [
war_block
]
hall: false
}
{
@@ -433,9 +598,14 @@
restricted: [
"11_132", "11_100"
]
set: [
sets: [
10, 11, 12, 13, 14
]
blocks: [
King Block|Mount Doom:10
war_block
Additional Sets|Expanded Middle-earth:14
]
hall: false
}
{
@@ -450,18 +620,27 @@
valid: [
"0_56-60"
]
set: [
sets: [
4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14
]
blocks: [
ttt_block
king_block
war_block
Additional Sets|Reflections:9,Expanded Middle-earth:14
]
}
{
name: Hunters Block
code: hunter_block
order: 33
sites: SHADOWS
set: [
sets: [
15, 17, 18
]
blocks: [
hunter_block
]
}
{
name: Pre-Hunters Expanded
@@ -477,9 +656,17 @@
"1_40", "1_80", "1_108", "1_139", "1_195", "1_248", "2_32", "2_75", "3_106",
"4_276", "4_304"
]
set: [
sets: [
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14
]
blocks: [
Promotional|Promotional:0
fotr_block
ttt_block
king_block
war_block
Additional Sets|Reflections:9,Expanded Middle-earth:14
]
}
{
name: Standard
@@ -490,9 +677,16 @@
"0_1-19", "0_21", "0_22", "0_30-47", "0_62-67", "8_1", "13_188", "11_114", "11_31",
"10_11", "15_64", "10_2", "10_91", "11_132", "7_49", "11_100"
]
set: [
sets: [
0, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19
]
blocks: [
Promotional|Promotional:0
king_block
war_block
hunter_block
Additional Sets|Reflections:9,Expanded Middle-earth:14,The Wraith Collection:16,Age's End:19
]
}
{
name: Open
@@ -502,22 +696,17 @@
restricted: [
"1_248", "7_49", "10_2", "10_91", "11_100", "11_132"
]
set: [
sets: [
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19
]
}
{
name: Anything Goes
code: rev_tow_sta
order: 37
sites: MULTIPATH
cancelRingBearerSkirmish: true
set: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19
30, 31, 32, 33
50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69
70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89
101, 102, 103
151, 152, 153
blocks: [
Promotional|Promotional:0
fotr_block
ttt_block
king_block
war_block
hunter_block
Additional Sets|Reflections:9,Expanded Middle-earth:14,The Wraith Collection:16,Age's End:19
]
}
{
@@ -532,9 +721,16 @@
"11_132", "11_222", "11_226", "11_231", "11_232", "13_11", "13_37", "13_64",
"13_188", "14_6"
]
set: [
sets: [
0, 1, 2, 3, 4, 5, 6, 9, 11, 12, 13, 14
]
blocks: [
Promotional|Promotional:0
fotr_block
ttt_block
war_block
Additional Sets|Reflections:9,Expanded Middle-earth:14,The Wraith Collection:16
]
}
{
name: Second Edition
@@ -550,7 +746,7 @@
valid: [
]
set: [
sets: [
40
]
cancelRingBearerSkirmish: true
@@ -569,9 +765,12 @@
"30_2", "30_5", "30_6", "30_7", "30_8", "30_9", "30_10", "30_11", "30_12",
"30_15", "30_16", "30_17", "30_18", "30_19", "30_29", "30_47", "30_48", "30_58"
]
set: [
sets: [
30, 31, 32, 33
]
blocks: [
hobbit
]
restrictedName: [
"Gandalf", Bilbo
]
@@ -585,9 +784,9 @@
cancelRingBearerSkirmish: true
winAtEndOfRegroup: true
discardPileIsPublic: true
hall: true
hall: false
playtest: true
set: [
sets: [
1, 2, 3, 101, 151
]
errataSets: [
@@ -603,9 +802,9 @@
winAtEndOfRegroup: true
discardPileIsPublic: true
usesMaps: true
hall: true
hall: false
playtest: true
set: [
sets: [
1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 101, 151
]
errataSets: [
@@ -620,9 +819,9 @@
order: 43
winAtEndOfRegroup: true
discardPileIsPublic: true
hall: true
hall: false
playtest: true
set: [
sets: [
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 100, 101, 151
]
errataSets: [
@@ -646,9 +845,12 @@
"2_100", "2_105", "2_108", "2_109", "2_112", "2_113", "3_1", "3_3", "3_8", "3_13", "3_15", "3_17", "3_19", "3_21", "3_23", "3_27", "3_29", "3_34", "3_38", "3_39", "3_40", "3_41", "3_42"
"3_44", "3_50", "3_52", "3_54", "3_64", "3_65", "3_66", "3_67", "3_68", "3_71", "3_77", "3_80", "3_81", "3_85", "3_91", "3_93", "3_99", "3_102", "3_103", "3_104", "3_105", "3_110", "3_113"
]
set: [
sets: [
1, 2, 3
]
blocks: [
fotr_block
]
hall: false
}
{
@@ -657,9 +859,12 @@
sites: FELLOWSHIP
cancelRingBearerSkirmish: true
maximumSameName: 1
set: [
sets: [
1, 2, 3
]
blocks: [
fotr_block
]
hall: false
}
{
@@ -667,9 +872,15 @@
code: movie_highlander
sites: KING
maximumSameName: 1
set: [
sets: [
1, 2, 3, 4, 5, 6, 7, 8, 9, 10
]
blocks: [
fotr_block
ttt_block
king_block
Additional Sets|Reflections:9
]
hall: false
}
{
@@ -678,9 +889,12 @@
sites: HOBBIT
cancelRingBearerSkirmish: true
Limited: true
set: [
sets: [
30, 31, 32, 33
]
blocks: [
hobbit
]
hall: false
}
{
@@ -689,9 +903,13 @@
sites: FELLOWSHIP
cancelRingBearerSkirmish: true
maximumSameName: 100
set: [
sets: [
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19
]
blocks: [
fotr_block
Other|Promotional:0,The Two Towers:4,Battle of Helm's Deep:5,Ents of Fangorn:6The Return of the King:7,Siege of Gondor:8,Reflections:9,Mount Doom:10,Shadows:11,Black Rider:12,Bloodlines:13,Expanded Middle-earth:14,The Hunters:15,The Wraith Collection:16,Rise of Saruman:17,Treachery & Deceit:18,Age's End:19
]
hall: false
}
{
@@ -700,9 +918,12 @@
sites: FELLOWSHIP
cancelRingBearerSkirmish: true
maximumSameName: 100
set: [
sets: [
1, 2, 3, 101
]
blocks: [
Fellowship Block|The Fellowship of the Ring:1,Mines of Moria:2,Realms of the Elf-lords:3,V1 - Shadow of the Past:101
]
errataSets: [
51,52,53
71,72,73
@@ -715,9 +936,13 @@
sites: TWO_TOWERS
cancelRingBearerSkirmish: true
maximumSameName: 100
set: [
sets: [
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19
]
blocks: [
ttt_block
Other|Promotional:0,The Fellowship of the Ring:1,Mines of Moria:2,Realms of the Elf-lords:3,The Return of the King:7,Siege of Gondor:8,Reflections:9,Mount Doom:10,Shadows:11,Black Rider:12,Bloodlines:13,Expanded Middle-earth:14,The Hunters:15,The Wraith Collection:16,Rise of Saruman:17,Treachery & Deceit:18,Age's End:19
]
hall: false
}
{
@@ -726,9 +951,14 @@
sites: KING
cancelRingBearerSkirmish: true
maximumSameName: 100
set: [
sets: [
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19
]
blocks: [
king_block
Additional Sets|Reflections:9,
Other|Promotional:0,The Fellowship of the Ring:1,Mines of Moria:2,Realms of the Elf-lords:3,The Two Towers:4,Battle of Helm's Deep:5,Ents of Fangorn:6,Reflections:9,Shadows:11,Black Rider:12,Bloodlines:13,Expanded Middle-earth:14,The Hunters:15,The Wraith Collection:16,Rise of Saruman:17,Treachery & Deceit:18,Age's End:19
]
hall: false
}
{
@@ -737,9 +967,15 @@
sites: SHADOWS
cancelRingBearerSkirmish: false
maximumSameName: 100
set: [
sets: [
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19
]
blocks: [
war_block
Additional Sets|Expanded Middle-earth:14,The Wraith Collection:16,Age's End:19
Movie Block|Promotional:0,The Fellowship of the Ring:1,Mines of Moria:2,Realms of the Elf-lords:3,The Two Towers:4,Battle of Helm's Deep:5,Ents of Fangorn:6,The Return of the King:7,Siege of Gondor:8,Reflections:9,Mount Doom:10
hunter_block
]
hall: false
}
{
@@ -748,9 +984,15 @@
sites: SHADOWS
cancelRingBearerSkirmish: false
maximumSameName: 100
set: [
sets: [
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19
]
blocks: [
war_block
hunter_block
Additional Sets|Expanded Middle-earth:14,The Wraith Collection:16,Age's End:19
Movie Block|Promotional:0,The Fellowship of the Ring:1,Mines of Moria:2,Realms of the Elf-lords:3,The Two Towers:4,Battle of Helm's Deep:5,Ents of Fangorn:6,The Return of the King:7,Siege of Gondor:8,Reflections:9,Mount Doom:10
]
hall: false
}
{
@@ -759,9 +1001,15 @@
sites: MULTIPATH
cancelRingBearerSkirmish: false
maximumSameName: 100
set: [
sets: [
1, 2, 3, 4, 5, 6, 7, 8, 9, 10
]
blocks: [
fotr_block
ttt_block
king_block
Additional Sets|Reflections:9
]
hall: false
}
]

File diff suppressed because it is too large Load Diff

View File

@@ -49,7 +49,9 @@ public class JSONDefs {
public int maximumSameName = 4;
public boolean mulliganRule = true;
public boolean usesMaps = false;
public ArrayList<Integer> set;
public ArrayList<Integer> sets;
public ArrayList<String> blocks;
public ArrayList<BlockFilter> blockFilters;
public ArrayList<String> banned = new ArrayList<>();
public ArrayList<String> restricted = new ArrayList<>();
public ArrayList<String> valid = new ArrayList<>();
@@ -62,6 +64,12 @@ public class JSONDefs {
}
public static class BlockFilter {
public String name;
public String filter;
public Map<String, String> setFilters = new HashMap<>();
}
public static class Set {
public int setId;
public String setName;

View File

@@ -328,7 +328,7 @@ public class LotroCardBlueprintLibrary {
}
}
public boolean hasAlternateInSet(String blueprintId, int setNo) {
public boolean hasAlternateInSet(String blueprintId, String setNo) {
try {
collectionReady.acquire();
var alternatives = _fullBlueprintMapping.get(blueprintId);

View File

@@ -2,6 +2,7 @@ package com.gempukku.lotro.game;
import com.gempukku.lotro.common.JSONDefs;
import com.gempukku.lotro.common.SitesBlock;
import com.gempukku.lotro.game.packs.SetDefinition;
import com.gempukku.lotro.logic.vo.LotroDeck;
import java.util.List;
@@ -47,7 +48,7 @@ public interface LotroFormat {
LotroDeck applyErrata(LotroDeck deck);
List<Integer> getValidSets();
List<String> getValidSets();
List<String> getBannedCards();
@@ -75,4 +76,5 @@ public interface LotroFormat {
Adventure getAdventure();
JSONDefs.Format Serialize();
void generateBlockFilter(Map<String, LotroFormat> allFormats, Map<String, SetDefinition> allSets);
}

View File

@@ -18,7 +18,12 @@ public class SortAndFilterCards {
var rarities = params.getOrDefault("rarity", new ArrayList<>());
var side = Side.Parse(getSingleton(params.get("side")));
var sort = params.getOrDefault("sort", new ArrayList<>());
var formats = params.getOrDefault("format", new ArrayList<>());
var blocks = params.getOrDefault("block", new ArrayList<>());
var sets = params.getOrDefault("set", new ArrayList<>());
var cardTypes = getEnumFilter(CardType.values(), CardType.class, params.get("cardtype"), false);
var cultures = getEnumFilter(Culture.values(), Culture.class, params.get("culture"), true);
@@ -75,7 +80,16 @@ public class SortAndFilterCards {
var card = cardBPCache.get(blueprintId);
boolean valid = true;
if(!IsFlagAccepted(canStartWithRing, card.canStartWithRing()))
if(!formats.isEmpty() && !isInSetOrFormat(blueprintId, card, formats, cardLibrary, formatLibrary))
continue;
if(!blocks.isEmpty() && !isInSetOrFormat(blueprintId, card, blocks, cardLibrary, formatLibrary))
continue;
if(!sets.isEmpty() && !isInSetOrFormat(blueprintId, card, sets, cardLibrary, formatLibrary))
continue;
if(!isFlagAccepted(canStartWithRing, card.canStartWithRing()))
continue;
if(product != null) {
@@ -118,9 +132,6 @@ public class SortAndFilterCards {
}
}
if(!sets.isEmpty() && !isInSets(blueprintId, card, sets, cardLibrary, formatLibrary))
continue;
if(!cardTypes.isEmpty() && !cardTypes.contains(card.getCardType()))
continue;
@@ -238,19 +249,28 @@ public class SortAndFilterCards {
return result;
}
private boolean isInSets(String blueprintId, LotroCardBlueprint card, List<String> setFilters, LotroCardBlueprintLibrary library, LotroFormatLibrary formatLibrary) {
private boolean isInSetOrFormat(String blueprintId, LotroCardBlueprint card, List<String> setFilters, LotroCardBlueprintLibrary library, LotroFormatLibrary formatLibrary) {
boolean isInAnySet = false;
for (String set : setFilters) {
if(isJSInvalidString(set))
continue;
LotroFormat format = formatLibrary.getFormat(set);
if (format != null) {
String invalid = "";
if (card.getCardType() == CardType.SITE) {
String invalid = format.validateSite(blueprintId);
if(!StringUtils.isEmpty(invalid))
return false;
invalid = format.validateSite(blueprintId);
}
else {
invalid = format.validateCard(blueprintId);
}
String invalid = format.validateCard(blueprintId);
return StringUtils.isEmpty(invalid);
if(StringUtils.isEmpty(invalid)) {
isInAnySet = true;
}
continue;
}
if (set.contains("-")) {
@@ -258,17 +278,18 @@ public class SortAndFilterCards {
int min = Integer.parseInt(split[0]);
int max = Integer.parseInt(split[1]);
for (int setNo = min; setNo <= max; setNo++) {
if (blueprintId.startsWith(setNo + "_") || library.hasAlternateInSet(blueprintId, setNo))
return true;
if (blueprintId.startsWith(setNo + "_") || library.hasAlternateInSet(blueprintId, String.valueOf(setNo))) {
isInAnySet = true;
}
}
} else {
if (blueprintId.startsWith(set + "_") || library.hasAlternateInSet(blueprintId, Integer.parseInt(set)))
return true;
if (blueprintId.startsWith(set + "_") || library.hasAlternateInSet(blueprintId, set)) {
isInAnySet = true;
}
}
}
return false;
return isInAnySet;
}
private List<String> getWords(List<String> params, boolean sanitize) {
@@ -393,7 +414,7 @@ public class SortAndFilterCards {
return result;
}
private static boolean IsFlagAccepted(Boolean filterValue, Boolean blueprintValue) {
private static boolean isFlagAccepted(Boolean filterValue, Boolean blueprintValue) {
if(filterValue == null)
return true;
@@ -403,6 +424,10 @@ public class SortAndFilterCards {
return filterValue == blueprintValue;
}
private static boolean isJSInvalidString(String str) {
return str == null || str.isEmpty() || str.equals("null") || str.equals("undefined");
}
/**
* Determines if the blueprint attribute value is accepted by the filter comparison.

View File

@@ -5,6 +5,7 @@ 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.game.packs.SetDefinition;
import com.gempukku.lotro.logic.GameUtils;
import com.gempukku.lotro.logic.vo.LotroDeck;
import org.apache.commons.lang3.StringUtils;
@@ -35,7 +36,7 @@ public class DefaultLotroFormat implements LotroFormat {
private final List<String> _bannedCards = new ArrayList<>();
private final List<String> _restrictedCards = new ArrayList<>();
private final List<String> _validCards = new ArrayList<>();
private final List<Integer> _validSets = new ArrayList<>();
private final List<String> _validSets = new ArrayList<>();
private final List<String> _restrictedCardNames = new ArrayList<>();
private final String _surveyUrl;
private final boolean _isPlaytest;
@@ -45,6 +46,9 @@ public class DefaultLotroFormat implements LotroFormat {
private final List<String> _limit3Cards = new ArrayList<>();
private final Map<String,String> _errataCardMap = new TreeMap<>();
private final List<String> _blockDefs = new ArrayList<>();
private final List<JSONDefs.BlockFilter> _blockFilters = new ArrayList<>();
public DefaultLotroFormat(AdventureLibrary adventureLibrary, LotroCardBlueprintLibrary library, JSONDefs.Format def) throws InvalidPropertiesFormatException{
@@ -68,8 +72,8 @@ public class DefaultLotroFormat implements LotroFormat {
_isPlaytest = def.playtest;
_hallVisible = def.hall;
if(def.set != null)
def.set.forEach(this::addValidSet);
if(def.sets != null)
def.sets.forEach(this::addValidSet);
if(def.banned != null)
def.banned.forEach(this::addBannedCard);
if(def.restricted != null)
@@ -89,6 +93,58 @@ public class DefaultLotroFormat implements LotroFormat {
}
if(def.errata != null)
def.errata.forEach(this::addCardErrata);
if(def.blocks != null)
this._blockDefs.addAll(def.blocks);
}
@Override
public void generateBlockFilter(Map<String, LotroFormat> allFormats, Map<String, SetDefinition> allSets) {
try {
for (String def : this._blockDefs) {
if (def == null || def.isEmpty())
continue;
var filter = new JSONDefs.BlockFilter();
var format = allFormats.get(def);
if (format != null) {
filter.name = format.getName();
filter.filter = format.getCode();
for (String setId : format.getValidSets()) {
var set = allSets.get(setId);
if (set == null)
continue; // maybe throw?
filter.setFilters.put(set.getSetName(), set.getSetId());
}
_blockFilters.add(filter);
continue;
}
//Not a format, so we are splitting apart an ad-hoc definition in the form of:
// Additional Sets|Reflections:9,Expanded Middle-earth:14,The Wraith Collection:16
String filterList = "";
var blockInfo = def.split("\\|");
filter.name = blockInfo[0];
var sets = blockInfo[1].split(",");
for (String set : sets) {
var setInfo = set.split(":");
filter.setFilters.put(setInfo[0], setInfo[1]);
filterList += setInfo[1] + ",";
}
filter.filter = filterList.substring(0, filterList.length() - 1);
_blockFilters.add(filter);
}
}
catch(Exception ex) {
throw new IllegalArgumentException("Format " + _name + " has invalid block definition.", ex);
}
}
@Override
@@ -157,7 +213,7 @@ public class DefaultLotroFormat implements LotroFormat {
}
@Override
public List<Integer> getValidSets() {
public List<String> getValidSets() {
return Collections.unmodifiableList(_validSets);
}
@@ -248,8 +304,8 @@ public class DefaultLotroFormat implements LotroFormat {
_validCards.add(baseBlueprintId);
}
public void addValidSet(int setNo) {
_validSets.add(setNo);
public void addValidSet(Integer setNo) {
_validSets.add(String.valueOf(setNo));
}
//Additional Hobbit Draft card lists
@@ -322,7 +378,7 @@ public class DefaultLotroFormat implements LotroFormat {
}
private boolean isValidInSets(String blueprintId) {
for (int validSet : _validSets)
for (String validSet : _validSets)
if (blueprintId.startsWith(validSet + "_")
|| _library.hasAlternateInSet(blueprintId, validSet))
return true;
@@ -803,7 +859,9 @@ public class DefaultLotroFormat implements LotroFormat {
maximumSameName = _maximumSameName;
mulliganRule = _mulliganRule;
usesMaps = _usesMaps;
set = null;
sets = null;
blocks = null;
blockFilters = new ArrayList<>(_blockFilters);
banned = null;
restricted = null;
valid = null;

View File

@@ -120,6 +120,11 @@ public class LotroFormatLibrary {
_hallFormats.put(format.getCode(), format);
}
}
for(var format : _hallFormats.values()) {
format.generateBlockFilter(_allFormats, _cardLibrary.getSetDefinitions());
}
collectionReady.release();
}
catch (Exception exp) {