From Dark and Darker Wiki
m (Raw Salad moved page Template:ArmorTable to Template:GenerateArmorTable: Merging templates, changing name to be consistent with other templates of the same type.) |
(Merged ArmorTable, GenerateArmorRows, GenerateArmorRow) |
||
Line 1: | Line 1: | ||
<includeonly><table cellspacing="0" class="wikitable sortable jquery-tablesorter" style="width:95%;color:#eee; background:transparent; text-align:center; vertical-align:middle;"> | <includeonly><!-- | ||
--><table cellspacing="0" class="wikitable sortable jquery-tablesorter" style="width:95%;color:#eee; background:transparent; text-align:center; vertical-align:middle;"> | |||
<tr style="font-weight:bold; color:#eee;"> | <tr style="font-weight:bold; color:#eee;"> | ||
<th style="width:5%" class="headerSort" tabindex="0" role="columnheader button" title="Sort ascending">Name</th> | <th style="width:5%" class="headerSort" tabindex="0" role="columnheader button" title="Sort ascending">Name</th> | ||
{{# | {{#ifeq:{{lc:{{{2|}}}}}|back | ||
||<th style="width:5%" class="headerSort" tabindex="0" role="columnheader button" title="Sort ascending">Class Requirements</th> | |||
<th style="width:5%" class="headerSort" tabindex="0" role="columnheader button" title="Sort ascending">Movement Speed</th>}} | |||
<th style="width:10%" class="headerSort" tabindex="0" role="columnheader button" title="Sort ascending">Armor/Magic Rating</th> | <th style="width:10%" class="headerSort" tabindex="0" role="columnheader button" title="Sort ascending">Armor/Magic Rating</th> | ||
<th style="width:10%" class="headerSort" tabindex="0" role="columnheader button" title="Sort ascending">Attributes</th> | <th style="width:10%" class="headerSort" tabindex="0" role="columnheader button" title="Sort ascending">Attributes</th> | ||
<th style="width:25%" class="headerSort" tabindex="0" role="columnheader button" title="Sort ascending">Other</th> | <th style="width:25%" class="headerSort" tabindex="0" role="columnheader button" title="Sort ascending">Other</th> | ||
</tr> | </tr><!-- | ||
{{{1}}} | Parameter {{{1}}} has the domain: {Uncraftable,Cratable} | ||
</table><!-- | Parameter {{{2}}} has the domain: {Foot,Back,Chest,Head,Legs,Hands} | ||
-->{{#arraydefine:armors|{{Armor Data|AllLists|SlotType|Armor|{{{1}}}|{{{2}}}}}}}<!-- | |||
-->{{#loop:i|0|{{ #arraysize:armors }}<!-- | |||
-->|{{#vardefine:current|{{#arrayindex:armors|{{#var:i}}}}}}<!-- | |||
-->{{#vardefine:AllStats|{{Armor Data|{{#var:current}}|Stats|AllStats}} }}<!-- | |||
-->{{#vardefine:use_horizontal_format|}}<!-- | |||
--><tr><!-- | |||
Iconbox | |||
--><td>{{Iconbox|<!-- | |||
-->{{#var:current}}<!-- | |||
-->|image={{#var:current}}.png<!-- | |||
-->|size={{IconboxInventorySize|Armor Data|{{#var:current}}}}<!-- | |||
-->|rarity=<!-- | |||
-->{{#if:{{#pos:{{#vardefineecho:rarities|{{Armor Data|{{#var:current}}|rarities}}}}|,}}<!-- | |||
-->|2<!-- | |||
-->|{{#var:rarities}}}}<!-- | |||
-->|caption=</span class="colorrarity{{#var:rarities}}">{{#var:current}}</span>}}</td><!-- | |||
Classes | |||
-->{{#if:{{#pos:{{Armor Data|{{#var:current}}|slottype}}|Back}}<!-- | |||
-->||<td>{{#replace:{{Armor Data|{{#var:current}}|classes}}|,|<br>}}</td>}}<!-- | |||
Movement Speed | |||
-->{{#if:{{#pos:{{Armor Data|{{#var:current}}|slottype}}|Back}}<!-- | |||
-->||<td>{{#if:{{#vardefineecho:armor_stat|{{Armor Data|{{#var:current}}|stats|move speed}} }}<!-- | |||
-->|{{#var:armor_stat}}<!-- | |||
-->|{{#if:{{#vardefineecho:armor_stat|{{Armor Data|{{#var:current}}|stats|move speed 0}} }}<!-- | |||
-->|<span class="colorrarity0">{{#var:armor_stat}}</span><br><!-- | |||
-->{{#if:{{#vardefineecho:armor_stat|{{Armor Data|{{#var:current}}|stats|move speed 1}} }}<!-- | |||
-->|<span class="colorrarity1">{{#var:armor_stat}}</span><br>}}<!-- | |||
-->{{#if:{{#vardefineecho:armor_stat|{{Armor Data|{{#var:current}}|stats|move speed 2}} }}<!-- | |||
-->|<span class="colorrarity2">{{#var:armor_stat}}</span><br>}}<!-- | |||
-->{{#if:{{#vardefineecho:armor_stat|{{Armor Data|{{#var:current}}|stats|move speed 3}} }}<!-- | |||
-->|<span class="colorrarity3">{{#var:armor_stat}}</span><br>}}<!-- | |||
-->{{#if:{{#vardefineecho:armor_stat|{{Armor Data|{{#var:current}}|stats|move speed 4}} }}<!-- | |||
-->|<span class="colorrarity4">{{#var:armor_stat}}</span><br>}}<!-- | |||
-->{{#if:{{#vardefineecho:armor_stat|{{Armor Data|{{#var:current}}|stats|move speed 5}} }}<!-- | |||
-->|<span class="colorrarity5">{{#var:armor_stat}}</span><br>}}<!-- | |||
-->{{#if:{{#vardefineecho:armor_stat|{{Armor Data|{{#var:current}}|stats|move speed 6}} }}<!-- | |||
-->|<span class="colorrarity6">{{#var:armor_stat}}</span><br>}}<!-- | |||
-->{{#if:{{#vardefineecho:armor_stat|{{Armor Data|{{#var:current}}|stats|move speed 7}} }}<!-- | |||
-->|<span class="colorrarity7">{{#var:armor_stat}}</span>}} }} }}</td>}}<!-- | |||
Magic/Armor Rating | |||
--><td>{{#if:{{#pos:{{#var:AllStats}}|Magic Resistance}}<!-- | |||
-->|<div style="display:inline-block; vertical-align:top; border-right:40px solid #0000;"><!-- | |||
--><span style="color:#eee8;">Magic Resistance<br></span><!-- | |||
-->{{#if:{{#vardefineecho:armor_stat|{{Armor Data|{{#var:current}}|stats|magic resistance}} }}<!-- | |||
-->|{{#var:armor_stat}}<!-- | |||
-->|{{#vardefine:use_horizontal_format|{{#if:{{Armor Data|{{#var:current}}|stats|armor rating 5}}|1}} }}<!-- | |||
-->{{#if:{{#vardefineecho:armor_stat|{{Armor Data|{{#var:current}}|stats|magic resistance 0}} }}<!-- | |||
-->|<span class="colorrarity0">{{#var:armor_stat}}</span><br>}}<!-- | |||
-->{{#if:{{#vardefineecho:armor_stat|{{Armor Data|{{#var:current}}|stats|magic resistance 1}} }}<!-- | |||
-->|<span class="colorrarity1">{{#var:armor_stat}}</span><br>}}<!-- | |||
-->{{#if:{{#vardefineecho:armor_stat|{{Armor Data|{{#var:current}}|stats|magic resistance 2}} }}<!-- | |||
-->|<span class="colorrarity2">{{#var:armor_stat}}</span><br>}}<!-- | |||
-->{{#if:{{#vardefineecho:armor_stat|{{Armor Data|{{#var:current}}|stats|magic resistance 3}} }}<!-- | |||
-->|<span class="colorrarity3">{{#var:armor_stat}}</span><br>}}<!-- | |||
-->{{#if:{{#vardefineecho:armor_stat|{{Armor Data|{{#var:current}}|stats|magic resistance 4}} }}<!-- | |||
-->|<span class="colorrarity4">{{#var:armor_stat}}</span><br>}}<!-- | |||
-->{{#if:{{#vardefineecho:armor_stat|{{Armor Data|{{#var:current}}|stats|magic resistance 5}} }}<!-- | |||
-->|<span class="colorrarity5">{{#var:armor_stat}}</span><br>}}<!-- | |||
-->{{#if:{{#vardefineecho:armor_stat|{{Armor Data|{{#var:current}}|stats|magic resistance 6}} }}<!-- | |||
-->|<span class="colorrarity6">{{#var:armor_stat}}</span><br>}}<!-- | |||
-->{{#if:{{#vardefineecho:armor_stat|{{Armor Data|{{#var:current}}|stats|magic resistance 7}} }}<!-- | |||
-->|<span class="colorrarity7">{{#var:armor_stat}}</span>}} }}</div>}}<!-- | |||
-->{{#if:{{#pos:{{#var:AllStats}}|Armor Rating}}<!-- | |||
-->|<div style="display:inline-block; vertical-align:top;"><!-- | |||
--><span style="color:#eee8;">Armor Rating<br></span><!-- | |||
-->{{#if:{{#vardefineecho:armor_stat|{{Armor Data|{{#var:current}}|stats|armor rating}} }}<!-- | |||
-->|{{#var:armor_stat}}<!-- | |||
-->|{{#if:{{#vardefineecho:armor_stat|{{Armor Data|{{#var:current}}|stats|armor rating 0}} }}<!-- | |||
-->|<span class="colorrarity0">{{#var:armor_stat}}</span><br>}}<!-- | |||
-->{{#if:{{#vardefineecho:armor_stat|{{Armor Data|{{#var:current}}|stats|armor rating 1}} }}<!-- | |||
-->|<span class="colorrarity1">{{#var:armor_stat}}</span><br>}}<!-- | |||
-->{{#if:{{#vardefineecho:armor_stat|{{Armor Data|{{#var:current}}|stats|armor rating 2}} }}<!-- | |||
-->|<span class="colorrarity2">{{#var:armor_stat}}</span><br>}}<!-- | |||
-->{{#if:{{#vardefineecho:armor_stat|{{Armor Data|{{#var:current}}|stats|armor rating 3}} }}<!-- | |||
-->|<span class="colorrarity3">{{#var:armor_stat}}</span><br>}}<!-- | |||
-->{{#if:{{#vardefineecho:armor_stat|{{Armor Data|{{#var:current}}|stats|armor rating 4}} }}<!-- | |||
-->|<span class="colorrarity4">{{#var:armor_stat}}</span><br>}}<!-- | |||
-->{{#if:{{#vardefineecho:armor_stat|{{Armor Data|{{#var:current}}|stats|armor rating 5}} }}<!-- | |||
-->|<span class="colorrarity5">{{#var:armor_stat}}</span><br>}}<!-- | |||
-->{{#if:{{#vardefineecho:armor_stat|{{Armor Data|{{#var:current}}|stats|armor rating 6}} }}<!-- | |||
-->|<span class="colorrarity6">{{#var:armor_stat}}</span><br>}}<!-- | |||
-->{{#if:{{#vardefineecho:armor_stat|{{Armor Data|{{#var:current}}|stats|armor rating 7}} }}<!-- | |||
-->|<span class="colorrarity7">{{#var:armor_stat}}</span>}} }}</div>}}</td><!-- | |||
Sieve Stats into Attributes and Others | |||
-->{{#arraydefine:Stats|{{Armor Data|{{#var:current}}|Stats|AllStats}} }}<!-- | |||
-->{{#arraydefine:attributes}}<!-- | |||
-->{{#arraydefine:others}}<!-- | |||
-->{{#loop:i|0|{{#arraysize:Stats}}<!-- | |||
-->|{{#vardefine:Stat|{{#arrayindex:Stats|{{#var:i}} }} }}<!-- | |||
-->{{#if:{{#pos:Strength,Vigor,Agility,Dexterity,Will,Knowledge,Resourcefulness|{{#var:Stat}} }}<!-- | |||
-->|{{#arraydefine:temp|{{#var:Stat}} }}{{#arraymerge:attributes|attributes|temp}}<!-- | |||
-->|{{#if:{{#pos:Armor Rating,Magic Resistance,Move Speed|{{#var:Stat}} }}<!-- | |||
-->||{{#arraydefine:temp|{{#var:Stat}} }}{{#arraymerge:others|others|temp}} }} }} }}<!-- | |||
Attribute Stats | |||
--><td><!-- | |||
-->{{#loop:i|0|{{#arraysize:attributes}}<!-- | |||
-->|{{#vardefine:attribute|{{#arrayindex:attributes|{{#var:i}} }} }}<!-- | |||
--><div style="display:inline-block; vertical-align:top; {{#ifexpr:{{#var:i}}>0|border-left:40px solid #0000;}}"><!-- | |||
-->{{#if:{{#vardefineecho:armor_stat|{{Armor Data|{{#var:current}}|stats|{{#var:attribute}} }} }}<!-- | |||
-->|<span style="color:#eee8;">{{#var:attribute}}</span><br><!-- | |||
-->{{#var:armor_stat}}<br><!-- | |||
-->|<span style="color:#eee8;">{{#var:attribute}}</span><br><!-- | |||
-->{{#if:{{#vardefineecho:armor_stat|{{Armor Data|{{#var:current}}|stats|{{#var:attribute}} 0}} }}<!-- | |||
-->|<span class="colorrarity0">{{#var:armor_stat}}</span><br>}}<!-- | |||
-->{{#if:{{#vardefineecho:armor_stat|{{Armor Data|{{#var:current}}|stats|{{#var:attribute}} 1}} }}<!-- | |||
-->|<span class="colorrarity1">{{#var:armor_stat}}</span><br>}}<!-- | |||
-->{{#if:{{#vardefineecho:armor_stat|{{Armor Data|{{#var:current}}|stats|{{#var:attribute}} 2}} }}<!-- | |||
-->|<span class="colorrarity2">{{#var:armor_stat}}</span><br>}}<!-- | |||
-->{{#if:{{#vardefineecho:armor_stat|{{Armor Data|{{#var:current}}|stats|{{#var:attribute}} 3}} }}<!-- | |||
-->|<span class="colorrarity3">{{#var:armor_stat}}</span><br>}}<!-- | |||
-->{{#if:{{#vardefineecho:armor_stat|{{Armor Data|{{#var:current}}|stats|{{#var:attribute}} 4}} }}<!-- | |||
-->|<span class="colorrarity4">{{#var:armor_stat}}</span><br>}}<!-- | |||
-->{{#if:{{#vardefineecho:armor_stat|{{Armor Data|{{#var:current}}|stats|{{#var:attribute}} 5}} }}<!-- | |||
-->|<span class="colorrarity5">{{#var:armor_stat}}</span><br>}}<!-- | |||
-->{{#if:{{#vardefineecho:armor_stat|{{Armor Data|{{#var:current}}|stats|{{#var:attribute}} 6}} }}<!-- | |||
-->|<span class="colorrarity6">{{#var:armor_stat}}</span><br>}}<!-- | |||
-->{{#if:{{#vardefineecho:armor_stat|{{Armor Data|{{#var:current}}|stats|{{#var:attribute}} 7}} }}<!-- | |||
-->|<span class="colorrarity7">{{#var:armor_stat}}</span><br>}} }}</div>}}</td><!-- | |||
Other Stats | |||
--><td><!-- | |||
-->{{#loop:i|0|{{#arraysize:others}}<!-- | |||
-->|{{#vardefine:stat|{{#arrayindex:others|{{#var:i}} }} }}<!-- | |||
--><div style="display:inline-block; vertical-align:top; {{#ifexpr:{{#var:i}}>0|border-left:40px solid #0000;}}"><!-- | |||
-->{{#if:{{#vardefineecho:armor_stat|{{Armor Data|{{#var:current}}|stats|{{#var:stat}} }} }}<!-- | |||
-->|<span style="color:#eee8;">{{#var:stat}}</span><br><!-- | |||
-->{{#var:armor_stat}}<br><!-- | |||
-->|<span style="color:#eee8;">{{#var:stat}}</span><br><!-- | |||
-->{{#if:{{#vardefineecho:armor_stat|{{Armor Data|{{#var:current}}|stats|{{#var:stat}} 0}} }}<!-- | |||
-->|<span class="colorrarity0">{{#var:armor_stat}}</span><br>}}<!-- | |||
-->{{#if:{{#vardefineecho:armor_stat|{{Armor Data|{{#var:current}}|stats|{{#var:stat}} 1}} }}<!-- | |||
-->|<span class="colorrarity1">{{#var:armor_stat}}</span><br>}}<!-- | |||
-->{{#if:{{#vardefineecho:armor_stat|{{Armor Data|{{#var:current}}|stats|{{#var:stat}} 2}} }}<!-- | |||
-->|<span class="colorrarity2">{{#var:armor_stat}}</span><br>}}<!-- | |||
-->{{#if:{{#vardefineecho:armor_stat|{{Armor Data|{{#var:current}}|stats|{{#var:stat}} 3}} }}<!-- | |||
-->|<span class="colorrarity3">{{#var:armor_stat}}</span><br>}}<!-- | |||
-->{{#if:{{#vardefineecho:armor_stat|{{Armor Data|{{#var:current}}|stats|{{#var:stat}} 4}} }}<!-- | |||
-->|<span class="colorrarity4">{{#var:armor_stat}}</span><br>}}<!-- | |||
-->{{#if:{{#vardefineecho:armor_stat|{{Armor Data|{{#var:current}}|stats|{{#var:stat}} 5}} }}<!-- | |||
-->|<span class="colorrarity5">{{#var:armor_stat}}</span><br>}}<!-- | |||
-->{{#if:{{#vardefineecho:armor_stat|{{Armor Data|{{#var:current}}|stats|{{#var:stat}} 6}} }}<!-- | |||
-->|<span class="colorrarity6">{{#var:armor_stat}}</span><br>}}<!-- | |||
-->{{#if:{{#vardefineecho:armor_stat|{{Armor Data|{{#var:current}}|stats|{{#var:stat}} 7}} }}<!-- | |||
-->|<span class="colorrarity7">{{#var:armor_stat}}</span><br>}} }}</div>}}</td></tr>}}</table><!-- | |||
--></includeonly><noinclude> | --></includeonly><noinclude> | ||
{{ | *1={Uncraftable,Craftable,Both} | ||
*2={Foot,Back,Chest,Head,Legs,Hands} | |||
== Example == | |||
<table class="wikitable"> | |||
<tr> | |||
<th>Code</th> | |||
<th>Preview</th></tr> | |||
<tr> | |||
<td style="padding: 20px 30px;"> | |||
<pre>{{GenerateArmorTable|Uncraftable|Head}}</pre></td> | |||
<td style="padding: 20px 30px;"> | |||
{{GenerateArmorTable|Uncraftable|Head}}</td></tr></table> | |||
</noinclude> | </noinclude> |
Revision as of 13:23, 14 June 2024
- 1={Uncraftable,Craftable,Both}
- 2={Foot,Back,Chest,Head,Legs,Hands}
Example
Code | Preview | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
{{GenerateArmorTable|Uncraftable|Head}} |
|