diff --git a/assets/js/app.data.js b/assets/js/app.data.js index 938e9b57..34678c6a 100755 --- a/assets/js/app.data.js +++ b/assets/js/app.data.js @@ -16,6 +16,221 @@ var dfd; + // Restricted/Banned Lists issued by The Conclave (v2.0) + data.joust_restricted_list = [ + "02034", // Crown of Gold (TRtW) + "02065", // Halder (NMG) + "02091", // Raider from Pyke (CoW) + "02092", // Iron Mines (CoW) + "02102", // Ward (TS) + "06004", // All Men Are Fools (AMAF) + "06038", // Great Hall (GtR) + "06039", // "The Dornishman's Wife" (GtR) + "06040", // The Annals of Castle Black (GtR) + "06098", // Flea Bottom (OR) + "08080", // The King in the North (FotOG) + "08082", // I Am No One (TFM) + "09001", // Mace Tyrell (HoT) + "09037", // Qotho (HoT) + "09051", // Trade Routes (HoT) + "10045", // The Wars To Come (SoD) + "10048", // Forced March (SoD) + "10050", // Breaking Ties (SoD) + "11012", // Nighttime Marauders (TSC) + "11021", // Wyman Manderly (TMoW) + "11033", // Hizdahr zo Loraq (TMoW) + "11034", // Meereen (TMoW) + "11051", // Drowned God Fanatic (SoKL) + "11061", // Meera Reed (MoD) + "11114", // Gifts for the Widow (DitD) + "12002", // Euron Crow's Eye (KotI) + "12029", // Desert Raider (KotI) + "12046", // We Take Westeros! (KotI) + "12047", // Return to the Fields (KotI) + "13044", // Unexpected Guile (PoS) + "13085", // Yoren (TB) + "13086", // Bound for the Wall (TB) + "13103", // The Queen's Retinue (LMHR) + "14008", // Selyse Baratheon (FotS) + "15030", // The Red Keep (DotE) + "15033", // Clydas (DotE) + "15045", // Bribery (DotE) + "16027", // Aloof and Apart (TTWDFL) + ]; + data.joust_pods = [ + { + name: "P1", + restricted: "13085", // Yoren (TB) + cards: [ + "04026", // Craven (CtA) + "11085", // Three-Finger Hobb (IDP) + ], + }, + { + name: "P2", + restricted: "11051", // Drowned God Fanatic (SoKL) + cards: [ + "06011", // Drowned Disciple (AMAF) + ], + }, + { + name: "P3", + restricted: "11114", // Gifts for the Widow (DitD) + cards: [ + "15001", // Daenerys Targaryen (DotE) + ] + }, + { + name: "P4", + restricted: "09037", // Qotho (HoT) + cards: [ + "15017", // Womb of the World (DotE) + ] + }, + { + name: "P5", + restricted: "09001", // Mace Tyrell (HoT) + cards: [ + "09017", // The Hightower (HoT) + ] + }, + { + name: "P6", + restricted: "12029", // Desert Raider (KotI) + cards: [ + "06011", // Drowned Disciple (AMAF) + ] + }, + { + name: "P7", + restricted: "11021", // Wyman Manderly (TMoW) + cards: [ + "11081", // Bear Island Scout (IDP) + "11082", // Skagos (IDP) + ] + }, + { + name: "P8", + restricted: "06040", // The Annals of Castle Black (GtR) + cards: [ + "06063", // Oldtown Informer (TRW) + "06100", // Wheels Within Wheels (OR) + ] + }, + ]; + data.joust_banned_list = [ + "03038", // To the Rose Banner! (WotN) + "04001", // The Dragon's Tail (AtSK) + "05010", // Taena Merryweather (LoCR) + "05049", // Littlefinger's Meddling (LoCR) + "11076", // A Mission in Essos (MoD) + "12045", // Sea of Blood (KotI) + "13079", // Kingdom of Shadows (BtRK) + "16001", // Ser Davos Seaworth (TTWDFL) + "16002", // Melisandre's Favor (TTWDFL) + "16003", // Wintertime Marauders (TTWDFL) + "16004", // Conquer (TTWDFL) + "16005", // Spider's Whisperer (TTWDFL) + "16006", // Wheels Within Wheels (TTWDFL) + "16007", // Prince's Loyalist (TTWDFL) + "16008", // You Murdered Her Children (TTWDFL) + "16009", // Samwell Tarly (TTWDFL) + "16010", // Old Bear Mormont (TTWDFL) + "16011", // Catelyn Stark (TTWDFL) + "16012", // Snow Castle (TTWDFL) + "16013", // Mad King Aerys (TTWDFL) + "16014", // The Hatchlings' Feast (TTWDFL) + "16015", // The Queen of Thorns (TTWDFL) + "16016", // Olenna's Study (TTWDFL) + "16017", // Littlefinger (TTWDFL) + "16018", // Vale Refugee (TTWDFL) + "16019", // High Ground (TTWDFL) + "16020", // King's Landing (TTWDFL) + "16021", // Harrenhal (TTWDFL) + "16022", // Sky Cell (TTWDFL) + "16023", // Heads on Pikes (TTWDFL) + "16024", // Narrow Escape (TTWDFL) + "16025", // Seductive Promise (TTWDFL) + "16026", // Westeros Bleeds (TTWDFL) + "16031", // Benjen's Cache (TTWDFL) + "16032", // Rioting (TTWDFL) + "16033", // Rule By Decree (TTWDFL) + "16034", // Search and Detain (TTWDFL) + "16035", // The Art of Seduction (TTWDFL) + "16036", // The Gathering Storm (TTWDFL) + ]; + data.melee_restricted_list = [ + "01001", // A Clash of Kings (Core) + "01013", // Heads on Spikes (Core) + "01043", // Superior Claim (Core) + "01078", // Great Kraken (Core) + "01119", // Doran's Game (Core) + "01146", // Robb Stark (Core) + "01162", // Khal Drogo (Core) + "02012", // Rise of the Kraken (TtB) + "02024", // Lady Sansa's Rose (TRtW) + "02060", // The Lord of the Crossing (TKP) + "03003", // Eddard Stark (WotN) + "04003", // Riverrun (AtSK) + "04118", // Relentless Assault (TC) + "05001", // Cersei Lannister (LoCR) + "06004", // All Men Are Fools (AMAF) + "06011", // Drowned Disciple (AMAF) + "06039", // "The Dornishman's Wife" (GtR) + "06040", // The Annals of Castle Black (GtR) + "06098", // Flea Bottom (OR) + "07036", // Plaza of Pride (WotW) + "08013", // Nagga's Ribs (TAK) + "08014", // Daario Naharis (TAK) + "08082", // I Am No One (TFM) + "08098", // "The Song of the Seven" (TFM) + "08120", // You Win Or You Die (SAT) + "09001", // Mace Tyrell (HoT) + "09028", // Corpse Lake (HoT) + "11039", // Trading With Qohor (TMoW) + "11054", // Queensguard (SoKL) + "13107", // Robert Baratheon (LMHR) + "15045", // Bribery (DotE) + ]; + data.melee_banned_list = [ + "03038", // To the Rose Banner! (WotN) + "05010", // Taena Merryweather (LoCR) + "05049", // Littlefinger's Meddling (LoCR) + "11076", // A Mission in Essos (MoD) + "16001", // Ser Davos Seaworth (TTWDFL) + "16002", // Melisandre's Favor (TTWDFL) + "16003", // Wintertime Marauders (TTWDFL) + "16004", // Conquer (TTWDFL) + "16005", // Spider's Whisperer (TTWDFL) + "16006", // Wheels Within Wheels (TTWDFL) + "16007", // Prince's Loyalist (TTWDFL) + "16008", // You Murdered Her Children (TTWDFL) + "16009", // Samwell Tarly (TTWDFL) + "16010", // Old Bear Mormont (TTWDFL) + "16011", // Catelyn Stark (TTWDFL) + "16012", // Snow Castle (TTWDFL) + "16013", // Mad King Aerys (TTWDFL) + "16014", // The Hatchlings' Feast (TTWDFL) + "16015", // The Queen of Thorns (TTWDFL) + "16016", // Olenna's Study (TTWDFL) + "16017", // Littlefinger (TTWDFL) + "16018", // Vale Refugee (TTWDFL) + "16019", // High Ground (TTWDFL) + "16020", // King's Landing (TTWDFL) + "16021", // Harrenhal (TTWDFL) + "16022", // Sky Cell (TTWDFL) + "16023", // Heads on Pikes (TTWDFL) + "16024", // Narrow Escape (TTWDFL) + "16025", // Seductive Promise (TTWDFL) + "16026", // Westeros Bleeds (TTWDFL) + "16031", // Benjen's Cache (TTWDFL) + "16032", // Rioting (TTWDFL) + "16033", // Rule By Decree (TTWDFL) + "16034", // Search and Detain (TTWDFL) + "16035", // The Art of Seduction (TTWDFL) + "16036", // The Gathering Storm (TTWDFL) + ]; + function onCollectionUpdate(updated) { database_changed = true; } @@ -42,7 +257,7 @@ /* * data has been fetched from local store */ - + /* * we set up insert and update listeners now * if we did it before, .load() would have called onInsert diff --git a/assets/js/app.deck.js b/assets/js/app.deck.js index 24ef2c56..2d986a4d 100755 --- a/assets/js/app.deck.js +++ b/assets/js/app.deck.js @@ -26,222 +26,7 @@ card_line_tpl = _.template(' <%= card.label %><%= labels %>'), card_line_label_tpl = _.template('<%= label %>'), layouts = {}, - layout_data = {}, - // Restricted/Banned Lists issued by The Conclave (v2.0) - joust_restricted_list = [ - "02034", // Crown of Gold (TRtW) - "02065", // Halder (NMG) - "02091", // Raider from Pyke (CoW) - "02092", // Iron Mines (CoW) - "02102", // Ward (TS) - "06004", // All Men Are Fools (AMAF) - "06038", // Great Hall (GtR) - "06039", // "The Dornishman's Wife" (GtR) - "06040", // The Annals of Castle Black (GtR) - "06098", // Flea Bottom (OR) - "08080", // The King in the North (FotOG) - "08082", // I Am No One (TFM) - "09001", // Mace Tyrell (HoT) - "09037", // Qotho (HoT) - "09051", // Trade Routes (HoT) - "10045", // The Wars To Come (SoD) - "10048", // Forced March (SoD) - "10050", // Breaking Ties (SoD) - "11012", // Nighttime Marauders (TSC) - "11021", // Wyman Manderly (TMoW) - "11033", // Hizdahr zo Loraq (TMoW) - "11034", // Meereen (TMoW) - "11051", // Drowned God Fanatic (SoKL) - "11061", // Meera Reed (MoD) - "11114", // Gifts for the Widow (DitD) - "12002", // Euron Crow's Eye (KotI) - "12029", // Desert Raider (KotI) - "12046", // We Take Westeros! (KotI) - "12047", // Return to the Fields (KotI) - "13044", // Unexpected Guile (PoS) - "13085", // Yoren (TB) - "13086", // Bound for the Wall (TB) - "13103", // The Queen's Retinue (LMHR) - "14008", // Selyse Baratheon (FotS) - "15030", // The Red Keep (DotE) - "15033", // Clydas (DotE) - "15045", // Bribery (DotE) - "16027", // Aloof and Apart (TTWDFL) - ], - joust_pods = [ - { - name: "P1", - restricted: "13085", // Yoren (TB) - cards: [ - "04026", // Craven (CtA) - "11085", // Three-Finger Hobb (IDP) - ], - }, - { - name: "P2", - restricted: "11051", // Drowned God Fanatic (SoKL) - cards: [ - "06011", // Drowned Disciple (AMAF) - ], - }, - { - name: "P3", - restricted: "11114", // Gifts for the Widow (DitD) - cards: [ - "15001", // Daenerys Targaryen (DotE) - ] - }, - { - name: "P4", - restricted: "09037", // Qotho (HoT) - cards: [ - "15017", // Womb of the World (DotE) - ] - }, - { - name: "P5", - restricted: "09001", // Mace Tyrell (HoT) - cards: [ - "09017", // The Hightower (HoT) - ] - }, - { - name: "P6", - restricted: "12029", // Desert Raider (KotI) - cards: [ - "06011", // Drowned Disciple (AMAF) - ] - }, - { - name: "P7", - restricted: "11021", // Wyman Manderly (TMoW) - cards: [ - "11081", // Bear Island Scout (IDP) - "11082", // Skagos (IDP) - ] - }, - { - name: "P8", - restricted: "06040", // The Annals of Castle Black (GtR) - cards: [ - "06063", // Oldtown Informer (TRW) - "06100", // Wheels Within Wheels (OR) - - ] - }, - ], - joust_banned_list = [ - "03038", // To the Rose Banner! (WotN) - "04001", // The Dragon's Tail (AtSK) - "05010", // Taena Merryweather (LoCR) - "05049", // Littlefinger's Meddling (LoCR) - "11076", // A Mission in Essos (MoD) - "12045", // Sea of Blood (KotI) - "13079", // Kingdom of Shadows (BtRK) - "16001", // Ser Davos Seaworth (TTWDFL) - "16002", // Melisandre's Favor (TTWDFL) - "16003", // Wintertime Marauders (TTWDFL) - "16004", // Conquer (TTWDFL) - "16005", // Spider's Whisperer (TTWDFL) - "16006", // Wheels Within Wheels (TTWDFL) - "16007", // Prince's Loyalist (TTWDFL) - "16008", // You Murdered Her Children (TTWDFL) - "16009", // Samwell Tarly (TTWDFL) - "16010", // Old Bear Mormont (TTWDFL) - "16011", // Catelyn Stark (TTWDFL) - "16012", // Snow Castle (TTWDFL) - "16013", // Mad King Aerys (TTWDFL) - "16014", // The Hatchlings' Feast (TTWDFL) - "16015", // The Queen of Thorns (TTWDFL) - "16016", // Olenna's Study (TTWDFL) - "16017", // Littlefinger (TTWDFL) - "16018", // Vale Refugee (TTWDFL) - "16019", // High Ground (TTWDFL) - "16020", // King's Landing (TTWDFL) - "16021", // Harrenhal (TTWDFL) - "16022", // Sky Cell (TTWDFL) - "16023", // Heads on Pikes (TTWDFL) - "16024", // Narrow Escape (TTWDFL) - "16025", // Seductive Promise (TTWDFL) - "16026", // Westeros Bleeds (TTWDFL) - "16031", // Benjen's Cache (TTWDFL) - "16032", // Rioting (TTWDFL) - "16033", // Rule By Decree (TTWDFL) - "16034", // Search and Detain (TTWDFL) - "16035", // The Art of Seduction (TTWDFL) - "16036", // The Gathering Storm (TTWDFL) - ], - melee_restricted_list = [ - "01001", // A Clash of Kings (Core) - "01013", // Heads on Spikes (Core) - "01043", // Superior Claim (Core) - "01078", // Great Kraken (Core) - "01119", // Doran's Game (Core) - "01146", // Robb Stark (Core) - "01162", // Khal Drogo (Core) - "02012", // Rise of the Kraken (TtB) - "02024", // Lady Sansa's Rose (TRtW) - "02060", // The Lord of the Crossing (TKP) - "03003", // Eddard Stark (WotN) - "04003", // Riverrun (AtSK) - "04118", // Relentless Assault (TC) - "05001", // Cersei Lannister (LoCR) - "06004", // All Men Are Fools (AMAF) - "06011", // Drowned Disciple (AMAF) - "06039", // "The Dornishman's Wife" (GtR) - "06040", // The Annals of Castle Black (GtR) - "06098", // Flea Bottom (OR) - "07036", // Plaza of Pride (WotW) - "08013", // Nagga's Ribs (TAK) - "08014", // Daario Naharis (TAK) - "08082", // I Am No One (TFM) - "08098", // "The Song of the Seven" (TFM) - "08120", // You Win Or You Die (SAT) - "09001", // Mace Tyrell (HoT) - "09028", // Corpse Lake (HoT) - "11039", // Trading With Qohor (TMoW) - "11054", // Queensguard (SoKL) - "13107", // Robert Baratheon (LMHR) - "15045", // Bribery (DotE) - ], - melee_banned_list = [ - "03038", // To the Rose Banner! (WotN) - "05010", // Taena Merryweather (LoCR) - "05049", // Littlefinger's Meddling (LoCR) - "11076", // A Mission in Essos (MoD) - "16001", // Ser Davos Seaworth (TTWDFL) - "16002", // Melisandre's Favor (TTWDFL) - "16003", // Wintertime Marauders (TTWDFL) - "16004", // Conquer (TTWDFL) - "16005", // Spider's Whisperer (TTWDFL) - "16006", // Wheels Within Wheels (TTWDFL) - "16007", // Prince's Loyalist (TTWDFL) - "16008", // You Murdered Her Children (TTWDFL) - "16009", // Samwell Tarly (TTWDFL) - "16010", // Old Bear Mormont (TTWDFL) - "16011", // Catelyn Stark (TTWDFL) - "16012", // Snow Castle (TTWDFL) - "16013", // Mad King Aerys (TTWDFL) - "16014", // The Hatchlings' Feast (TTWDFL) - "16015", // The Queen of Thorns (TTWDFL) - "16016", // Olenna's Study (TTWDFL) - "16017", // Littlefinger (TTWDFL) - "16018", // Vale Refugee (TTWDFL) - "16019", // High Ground (TTWDFL) - "16020", // King's Landing (TTWDFL) - "16021", // Harrenhal (TTWDFL) - "16022", // Sky Cell (TTWDFL) - "16023", // Heads on Pikes (TTWDFL) - "16024", // Narrow Escape (TTWDFL) - "16025", // Seductive Promise (TTWDFL) - "16026", // Westeros Bleeds (TTWDFL) - "16031", // Benjen's Cache (TTWDFL) - "16032", // Rioting (TTWDFL) - "16033", // Rule By Decree (TTWDFL) - "16034", // Search and Detain (TTWDFL) - "16035", // The Art of Seduction (TTWDFL) - "16036", // The Gathering Storm (TTWDFL) - ]; + layout_data = {}; var factions = { '01198': 'baratheon', @@ -272,7 +57,7 @@ return map; } - var joust_pods_map = get_pods_map(joust_pods); + var joust_pods_map = get_pods_map(app.data.joust_pods); /* * Checks a given card's text has the "Shadow" keyword. @@ -360,8 +145,8 @@ * @return {boolean} */ var is_joust_restricted_list_compliant = function(cards) { - return validate_deck_against_restricted_list(cards, joust_restricted_list) - && validate_deck_against_pods(cards, joust_pods); + return validate_deck_against_restricted_list(cards, app.data.joust_restricted_list) + && validate_deck_against_pods(cards, app.data.joust_pods); }; /* @@ -370,7 +155,7 @@ * @return {boolean} */ var is_melee_restricted_list_compliant = function(cards) { - return validate_deck_against_restricted_list(cards, melee_restricted_list); + return validate_deck_against_restricted_list(cards, app.data.melee_restricted_list); }; /* @@ -379,7 +164,7 @@ * @return {boolean} */ var is_joust_banned_list_compliant = function(cards) { - return validate_against_banned_list(cards, joust_banned_list); + return validate_against_banned_list(cards, app.data.joust_banned_list); } /* @@ -388,7 +173,7 @@ * @return {boolean} */ var is_melee_banned_list_compliant = function(cards) { - return validate_against_banned_list(cards, melee_banned_list); + return validate_against_banned_list(cards, app.data.melee_banned_list); } /** @@ -1376,12 +1161,12 @@ } return rhett; } - var isBannedInJoust = (-1 !== joust_banned_list.indexOf(card.code)); - var isBannedInMelee = (-1 !== melee_banned_list.indexOf(card.code)); - if (-1 !== joust_restricted_list.indexOf(card.code)) { + var isBannedInJoust = (-1 !== app.data.joust_banned_list.indexOf(card.code)); + var isBannedInMelee = (-1 !== app.data.melee_banned_list.indexOf(card.code)); + if (-1 !== app.data.joust_restricted_list.indexOf(card.code)) { labels.push({ name: '[J]', class: "rl-joust", title: Translator.trans('card.rl-joust.title') }); } - if (-1 !== melee_restricted_list.indexOf(card.code)) { + if (-1 !== app.data.melee_restricted_list.indexOf(card.code)) { labels.push({ name: '[M]', class: "rl-melee", title: Translator.trans('card.rl-melee.title') }); } if (isBannedInJoust && isBannedInMelee) { diff --git a/assets/js/ui.deckedit.js b/assets/js/ui.deckedit.js index 5a9c300e..7c99dae1 100755 --- a/assets/js/ui.deckedit.js +++ b/assets/js/ui.deckedit.js @@ -24,6 +24,8 @@ Config = _.extend({ 'show-unusable': false, 'show-only-deck': false, + 'hide-banned-melee': false, + 'hide-banned-joust': false, 'display-column': 1, 'core-set': 3, 'buttons-behavior': 'cumulative' @@ -53,11 +55,12 @@ $('input[name=' + radio + '][value=' + Config[radio] + ']').prop('checked', true); }); // checkbox - ['show-unusable', 'show-only-deck'].forEach(function (checkbox) + ['show-unusable', 'show-only-deck', 'hide-banned-melee', 'hide-banned-joust'].forEach(function (checkbox) { if(Config[checkbox]) $('input[name=' + checkbox + ']').prop('checked', true); }); + }; /** @@ -627,7 +630,12 @@ var unusable = !app.deck.can_include_card(card); if(!Config['show-unusable'] && unusable) return; - + if (Config['hide-banned-joust'] && -1 !== app.data.joust_banned_list.indexOf(card.code)) { + return; + } + if (Config['hide-banned-melee'] && -1 !== app.data.melee_banned_list.indexOf(card.code)) { + return; + } var row = divs[card.code]; if(!row) row = divs[card.code] = ui.build_row(card); diff --git a/templates/Builder/tab-pane-build.html.twig b/templates/Builder/tab-pane-build.html.twig index 36c5741f..1a32799b 100755 --- a/templates/Builder/tab-pane-build.html.twig +++ b/templates/Builder/tab-pane-build.html.twig @@ -21,12 +21,38 @@ data-toggle="dropdown">{{ 'decks.edit.build.options.label' | trans }}