From Dark and Darker Wiki

mNo edit summary
(Changing Template to use structure that works with the new Item Data.)
Line 1: Line 1:
<includeonly>{{ #arraydefine: stats | {{Weapon_Data|{{{1}}}|stats|allstats}} }}{{Infobox
<includeonly>{{#arraydefine:stats|{{Item Data|Weapon|{{{1}}}|stats|allstats}}}}<!--
|name                 = {{#ifeq:{{{2}}}|7|{{#if:{{Weapon_Data|{{{1}}}|unique}}|{{Weapon_Data|{{{1}}}|unique}}|{{{1}}}}}|{{{1}}}}}
-->{{Infobox
|image                = {{#if:{{Weapon_Data|{{{1}}}|craftable}}|{{{1}}}|{{{1}}} {{{2}}}}}
|name ={{{1}}}
|rarity               = {{{2}}}
|image ={{#if:{{Item Data|Weapon|{{{1}}}|iscraftable}}{{Item Data|Weapon|{{{1}}}|artifactpower}}|{{{1}}}|{{{1}}} {{{2}}}}}
    |stats ={{
|rarity ={{{2}}}
  #loop: i
|stats ={{
  | 0                       <!-- {{#ifexpr:{{#expr: {{{2}}} -2 }} >0|{{#expr: {{{2}}} -2 }}}} -->
#loop: i
  | {{ #arraysize:stats }} <!-- number of loops -->
|0
  | <nowiki/>{{#vardefine:stat|{{ #arrayindex:stats | {{ #var:i }} }}}}{{#ifeq:{{ #var:i }}|0||,}}{{ #var:stat }} {{#if:{{Weapon_Data|{{{1}}}|stats|{{ #var:stat }} }}|{{Weapon_Data|{{{1}}}|stats|{{ #var:stat }} }}|{{Weapon_Data|{{{1}}}|stats|{{ #var:stat }} {{{2}}} }} }}
|{{ #arraysize:stats }}
}}
|<nowiki/>{{#vardefine:stat|{{ #arrayindex:stats | {{ #var:i }}}}}}<!--
    |special             ={{#ifeq:{{{2}}}|7|{{Weapon_Data|{{{1}}}|uniquepower}}}}
-->{{#ifeq:{{ #var:i }}|0<!--
|classes             = {{Weapon Data|{{{1}}}|classes}}
-->||,}}<!--
|slottype             = {{Weapon Data|{{{1}}}|slottype}}
-->{{#var:stat}} <!--
|enchantments         = {{#ifexpr:{{#expr: {{{2}}} -2 }} >0|{{#expr: {{{2}}} -2 }}}}
-->{{#if:{{Item Data|Weapon|{{{1}}}|stats|{{#var:stat}}}}<!--
|handtype             = {{Weapon Data|{{{1}}}|handtype}}
-->|{{Item Data|Weapon|{{{1}}}|stats|{{#var:stat}}}}<!--
|weapontype          = {{Weapon_Data|{{{1}}}|weapontype}}
-->|{{Item Data|Weapon|{{{1}}}|stats|{{#var:stat}} {{{2}}}}}}}}}
|quiversize          = {{Weapon_Data|{{{1}}}|maxammo}}
|special ={{Item Data|Weapon|{{{1}}}|artifactpower}}
|hitbox              = {{Weapon_Data|{{{1}}}|range|height}}x{{Weapon_Data|{{{1}}}|range|width}}
|classes ={{Item Data|Weapon|{{{1}}}|classes}}
|projectilespeed      = {{Weapon_Data|{{{1}}}|projectilespeed}}
|slottype ={{Item Data|Weapon|{{{1}}}|slottype}}
|pierce              = {{Weapon_Data|{{{1}}}|pierce}}
|enchantments ={{#ifexpr:{{#expr:{{{2}}}-2}}>0|{{#expr:{{{2}}}-2}}}}
|description          = {{#ifeq:{{{2}}}|7|{{#if:{{Weapon_Data|{{{1}}}|uniqueflavortext}}|{{Weapon_Data|{{{1}}}|uniqueflavortext}}|{{Weapon_Data|{{{1}}}|flavortext}}}}|{{Weapon_Data|{{{1}}}|flavortext}}}}
|handtype ={{Item Data|Weapon|{{{1}}}|handtype}}
    |invslots             = {{Weapon_Data|{{{1}}}|invslots}}
|slottype ={{Item Data|Weapon|{{{1}}}|slottype}}
|nomargin             = 1
|weapontype ={{Item Data|Weapon|{{{1}}}|types|all}}
|nofloat             = 1
|quiversize ={{Item Data|Weapon|{{{1}}}|maxammocount}}
}} </includeonly><noinclude>
|hitbox ={{Item Data|Weapon|{{{1}}}|hitbox|height}}x{{Item Data|Weapon|{{{1}}}|hitbox|width}}x{{Item Data|Weapon|{{{1}}}|hitbox|depth}}
|projectilespeed={{Item Data|Weapon|{{{1}}}|initialprojectilespeed}}
|description ={{Item Data|Weapon|{{{1}}}|flavortext}}
|invslots ={{Item Data|Weapon|{{{1}}}|invslots}}
|nomargin =1
|nofloat =1
}}</includeonly><noinclude>
Auto creates weapon infobox
Auto creates weapon infobox
==Example==
==Example==
Line 32: Line 38:
<table cellspacing="0" class="wikitable sortable jquery-tablesorter" style="width:95%;color:#eee; background:transparent; text-align:center; vertical-align:middle;">
<table cellspacing="0" class="wikitable sortable jquery-tablesorter" style="width:95%;color:#eee; background:transparent; text-align:center; vertical-align:middle;">
{{GenerateWeaponInfobox|Arming Sword|1}}
{{GenerateWeaponInfobox|Arming Sword|1}}
{{GenerateWeaponInfobox|Arming Sword|7}}
{{GenerateWeaponInfobox|Fulgor|7}}
{{GenerateWeaponInfobox|Demon's Glee|6}}
</table>
</table>
</noinclude>
</noinclude>

Revision as of 03:47, 15 March 2024

Auto creates weapon infobox

Example

{{GenerateWeaponInfobox|<weapon name>|<rarity number>}}
{{GenerateWeaponInfobox|Arming Sword|1}}
Arming Sword 1.png
Hitbox:
xx
Fulgor 7.png
-
Up to 5 extra enchantments
-
Hitbox:
xx
-
Up to 4 extra enchantments
-
Hitbox:
xx