Toggle menu
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

Template:Weapon properties: Difference between revisions

Template page
Perci (talk | contribs)
Added winddown time and windup time stats
Ratboy Slim (talk | contribs)
Updated documentation to say not to include default percentages. Actual template is unchanged.
Line 154: 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>


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>. 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 160: 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.