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... | <tr><td>1...4</td><td>Extracts the value of the ith entry (i = 1...4) in the defense property input.</td><td>vector of 5 comma-separated numbers, representing defense values (e.g. "2,15,5,2")</td><td>{{Defense|2,15,5,2|1}}</td></tr> | ||
<tr><td>d1... | <tr><td>d1...d4</td><td>Extracts the value of the ith entry (i = 1...4) 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")</td><td>{{Defense|2,15,5,2|d1}}</td></tr> | ||
</table> | </table> | ||
In the above-mentioned vector of | In the above-mentioned vector of 4 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 23: | Line 23: | ||
<tr><td>3</td><td>{{Defense/names|3}}</td></tr> | <tr><td>3</td><td>{{Defense/names|3}}</td></tr> | ||
<tr><td>4</td><td>{{Defense/names|4}}</td></tr> | <tr><td>4</td><td>{{Defense/names|4}}</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 36: | Line 35: | ||
<tr><td>33</td><td>{{Defense/names|33}}</td></tr> | <tr><td>33</td><td>{{Defense/names|33}}</td></tr> | ||
<tr><td>44</td><td>{{Defense/names|44}}</td></tr> | <tr><td>44</td><td>{{Defense/names|44}}</td></tr> | ||
</table> | </table> | ||
Revision as of 21:16, 4 February 2024
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
| Format | Description | Input | Example output |
|---|---|---|---|
| 1...4 | Extracts the value of the ith entry (i = 1...4) in the defense property input. | vector of 5 comma-separated numbers, representing defense values (e.g. "2,15,5,2") | 2 |
| d1...d4 | Extracts the value of the ith entry (i = 1...4) 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") | +2 |
In the above-mentioned vector of 4 comma-separated numbers, each position/index corresponds to a specific defense property. See the subsequent list for details.
Defense property names
| Index | Name |
|---|---|
| 1 | Armor |
| 2 | Avoidance |
| 3 | Critical Defense |
| 4 | Armor Training |
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:
| Index | Name |
|---|---|
| 11 | Arm. |
| 22 | Avoid. |
| 33 | Crit. Def. |
| 44 | Arm. Train. |