Template:CardSearch: Difference between revisions

From LOTR-TCG Wiki
m (fixing phase action filter)
(Adding proper hunter support to the has keyword section)
 
(17 intermediate revisions by 2 users not shown)
Line 32: Line 32:
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 ("{{{phaseAction|}}}" = "" OR ((C.CardType IN ('Event') AND "{{{phaseAction|}}}" LIKE CONCAT('%', CR.Subtypes__full, '%')) OR CR.GameText RLIKE "({{#replace:{{#replace:{{{PhaseAction|}}}:|,|:{{!}}}}||}})"))
AND ("{{{phaseAction|}}}" = "" OR ((C.CardType IN ('Event') AND "{{{phaseAction|}}}" LIKE CONCAT('%', CR.Subtypes__full, '%')) OR CR.GameText RLIKE "({{#replace:{{#replace:{{{phaseAction|}}}:|,|:{{!}}}}||}})"))


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+\\)\\.') OR ("{{{keyword|}}}" LIKE '%Hunter%' AND CR.GameText RLIKE '(?<!\\w )Hunter \\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 >= "{{{strengthLess|}}}" END)
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 68: Line 68:
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}}}" = "" OR CASE WHEN {{Boolean|{{{isSanctuary|any}}}}} = 1 THEN CR.GameText RLIKE '(?<!\\w )Sanctuary\\.' ELSE CR.GameText NOT RLIKE '(?<!\\w )Sanctuary\\.' END)
AND ("{{{isSanctuary|any}}}" = "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}}}" = "Any" OR CR.ArrowDir = "{{{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 105: Line 105:
("{{{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:{{!}}Discard From Your Hand)' 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 '(Cycling:{{!}}Discard From Your Hand)' AND (CR.GameText RLIKE 'discard [^\\.]*from hand' AND CR.GameText NOT RLIKE '(opponent{{!}}owner{{!}}(Free Peoples {{!}}Shadow )?player)[^\\.]* discard[^\\.]*from hand' 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
("{{{advancedOptions|}}}" RLIKE '(Recursion:{{!}}Take Cards Into Hand From Discard)' AND CR.GameText RLIKE 'take [^\\.]*into hand from[^\\.]*discard') OR
Line 156: Line 156:
("{{{advancedOptions|}}}" RLIKE '(Card Manipulation:{{!}}Place On Bottom Of Deck)' AND CR.GameText RLIKE "((on the bottom of{{!}}beneath) (your{{!}}its owners{{!}}(your{{!}}an) opponent's{{!}}his or her{{!}}their) draw deck)") OR
("{{{advancedOptions|}}}" RLIKE '(Card Manipulation:{{!}}Place On Bottom Of Deck)' AND CR.GameText RLIKE "((on the bottom of{{!}}beneath) (your{{!}}its owners{{!}}(your{{!}}an) opponent's{{!}}his or her{{!}}their) draw deck)") OR
("{{{advancedOptions|}}}" RLIKE '(Card Manipulation:{{!}}Shuffle Into Deck)' AND CR.GameText RLIKE "shuffle (up to )?(an?{{!}}X{{!}}\\d{{!}}all{{!}}every{{!}}each)[^\\.]* into (your{{!}}its owners{{!}}(your{{!}}an) opponent's{{!}}his or her{{!}}their) draw deck") OR
("{{{advancedOptions|}}}" RLIKE '(Card Manipulation:{{!}}Shuffle Into Deck)' AND CR.GameText RLIKE "shuffle (up to )?(an?{{!}}X{{!}}\\d{{!}}all{{!}}every{{!}}each)[^\\.]* into (your{{!}}its owners{{!}}(your{{!}}an) opponent's{{!}}his or her{{!}}their) draw deck") OR
("{{{advancedOptions|}}}" RLIKE '(Card Manipulation:{{!}}Discard From Your Deck)' AND CR.GameText RLIKE "discard (up to )?(the{{!}}an?{{!}}X{{!}}\\d{{!}}all{{!}}every{{!}}each)[^\\.]* (from{{!}}of) (the top of )?your draw deck") OR
("{{{advancedOptions|}}}" RLIKE '(Card Manipulation:{{!}}Discard From Your Deck)' AND CR.GameText RLIKE "discards? (up to )?(the{{!}}an?{{!}}X{{!}}\\d{{!}}all{{!}}every{{!}}each)[^\\.]* (from{{!}}of) (the top of )?your draw deck") OR
("{{{advancedOptions|}}}" RLIKE '(Card Manipulation:{{!}}Discard From Opponent''s Deck)' AND CR.GameText RLIKE "discard (up to )?(the{{!}}an?{{!}}X{{!}}\\d{{!}}all{{!}}every{{!}}each)[^\\.]* (from{{!}}of) (the top of )?(its owners{{!}}(your{{!}}an) opponent's{{!}}his or her{{!}}their) draw deck") OR
("{{{advancedOptions|}}}" RLIKE '(Card Manipulation:{{!}}Discard From Opponent''s Deck)' AND CR.GameText RLIKE "discards? (up to )?(the{{!}}an?{{!}}X{{!}}\\d{{!}}all{{!}}every{{!}}each)[^\\.]* (from{{!}}of) (the top of )?(its owners{{!}}(your{{!}}an) opponent's{{!}}his{{!}}his or her{{!}}their) draw deck") OR
("{{{advancedOptions|}}}" RLIKE '(Card Manipulation:{{!}}Discard From Opponent''s Hand)' AND CR.GameText RLIKE "(discard (up to )?(an?{{!}}X{{!}}\\d{{!}}all{{!}}every{{!}}each)[^\\.]* from (its owners{{!}}(your{{!}}an) opponent's{{!}}the shadow player''s{{!}}his or her{{!}}their) hand{{!}}make (an opponent{{!}}the shadow player{{!}}the free peoples player) discard[^\\.]*from hand)") OR
("{{{advancedOptions|}}}" RLIKE '(Card Manipulation:{{!}}Discard From Opponent''s Hand)' AND CR.GameText RLIKE "(discards? (up to )?(an?{{!}}X{{!}}\\d{{!}}all{{!}}every{{!}}each)[^\\.]* from (its owners{{!}}(your{{!}}an) opponent's{{!}}the shadow player''s{{!}}his{{!}}his or her{{!}}their) hand{{!}}((choose{{!}}make) )?(an opponent{{!}}the shadow player{{!}}the free peoples player{{!}}that player)( to)? discard[^\\.]*from hand){{!}}owner discards") OR
("{{{advancedOptions|}}}" RLIKE '(Card Manipulation:{{!}}Reveal Opponent''s Hand)' AND CR.GameText RLIKE "(reveal (up to )?(an?{{!}}X{{!}}\\d{{!}}all{{!}}every{{!}}each)[^\\.]* from (its owners{{!}}(your{{!}}an) opponent's{{!}}his or her{{!}}their) hand{{!}}reveal (your{{!}}an) opponent's hand)") OR
("{{{advancedOptions|}}}" RLIKE '(Card Manipulation:{{!}}Reveal Opponent''s Hand)' AND CR.GameText RLIKE "(reveal (up to )?(an?{{!}}X{{!}}\\d{{!}}all{{!}}every{{!}}each)[^\\.]* from (its owners{{!}}(your{{!}}an) opponent's{{!}}his{{!}}his or her{{!}}their) hand{{!}}reveal (your{{!}}an) opponent's hand)") OR





Latest revision as of 04:34, 22 June 2023

This is the "CardSearch" template.

It should be called in the following format:

{{CardSearch
|isUnique=
|sort=
}}

Edit the page to see the template text.