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

From Team Fortress Wiki
Jump to: navigation, search
m
 
(3 intermediate revisions by the same user not shown)
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
 +
    | soul gargoyle = nothing
 +
    | tough break campaign stamp = nothing
 +
 
 +
    | #default = {{lc:{{{rankson|kills}}}}}
 
   }}
 
   }}
  
Line 46: Line 44:
 
     {{#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 67:
 
     {{#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 90:
 
     {{#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 135:
 
     {{#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 158:
 
     {{#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 205:
 
     {{#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>
+
-->{{#if:{{{rankson|{{{item-name|}}}}}}||[[Category:Strange rank name ERROR|3]]}}<!--
 +
--></includeonly><noinclude>
 +
{{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}}.
 +
 
 +
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}}
 +
 
 +
{{tlx|Strange rank name/Sandbox|2=item-name=Gun Mettle Campaign Coin|3=kills=0}}
 +
{{Strange rank name/Sandbox|item-name=Gun Mettle Campaign Coin|kills=0}}
 +
 
 +
{{tlx|Strange rank name/Sandbox|2=item-name=Gun Mettle Campaign Coin|3=rankson=Contract Points|4=kills=0}}
 +
{{Strange rank name/Sandbox|item-name=Gun Mettle Campaign Coin|rankson=Contract Points|kills=0}}
 +
 
 +
</noinclude>

Latest revision as of 07:36, 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}}