Template:Weapon properties: Difference between revisions
Template page
More actions
Ratboy Slim (talk | contribs) Added "effect-duration" to example table and template (it was already coded but I forgot to put it in the example) |
VivaRomania (talk | contribs) mNo edit summary |
||
| (4 intermediate revisions by 2 users not shown) | |||
| Line 1: | Line 1: | ||
{| class="wikitable" | {| class="wikitable" | ||
! colspan="3" style="text-align: center;font-size: | ! 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 144: | Line 148: | ||
This is a template for displaying weapon properties on weapon pages. | 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. | 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. | 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 | Values for header rows (Damage, Status Effects, Splash, Healing, Construction, Ammo, Function Times) must be {{code|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 | Three-column parameters, such as {{code|base-damage}}, require an additional "percentage" parameter to be passed. The percentage parameter is named the same as the first one, but with {{code|-percentage}} at the end. For example, {{code|base-damage-percentage}}. | ||
=== Editing this template === | === 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 {{code|#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 {{code|#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 {{code|#ifeq}} 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. | |||
{{tl|!}}, {{tl|!!}}, and {{tl|!-}} are escape templates that represent | {{tl|!}}, {{tl|!!}}, and {{tl|!-}} are escape templates that represent {{code|{{!}}}}, {{code|{{!!}}}}, and {{code|{{!}}-}}, respectively. Their purpose is to escape those characters in templates that have tables, because MediaWiki syntax does not support a literal {{code|{{!}}}} symbol in templates that have tables. | ||
See Wikipedia for more details: https://en.wikipedia.org/wiki/Help:Template#Creating_and_editing_templates | See Wikipedia for more details: https://en.wikipedia.org/wiki/Help:Template#Creating_and_editing_templates | ||
=== Example Table === | === Example Table === | ||
The following is an example table with every parameter (currently) supported by the template. | The following is an example table with every parameter (currently) supported by the template. | ||
| Line 231: | Line 233: | ||
| 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 311: | Line 315: | ||
| 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 | ||