Template:Weapon properties: Difference between revisions

From TF2 Classic Wiki
Jump to navigation Jump to search
(Removed default percentages from the template, as it promotes lazy editing and can silently introduce wrong information)
(Made the font of the top header, "Properties", 22px, up from 20px)
 
(7 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{| class="wikitable"
{| class="wikitable"
! colspan="3" style="text-align: center;font-size: 20px;background-color: #583a31;color: white;" | Properties
! colspan="3" style="text-align: center;font-size: 22px;background-color: #583a31;color: white;" | Properties
|-
|-
{{#if:{{{shot-type|}}} |{{!}} colspan="2" style="background-color: #f1e9cb" {{!}} '''Shot type''' {{!!}} style="background-color: #dee8ed; text-align: right" {{!}} {{{shot-type}}}
{{#if:{{{shot-type|}}} |{{!}} colspan="2" style="background-color: #f1e9cb" {{!}} '''Shot type''' {{!!}} style="background-color: #dee8ed; text-align: right" {{!}} {{{shot-type}}}
Line 12: Line 12:
{{#ifeq:{{{damage-column|}}} | true |{{!}} colspan="3" style="text-align: center;font-size: 20px;background-color: #583a31;color: white;" {{!}} '''Damage'''
{{#ifeq:{{{damage-column|}}} | true |{{!}} colspan="3" style="text-align: center;font-size: 20px;background-color: #583a31;color: white;" {{!}} '''Damage'''
{{!-}}}}
{{!-}}}}
{{#if:{{{maximum-ramp-up|}}} |{{!}} style="background-color: #f1e9cb" {{!}} '''Maximum ramp-up''' {{!!}} style="text-align: center;" {{!}} {{{maximum-ramp-up-percentage}}} {{!!}} style="background-color: #dee8ed; text-align: right" {{!}} {{{maximum-ramp-up}}}
{{#if:{{{maximum-ramp-up|}}} |{{!}} style="background-color: #f1e9cb" {{!}} '''Maximum ramp-up''' {{!!}} style="text-align: center; background-color: white;" {{!}} {{{maximum-ramp-up-percentage}}} {{!!}} style="background-color: #dee8ed; text-align: right" {{!}} {{{maximum-ramp-up}}}
{{!-}}}}
{{!-}}}}
{{#if:{{{base-damage|}}} |{{!}} style="background-color: #f1e9cb" {{!}} '''Base damage''' {{!!}} style="text-align: center;" {{!}} {{{base-damage-percentage}}} {{!!}} style="background-color: #dee8ed; text-align: right" {{!}} {{{base-damage}}}
{{#if:{{{base-damage|}}} |{{!}} style="background-color: #f1e9cb" {{!}} '''Base damage''' {{!!}} style="text-align: center; background-color: white;" {{!}} {{{base-damage-percentage}}} {{!!}} style="background-color: #dee8ed; text-align: right" {{!}} {{{base-damage}}}
{{!-}}}}
{{!-}}}}
{{#if:{{{charged-damage|}}} |{{!}} style="background-color: #f1e9cb" {{!}} '''Charged damage''' {{!!}} style="text-align: center;" {{!}} {{{charged-damage-percentage}}} {{!!}} style="background-color: #dee8ed; text-align: right" {{!}} {{{charged-damage}}}
{{#if:{{{charged-damage|}}} |{{!}} style="background-color: #f1e9cb" {{!}} '''Charged damage''' {{!!}} style="text-align: center; background-color: white" {{!}} {{{charged-damage-percentage}}} {{!!}} style="background-color: #dee8ed; text-align: right" {{!}} {{{charged-damage}}}
{{!-}}}}
{{!-}}}}
{{#if:{{{maximum-fall-off|}}} |{{!}} style="background-color: #f1e9cb" {{!}} '''Maximum fall-off''' {{!!}} style="text-align: center;" {{!}} {{{maximum-fall-off-percentage}}} {{!!}} style="background-color: #dee8ed; text-align: right" {{!}} {{{maximum-fall-off}}}
{{#if:{{{maximum-fall-off|}}} |{{!}} style="background-color: #f1e9cb" {{!}} '''Maximum fall-off''' {{!!}} style="text-align: center; background-color: white;" {{!}} {{{maximum-fall-off-percentage}}} {{!!}} style="background-color: #dee8ed; text-align: right" {{!}} {{{maximum-fall-off}}}
{{!-}}}}
{{!-}}}}
{{#if:{{{critical|}}} |{{!}} colspan="2" style="background-color: #f1e9cb" {{!}} '''Critical''' {{!!}} style="background-color: #dee8ed; text-align: right" {{!}} {{{critical}}}
{{#if:{{{critical|}}} |{{!}} colspan="2" style="background-color: #f1e9cb" {{!}} '''Critical''' {{!!}} style="background-color: #dee8ed; text-align: right" {{!}} {{{critical}}}
Line 30: Line 30:
{{#if:{{{mini-crit-charged|}}} |{{!}} colspan="2" style="background-color: #f1e9cb" {{!}} '''Mini-crit (charged)''' {{!!}} style="background-color: #dee8ed; text-align: right" {{!}} {{{mini-crit-charged}}}
{{#if:{{{mini-crit-charged|}}} |{{!}} colspan="2" style="background-color: #f1e9cb" {{!}} '''Mini-crit (charged)''' {{!!}} style="background-color: #dee8ed; text-align: right" {{!}} {{{mini-crit-charged}}}
{{!-}}}}
{{!-}}}}
{{#if:{{{flame-damage-close|}}} |{{!}} style="background-color: #f1e9cb" {{!}} '''Flame damage (close)''' {{!!}} style="text-align: center;" {{!}} {{{flame-damage-close-percentage}}} {{!!}} style="background-color: #dee8ed; text-align: right" {{!}} {{{flame-damage-close}}}
{{#if:{{{flame-damage-close|}}} |{{!}} style="background-color: #f1e9cb" {{!}} '''Flame damage (close)''' {{!!}} style="text-align: center; background-color: white;" {{!}} {{{flame-damage-close-percentage}}} {{!!}} style="background-color: #dee8ed; text-align: right" {{!}} {{{flame-damage-close}}}
{{!-}}}}
{{!-}}}}
{{#if:{{{flame-damage-far|}}} |{{!}} style="background-color: #f1e9cb" {{!}} '''Flame damage (far)''' {{!!}} style="text-align: center;" {{!}} {{{flame-damage-far-percentage}}} {{!!}} style="background-color: #dee8ed; text-align: right" {{!}} {{{flame-damage-far}}}
{{#if:{{{flame-damage-far|}}} |{{!}} style="background-color: #f1e9cb" {{!}} '''Flame damage (far)''' {{!!}} style="text-align: center; background-color: white;" {{!}} {{{flame-damage-far-percentage}}} {{!!}} style="background-color: #dee8ed; text-align: right" {{!}} {{{flame-damage-far}}}
{{!-}}}}
{{!-}}}}
{{#if:{{{bullet-count|}}} |{{!}} colspan="2" style="background-color: #f1e9cb" {{!}} '''Bullet count''' {{!!}} style="background-color: #dee8ed; text-align: right" {{!}} {{{bullet-count}}}
{{#if:{{{bullet-count|}}} |{{!}} colspan="2" style="background-color: #f1e9cb" {{!}} '''Bullet count''' {{!!}} style="background-color: #dee8ed; text-align: right" {{!}} {{{bullet-count}}}
Line 60: Line 60:
{{#ifeq:{{{splash-column|}}} | true |{{!}} colspan="3" style="text-align: center;font-size: 20px;background-color: #583a31;color: white;" {{!}} '''Splash'''
{{#ifeq:{{{splash-column|}}} | true |{{!}} colspan="3" style="text-align: center;font-size: 20px;background-color: #583a31;color: white;" {{!}} '''Splash'''
{{!-}}}}
{{!-}}}}
{{#if:{{{minimum-splash|}}} |{{!}} style="background-color: #f1e9cb" {{!}} '''Minimum splash''' {{!!}} style="text-align: center;" {{!}} {{{minimum-splash-percentage}}} {{!!}} style="background-color: #dee8ed; text-align: right" {{!}} {{{minimum-splash}}}
{{#if:{{{minimum-splash|}}} |{{!}} style="background-color: #f1e9cb" {{!}} '''Minimum splash''' {{!!}} style="text-align: center; background-color: white;" {{!}} {{{minimum-splash-percentage}}} {{!!}} style="background-color: #dee8ed; text-align: right" {{!}} {{{minimum-splash}}}
{{!-}}}}
{{!-}}}}
{{#if:{{{damage-reduction|}}} |{{!}} colspan="2" style="background-color: #f1e9cb" {{!}} '''Damage reduction''' {{!!}} style="background-color: #dee8ed; text-align: right" {{!}} {{{damage-reduction}}}
{{#if:{{{damage-reduction|}}} |{{!}} colspan="2" style="background-color: #f1e9cb" {{!}} '''Damage reduction''' {{!!}} style="background-color: #dee8ed; text-align: right" {{!}} {{{damage-reduction}}}
Line 70: Line 70:
{{#ifeq:{{{healing-column|}}} | true |{{!}} colspan="3" style="text-align: center;font-size: 20px;background-color: #583a31;color: white;" {{!}} '''Healing'''
{{#ifeq:{{{healing-column|}}} | true |{{!}} colspan="3" style="text-align: center;font-size: 20px;background-color: #583a31;color: white;" {{!}} '''Healing'''
{{!-}}}}
{{!-}}}}
{{#if:{{{healing-in-combat|}}} |{{!}} style="background-color: #f1e9cb" {{!}} '''Healing (in combat)''' {{!!}} style="text-align: center;" {{!}} {{{healing-in-combat-percentage}}} {{!!}} style="background-color: #dee8ed; text-align: right" {{!}} {{{healing-in-combat}}}
{{#if:{{{healing-in-combat|}}} |{{!}} style="background-color: #f1e9cb" {{!}} '''Healing (in combat)''' {{!!}} style="text-align: center; background-color: white;" {{!}} {{{healing-in-combat-percentage}}} {{!!}} style="background-color: #dee8ed; text-align: right" {{!}} {{{healing-in-combat}}}
{{!-}}}}
{{!-}}}}
{{#if:{{{healing-out-of-combat|}}} |{{!}} style="background-color: #f1e9cb" {{!}} '''Healing (out of combat)''' {{!!}} style="text-align: center;" {{!}} {{{healing-out-of-combat-percentage}}} {{!!}} style="background-color: #dee8ed; text-align: right" {{!}} {{{healing-out-of-combat}}}
{{#if:{{{healing-out-of-combat|}}} |{{!}} style="background-color: #f1e9cb" {{!}} '''Healing (out of combat)''' {{!!}} style="text-align: center; background-color: white;" {{!}} {{{healing-out-of-combat-percentage}}} {{!!}} style="background-color: #dee8ed; text-align: right" {{!}} {{{healing-out-of-combat}}}
{{!-}}}}
{{!-}}}}
{{#if:{{{healing-self|}}} |{{!}} colspan="2" style="background-color: #f1e9cb" {{!}} '''Healing (self)''' {{!!}} style="background-color: #dee8ed; text-align: right" {{!}} {{{healing-self}}}
{{#if:{{{healing-self|}}} |{{!}} colspan="2" style="background-color: #f1e9cb" {{!}} '''Healing (self)''' {{!!}} style="background-color: #dee8ed; text-align: right" {{!}} {{{healing-self}}}
Line 111: Line 111:
{{!-}}}}
{{!-}}}}
{{#if:{{{activation-time|}}} |{{!}} colspan="2" style="background-color: #f1e9cb" {{!}} '''Activation time''' {{!!}} style="background-color: #dee8ed; text-align: right" {{!}} {{{activation-time}}}
{{#if:{{{activation-time|}}} |{{!}} colspan="2" style="background-color: #f1e9cb" {{!}} '''Activation time''' {{!!}} style="background-color: #dee8ed; text-align: right" {{!}} {{{activation-time}}}
{{!-}}}}
{{#if:{{{windup-time|}}} |{{!}} colspan="2" style="background-color: #f1e9cb" {{!}} '''Windup time''' {{!!}} style="background-color: #dee8ed; text-align: right" {{!}} {{{windup-time}}}
{{!-}}}}
{{#if:{{{winddown-time|}}} |{{!}} colspan="2" style="background-color: #f1e9cb" {{!}} '''Winddown time''' {{!!}} style="background-color: #dee8ed; text-align: right" {{!}} {{{winddown-time}}}
{{!-}}}}
{{!-}}}}
{{#if:{{{spread-recovery|}}} |{{!}} colspan="2" style="background-color: #f1e9cb" {{!}} '''Spread recovery''' {{!!}} style="background-color: #dee8ed; text-align: right" {{!}} {{{spread-recovery}}}
{{#if:{{{spread-recovery|}}} |{{!}} colspan="2" style="background-color: #f1e9cb" {{!}} '''Spread recovery''' {{!!}} style="background-color: #dee8ed; text-align: right" {{!}} {{{spread-recovery}}}
Line 150: Line 154:
Values for header rows (Damage, Status Effects, Splash, Healing, Construction, Ammo, Function Times) must be <code>true</code> if you want them to be displayed. Any other value is silently ignored, and the header row will not appear.<br>
Values for header rows (Damage, Status Effects, Splash, Healing, Construction, Ammo, Function Times) must be <code>true</code> if you want them to be displayed. Any other value is silently ignored, and the header row will not appear.<br>


Parameters with "percentage" in their name have an additional "percentage" parameter passed. The default percentages for most weapons are provided in the example table.<br>
Three-column parameters, such as <code>base-damage</code>, require an additional "percentage" parameter to be passed. The percentage parameter is named the same as the first one, but with <code>-percentage</code> at the end. For example, <code>base-damage-percentage</code>.<br>


=== Editing this template ===
=== Editing this template ===
Line 156: Line 160:
The basic principle is that the template is a MediaWiki table consisting of a series of rows. Each row is wrapped in an <code>#if</code> statement for each parameter name, which says that if a parameter with that name is given, that row appears and the parameter given is inserted into the row's rightmost column as a variable. This means more properties can be added to this template by copy and pasting the <code>#if</code> statement and adjusting the names. When adding properties to this template, also include them in the example table and syntax below.
The basic principle is that the template is a MediaWiki table consisting of a series of rows. Each row is wrapped in an <code>#if</code> statement for each parameter name, which says that if a parameter with that name is given, that row appears and the parameter given is inserted into the row's rightmost column as a variable. This means more properties can be added to this template by copy and pasting the <code>#if</code> statement and adjusting the names. When adding properties to this template, also include them in the example table and syntax below.


Rows with percentages have three columns instead of two, so copy and paste from those instead of any two-columned row. Be sure to provide a default percentage instead of leaving it blank. Headers use <code>#ifeq</code> statements instead of <code>#if</code> statements, so when adding a header, copy and paste the header code.
Rows with percentages have three columns instead of two, so copy and paste from those instead of any two-columned row. Do ''not'' include a default percentage, as this promotes lazy editing and can include inaccurate information. Headers use <code>#ifeq</code> statements instead of <code>#if</code> statements, so when adding a header, copy and paste the header code.


{{tl|!}}, {{tl|!!}}, and {{tl|!-}} are escape templates that represent <code>|</code>, <code>||</code>, and <code>|-</code>, respectively. Their purpose is to escape those characters in templates that have tables, because MediaWiki syntax does not support a literal <code>|</code> symbol in templates that have tables.
{{tl|!}}, {{tl|!!}}, and {{tl|!-}} are escape templates that represent <code>|</code>, <code>||</code>, and <code>|-</code>, respectively. Their purpose is to escape those characters in templates that have tables, because MediaWiki syntax does not support a literal <code>|</code> symbol in templates that have tables.
Line 193: Line 197:
| status-effects-column = true
| status-effects-column = true
  | effect = Bleed
  | effect = Bleed
| effect-duration = 10 s
  | afterburn = 4 / tick
  | afterburn = 4 / tick
  | afterburn-mini-crit = 5/ tick
  | afterburn-mini-crit = 5/ tick
Line 230: Line 235:
  | further-reloads = 0.67 s
  | further-reloads = 0.67 s
  | activation-time = 0.7 s
  | activation-time = 0.7 s
| windup-time = 1 s
| winddown-time = 0.5 s
  | spread-recovery = 1.25 s
  | spread-recovery = 1.25 s
  | consumption-time = 4.3 s
  | consumption-time = 4.3 s
Line 272: Line 279:
| status-effects-column = true
| status-effects-column = true
  | effect = Bleed
  | effect = Bleed
| effect-duration = 10 s
  | afterburn = 4 / tick
  | afterburn = 4 / tick
  | afterburn-mini-crit = 5/ tick
  | afterburn-mini-crit = 5/ tick
Line 309: Line 317:
  | further-reloads = 0.67 s
  | further-reloads = 0.67 s
  | activation-time = 0.7 s
  | activation-time = 0.7 s
| windup-time = 1 s
| winddown-time = 0.5 s
  | spread-recovery = 1.25 s
  | spread-recovery = 1.25 s
  | consumption-time = 4.3 s
  | consumption-time = 4.3 s

Latest revision as of 06:26, 6 September 2023

Properties
All values are approximate.

Documentation for Weapon properties

This is a template for displaying weapon properties on weapon pages.

By default, the only rows that will show up are the "Properties" header row and the "All values are approximate" footer row.

To make a row appear in the template, pass any string to its parameter. If no parameter is passed, the row will not show up. The passed parameter will show up in its right-most column.

Values for header rows (Damage, Status Effects, Splash, Healing, Construction, Ammo, Function Times) must be true if you want them to be displayed. Any other value is silently ignored, and the header row will not appear.

Three-column parameters, such as base-damage, require an additional "percentage" parameter to be passed. The percentage parameter is named the same as the first one, but with -percentage at the end. For example, base-damage-percentage.

Editing this template

The basic principle is that the template is a MediaWiki table consisting of a series of rows. Each row is wrapped in an #if statement for each parameter name, which says that if a parameter with that name is given, that row appears and the parameter given is inserted into the row's rightmost column as a variable. This means more properties can be added to this template by copy and pasting the #if statement and adjusting the names. When adding properties to this template, also include them in the example table and syntax below.

Rows with percentages have three columns instead of two, so copy and paste from those instead of any two-columned row. Do not include a default percentage, as this promotes lazy editing and can include inaccurate information. Headers use #ifeq statements instead of #if statements, so when adding a header, copy and paste the header code.

{{!}}, {{!!}}, and {{!-}} are escape templates that represent |, ||, and |-, respectively. Their purpose is to escape those characters in templates that have tables, because MediaWiki syntax does not support a literal | symbol in templates that have tables.

See Wikipedia for more details: https://en.wikipedia.org/wiki/Help:Template#Creating_and_editing_templates

Example Table

The following is an example table with every parameter (currently) supported by the template.

Properties
Shot type Hitscan
Damage type Bullet
Ranged or Melee? Ranged
Taunt Hadouken
Damage
Maximum ramp-up 150% 60
Base damage 100% 40
Charged damage 300% 120
Maximum fall-off 52.8% 21
Critical 120
Critical (charged) 360
Mini-crit 54
Mini-crit (ramp-up) 81
Mini-crit (charged) 162
Flame damage (close) 100% 6.5-13 / tick
Flame damage (far) 50% 3.25-6.5 / tick
Bullet count 1
Spread 80:1
Status Effects
Effect Bleed
Effect duration 10 s
Afterburn 4 / tick
Afterburn (mini-crit) 5/ tick
Afterburn duration 4-10 s
Bleed 4 / tick
Bleed (mini-crit) 5 /tick
Bleed duration 8 s
Tranquilize duration 5 s
Splash
Minimum splash 50% 2.8 m
Damage reduction 1% / 2.88
Self-damage 27-89
Self-damage (rocket jump) 27-46
Healing
Healing (in combat) 100% 24 / s
Healing (out of combat) 300% 72 / s
Healing (self) 300
Healing (others) 50% of max health
Beam connect distance 450 HU
Beam disconnect distance 540 HU
Construction
Repair per hit 102
Upgrade per hit 25
Cost per repair damage / 3
Cost per ammo 1 / bullet, 40 / hit
2 / rocket, 16 / hit
Ammo
Loaded 6
Carried 24
Reload type Clip
Function Times
Attack interval 0.5 s
Reload 1.133 s
First reload 1.09 s
Further reloads 0.67 s
Activation time 0.7 s
Windup time 1 s
Winddown time 0.5 s
Spread recovery 1.25 s
Consumption time 4.3 s
Cloak fade 1.0 s
Uncloak fade 1.8 s
Charge fill speed 2.5% / s (1.25% / s)
Charge fill time 40 s (80 s)
Recharge time 12 s
Drop expiry 30 s
Airblast interval 0.75 s
Scoped charge delay 1.3 s
Scoped headshot delay 0.2 s
Aim fatigue 5 s
Taunt duration 3.8 s
All values are approximate.
{{Weapon properties
 | shot-type = Hitscan
 | damage-type = Bullet
 | ranged-type = Ranged
 | taunt = Hadouken
| damage-column = true
 | maximum-ramp-up = 60
 | maximum-ramp-up-percentage = 150%
 | base-damage = 40
 | base-damage-percentage = 100%
 | charged-damage = 120
 | charged-damage-percentage = 300%
 | maximum-fall-off = 21
 | maximum-fall-off-percentage = 52.8%
 | critical = 120
 | critical-charged = 360
 | mini-crit = 54
 | mini-crit-ramp-up = 81
 | mini-crit-charged = 162
 | flame-damage-close = 6.5-13 / tick
 | flame-damage-close-percentage = 100%
 | flame-damage-far = 3.25-6.5 / tick
 | flame-damage-far-percentage = 50%
 | bullet-count = 1
 | spread = 80:1
| status-effects-column = true
 | effect = Bleed
 | effect-duration = 10 s
 | afterburn = 4 / tick
 | afterburn-mini-crit = 5/ tick
 | afterburn-duration = 4-10 s
 | bleed = 4 / tick
 | bleed-mini-crit =  5 /tick
 | bleed-duration = 8 s
 | tranquilize-duration = 5 s
| splash-column = true
 | minimum-splash = 2.8 m
 | minimum-splash-percentage = 50%
 | damage-reduction = 1% / 2.88
 | self-damage = 27-89
 | self-damage-rocket-jump = 27-46
| healing-column = true
 | healing-in-combat = 24 / s
 | healing-in-combat-percentage = 100%
 | healing-out-of-combat = 72 / s
 | healing-out-of-combat-percentage = 300%
 | healing-self = 300
 | healing-others = 50% of max health
 | beam-connect-distance = 450 HU
 | beam-disconnect-distance = 540 HU
| construction-column = true
 | repair-per-hit = 102
 | upgrade-per-hit = 25
 | cost-per-repair = damage / 3
 | cost-per-ammo = 1 / bullet, 40 / hit<br>2 / rocket, 16 / hit
| ammo-column = true
 | loaded = 6
 | carried = 24
 | reload-type = Clip
| function-times-column = true
 | attack-interval = 0.5 s
 | reload = 1.133 s
 | first-reload = 1.09 s
 | further-reloads = 0.67 s
 | activation-time = 0.7 s
 | windup-time = 1 s
 | winddown-time = 0.5 s
 | spread-recovery = 1.25 s
 | consumption-time = 4.3 s
 | cloak-fade = 1.0 s
 | uncloak-fade = 1.8 s
 | charge-fill-speed = 2.5% / s (1.25% / s)
 | charge-fill-time = 40 s (80 s)
 | recharge-time = 12 s
 | drop-expiry = 30 s
 | airblast-interval = 0.75 s
 | scoped-charge-delay = 1.3 s
 | scoped-headshot-delay = 0.2 s
 | aim-fatigue = 5 s
 | taunt-duration = 3.8 s
|}}