Template:Defense/doc: Difference between revisions

From Archaelund Wiki
No edit summary
No edit summary
Line 11: Line 11:
<table class="wikitable>
<table class="wikitable>
<tr><th>Format</th><th>Description</th><th>Input</th><th>Example output</th></tr>
<tr><th>Format</th><th>Description</th><th>Input</th><th>Example output</th></tr>
<tr><td>1...2</td><td>Extracts the value of the ith entry (i = 1...2) in the defense property input.</td><td>vector of 2 comma-separated numbers, representing defense values (e.g. "2,15")</td><td>{{Defense|2,15|1}}</td></tr>
<tr><td>1...5</td><td>Extracts the value of the ith entry (i = 1...5) in the defense property input.</td><td>vector of 5 comma-separated numbers, representing defense values (e.g. "2,15,5,2,0")</td><td>{{Defense|2,15,5,2,0|1}}</td></tr>
<tr><td>d1...d2</td><td>Extracts the value of the ith entry (i = 1...2) in the defense property input and formats it as a bonus/malus using [[Template:Difference]].</td><td>vector of 2 comma-separated numbers, representing defense values (e.g. "2,15")</td><td>{{Defense|2,15|d1}}</td></tr>
<tr><td>d1...d5</td><td>Extracts the value of the ith entry (i = 1...5) in the defense property input and formats it as a bonus/malus using [[Template:Difference]].</td><td>vector of 5 comma-separated numbers, representing defense values (e.g. "2,15,5,2,0")</td><td>{{Defense|2,15,5,2,0|d1}}</td></tr>
</table>
</table>
In the above-mentioned vector of 2 comma-separated numbers, each position/index corresponds to a specific defense property. See the subsequent list for details.
In the above-mentioned vector of 5 comma-separated numbers, each position/index corresponds to a specific defense property. See the subsequent list for details.


== Defense property names ==
== Defense property names ==
Line 21: Line 21:
<tr><td>1</td><td>{{Defense/names|1}}</td></tr>
<tr><td>1</td><td>{{Defense/names|1}}</td></tr>
<tr><td>2</td><td>{{Defense/names|2}}</td></tr>
<tr><td>2</td><td>{{Defense/names|2}}</td></tr>
<tr><td>3</td><td>{{Defense/names|3}}</td></tr>
<tr><td>4</td><td>{{Defense/names|4}}</td></tr>
<tr><td>5</td><td>{{Defense/names|5}}</td></tr>
</table>
</table>
To extract the individual defense property names use the following syntax:
To extract the individual defense property names use the following syntax:
Line 31: Line 34:
<tr><td>11</td><td>{{Defense/names|11}}</td></tr>
<tr><td>11</td><td>{{Defense/names|11}}</td></tr>
<tr><td>22</td><td>{{Defense/names|22}}</td></tr>
<tr><td>22</td><td>{{Defense/names|22}}</td></tr>
<tr><td>33</td><td>{{Defense/names|33}}</td></tr>
<tr><td>44</td><td>{{Defense/names|44}}</td></tr>
<tr><td>55</td><td>{{Defense/names|55}}</td></tr>
</table>
</table>

Revision as of 20:02, 20 November 2023

Description

This template generates various output formats from raw defense property input.

Usage

{{Defense|<defense property input>|<format>}}

Make sure that <defense property input> is formatted correctly according to the rules given below, otherwise error messages may be generated.

Format options

FormatDescriptionInputExample output
1...5Extracts the value of the ith entry (i = 1...5) in the defense property input.vector of 5 comma-separated numbers, representing defense values (e.g. "2,15,5,2,0")2
d1...d5Extracts the value of the ith entry (i = 1...5) in the defense property input and formats it as a bonus/malus using Template:Difference.vector of 5 comma-separated numbers, representing defense values (e.g. "2,15,5,2,0")+2

In the above-mentioned vector of 5 comma-separated numbers, each position/index corresponds to a specific defense property. See the subsequent list for details.

Defense property names

IndexName
1Armor
2Avoidance
3Critical Defense
4Armor Training
5

To extract the individual defense property names use the following syntax:

{{Defense/names|<defense property index>}}

Abbreviated names can be produced for each defense property by using specific double indices:

IndexName
11Arm.
22Avoid.
33Crit. Def.
44Arm. Train.
55