Template:Infobox item: Difference between revisions

Jump to navigation Jump to search
no edit summary
No edit summary
No edit summary
Line 64: Line 64:
   {{!}}-
   {{!}}-
   {{!}} class="infobox-section" {{!}} Attack speed:
   {{!}} class="infobox-section" {{!}} Attack speed:
   {{!}} class="infobox-detail" {{!}} <span title="Attacks per second ({{{attackspeed}}} ms)">{{#var:$attackspeed}}</span> {{#set:Attackspeed={{#var:$attackspeed}}}}<!--
   {{!}} class="infobox-detail" {{!}} <span title="Attacks per second ({{{attackspeed}}} ms)">{{#var:$attackspeed}}</span> {{#set:Attackspeed={{#var:$attackspeed}}}}
// If we have set attack speed and damage, set the DPS variable
}}<nowiki />
-->{{#if:{{#show:{{FULLPAGENAME}}|?Damage=}}|{{#vardefine:$DPS|{{#expr:{{#show:{{FULLPAGENAME}}|?Damage=}} * {{#var:$attackspeed}}}}}}}}<!--
{{#if:{{#show:{{FULLPAGENAME}}|?Damage=}}|<!--
-->{{#vardefine:$damage|{{formatnum:{{#show:{{FULLPAGENAME}}|?Damage=}}|R}}}}<!--
// Define attack speed based on attackspeed stat
-->{{#vardefine:$attackspeed|{{formatnum:{{#show:{{FULLPAGENAME}}|?Attackspeed=}}|R}}}}<!--
// If no attackspeed is defined, set it to 1
-->{{#if:{{#var:$attackspeed}}||{{#vardefine:$attackspeed|1}}}}<!--
// Set the DPS variable
-->{{#vardefine:$DPS|{{#expr:{{#var:$damage}} * {{#var:$attackspeed}}}}}}<!--
// If dpsmodifier is given, multiply the current DPS (default 1 if not set) with the modifier and set the DPS variable to that
// If dpsmodifier is given, multiply the current DPS (default 1 if not set) with the modifier and set the DPS variable to that
-->{{#if:{{{dpsmodifier|}}}|{{#vardefine:$DPS|{{#expr:{{#var:$DPS|1}} * {{{dpsmodifier|}}}}}}}}}<!--
-->{{#if:{{{dpsmodifier|}}}|{{#vardefine:$DPS|{{#expr:{{#var:$DPS|1}} * {{{dpsmodifier|}}}}}}}}}<!--

Navigation menu