Difference between revisions of "Template:Strange rank name"

From Team Fortress Wiki
Jump to: navigation, search
m (Doc, and includeonly.)
(Fix for some non-strange items which use this template)
 
(14 intermediate revisions by 4 users not shown)
Line 1: Line 1:
<includeonly>{{#if:
+
<includeonly>{{#switch:
  {{#ifeq:{{lc:{{{rankson}}}}}|tickle fights won|yes}}
+
  <!-- 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. -->
  {{#ifeq:{{lc:{{{item-name}}}}}|holiday punch|yes}}
+
 
|
+
  {{#switch:{{lc:{{{item-name|}}}}}
    {{#ifexpr: 0 <= {{{kills}}} and {{{kills}}} < 10 | {{Item name|Strange}}}}
+
    | holiday punch = tickle fights won
    {{#ifexpr: 10 <= {{{kills}}} and {{{kills}}} < 25 | {{Item name|Unremarkable}}}}
+
    | invis watch = seconds cloaked
    {{#ifexpr: 25 <= {{{kills}}} and {{{kills}}} < 45 | {{Item name|Almost Amusing}}}}
+
    | mantreads = opponents flattened
    {{#ifexpr: 45 <= {{{kills}}} and
+
    | 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. -->
 +
 
 +
    <!-- Some weapons should not use the generic

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