Difference between revisions of "Template:Strange rank name"

From Team Fortress Wiki
Jump to: navigation, search
m (update all strange quality dictionary references to strange rank dictionary references for fixing different translation problem between these two in some language like zh-hans)
(Updated -- now has an error tracking category and made rankson properly optional)
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}}
+
   {{#if:{{{rankson|}}}
|
+
    |{{lc:{{{rankson}}}}}
 +
    |{{#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
 +
 
 +
      <!-- 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 -->
 +
      | gun mettle campaign coin = nothing
 +
      | soul gargoyle = nothing
 +
      | tough break campaign stamp = nothing
 +
 
 +
      | #default = kills
 +
    }}
 +
  }}
 +
 
 +
  <!-- And then, the main body of the switch, which chooses the correct rank name for each kill count. -->
 +
  | tickle fights won =
 
     {{#ifexpr: 0 <= {{{kills}}} and {{{kills}}} < 10 | {{Item name|strange-rank}}}}
 
     {{#ifexpr: 0 <= {{{kills}}} and {{{kills}}} < 10 | {{Item name|strange-rank}}}}
 
     {{#ifexpr: 10 <= {{{kills}}} and {{{kills}}} < 25 | {{Item name|Unremarkable}}}}
 
     {{#ifexpr: 10 <= {{{kills}}} and {{{kills}}} < 25 | {{Item name|Unremarkable}}}}
Line 24: Line 45:
 
     {{#ifexpr: 7923 <= {{{kills}}} and {{{kills}}} < 8500 | {{Item name|Australian}}}}
 
     {{#ifexpr: 7923 <= {{{kills}}} and {{{kills}}} < 8500 | {{Item name|Australian}}}}
 
     {{#ifexpr: 8500 <= {{{kills}}} | {{Item name|Mann Co. Select}}}}
 
     {{#ifexpr: 8500 <= {{{kills}}} | {{Item name|Mann Co. Select}}}}
|{{#if:
+
 
   {{#ifeq:{{lc:{{{rankson}}}}}|seconds cloaked|yes}}
+
   | seconds cloaked =
  {{#ifeq:{{lc:{{{item-name}}}}}|invis watch|yes}}
 
|
 
 
     {{#ifexpr: 0 <= {{{kills}}} and {{{kills}}} < 200 | {{Item name|strange-rank}}}}
 
     {{#ifexpr: 0 <= {{{kills}}} and {{{kills}}} < 200 | {{Item name|strange-rank}}}}
 
     {{#ifexpr: 200 <= {{{kills}}} and {{{kills}}} < 500 | {{Item name|Unremarkable}}}}
 
     {{#ifexpr: 200 <= {{{kills}}} and {{{kills}}} < 500 | {{Item name|Unremarkable}}}}
Line 49: Line 68:
 
     {{#ifexpr: 140000 <= {{{kills}}} and {{{kills}}} < 160000 | {{Item name|Australian}}}}
 
     {{#ifexpr: 140000 <= {{{kills}}} and {{{kills}}} < 160000 | {{Item name|Australian}}}}
 
     {{#ifexpr: 160000 <= {{{kills}}} | {{Item name|Mann Co. Select}}}}
 
     {{#ifexpr: 160000 <= {{{kills}}} | {{Item name|Mann Co. Select}}}}
|{{#if:
+
 
<!--  {{#ifeq:{{lc:{{{rankson}}}}}|kills|yes}}  Kills is also used by a lot of other things. It thus defaults to the default strange ranks.-->
+
   | opponents flattened =
   {{#ifeq:{{lc:{{{item-name}}}}}|mantreads|yes}}
 
|
 
 
     {{#ifexpr: 0 <= {{{kills}}} and {{{kills}}} < 1 | {{Item name|strange-rank}}}}
 
     {{#ifexpr: 0 <= {{{kills}}} and {{{kills}}} < 1 | {{Item name|strange-rank}}}}
 
     {{#ifexpr: 1 <= {{{kills}}} and {{{kills}}} < 3 | {{Item name|Broken-In}}}}
 
     {{#ifexpr: 1 <= {{{kills}}} and {{{kills}}} < 3 | {{Item name|Broken-In}}}}
Line 74: Line 91:
 
     {{#ifexpr: 784 <= {{{kills}}} and {{{kills}}} < 850 | {{Item name|Australian}}}}
 
     {{#ifexpr: 784 <= {{{kills}}} and {{{kills}}} < 850 | {{Item name|Australian}}}}
 
     {{#ifexpr: 850 <= {{{kills}}} | {{Item name|Hale's Custom}}}}
 
     {{#ifexpr: 850 <= {{{kills}}} | {{Item name|Hale's Custom}}}}
|{{#if:
+
 
   {{#ifeq:{{lc:{{{rankson}}}}}|buildings sapped|yes}}
+
   | buildings sapped =
  {{#ifeq:{{lc:{{{item-name}}}}}|sapper|yes}}
 
|
 
 
     {{#ifexpr: 0 <= {{{kills}}} and {{{kills}}} < 3 | {{Item name|strange-rank}}}}
 
     {{#ifexpr: 0 <= {{{kills}}} and {{{kills}}} < 3 | {{Item name|strange-rank}}}}
 
     {{#ifexpr: 3 <= {{{kills}}} and {{{kills}}} < 9 | {{Item name|Unremarkable}}}}
 
     {{#ifexpr: 3 <= {{{kills}}} and {{{kills}}} < 9 | {{Item name|Unremarkable}}}}
Line 99: Line 114:
 
     {{#ifexpr: 2345 <= {{{kills}}} and {{{kills}}} < 2550 | {{Item name|Australian}}}}
 
     {{#ifexpr: 2345 <= {{{kills}}} and {{{kills}}} < 2550 | {{Item name|Australian}}}}
 
     {{#ifexpr: 2550 <= {{{kills}}} | {{Item name|Mann Co. Select}}}}
 
     {{#ifexpr: 2550 <= {{{kills}}} | {{Item name|Mann Co. Select}}}}
|{{#if:
+
 
   {{#ifeq:{{lc:{{{rankson}}}}}|gifts given|yes}}
+
   | gifts given =
  {{#ifeq:{{lc:{{{item-name}}}}}|spirit of giving|yes}}
 
|
 
 
     {{#ifexpr: 0 <= {{{kills}}} and {{{kills}}} < 1 | {{Item name|The Spirit of Giving}}}}
 
     {{#ifexpr: 0 <= {{{kills}}} and {{{kills}}} < 1 | {{Item name|The Spirit of Giving}}}}
 
     {{#ifexpr: 1 <= {{{kills}}} and {{{kills}}} < 3 | {{Item name|The Baseline Benefactor's}}}}
 
     {{#ifexpr: 1 <= {{{kills}}} and {{{kills}}} < 3 | {{Item name|The Baseline Benefactor's}}}}
Line 123: Line 136:
 
     {{#ifexpr: 210 <= {{{kills}}} and {{{kills}}} < 250 | {{Item name|The Uber-Altruist's}}}}
 
     {{#ifexpr: 210 <= {{{kills}}} and {{{kills}}} < 250 | {{Item name|The Uber-Altruist's}}}}
 
     {{#ifexpr: 250 <= {{{kills}}} | {{Item name|Saxton's Own}}}}
 
     {{#ifexpr: 250 <= {{{kills}}} | {{Item name|Saxton's Own}}}}
|{{#if:
+
 
   {{#ifeq:{{lc:{{{rankson}}}}}|points scored|yes}}
+
   | points scored =  
<!--  {{#ifeq:{{lc:{{{item-name}}}}}|cosmetic|yes}} There isn't a good way to call this. Just use rankson=points scored. -->
 
|
 
 
     {{#ifexpr: 0 <= {{{kills}}} and {{{kills}}} < 15 | {{Item name|strange-rank}}}}
 
     {{#ifexpr: 0 <= {{{kills}}} and {{{kills}}} < 15 | {{Item name|strange-rank}}}}
 
     {{#ifexpr: 15 <= {{{kills}}} and {{{kills}}} < 30 | {{Item name|Ragged}}}}
 
     {{#ifexpr: 15 <= {{{kills}}} and {{{kills}}} < 30 | {{Item name|Ragged}}}}
Line 148: Line 159:
 
     {{#ifexpr: 10000 <= {{{kills}}} and {{{kills}}} < 15000 | {{Item name|Mann Co. Select}}}}
 
     {{#ifexpr: 10000 <= {{{kills}}} and {{{kills}}} < 15000 | {{Item name|Mann Co. Select}}}}
 
     {{#ifexpr: 15000 <= {{{kills}}} | {{Item name|Mannceaux Signature Collection}}}}
 
     {{#ifexpr: 15000 <= {{{kills}}} | {{Item name|Mannceaux Signature Collection}}}}
|{{#if:
+
 
   {{#ifeq:{{lc:{{{rankson}}}}}|duck xp level|yes}}
+
   | duck xp level =
  {{#ifeq:{{lc:{{{item-name}}}}}|duck journal|yes}}
 
|
 
 
     {{#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 173: Line 182:
 
     {{#ifexpr: 19 <= {{{kills}}} and {{{kills}}} < 20 | {{Item name|Specquackular}}}}
 
     {{#ifexpr: 19 <= {{{kills}}} and {{{kills}}} < 20 | {{Item name|Specquackular}}}}
 
     {{#ifexpr: 20 <= {{{kills}}} | {{Item name|Quackston's Own}}}}
 
     {{#ifexpr: 20 <= {{{kills}}} | {{Item name|Quackston's Own}}}}
|{{#switch:{{lc:{{{item-name}}}}} <!-- Handling some exceptions for the 'generic', i.e. weapons that have a rank but aren't actually strange: -->
+
 
   | gun mettle campaign coin
+
   | nothing = {{ns:0}}
  | soul gargoyle
+
 
  | tough break campaign stamp = {{ns:0}}<!-- Nothing -->
+
   | kills =
   | #default = <!-- Since there are a variety of weapons using the 'generic' system, this is the fall-through case. -->
 
 
     {{#ifexpr: 0 <= {{{kills}}} and {{{kills}}} < 10 | {{Item name|strange-rank}}}}
 
     {{#ifexpr: 0 <= {{{kills}}} and {{{kills}}} < 10 | {{Item name|strange-rank}}}}
 
     {{#ifexpr: 10 <= {{{kills}}} and {{{kills}}} < 25 | {{Item name|Unremarkable}}}}
 
     {{#ifexpr: 10 <= {{{kills}}} and {{{kills}}} < 25 | {{Item name|Unremarkable}}}}
Line 199: Line 207:
 
     {{#ifexpr: 7616 <= {{{kills}}} and {{{kills}}} < 8500 | {{Item name|Australian}}}}
 
     {{#ifexpr: 7616 <= {{{kills}}} and {{{kills}}} < 8500 | {{Item name|Australian}}}}
 
     {{#ifexpr: 8500 <= {{{kills}}} | {{Item name|Hale's Own}}}}
 
     {{#ifexpr: 8500 <= {{{kills}}} | {{Item name|Hale's Own}}}}
}}}}}}}}}}}}}}}}</includeonly><noinclude>
+
   
 +
  | #default = [[Category:Strange rank name ERROR|1]]
 +
}}<!--
 +
-->{{#if:{{{kills|}}}||[[Category:Strange rank name ERROR|2]]}}<!--
 +
-->{{#if:{{{rankson|{{{item-name|}}}}}}||[[Category:Strange rank name ERROR|3]]}}<!--
 +
--></includeonly><noinclude>
 
{{Doc begin}}
 
{{Doc begin}}
 
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 {{tl|Backpack item}}.
 
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 {{tl|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.
 +
* <code>rankson</code> - The primary switched value, indicates what action causes the strange item to rank up. For example, [[sapper]]s rank up on <code>buildings sapped</code>.
 +
* <code>item-name</code> - As a fall-back, when rankson is not provided, we can look up the ranking action for a few known items.
 +
* <code>kills</code> - Required, this is used to pick the correct prefix name, as many items have different rank-up thresholds.
 +
 +
== Examples ==
 +
{{tlx|Strange rank name/Sandbox|2=rankson=Opponents Flattened|3=kills=100}}
 +
{{Strange rank name/Sandbox|rankson=Opponents Flattened|kills=100}}
 +
 +
{{tlx|Strange rank name/Sandbox|2=item-name=Mantreads|3=kills=100}}
 +
{{Strange rank name/Sandbox|item-name=Mantreads|kills=100}}
 +
 +
{{tlx|Strange rank name/Sandbox|2=rankson=Opponents Flattened|3=item-name=Gunboats|4=kills=100}}
 +
{{Strange rank name/Sandbox|rankson=Opponents Flattened|item-name=Gunboats|kills=100}}
 +
 +
{{tlx|Strange rank name/Sandbox|2=item-name=Gunboats|3=kills=100}}
 +
{{Strange rank name/Sandbox|item-name=Gunboats|kills=100}}
 +
 
</noinclude>
 
</noinclude>

Revision as of 10:31, 30 November 2021

Documentation for Strange rank name

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