Editing Template:CardSearch
From LOTR-TCG Wiki
The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then publish the changes below to finish undoing the edit.
Latest revision | Your text | ||
Line 3: | Line 3: | ||
</noinclude><includeonly> | </noinclude><includeonly> | ||
{{#cargo_query:tables= | {{{advancedOptions|}}} | ||
|join on= | |||
{{#cargo_query:tables=Cards=C,CardReleases=EN,CardReleases=CR,CardSets=S,Languages=L | |||
|join on=C.ReprintBaseID = EN.ID,EN.ID = CR.BaseCardID,C.SetNum=S.ID,CR.LanguageCode=L.Code | |||
|fields= | |fields= | ||
CONCAT('[[Image:Culture_', C.Culture, '.svg|x20px|text-bottom|link=', C.Culture, '_Culture|class=whitebg]]', ' <span class="tooltip">[[', REPLACE(REPLACE(C._pageName, '/Data', ''), 'Data:', ''), '|', CASE WHEN CR.LanguageCode <> 'EN' THEN CONCAT("'''", CR.LanguageCode, "''' ") ELSE '' END, IFNULL(CR.Title,EN.Title), CASE WHEN IFNULL(CR.Subtitle,EN.Subtitle) IS NULL THEN '' ELSE CONCAT(', ', IFNULL(CR.Subtitle,EN.Subtitle)) END, ' (', IFNULL(CR.CollInfo,C.CollInfo), ')', CASE WHEN CR.Revision > 0 THEN CONCAT(' [E',CR.Revision,']') ELSE '' END, ']]<span>[[File:', IFNULL(CR.ImageFilename,'Card_Not_Found.jpg'), '|500x500px]]</span></span>')=CardName | CONCAT('[[Image:Culture_', C.Culture, '.svg|x20px|text-bottom|link=', C.Culture, '_Culture|class=whitebg]]', ' <span class="tooltip">[[', REPLACE(REPLACE(C._pageName, '/Data', ''), 'Data:', ''), '|', CASE WHEN CR.LanguageCode <> 'EN' THEN CONCAT("'''", CR.LanguageCode, "''' ") ELSE '' END, IFNULL(CR.Title,EN.Title), CASE WHEN IFNULL(CR.Subtitle,EN.Subtitle) IS NULL THEN '' ELSE CONCAT(', ', IFNULL(CR.Subtitle,EN.Subtitle)) END, ' (', IFNULL(CR.CollInfo,C.CollInfo), ')', CASE WHEN CR.Revision > 0 THEN CONCAT(' [E',CR.Revision,']') ELSE '' END, ']]<span>[[File:', IFNULL(CR.ImageFilename,'Card_Not_Found.jpg'), '|500x500px]]</span></span>')=CardName | ||
|where= ('{{{isUnique|any}}}' = 'any' OR CR.IsUnique = {{Boolean|{{{isUnique|any}}}}}) | |where= ('{{{isUnique|any}}}' = 'any' OR CR.IsUnique = {{Boolean|{{{isUnique|any}}}}}) | ||
AND ("{{{title|}}}" = "" OR | AND ("{{{title|}}}" = "" OR CR.Title RLIKE "{{{title|}}}") | ||
AND ("{{{subtitle|}}}" = "" OR | AND ("{{{subtitle|}}}" = "" OR CR.Subtitle RLIKE "{{{subtitle|}}}") | ||
AND ("{{{side|}}}" = "" OR C.Side = "{{{side|}}}") | AND ("{{{side|}}}" = "" OR C.Side = "{{{side|}}}") | ||
AND ("{{{creator|}}}" = "" OR "{{{creator|}}}" LIKE CONCAT('%', S.Creator, '%')) | AND ("{{{creator|}}}" = "" OR "{{{creator|}}}" LIKE CONCAT('%', S.Creator, '%')) | ||
AND ("{{{setnums|}}}" = "" OR "{{{setnums|}}}" LIKE CONCAT('%', S.Name, '%')) | AND ("{{{setnums|}}}" = "" OR "{{{setnums|}}}" LIKE CONCAT('%', S.Name, '%')) | ||
Line 18: | Line 19: | ||
AND ("{{{textSearch|}}}" = "" OR CR.GameText LIKE "%{{{textSearch|}}}%") | AND ("{{{textSearch|}}}" = "" OR CR.GameText LIKE "%{{{textSearch|}}}%") | ||
AND ("{{{textRegexSearch|}}}" = "" OR CR.GameText RLIKE "{{ | AND ("{{{textRegexSearch|}}}" = "" OR CR.GameText RLIKE "{{{textRegexSearch|}}}") | ||
AND ("{{{taggedTextRegexSearch|}}}" = "" OR CR.TaggedGameText RLIKE "{{{taggedTextRegexSearch|}}}") | |||
AND ("{{{culture|}}}" = "" OR "{{{culture|}}}" LIKE CONCAT('%', C.Culture, '%')) | AND ("{{{culture|}}}" = "" OR "{{{culture|}}}" LIKE CONCAT('%', C.Culture, '%')) | ||
Line 32: | Line 34: | ||
AND ("{{{usesItemClass|}}}" = "" OR CR.GameText RLIKE "({{#replace:{{#replace:{{#replace:{{#replace:{{{usesItemClass|}}}|,|{{!}}}}||}}|RangedWeapon|Ranged Weapon}}|HandWeapon|Hand Weapon}})" ) | AND ("{{{usesItemClass|}}}" = "" OR CR.GameText RLIKE "({{#replace:{{#replace:{{#replace:{{#replace:{{{usesItemClass|}}}|,|{{!}}}}||}}|RangedWeapon|Ranged Weapon}}|HandWeapon|Hand Weapon}})" ) | ||
AND ("{{{keyword|}}}" = "" OR CR.GameText RLIKE '(?<!\\w )({{#replace:{{#replace:{{#replace:{{#replace:{{{keyword|}}}|,|{{!}}}}||}}|+|XX \\+}}|XX|}})\\.' OR ("{{{keyword|}}}" LIKE '%Ring-bound%' AND (C.Title IN ('Frodo', 'Sam') OR CR.CanBearRing = 1)) OR ("{{{keyword|}}}" LIKE '%Unbound%' AND (C.CardType = 'Companion' AND C.Title NOT IN ('Frodo', 'Sam') AND CR.GameText NOT RLIKE '(?<!\\w )Ring-bound\\.')) OR ("{{{keyword|}}}" LIKE '%Ambush%' AND CR.GameText RLIKE '(?<!\\w )Ambush \\(\\d+\\)\\.') ) | |||
AND ("{{{keyword|}}}" = "" OR CR.GameText RLIKE '(?<!\\w )({{#replace:{{#replace:{{#replace:{{#replace:{{{keyword|}}}|,|{{!}}}}||}}|+|XX \\+}}|XX|}})\\.' OR ("{{{keyword|}}}" LIKE '%Ring-bound%' AND (C.Title IN ('Frodo', 'Sam') OR CR.CanBearRing = 1)) OR ("{{{keyword|}}}" LIKE '%Unbound%' AND (C.CardType = 'Companion' AND C.Title NOT IN ('Frodo', 'Sam') AND CR.GameText NOT RLIKE '(?<!\\w )Ring-bound\\.')) OR ("{{{keyword|}}}" LIKE '%Ambush%' AND CR.GameText RLIKE '(?<!\\w )Ambush \\(\\d+\\) | |||
AND ("{{{usesKeyword|}}}" = "" OR (CR.GameText RLIKE '(?<=\\w )({{#replace:{{#replace:{{{usesKeyword|}}}|,|{{!}}}}||}})' AND (1 = CASE WHEN "{{{usesKeyword|}}}" LIKE '%Archer%' AND CR.GameText LIKE '%Archer%' THEN CR.GameText RLIKE '(?<=\\w )archer\\b' ELSE 1 END )) ) | AND ("{{{usesKeyword|}}}" = "" OR (CR.GameText RLIKE '(?<=\\w )({{#replace:{{#replace:{{{usesKeyword|}}}|,|{{!}}}}||}})' AND (1 = CASE WHEN "{{{usesKeyword|}}}" LIKE '%Archer%' AND CR.GameText LIKE '%Archer%' THEN CR.GameText RLIKE '(?<=\\w )archer\\b' ELSE 1 END )) ) | ||
Line 44: | Line 44: | ||
AND ("{{{strength|}}}" = "" OR CASE WHEN "{{{strength|}}}" RLIKE '(\\+{{!}}-)\\d+' THEN CR.StrengthMod = "{{{strength|}}}" ELSE CR.Strength = "{{{strength|}}}" END) | AND ("{{{strength|}}}" = "" OR CASE WHEN "{{{strength|}}}" RLIKE '(\\+{{!}}-)\\d+' THEN CR.StrengthMod = "{{{strength|}}}" ELSE CR.Strength = "{{{strength|}}}" END) | ||
AND ("{{{strengthMore|}}}" = "" OR CASE WHEN "{{{strengthMore|}}}" RLIKE '(\\+{{!}}-)\\d+' THEN CAST(CR.StrengthMod AS INT) >= CAST("{{{strengthMore|}}}" AS INT) ELSE CR.Strength >= "{{{strengthMore|}}}" END) | AND ("{{{strengthMore|}}}" = "" OR CASE WHEN "{{{strengthMore|}}}" RLIKE '(\\+{{!}}-)\\d+' THEN CAST(CR.StrengthMod AS INT) >= CAST("{{{strengthMore|}}}" AS INT) ELSE CR.Strength >= "{{{strengthMore|}}}" END) | ||
AND ("{{{strengthLess|}}}" = "" OR CASE WHEN "{{{strengthLess|}}}" RLIKE '(\\+{{!}}-)\\d+' THEN CAST(CR.StrengthMod AS INT) <= CAST("{{{strengthLess|}}}" AS INT) ELSE CR.Strength | AND ("{{{strengthLess|}}}" = "" OR CASE WHEN "{{{strengthLess|}}}" RLIKE '(\\+{{!}}-)\\d+' THEN CAST(CR.StrengthMod AS INT) <= CAST("{{{strengthLess|}}}" AS INT) ELSE CR.Strength >= "{{{strengthLess|}}}" END) | ||
AND ("{{{vitality|}}}" = "" OR CASE WHEN "{{{vitality|}}}" RLIKE '(\\+{{!}}-)\\d+' THEN CR.VitalityMod = "{{{vitality|}}}" ELSE CR.Vitality = "{{{vitality|}}}" END) | AND ("{{{vitality|}}}" = "" OR CASE WHEN "{{{vitality|}}}" RLIKE '(\\+{{!}}-)\\d+' THEN CR.VitalityMod = "{{{vitality|}}}" ELSE CR.Vitality = "{{{vitality|}}}" END) | ||
Line 60: | Line 60: | ||
AND ("{{{signet|}}}" = "" OR CR.Signet = "{{{signet|}}}") | AND ("{{{signet|}}}" = "" OR CR.Signet = "{{{signet|}}}") | ||
AND ("{{{block|}}}" = "" OR (C.CardType = 'Site' AND CR.Block = "{{{block|}}}")) | |||
AND ("{{{sitesitenum|}}}" = "" OR (C.CardType = 'Site' AND CR.SiteNum = "{{{sitesitenum|}}}")) | AND ("{{{sitesitenum|}}}" = "" OR (C.CardType = 'Site' AND CR.SiteNum = "{{{sitesitenum|}}}")) | ||
AND ("{{{sitesitenumMore|}}}" = "" OR (C.CardType = 'Site' AND CR.SiteNum >= "{{{sitesitenumMore|}}}")) | AND ("{{{sitesitenumMore|}}}" = "" OR (C.CardType = 'Site' AND CR.SiteNum >= "{{{sitesitenumMore|}}}")) | ||
Line 68: | Line 69: | ||
AND ("{{{shadownumLess|}}}" = "" OR (C.CardType = 'Site' AND IFNULL(CR.ShadowNum, CR.TwilightCost) <= "{{{shadownumLess|}}}")) | AND ("{{{shadownumLess|}}}" = "" OR (C.CardType = 'Site' AND IFNULL(CR.ShadowNum, CR.TwilightCost) <= "{{{shadownumLess|}}}")) | ||
AND ("{{{isSanctuary|any}}}" = " | AND ("{{{isSanctuary|any}}}" = "" OR CASE WHEN {{Boolean|{{{isSanctuary|any}}}}} = 1 THEN CR.GameText RLIKE '(?<!\\w )Sanctuary\\.' ELSE CR.GameText NOT RLIKE '(?<!\\w )Sanctuary\\.' END) | ||
AND ("{{{arrowDir|Any}}}" = " | AND ("{{{arrowDir|Any}}}" = "Any" OR CR.ArrowDir = "{{{arrowDir|Any}}}") | ||
AND (CASE WHEN {{Boolean|{{{isFoil|no}}}}} = 0 THEN CR.Subset NOT IN ('F', 'A', 'O') ELSE CR.Subset IN ('F', 'A', 'O') END) | AND (CASE WHEN {{Boolean|{{{isFoil|no}}}}} = 0 THEN CR.Subset NOT IN ('F', 'A', 'O') ELSE CR.Subset IN ('F', 'A', 'O') END) | ||
Line 78: | Line 79: | ||
AND ("{{#replace:{{{loreSearch|}}}|"|}}" = "" OR CR.Lore RLIKE "{{#replace:{{{loreSearch|}}}|"|}}") | AND ("{{#replace:{{{loreSearch|}}}|"|}}" = "" OR CR.Lore RLIKE "{{#replace:{{{loreSearch|}}}|"|}}") | ||
AND ("{{{advancedOptions|}}}" = "" OR | AND ("{{{advancedOptions|}}}" = "" OR | ||
("{{{advancedOptions|}}}" | ("{{{advancedOptions|}}}" LIKE '%Burdens:%' AND CR.GameText RLIKE 'burden') OR | ||
("{{{advancedOptions|}}}" | ("{{{advancedOptions|}}}" LIKE '%Add Burdens%' AND CR.GameText RLIKE 'add (up to )?(a{{!}}X{{!}}\\d) burden') OR | ||
("{{{advancedOptions|}}}" | ("{{{advancedOptions|}}}" LIKE '%Prevent Burden Removal%' AND CR.GameText RLIKE '(burden[^\\.]*(can{{!}}may) ?not (be )?remove{{!}}about to remove[^\\.]*burdens?,)') OR | ||
("{{{advancedOptions|}}}" | ("{{{advancedOptions|}}}" LIKE '%Remove Burdens%' AND CR.GameText RLIKE 'remove (up to )?(a{{!}}X{{!}}\\d) burden') OR | ||
("{{{advancedOptions|}}}" | ("{{{advancedOptions|}}}" LIKE '%Prevent Burden Adding%' AND CR.GameText RLIKE '(burden[^\\.]*(can{{!}}may) ?not (be )?add{{!}}about to add[^\\.]*burdens?,)') OR | ||
("{{{advancedOptions|}}}" RLIKE '( | ("{{{advancedOptions|}}}" LIKE '%Strength:%' AND CR.GameText RLIKE 'strength (of [^\\d\\.\\+-]* )?(\\+{{!}}-)') OR | ||
("{{{advancedOptions|}}}" | ("{{{advancedOptions|}}}" LIKE '%Add Strength%' AND CR.GameText RLIKE 'strength (of [^\\d\\.\\+-]* )?\\+') OR | ||
("{{{advancedOptions|}}}" LIKE '%Remove Strength%' AND CR.GameText RLIKE 'strength (of [^\\d\\.\\+-]* )?-') OR | |||
("{{{advancedOptions|}}}" RLIKE '( | ("{{{advancedOptions|}}}" LIKE '%Resistance:%' AND CR.GameText RLIKE 'resistance (of [^\\d\\.\\+-]* )?(\\+{{!}}-)') OR | ||
("{{{advancedOptions|}}}" | ("{{{advancedOptions|}}}" LIKE '%Add Resistance%' AND CR.GameText RLIKE 'resistance (of [^\\d\\.\\+-]* )?\\+') OR | ||
("{{{advancedOptions|}}}" LIKE '%Remove Resistance%' AND CR.GameText RLIKE 'resistance (of [^\\d\\.\\+-]* )?-') OR | |||
("{{{advancedOptions|}}}" RLIKE '( | ("{{{advancedOptions|}}}" LIKE '%Site Number:%' AND CR.GameText RLIKE 'site number (of [^\\d\\.\\+-]* )?(\\+{{!}}-)') OR | ||
("{{{advancedOptions|}}}" | ("{{{advancedOptions|}}}" LIKE '%Add Site Number%' AND CR.GameText RLIKE 'site number (of [^\\d\\.\\+-]* )?\\+') OR | ||
("{{{advancedOptions|}}}" LIKE '%Remove Site Number%' AND CR.GameText RLIKE 'site number (of [^\\d\\.\\+-]* )?-') OR | |||
("{{{advancedOptions|}}}" LIKE '%Ally Removal%' AND | ("{{{advancedOptions|}}}" LIKE '%Ally Removal%' AND CR.GameText RLIKE 'discard (up to )?(an?{{!}}X{{!}}\\d{{!}}all{{!}}every{{!}}each) (\\[\\w+\\] )?(\\w+ or )?ally') OR | ||
("{{{advancedOptions|}}}" LIKE '%Companion Removal%' AND CR.GameText RLIKE 'discard (up to )?(an?{{!}}X{{!}}\\d{{!}}all{{!}}every{{!}}each) (\\[\\w+\\] )?(\\w+ or )?companion(?! from hand)') OR | ("{{{advancedOptions|}}}" LIKE '%Companion Removal%' AND CR.GameText RLIKE 'discard (up to )?(an?{{!}}X{{!}}\\d{{!}}all{{!}}every{{!}}each) (\\[\\w+\\] )?(\\w+ or )?companion(?! from hand)') OR | ||
("{{{advancedOptions|}}}" LIKE '%Minion Removal%' AND CR.GameText RLIKE 'discard (up to )?(an?{{!}}X{{!}}\\d{{!}}all{{!}}every{{!}}each) (\\[\\w+\\] )?(\\w+ or )?minion') OR | ("{{{advancedOptions|}}}" LIKE '%Minion Removal%' AND CR.GameText RLIKE 'discard (up to )?(an?{{!}}X{{!}}\\d{{!}}all{{!}}every{{!}}each) (\\[\\w+\\] )?(\\w+ or )?minion') OR | ||
("{{{advancedOptions|}}}" LIKE '%Follower Removal%' AND | ("{{{advancedOptions|}}}" LIKE '%Follower Removal%' AND CR.GameText RLIKE 'discard (up to )?(an?{{!}}X{{!}}\\d{{!}}all{{!}}every{{!}}each) (\\[\\w+\\] )?(\\w+ or )?follower') OR | ||
("{{{advancedOptions|}}}" LIKE '%Condition Removal%' AND | ("{{{advancedOptions|}}}" LIKE '%Condition Removal%' AND CR.GameText RLIKE 'discard (up to )?(an?{{!}}X{{!}}\\d{{!}}all{{!}}every{{!}}each) (Free Peoples {{!}}Shadow )?(\\[\\w+\\] )?(\\w+ or (Free Peoples {{!}}Shadow )?)?condition') OR | ||
("{{{advancedOptions|}}}" LIKE '%Possession Removal%' AND | ("{{{advancedOptions|}}}" LIKE '%Possession Removal%' AND CR.GameText RLIKE 'discard (up to )?(an?{{!}}X{{!}}\\d{{!}}all{{!}}every{{!}}each) (Free Peoples {{!}}Shadow )?(\\[\\w+\\] )?(\\w+ or (Free Peoples {{!}}Shadow )?)?possession') OR | ||
("{{{advancedOptions|}}}" LIKE '%Artifact Removal%' AND | ("{{{advancedOptions|}}}" LIKE '%Artifact Removal%' AND CR.GameText RLIKE 'discard (up to )?(an?{{!}}X{{!}}\\d{{!}}all{{!}}every{{!}}each) (Free Peoples {{!}}Shadow )?(\\[\\w+\\] )?(\\w+ or (Free Peoples {{!}}Shadow )?)?artifact') OR | ||
("{{{advancedOptions|}}}" RLIKE '(Cycling:{{!}}Draw Cards)' AND (CR.GameText RLIKE 'draw (up to )?(an?{{!}}X{{!}}\\d{{!}}all{{!}}every{{!}}each) card' AND CR.GameText NOT RLIKE 'opponent shuffle[^\\.]*draw deck and draw' AND CR.GameText NOT RLIKE '(Free Peoples {{!}}Shadow )?player (must {{!}}may )?draw' OR CR.GameText RLIKE 'muster')) OR | ("{{{advancedOptions|}}}" RLIKE '(Cycling:{{!}}Draw Cards)' AND (CR.GameText RLIKE 'draw (up to )?(an?{{!}}X{{!}}\\d{{!}}all{{!}}every{{!}}each) card' AND CR.GameText NOT RLIKE 'opponent shuffle[^\\.]*draw deck and draw' AND CR.GameText NOT RLIKE '(Free Peoples {{!}}Shadow )?player (must {{!}}may )?draw' OR CR.GameText RLIKE 'muster')) OR | ||
("{{{advancedOptions|}}}" RLIKE '(Cycling:{{!}}Recover Cards Into Hand)' AND CR.GameText RLIKE 'take [^\\.]*into hand') OR | ("{{{advancedOptions|}}}" RLIKE '(Cycling:{{!}}Recover Cards Into Hand)' AND CR.GameText RLIKE 'take [^\\.]*into hand') OR | ||
("{{{advancedOptions|}}}" RLIKE '(Cycling:{{!}} | ("{{{advancedOptions|}}}" RLIKE '(Cycling:{{!}}Hand Discard)' AND (CR.GameText RLIKE 'discard (up to )?(an?{{!}}X{{!}}\\d{{!}}all{{!}}every{{!}}each) cards? from hand' AND CR.GameText NOT RLIKE '(opponent must discard{{!}}(Free Peoples {{!}}Shadow )?player[^\\.]*must [^\\.]* discard)' OR CR.GameText RLIKE 'muster')) OR | ||
("{{{advancedOptions|}}}" RLIKE '(Recursion:{{!}}Take Cards Into Hand From Discard)' AND CR.GameText RLIKE 'take [^\\.]*into hand from[^\\.]*discard') OR | |||