Difference between revisions of "Template:Rarity"
Dinoguy1000 (talk | contribs) (+Duel Terminal Normal Rare Parallel Rare/DNRPR) |
Dinoguy1000 (talk | contribs) (support inputting the abbreviation, too) |
||
Line 1: | Line 1: | ||
{{ #switch: {{ #replace: {{ lc: {{{1}}} }} | {{ #ifeq: {{ lc: {{{1}}} }} | rare || rare }} }} | {{ #switch: {{ #replace: {{ lc: {{{1}}} }} | {{ #ifeq: {{ lc: {{{1}}} }} | rare || rare }} }} | ||
− | | c | common = {{ #if: {{{full|}}} | Common | + | | c | common = {{ #if: {{{full|}}} | Common | C }} |
− | | nr | normal = {{ #if: {{{full|}}} | Normal Rare | + | | nr | normal = {{ #if: {{{full|}}} | Normal Rare | NR }} |
− | | sp | short print = {{ #if: {{{full|}}} | Short Print | + | | sp | short print = {{ #if: {{{full|}}} | Short Print | SP }} |
− | | ssp | super short print = {{ #if: {{{full|}}} | Super Short Print | + | | ssp | super short print = {{ #if: {{{full|}}} | Super Short Print | SSP }} |
− | | hfr | holofoil = {{ #if: {{{full|}}} | Holofoil Rare | + | | hfr | holofoil = {{ #if: {{{full|}}} | Holofoil Rare | HFR }} |
− | | r | rare = {{ #if: {{{full|}}} | Rare | + | | r | rare = {{ #if: {{{full|}}} | Rare | R }} |
− | | sr | super = {{ #if: {{{full|}}} | Super Rare | + | | sr | super = {{ #if: {{{full|}}} | Super Rare | SR }} |
− | | ur | ultra = {{ #if: {{{full|}}} | Ultra Rare | + | | ur | ultra = {{ #if: {{{full|}}} | Ultra Rare | UR }} |
− | | utr | ultimate = {{ #if: {{{full|}}} | Ultimate Rare | + | | utr | ultimate = {{ #if: {{{full|}}} | Ultimate Rare | UtR }} |
− | | gr | ghost = {{ #if: {{{full|}}} | Ghost Rare | + | | gr | ghost = {{ #if: {{{full|}}} | Ghost Rare | GR }} |
− | | hgr | holographic = {{ #if: {{{full|}}} | Holographic Rare | + | | hgr | holographic = {{ #if: {{{full|}}} | Holographic Rare | HGR }} |
− | | scr | secret = {{ #if: {{{full|}}} | Secret Rare | + | | scr | secret = {{ #if: {{{full|}}} | Secret Rare | ScR }} |
− | | pscr | prismatic secret = {{ #if: {{{full|}}} | Prismatic Secret Rare | + | | pscr | prismatic secret = {{ #if: {{{full|}}} | Prismatic Secret Rare | PScR }} |
− | | uscr | ultra secret = {{ #if: {{{full|}}} | Ultra Secret Rare | + | | uscr | ultra secret = {{ #if: {{{full|}}} | Ultra Secret Rare | UScR }} |
− | | scur | secret ultra = {{ #if: {{{full|}}} | Secret Ultra Rare | + | | scur | secret ultra = {{ #if: {{{full|}}} | Secret Ultra Rare | ScUR }} |
− | | escr | extra secret = {{ #if: {{{full|}}} | Extra Secret Rare | + | | escr | extra secret = {{ #if: {{{full|}}} | Extra Secret Rare | EScR }} |
− | | plr | platinum = {{ #if: {{{full|}}} | Platinum Rare | + | | plr | platinum = {{ #if: {{{full|}}} | Platinum Rare | PlR }} |
− | | plscr | platinum secret = {{ #if: {{{full|}}} | Platinum Secret Rare | + | | plscr | platinum secret = {{ #if: {{{full|}}} | Platinum Secret Rare | PlScR }} |
− | | pr | parallel = {{ #if: {{{full|}}} | Parallel Rare | + | | pr | parallel = {{ #if: {{{full|}}} | Parallel Rare | PR }} |
− | | pc | parallel common = {{ #if: {{{full|}}} | Parallel Common | + | | pc | parallel common = {{ #if: {{{full|}}} | Parallel Common | PC }} |
− | | npr | normal parallel = {{ #if: {{{full|}}} | Normal Parallel Rare | + | | npr | normal parallel = {{ #if: {{{full|}}} | Normal Parallel Rare | NPR }} |
− | | spr | super parallel = {{ #if: {{{full|}}} | Super Parallel Rare | + | | spr | super parallel = {{ #if: {{{full|}}} | Super Parallel Rare | SPR }} |
− | | upr | ultra parallel = {{ #if: {{{full|}}} | Ultra Parallel Rare | + | | upr | ultra parallel = {{ #if: {{{full|}}} | Ultra Parallel Rare | UPR }} |
− | | sfr | starfoil = {{ #if: {{{full|}}} | Starfoil Rare | + | | sfr | starfoil = {{ #if: {{{full|}}} | Starfoil Rare | SFR }} |
− | | msr | mosaic = {{ #if: {{{full|}}} | Mosaic Rare | + | | msr | mosaic = {{ #if: {{{full|}}} | Mosaic Rare | MSR }} |
− | | shr | shatterfoil = {{ #if: {{{full|}}} | Shatterfoil Rare | + | | shr | shatterfoil = {{ #if: {{{full|}}} | Shatterfoil Rare | SHR }} |
− | | cr | collector's | collectors = {{ #if: {{{full|}}} | Collectors Rare | + | | cr | collector's | collectors = {{ #if: {{{full|}}} | Collectors Rare | CR }} |
− | | mr | millennium = {{ #if: {{{full|}}} | Millennium Rare | + | | mr | millennium = {{ #if: {{{full|}}} | Millennium Rare | MR }} |
| ¬ | gold = Gold Rare | | ¬ | gold = Gold Rare | ||
− | | gur | gold = {{ #if: {{{full|}}} | Gold Rare | + | | gur | gold = {{ #if: {{{full|}}} | Gold Rare | GUR }} |
− | | gscr | gold secret = {{ #if: {{{full|}}} | Gold Secret Rare | + | | gscr | gold secret = {{ #if: {{{full|}}} | Gold Secret Rare | GScR }} |
− | | ggr | ghost/gold = {{ #if: {{{full|}}} | Ghost/Gold Rare | + | | ggr | ghost/gold = {{ #if: {{{full|}}} | Ghost/Gold Rare | GGR }} |
− | | dpc | duel terminal parallel common = {{ #if: {{{full|}}} | Duel Terminal Parallel Common | + | | dpc | duel terminal parallel common = {{ #if: {{{full|}}} | Duel Terminal Parallel Common | DPC }} |
+ | | dnrpr | <!-- see next item --> = {{ #if: {{{full|}}} | Duel Terminal Normal Rare Parallel Rare | DNRPR }} | ||
| dnpr | duel terminal normal parallel = {{ #ifeq: {{ lc: {{{1}}} }} | duel terminal normal rare parallel rare | | dnpr | duel terminal normal parallel = {{ #ifeq: {{ lc: {{{1}}} }} | duel terminal normal rare parallel rare | ||
| {{ #if: {{{full|}}} | Duel terminal Normal Rare Parallel Rare | DNRPR }} | | {{ #if: {{{full|}}} | Duel terminal Normal Rare Parallel Rare | DNRPR }} | ||
− | | {{ #if: {{{full|}}} | Duel Terminal Normal Parallel Rare | DNPR }} }} | + | | {{ #if: {{{full|}}} | Duel Terminal Normal Parallel Rare | DNPR }} }} |
− | | drpr | duel terminal parallel = {{ #if: {{{full|}}} | Duel Terminal Rare Parallel Rare | + | | drpr | duel terminal parallel = {{ #if: {{{full|}}} | Duel Terminal Rare Parallel Rare | DRPR }} |
− | | dspr | duel terminal super parallel = {{ #if: {{{full|}}} | Duel Terminal Super Parallel Rare | + | | dspr | duel terminal super parallel = {{ #if: {{{full|}}} | Duel Terminal Super Parallel Rare | DSPR }} |
− | | dupr | duel terminal ultra parallel = {{ #if: {{{full|}}} | Duel Terminal Ultra Parallel Rare | + | | dupr | duel terminal ultra parallel = {{ #if: {{{full|}}} | Duel Terminal Ultra Parallel Rare | DUPR }} |
− | | dscpr | duel terminal secret parallel = {{ #if: {{{full|}}} | Duel Terminal Secret Parallel Rare | DScPR }} | + | | dscpr | duel terminal secret parallel = {{ #if: {{{full|}}} | Duel Terminal Secret Parallel Rare | DScPR }} |
}}<noinclude>{{Documentation}}</noinclude> | }}<noinclude>{{Documentation}}</noinclude> |
Revision as of 20:19, 31 January 2015
Usage
This template is used to standardize rarity names/abbreviations for templates, so they don't have to implement such a check locally. It currently supports all official rarities and their abbreviations, and is not case-sensitive. The template doesn't return anything when fed unsupported values, which can be used for error-checking.
Basic usage is {{rarity|rarity}}
, outputting the abbreviation for the given rarity. The full name can be output instead by using the {{{full}}}
parameter.
Examples
Code | Result | Code | Result |
---|---|---|---|
{{rarity|Common}} |
C | {{rarity|C}} |
C |
{{rarity|common}} |
C | {{rarity|c}} |
C |
{{rarity|Common|full=yes}} |
Common | {{rarity|C|full=yes}} |
Common |
{{rarity|Rare}} |
R | {{rarity|R}} |
R |
{{rarity|Ghost Rare}} |
GR | {{rarity|GR}} |
GR |
{{rarity|Foo}} |
{{rarity|BLA}} |
||
{{rarity|}} |
{{rarity}} |