Difference between revisions of "Template:Strange rank name"

From Team Fortress Wiki
Jump to: navigation, search
m (Updated cloak)
(Fix for some non-strange items which use this template)
 
Line 1: Line 1:
 
<includeonly>{{#switch:
 
<includeonly>{{#switch:
 
   <!-- Our switch uses rankson (if provided), then falls back to a handful of known items (which have known ranks) and then finally to generic 'kills' if neither value needs special handling. Note that, if rankson is provided, it is expected to match, and thus, a mismatch will result in the page being placed into an error category. -->
 
   <!-- Our switch uses rankson (if provided), then falls back to a handful of known items (which have known ranks) and then finally to generic 'kills' if neither value needs special handling. Note that, if rankson is provided, it is expected to match, and thus, a mismatch will result in the page being placed into an error category. -->
  {{#if:{{{rankson|}}}
 
    |{{lc:{{{rankson}}}}}
 
    |{{#switch:{{lc:{{{item-name|{{BASEPAGENAME}}}}}}}
 
      | holiday punch = tickle fights won
 
      | invis watch = seconds cloaked
 
      | mantreads = opponents flattened
 
      | sapper = buildings sapped
 
      | spirit of giving = gifts given
 
      | duck journal = duck xp level
 
  
      <!-- Cosmetic items rank on 'points scored', but I'm not going to list every cosmetic item here. Just use rankson=points scored. -->
+
  {{#switch:{{lc:{{{item-name|}}}}}
 +
    | holiday punch = tickle fights won
 +
    | invis watch = seconds cloaked
 +
    | mantreads = opponents flattened
 +
    | sapper = buildings sapped
 +
    | spirit of giving = gifts given
 +
    | duck journal = duck xp level
  
      <!-- Some weapons should not use the generic 'kills', i.e. they have a rank but aren't actually strange -->
+
    <!-- Cosmetic items rank on 'points scored', but I'm not going to list every cosmetic item here. Just use rankson=points scored. -->
      | gun mettle campaign coin = nothing
 
      | soul gargoyle = nothing
 
      | tough break campaign stamp = nothing
 
  
      | #default = kills
+
    <!-- Some weapons should not use the generic 'kills', i.e. they have a rank but aren't actually strange -->
    }}
+
    | gun mettle campaign coin = nothing
 +
    | invasion community update coin = nothing
 +
    | jungle inferno contracker = nothing
 +
    | soul gargoyle = nothing
 +
    | tough break campaign stamp = nothing
 +
 
 +
    | #default = {{lc:{{{rankson|kills}}}}}
 
   }}
 
   }}
  
Line 46: Line 46:
 
     {{#ifexpr: 8500 <= {{{kills}}} | {{item name|Mann Co. Select (Holiday Punch)}}}}
 
     {{#ifexpr: 8500 <= {{{kills}}} | {{item name|Mann Co. Select (Holiday Punch)}}}}
  
   | seconds cloaked =  
+
   | seconds cloaked =
 
     {{#ifexpr: 0 <= {{{kills}}} and {{{kills}}} < 200 | {{item name|Strange (cloak)}}}}
 
     {{#ifexpr: 0 <= {{{kills}}} and {{{kills}}} < 200 | {{item name|Strange (cloak)}}}}
 
     {{#ifexpr: 200 <= {{{kills}}} and {{{kills}}} < 500 | {{item name|Unremarkable (cloak)}}}}
 
     {{#ifexpr: 200 <= {{{kills}}} and {{{kills}}} < 500 | {{item name|Unremarkable (cloak)}}}}
Line 69: Line 69:
 
     {{#ifexpr: 160000 <= {{{kills}}} | {{item name|Mann Co. Select (cloak)}}}}
 
     {{#ifexpr: 160000 <= {{{kills}}} | {{item name|Mann Co. Select (cloak)}}}}
  
   | opponents flattened =  
+
   | opponents flattened =
 
     {{#ifexpr: 0 <= {{{kills}}} and {{{kills}}} < 1 | {{item name|Strange (Mantreads)}}}}
 
     {{#ifexpr: 0 <= {{{kills}}} and {{{kills}}} < 1 | {{item name|Strange (Mantreads)}}}}
 
     {{#ifexpr: 1 <= {{{kills}}} and {{{kills}}} < 3 | {{item name|Broken-In}}}}
 
     {{#ifexpr: 1 <= {{{kills}}} and {{{kills}}} < 3 | {{item name|Broken-In}}}}
Line 92: Line 92:
 
     {{#ifexpr: 850 <= {{{kills}}} | {{item name|Hale's Custom}}}}
 
     {{#ifexpr: 850 <= {{{kills}}} | {{item name|Hale's Custom}}}}
  
   | buildings sapped =  
+
   | buildings sapped =
 
     {{#ifexpr: 0 <= {{{kills}}} and {{{kills}}} < 3 | {{item name|Strange (Sapper)}}}}
 
     {{#ifexpr: 0 <= {{{kills}}} and {{{kills}}} < 3 | {{item name|Strange (Sapper)}}}}
 
     {{#ifexpr: 3 <= {{{kills}}} and {{{kills}}} < 9 | {{item name|Unremarkable (Sapper)}}}}
 
     {{#ifexpr: 3 <= {{{kills}}} and {{{kills}}} < 9 | {{item name|Unremarkable (Sapper)}}}}
Line 137: Line 137:
 
     {{#ifexpr: 250 <= {{{kills}}} | {{item name|Saxton's Own}}}}
 
     {{#ifexpr: 250 <= {{{kills}}} | {{item name|Saxton's Own}}}}
  
   | points scored =  
+
   | points scored =
 
     {{#ifexpr: 0 <= {{{kills}}} and {{{kills}}} < 15 | {{item name|Strange (cosmetics)}}}}
 
     {{#ifexpr: 0 <= {{{kills}}} and {{{kills}}} < 15 | {{item name|Strange (cosmetics)}}}}
 
     {{#ifexpr: 15 <= {{{kills}}} and {{{kills}}} < 30 | {{item name|Ragged}}}}
 
     {{#ifexpr: 15 <= {{{kills}}} and {{{kills}}} < 30 | {{item name|Ragged}}}}
Line 160: Line 160:
 
     {{#ifexpr: 15000 <= {{{kills}}} | {{item name|Mannceaux Signature Collection}}}}
 
     {{#ifexpr: 15000 <= {{{kills}}} | {{item name|Mannceaux Signature Collection}}}}
  
   | duck xp level =  
+
   | duck xp level =
 
     {{#ifexpr: 0 <= {{{kills}}} and {{{kills}}} < 1 | {{item name|The}}}}
 
     {{#ifexpr: 0 <= {{{kills}}} and {{{kills}}} < 1 | {{item name|The}}}}
 
     {{#ifexpr: 1 <= {{{kills}}} and {{{kills}}} < 2 | {{item name|Crumb Chasing}}}}
 
     {{#ifexpr: 1 <= {{{kills}}} and {{{kills}}} < 2 | {{item name|Crumb Chasing}}}}
Line 207: Line 207:
 
     {{#ifexpr: 7616 <= {{{kills}}} and {{{kills}}} < 8500 | {{item name|Australian (weapons)}}}}
 
     {{#ifexpr: 7616 <= {{{kills}}} and {{{kills}}} < 8500 | {{item name|Australian (weapons)}}}}
 
     {{#ifexpr: 8500 <= {{{kills}}} | {{item name|Hale's Own (weapons)}}}}
 
     {{#ifexpr: 8500 <= {{{kills}}} | {{item name|Hale's Own (weapons)}}}}
   
+
 
 
   | #default = [[Category:Strange rank name ERROR|1]]
 
   | #default = [[Category:Strange rank name ERROR|1]]
 
}}<!--
 
}}<!--
 
-->{{#if:{{{kills|}}}||[[Category:Strange rank name ERROR|2]]}}<!--
 
-->{{#if:{{{kills|}}}||[[Category:Strange rank name ERROR|2]]}}<!--
 
--></includeonly><noinclude>{{Documentation}}</noinclude>
 
--></includeonly><noinclude>{{Documentation}}</noinclude>

Latest revision as of 08:13, 27 October 2023

Template documentation [view] [edit] [history] [purge]

This template returns the correct (language-translated and killcount-accurate) strange rank name. For example, a rocket launcher with 750 kills is 'Positively Inhumane'. This is primarily used for {{Backpack item}}.

Pages which misuse this template will be placed into Category:Strange rank name ERROR.

Usage

As this is primarily intended for use with backpack item, it doesn't have complex paramaters.

  • rankson - The primary switched value, indicates what action causes the strange item to rank up. For example, sappers rank up on buildings sapped.
  • item-name - As a fall-back, when rankson is not provided, we can look up the ranking action for a few known items.
  • kills - Required, this is used to pick the correct prefix name, as many items have different rank-up thresholds.

Examples

{{Strange rank name|rankson=Opponents Flattened|kills=100}} Face-Flattening

{{Strange rank name|item-name=Mantreads|kills=100}} Face-Flattening

{{Strange rank name|rankson=Opponents Flattened|item-name=Gunboats|kills=100}} Face-Flattening

{{Strange rank name|item-name=Gunboats|kills=100}} Uncharitable

{{Strange rank name|item-name=Gun Mettle Campaign Coin|rankson=Contract Points|kills=0}} (this results in an empty string)  

{{Strange rank name|item-name=Ghastly Gibus|rankson=points scored|kills=0}} Strange