Fixing phase dropdown not working in filter. Removing illegitimate "Horn" item class.
This commit is contained in:
@@ -33,7 +33,7 @@
|
||||
|
||||
|
||||
|
||||
SET @player = 'sempolPL', @rank=0;
|
||||
SET @player = 'basmelis', @rank=0;
|
||||
|
||||
SELECT
|
||||
@player AS player
|
||||
@@ -42,6 +42,11 @@ SELECT
|
||||
WHEN winner = @player THEN CONCAT(REPLACE(winner, '_', '%5F'), '$', win_recording_id)
|
||||
ELSE CONCAT(REPLACE(loser, '_', '%5F'), '$', lose_recording_id)
|
||||
END, ']', @rank:=@rank+1,'[/url] • ') AS URL
|
||||
,CONCAT('https://play.lotrtcgpc.net/share/deck?id=',
|
||||
CASE
|
||||
WHEN winner = @player THEN TO_BASE64(CONCAT(winner, '|', winner_deck_name))
|
||||
ELSE TO_BASE64(CONCAT(loser, '|', loser_deck_name))
|
||||
END) AS DeckURL
|
||||
FROM game_history gh
|
||||
INNER JOIN player p
|
||||
ON p.name = @player
|
||||
|
||||
@@ -267,6 +267,8 @@ var CardFilter = Class.extend({
|
||||
this.itemClassLabel = $("<label for='itemClassSelect' class='filterLabel'>Item Class:</label>");
|
||||
this.itemClassSelect = $("<select id='itemClassSelect' class='filterInput'>"
|
||||
+ "<option value='' selected='selected'>Any</option>"
|
||||
+ "<option value='CLASSLESS'>Classless</option>"
|
||||
+ "<option value='SUPPORT_AREA'>Support Area</option>"
|
||||
+ "<option value='ARMOR'>Armor</option>"
|
||||
+ "<option value='BOX'>Box</option>"
|
||||
+ "<option value='BRACERS'>Bracers</option>"
|
||||
@@ -275,7 +277,6 @@ var CardFilter = Class.extend({
|
||||
+ "<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>"
|
||||
@@ -285,7 +286,7 @@ var CardFilter = Class.extend({
|
||||
+ "<option value='RING'>Ring</option>"
|
||||
+ "<option value='SHIELD'>Shield</option>"
|
||||
+ "<option value='STAFF'>Staff</option>"
|
||||
+ "<option value='CLASSLESS'>Classless</option>"
|
||||
|
||||
+ "</select>");
|
||||
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@ 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"),
|
||||
CLASSLESS("Classless"),
|
||||
|
||||
//PC Classes
|
||||
|
||||
@@ -32,7 +32,7 @@ public class SortAndFilterCards {
|
||||
var textWords = getWords(params.get("gametext"), false);
|
||||
|
||||
var keywords = getEnumFilter(Keyword.values(), Keyword.class, params.get("keyword"), true);
|
||||
var phases = getEnumFilter(Keyword.values(),Keyword.class, params.get("phase"), true);
|
||||
var phases = getEnumFilter(Timeword.values(),Timeword.class, params.get("phase"), true);
|
||||
var races = getEnumFilter(Race.values(), Race.class, params.get("race"), true);
|
||||
var itemClasses = getEnumFilter(PossessionClass.values(), PossessionClass.class, params.get("itemclass"), true);
|
||||
|
||||
@@ -56,7 +56,7 @@ public class SortAndFilterCards {
|
||||
|
||||
//In this giant loop, we will go through every item handed to us and see if it matches all of the above filter
|
||||
// conditions. Whenever we fail a filter, we hit "continue" and move on to the next item to check.
|
||||
for (T item : items) {
|
||||
cardValidation: for (T item : items) {
|
||||
String blueprintId = item.getBlueprintId();
|
||||
String strippedId = BlueprintUtils.stripModifiers(blueprintId);
|
||||
|
||||
@@ -174,8 +174,18 @@ public class SortAndFilterCards {
|
||||
continue;
|
||||
|
||||
if(!phases.isEmpty()) {
|
||||
if(card.getCardType() != CardType.EVENT || !containsAnyKeywords(card, phases))
|
||||
continue;
|
||||
if(card.getCardType() == CardType.EVENT) {
|
||||
if(!containsAnyTimewords(card, phases))
|
||||
continue;
|
||||
}
|
||||
else {
|
||||
for(var timeword : phases) {
|
||||
String timephrase = StringUtils.capitalize(timeword.toString().toLowerCase() + ":");
|
||||
if(!containsAllWords(GameUtils.getFullText(card), Collections.singletonList(timephrase)))
|
||||
continue cardValidation;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if(!itemClasses.isEmpty() && !containsAnyClasses(card, itemClasses))
|
||||
@@ -345,6 +355,14 @@ public class SortAndFilterCards {
|
||||
return false;
|
||||
}
|
||||
|
||||
private boolean containsAnyTimewords(LotroCardBlueprint blueprint, Set<Timeword> timewords) {
|
||||
for (Timeword timeword : timewords) {
|
||||
if (blueprint.hasTimeword(timeword))
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private boolean containsAnyClasses(LotroCardBlueprint blueprint, Set<PossessionClass> itemClassFilters) {
|
||||
if (blueprint == null)
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user