Difference between revisions of "Template:Strange rank name/Sandbox"

From Team Fortress Wiki
Jump to: navigation, search
m (Swap the order? I think this preserves everything.)
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|}}}}}
    |{{#switch:{{lc:{{{item-name|}}}}}
+
    | holiday punch = tickle fights won
      | holiday punch = tickle fights won
+
    | invis watch = seconds cloaked
      | invis watch = seconds cloaked
+
    | mantreads = opponents flattened
      | mantreads = opponents flattened
+
    | sapper = buildings sapped
      | sapper = buildings sapped
+
    | spirit of giving = gifts given
      | spirit of giving = gifts given
+
    | duck journal = duck xp level
      | 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. -->
+
    <!-- Cosmetic items rank on 'points scored', but I'm not going to list every cosmetic item here. Just use rankson=points scored. -->
  
      <!-- Some weapons should not use the generic 'kills', i.e. they have a rank but aren't actually strange -->
+
    <!-- Some weapons should not use the generic 'kills', i.e. they have a rank but aren't actually strange -->
      | gun mettle campaign coin = nothing
+
    | gun mettle campaign coin = nothing
      | soul gargoyle = nothing
+
    | soul gargoyle = nothing
      | tough break campaign stamp = nothing
+
    | tough break campaign stamp = nothing
  
      | #default = kills
+
    | #default = {{lc:{{{rankson|kills}}}}}
    }}
 
 
   }}
 
   }}
  

Revision as of 07:35, 27 October 2023

Documentation for Strange rank name/Sandbox

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/Sandbox|rankson=Opponents Flattened|kills=100}} Face-Flattening

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

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

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

{{Strange rank name/Sandbox|item-name=Gun Mettle Campaign Coin|kills=0}}


{{Strange rank name/Sandbox|item-name=Gun Mettle Campaign Coin|rankson=Contract Points|kills=0}}