Template:Elements: Difference between revisions
From Archaelund Wiki
No edit summary |
No edit summary |
||
| Line 1: | Line 1: | ||
<onlyinclude><includeonly>{{#if:{{{1|}}}|{{#switch:{{{2|}}} | <onlyinclude><includeonly>{{#if:{{{1|}}}|{{#switch:{{{2|}}} | ||
| | |Icon = | ||
{{#switch:{{{1}}} | {{#switch:{{{1}}} | ||
|0 = | |0 = | ||
| Line 19: | Line 19: | ||
|Resistance = | |Resistance = | ||
{{#ifexpr:{{#explode:{{{1}}}|,|0}} != 0| | {{#ifexpr:{{#explode:{{{1}}}|,|0}} != 0| {{Elements|1|Icon}} {{#explode:{{{1}}}|,|0}} |}}{{#ifexpr:{{#explode:{{{1}}}|,|1}} != 0| {{Elements|2|Icon}} {{#explode:{{{1}}}|,|1}} |}}{{#ifexpr:{{#explode:{{{1}}}|,|2}} != 0| {{Elements|3|Icon}} {{#explode:{{{1}}}|,|2}} |}}{{#ifexpr:{{#explode:{{{1}}}|,|3}} != 0| {{Elements|4|Icon}} {{#explode:{{{1}}}|,|3}} |}}{{#ifexpr:{{#explode:{{{1}}}|,|4}} != 0| {{Elements|5|Icon}} {{#explode:{{{1}}}|,|4}} |}}{{#ifexpr:{{#explode:{{{1}}}|,|5}} != 0| {{Elements|6|Icon}} {{#explode:{{{1}}}|,|5}}|}} | ||
|Threat = | |Threat = | ||
{{#ifexpr:{{#explode:{{{1}}}|,|0}} > 0|{{#ifexpr:{{#explode:{{{1}}}|,|0}} > 1| | {{#ifexpr:{{#explode:{{{1}}}|,|0}} > 0|{{#ifexpr:{{#explode:{{{1}}}|,|0}} > 1|{{Elements|11|Icon}} |{{Elements|1|Icon}} |}}|}}{{#ifexpr:{{#explode:{{{1}}}|,|1}} > 0|{{#ifexpr:{{#explode:{{{1}}}|,|1}} > 1|{{Elements|22|Icon}} |{{Elements|2|Icon}} |}}|}}{{#ifexpr:{{#explode:{{{1}}}|,|2}} > 0|{{#ifexpr:{{#explode:{{{1}}}|,|2}} > 1|{{Elements|33|Icon}} |{{Elements|3|Icon}} |}}|}}{{#ifexpr:{{#explode:{{{1}}}|,|3}} > 0|{{#ifexpr:{{#explode:{{{1}}}|,|3}} > 1|{{Elements|44|Icon}} |{{Elements|4|Icon}} |}}|}}{{#ifexpr:{{#explode:{{{1}}}|,|4}} > 0|{{#ifexpr:{{#explode:{{{1}}}|,|4}} > 1|{{Elements|55|Icon}} |{{Elements|5|Icon}} |}}|}}{{#ifexpr:{{#explode:{{{1}}}|,|5}} > 0|{{#ifexpr:{{#explode:{{{1}}}|,|5}} > 1|{{Elements|66|Icon}} |{{Elements|6|Icon}} |}}|}} | ||
|#default = | |#default = | ||
Revision as of 12:34, 12 September 2020
Description
This template generates various output formats from raw element input.
Usage
{{Elements|<element input>|<format>}}
Make sure that <element 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 element input. | vector of 4 comma-separated numbers, representing element values (e.g. "10,0,50,-10") | |
| d1...d4 | Extracts the value of the ith entry (i = 1...4) in the element input and formats it as a bonus/malus using Template:Difference. | vector of 4 comma-separated numbers, representing element values (e.g. "10,0,50,-10") |
In the above-mentioned vector of 4 comma-separated numbers, each position/index corresponds to a specific element. See the subsequent list for details.
Element names and icons
| Index | Name | Icon |
|---|---|---|
| 1 | Fire | |
| 2 | Cold | |
| 3 | Shock | |
| 4 | Toxic |
To extract the individual element names and corresponding icons use the following syntaxes:
{{Elements/names|<element index>}}
{{Elements/icons|<element index>}}
Abbreviated names and special double icons can be produced for each element by using specific double indices:
| Index | Name | Icon |
|---|---|---|
| 11 | Fire | |
| 22 | Cold | |
| 33 | Shock | |
| 44 | Toxic |
View/Edit documentation page