Difference between revisions of "Template:True Melee DPS Calculator"

From RimWorld Wiki
Jump to navigation Jump to search
(Undo revision 133663 by Ickputzdirwech (talk))
Tag: Undo
(first working iteration of integration of pawn verb set)
Line 10: Line 10:
  
 
1. VARIABLES
 
1. VARIABLES
 +
1.1 Important variables
 
-->{{#vardefine:name | {{{1|{{PAGENAME}} }}} }}<!--
 
-->{{#vardefine:name | {{{1|{{PAGENAME}} }}} }}<!--
 
-->{{#vardefine:material | {{{2|}}} }}<!--
 
-->{{#vardefine:material | {{{2|}}} }}<!--
Line 32: Line 33:
 
}} }}<!--
 
}} }}<!--
  
1.1 Clearing variables in case the page is called multiple times on the same page
+
WIP: calculating a pawn equipped with a certain weapon would look something like this: {{True Melee DPS Calculator|Longsword|Steel|Good|Human|Archotech arm|false|Denture}} for {{True Melee DPS Calculator|<weapon>|<material>|<quality>|<pawn>|<first attack>|<second attack>|<third attack>|<fourth attack>|<fifth attack>|<sixth attack>}}
 +
Do we need to consider Melee Hit Chance? After all it's affected by manipulation
 +
 
 +
-->{{#if: {{#vardefineecho:pawn| {{{4|}}} }} |
 +
{{#vardefine:attack7Type  | {{#if: {{{ 5|}}} | {{#ifeq: {{{ 5|}}} | false || {{Q|{{{ 5}}}|Attack 1 Type}} }} | {{Q|{{#var:pawn}}|Attack 1 Type}} }} }}
 +
{{#vardefine:attack8Type  | {{#if: {{{ 6|}}} | {{#ifeq: {{{ 6|}}} | false || {{Q|{{{ 6}}}|Attack 1 Type}} }} | {{Q|{{#var:pawn}}|Attack 2 Type}} }} }}
 +
{{#vardefine:attack9Type  | {{#if: {{{ 7|}}} | {{#ifeq: {{{ 7|}}} | false || {{Q|{{{ 7}}}|Attack 1 Type}} }} | {{Q|{{#var:pawn}}|Attack 3 Type}} }} }}
 +
{{#vardefine:attack10Type | {{#if: {{{ 8|}}} | {{#ifeq: {{{ 8|}}} | false || {{Q|{{{ 8}}}|Attack 1 Type}} }} | {{Q|{{#var:pawn}}|Attack 4 Type}} }} }}
 +
{{#vardefine:attack11Type | {{#if: {{{ 9|}}} | {{#ifeq: {{{ 9|}}} | false || {{Q|{{{ 9}}}|Attack 1 Type}} }} | {{Q|{{#var:pawn}}|Attack 5 Type}} }} }}
 +
{{#vardefine:attack12Type | {{#if: {{{10|}}} | {{#ifeq: {{{10|}}} | false || {{Q|{{{10}}}|Attack 1 Type}} }} | {{Q|{{#var:pawn}}|Attack 6 Type}} }} }}
 +
| {{#vardefine:attack7Type|}}{{#vardefine:attack8Type|}}{{#vardefine:attack9Type|}}{{#vardefine:attack10Type|}}{{#vardefine:attack11Type|}}{{#vardefine:attack12Type|}}
 +
}}<!--
 +
 
 +
1.2 Variables that might be useful to call outside of this template
 +
-->{{#if:{{#var:pawn}} |
 +
{{#vardefine:attack7Source | {{#if: {{{5|}}} | {{{5}}} | {{#var:pawn}} }} }}
 +
{{#vardefine:attack8Source | {{#if: {{{6|}}} | {{{6}}} | {{#var:pawn}} }} }}
 +
{{#vardefine:attack9Source | {{#if: {{{7|}}} | {{{7}}} | {{#var:pawn}} }} }}
 +
{{#vardefine:attack10Source | {{#if: {{{8|}}} | {{{8}}} | {{#var:pawn}} }} }}
 +
{{#vardefine:attack11Source | {{#if: {{{9|}}} | {{{9}}} | {{#var:pawn}} }} }}
 +
{{#vardefine:attack12Source | {{#if: {{{10|}}} | {{{10}}} | {{#var:pawn}} }} }}
 +
}}<!--
 +
-->{{#if:{{#var:pawn}} |
 +
{{#vardefine:attack7Part | {{#if: {{{5|}}} | {{Q|{{{5}}}|Attack 1 Part}} | {{Q|{{#var:pawn}}|Attack 1 Part}} }} }}
 +
{{#vardefine:attack8Part | {{#if: {{{6|}}} | {{Q|{{{6}}}|Attack 1 Part}} | {{Q|{{#var:pawn}}|Attack 2 Part}} }} }}
 +
{{#vardefine:attack9Part | {{#if: {{{7|}}} | {{Q|{{{7}}}|Attack 1 Part}} | {{Q|{{#var:pawn}}|Attack 3 Part}} }} }}
 +
{{#vardefine:attack10Part | {{#if: {{{8|}}} | {{Q|{{{8}}}|Attack 1 Part}} | {{Q|{{#var:pawn}}|Attack 4 Part}} }} }}
 +
{{#vardefine:attack11Part | {{#if: {{{9|}}} | {{Q|{{{9}}}|Attack 1 Part}} | {{Q|{{#var:pawn}}|Attack 5 Part}} }} }}
 +
{{#vardefine:attack12Part | {{#if: {{{10|}}} | {{Q|{{{10}}}|Attack 1 Part}} | {{Q|{{#var:pawn}}|Attack 6 Part}} }} }}
 +
}}<!--
 +
-->{{#vardefine:quality | {{{3|}}} }}<!--
 +
 
 +
1.3 Clearing variables in case the page is called multiple times on the same page
 
-->{{#vardefine:attack1InitialSelectionWeight|}}{{#vardefine:attack1SelectionCategory|}}{{#vardefine:attack1AP|}}{{#vardefine:attack1Cooldown|}}{{#vardefine:attack1Damage|}}{{#vardefine:attack1SelectionChance|}}<!--
 
-->{{#vardefine:attack1InitialSelectionWeight|}}{{#vardefine:attack1SelectionCategory|}}{{#vardefine:attack1AP|}}{{#vardefine:attack1Cooldown|}}{{#vardefine:attack1Damage|}}{{#vardefine:attack1SelectionChance|}}<!--
 
-->{{#vardefine:attack2InitialSelectionWeight|}}{{#vardefine:attack2SelectionCategory|}}{{#vardefine:attack2AP|}}{{#vardefine:attack2Cooldown|}}{{#vardefine:attack2Damage|}}{{#vardefine:attack2SelectionChance|}}<!--
 
-->{{#vardefine:attack2InitialSelectionWeight|}}{{#vardefine:attack2SelectionCategory|}}{{#vardefine:attack2AP|}}{{#vardefine:attack2Cooldown|}}{{#vardefine:attack2Damage|}}{{#vardefine:attack2SelectionChance|}}<!--
Line 39: Line 72:
 
-->{{#vardefine:attack5InitialSelectionWeight|}}{{#vardefine:attack5SelectionCategory|}}{{#vardefine:attack5AP|}}{{#vardefine:attack5Cooldown|}}{{#vardefine:attack5Damage|}}{{#vardefine:attack5SelectionChance|}}<!--
 
-->{{#vardefine:attack5InitialSelectionWeight|}}{{#vardefine:attack5SelectionCategory|}}{{#vardefine:attack5AP|}}{{#vardefine:attack5Cooldown|}}{{#vardefine:attack5Damage|}}{{#vardefine:attack5SelectionChance|}}<!--
 
-->{{#vardefine:attack6InitialSelectionWeight|}}{{#vardefine:attack6SelectionCategory|}}{{#vardefine:attack6AP|}}{{#vardefine:attack6Cooldown|}}{{#vardefine:attack6Damage|}}{{#vardefine:attack6SelectionChance|}}<!--
 
-->{{#vardefine:attack6InitialSelectionWeight|}}{{#vardefine:attack6SelectionCategory|}}{{#vardefine:attack6AP|}}{{#vardefine:attack6Cooldown|}}{{#vardefine:attack6Damage|}}{{#vardefine:attack6SelectionChance|}}<!--
 +
-->{{#vardefine:attack7InitialSelectionWeight|}}{{#vardefine:attack7SelectionCategory|}}{{#vardefine:attack7AP|}}{{#vardefine:attack7Cooldown|}}{{#vardefine:attack7Damage|}}{{#vardefine:attack7SelectionChance|}}<!--
 +
-->{{#vardefine:attack8InitialSelectionWeight|}}{{#vardefine:attack8SelectionCategory|}}{{#vardefine:attack8AP|}}{{#vardefine:attack8Cooldown|}}{{#vardefine:attack8Damage|}}{{#vardefine:attack8SelectionChance|}}<!--
 +
-->{{#vardefine:attack9InitialSelectionWeight|}}{{#vardefine:attack9SelectionCategory|}}{{#vardefine:attack9AP|}}{{#vardefine:attack9Cooldown|}}{{#vardefine:attack9Damage|}}{{#vardefine:attack9SelectionChance|}}<!--
 +
-->{{#vardefine:attack10InitialSelectionWeight|}}{{#vardefine:attack10SelectionCategory|}}{{#vardefine:attack10AP|}}{{#vardefine:attack10Cooldown|}}{{#vardefine:attack10Damage|}}{{#vardefine:attack10SelectionChance|}}<!--
 +
-->{{#vardefine:attack11InitialSelectionWeight|}}{{#vardefine:attack11SelectionCategory|}}{{#vardefine:attack11AP|}}{{#vardefine:attack11Cooldown|}}{{#vardefine:attack11Damage|}}{{#vardefine:attack11SelectionChance|}}<!--
 +
-->{{#vardefine:attack12InitialSelectionWeight|}}{{#vardefine:attack12SelectionCategory|}}{{#vardefine:attack12AP|}}{{#vardefine:attack12Cooldown|}}{{#vardefine:attack12Damage|}}{{#vardefine:attack12SelectionChance|}}<!--
 
-->{{#vardefine:numBestAttacks|0}}{{#vardefine:numMidAttacks|0}}<!--
 
-->{{#vardefine:numBestAttacks|0}}{{#vardefine:numMidAttacks|0}}<!--
  
Line 53: Line 92:
 
  | #default = {{Error|Unrecognised Damage Type: {{#var:attack1Type}} }}
 
  | #default = {{Error|Unrecognised Damage Type: {{#var:attack1Type}} }}
 
}}<!--
 
}}<!--
-->{{#vardefine: attack1InitialSelectionWeight | {{#expr: {{#var:attack1Damage}} * (1 + ({{#var:attack1AP}}/100)) * {{Q|{{#var:name}}|Attack 1 Chance Factor|1}} / {{#vardefineecho:attack1Cooldown | ({{Q|{{#var:name}}|Attack 1 Cooldown}}*{{#var:cooldownFactor}}) }} round 1}} }}<!--
+
-->{{#vardefine: attack1InitialSelectionWeight | {{#expr: {{#var:attack1Damage}} * (1 + ({{#var:attack1AP}}/100)) * {{Q|{{#var:name}}|Attack 1 Chance Factor|1}} / {{#vardefineecho:attack1Cooldown | {{#expr: {{Q|{{#var:name}}|Attack 1 Cooldown}}*{{#var:cooldownFactor}} }} }} round 1}} }}<!--
 
2.1.2 Second attack
 
2.1.2 Second attack
 
-->{{#if: {{#var:attack2Type}} |
 
-->{{#if: {{#var:attack2Type}} |
Line 65: Line 104:
 
  | #default = {{Error|Unrecognised Damage Type: {{#var:attack2Type}} }}
 
  | #default = {{Error|Unrecognised Damage Type: {{#var:attack2Type}} }}
 
}}
 
}}
{{#vardefine: attack2InitialSelectionWeight | {{#expr: {{#var:attack2Damage}} * (1 + ({{#var:attack2AP}}/100)) * {{Q|{{#var:name}}|Attack 2 Chance Factor|1}} / {{#vardefineecho:attack2Cooldown | ({{Q|{{#var:name}}|Attack 2 Cooldown}}*{{#var:cooldownFactor}}) }} round 1}} }}
+
{{#vardefine: attack2InitialSelectionWeight | {{#expr: {{#var:attack2Damage}} * (1 + ({{#var:attack2AP}}/100)) * {{Q|{{#var:name}}|Attack 2 Chance Factor|1}} / {{#vardefineecho:attack2Cooldown | {{#expr: {{Q|{{#var:name}}|Attack 2 Cooldown}}*{{#var:cooldownFactor}} }} }} round 1}} }}
 
}}<!--
 
}}<!--
 
2.1.3 Third attack
 
2.1.3 Third attack
Line 78: Line 117:
 
  | #default = {{Error|Unrecognised Damage Type: {{#var:attack3Type}} }}
 
  | #default = {{Error|Unrecognised Damage Type: {{#var:attack3Type}} }}
 
}}
 
}}
{{#vardefine: attack3InitialSelectionWeight | {{#expr: {{#var:attack3Damage}} * (1 + ({{#var:attack3AP}}/100)) * {{Q|{{#var:name}}|Attack 3 Chance Factor|1}} / {{#vardefineecho:attack3Cooldown | ({{Q|{{#var:name}}|Attack 3 Cooldown}}*{{#var:cooldownFactor}}) }} round 1}} }}
+
{{#vardefine: attack3InitialSelectionWeight | {{#expr: {{#var:attack3Damage}} * (1 + ({{#var:attack3AP}}/100)) * {{Q|{{#var:name}}|Attack 3 Chance Factor|1}} / {{#vardefineecho:attack3Cooldown | {{#expr: {{Q|{{#var:name}}|Attack 3 Cooldown}}*{{#var:cooldownFactor}} }} }} round 1}} }}
 
}}<!--
 
}}<!--
 
2.1.4 Fourth attack
 
2.1.4 Fourth attack
Line 91: Line 130:
 
  | #default = {{Error|Unrecognised Damage Type: {{#var:attack4Type}} }}
 
  | #default = {{Error|Unrecognised Damage Type: {{#var:attack4Type}} }}
 
}}
 
}}
{{#vardefine: attack4InitialSelectionWeight | {{#expr: {{#var:attack4Damage}} * (1 + ({{#var:attack4AP}}/100)) * {{Q|{{#var:name}}|Attack 4 Chance Factor|1}} / {{#vardefineecho:attack4Cooldown | ({{Q|{{#var:name}}|Attack 4 Cooldown}}*{{#var:cooldownFactor}}) }} round 1}} }}
+
{{#vardefine: attack4InitialSelectionWeight | {{#expr: {{#var:attack4Damage}} * (1 + ({{#var:attack4AP}}/100)) * {{Q|{{#var:name}}|Attack 4 Chance Factor|1}} / {{#vardefineecho:attack4Cooldown | {{#expr: {{Q|{{#var:name}}|Attack 4 Cooldown}}*{{#var:cooldownFactor}} }} }} round 1}} }}
 
}}<!--
 
}}<!--
 
2.1.5 Fifth attack
 
2.1.5 Fifth attack
Line 104: Line 143:
 
  | #default = {{Error|Unrecognised Damage Type: {{#var:attack5Type}} }}
 
  | #default = {{Error|Unrecognised Damage Type: {{#var:attack5Type}} }}
 
}}
 
}}
{{#vardefine: attack5InitialSelectionWeight | {{#expr: {{#var:attack5Damage}} * (1 + ({{#var:attack5AP}}/100)) * {{Q|{{#var:name}}|Attack 5 Chance Factor|1}} / {{#vardefineecho:attack5Cooldown | ({{Q|{{#var:name}}|Attack 5 Cooldown}}*{{#var:cooldownFactor}}) }} round 1}} }}
+
{{#vardefine: attack5InitialSelectionWeight | {{#expr: {{#var:attack5Damage}} * (1 + ({{#var:attack5AP}}/100)) * {{Q|{{#var:name}}|Attack 5 Chance Factor|1}} / {{#vardefineecho:attack5Cooldown | {{#expr: {{Q|{{#var:name}}|Attack 5 Cooldown}}*{{#var:cooldownFactor}} }} }} round 1}} }}
 
}}<!--
 
}}<!--
 
2.1.6 Sixth attack
 
2.1.6 Sixth attack
Line 117: Line 156:
 
  | #default = {{Error|Unrecognised Damage Type: {{#var:attack6Type}} }}
 
  | #default = {{Error|Unrecognised Damage Type: {{#var:attack6Type}} }}
 
}}
 
}}
{{#vardefine: attack6InitialSelectionWeight | {{#expr: {{#var:attack6Damage}} * (1 + ({{#var:attack6AP}}/100)) * {{Q|{{#var:name}}|Attack 6 Chance Factor|1}} / {{#vardefineecho:attack6Cooldown | ({{Q|{{#var:name}}|Attack 6 Cooldown}}*{{#var:cooldownFactor}}) }} round 1}} }}
+
{{#vardefine: attack6InitialSelectionWeight | {{#expr: {{#var:attack6Damage}} * (1 + ({{#var:attack6AP}}/100)) * {{Q|{{#var:name}}|Attack 6 Chance Factor|1}} / {{#vardefineecho:attack6Cooldown | {{#expr: {{Q|{{#var:name}}|Attack 6 Cooldown}}*{{#var:cooldownFactor}} }} }} round 1}} }}
 +
}}<!--
 +
2.1.7 Pawn attacks
 +
-->{{#if: {{#var:attack7Type}} |
 +
{{#if: {{{5|}}}
 +
| {{#vardefine: attack7InitialSelectionWeight | {{#expr: {{#vardefineecho:attack7Damage| {{Q|{{{5}}}|Attack 1 Damage}} }} * (1 + ({{#vardefineecho:attack7AP| {{Q|{{{5}}}|Attack 1 AP}} }}/100)) * {{Q|{{{5}}}|Attack 1 Chance Factor|1}} / {{#vardefineecho:attack7Cooldown | {{Q|{{{5}}}|Attack 1 Cooldown}} }} round 1}} }}
 +
| {{#vardefine: attack7InitialSelectionWeight | {{#expr: {{#vardefineecho:attack7Damage| {{Q|{{#var:pawn}}|Attack 1 Damage}} }} * (1 + ({{#vardefineecho:attack7AP| {{Q|{{#var:pawn}}|Attack 1 AP}} }}/100)) * {{Q|{{#var:pawn}}|Attack 1 Chance Factor|1}} / {{#vardefineecho:attack7Cooldown | {{Q|{{#var:pawn}}|Attack 1 Cooldown}} }} round 1}} }}
 +
}}
 +
}}<!--
 +
-->{{#if: {{#var:attack8Type}} |
 +
{{#if: {{{6|}}}
 +
| {{#vardefine: attack8InitialSelectionWeight | {{#expr: {{#vardefineecho:attack8Damage| {{Q|{{{6}}}|Attack 1 Damage}} }} * (1 + ({{#vardefineecho:attack8AP| {{Q|{{{6}}}|Attack 1 AP}} }}/100)) * {{Q|{{{6}}}|Attack 1 Chance Factor|1}} / {{#vardefineecho:attack8Cooldown | {{Q|{{{6}}}|Attack 1 Cooldown}} }} round 1}} }}
 +
| {{#vardefine: attack8InitialSelectionWeight | {{#expr: {{#vardefineecho:attack8Damage| {{Q|{{#var:pawn}}|Attack 2 Damage}} }} * (1 + ({{#vardefineecho:attack8AP| {{Q|{{#var:pawn}}|Attack 2 AP}} }}/100)) * {{Q|{{#var:pawn}}|Attack 2 Chance Factor|1}} / {{#vardefineecho:attack8Cooldown | {{Q|{{#var:pawn}}|Attack 2 Cooldown}} }} round 1}} }}
 +
}}
 +
}}<!--
 +
-->{{#if: {{#var:attack9Type}} |
 +
{{#if: {{{7|}}}
 +
| {{#vardefine: attack9InitialSelectionWeight | {{#expr: {{#vardefineecho:attack9Damage| {{Q|{{{7}}}|Attack 1 Damage}} }} * (1 + ({{#vardefineecho:attack9AP| {{Q|{{{7}}}|Attack 1 AP}} }}/100)) * {{Q|{{{7}}}|Attack 1 Chance Factor|1}} / {{#vardefineecho:attack9Cooldown | {{Q|{{{7}}}|Attack 1 Cooldown}} }} round 1}} }}
 +
| {{#vardefine: attack9InitialSelectionWeight | {{#expr: {{#vardefineecho:attack9Damage| {{Q|{{#var:pawn}}|Attack 3 Damage}} }} * (1 + ({{#vardefineecho:attack9AP| {{Q|{{#var:pawn}}|Attack 3 AP}} }}/100)) * {{Q|{{#var:pawn}}|Attack 3 Chance Factor|1}} / {{#vardefineecho:attack9Cooldown | {{Q|{{#var:pawn}}|Attack 3 Cooldown}} }} round 1}} }}
 +
}}
 +
}}<!--
 +
-->{{#if: {{#var:attack10Type}} |
 +
{{#if: {{{8|}}}
 +
| {{#vardefine: attack10InitialSelectionWeight | {{#expr: {{#vardefineecho:attack10Damage| {{Q|{{{8}}}|Attack 1 Damage}} }} * (1 + ({{#vardefineecho:attack10AP| {{Q|{{{8}}}|Attack 1 AP}} }}/100)) * {{Q|{{{8}}}|Attack 1 Chance Factor|1}} / {{#vardefineecho:attack10Cooldown | {{Q|{{{8}}}|Attack 1 Cooldown}} }} round 1}} }}
 +
| {{#vardefine: attack10InitialSelectionWeight | {{#expr: {{#vardefineecho:attack10Damage| {{Q|{{#var:pawn}}|Attack 4 Damage}} }} * (1 + ({{#vardefineecho:attack10AP| {{Q|{{#var:pawn}}|Attack 4 AP}} }}/100)) * {{Q|{{#var:pawn}}|Attack 1 Chance Factor|1}} / {{#vardefineecho:attack10Cooldown | {{Q|{{#var:pawn}}|Attack 4 Cooldown}} }} round 1}} }}
 +
}}
 +
}}<!--
 +
-->{{#if: {{#var:attack11Type}} |
 +
{{#if: {{{9|}}}
 +
| {{#vardefine: attack11InitialSelectionWeight | {{#expr: {{#vardefineecho:attack11Damage| {{Q|{{{9}}}|Attack 1 Damage}} }} * (1 + ({{#vardefineecho:attack11AP| {{Q|{{{9}}}|Attack 1 AP}} }}/100)) * {{Q|{{{5}}}|Attack 1 Chance Factor|1}} / {{#vardefineecho:attack11Cooldown | {{Q|{{{9}}}|Attack 1 Cooldown}} }} round 1}} }}
 +
| {{#vardefine: attack11InitialSelectionWeight | {{#expr: {{#vardefineecho:attack11Damage| {{Q|{{#var:pawn}}|Attack 5 Damage}} }} * (1 + ({{#vardefineecho:attack11AP| {{Q|{{#var:pawn}}|Attack 5 AP}} }}/100)) * {{Q|{{#var:pawn}}|Attack 5 Chance Factor|1}} / {{#vardefineecho:attack11Cooldown | {{Q|{{#var:pawn}}|Attack 5 Cooldown}} }} round 1}} }}
 +
}}
 +
}}<!--
 +
-->{{#if: {{#var:attack12Type}} |
 +
{{#if: {{{10|}}}
 +
| {{#vardefine: attack12InitialSelectionWeight | {{#expr: {{#vardefineecho:attack12Damage| {{Q|{{{10}}}|Attack 1 Damage}} }} * (1 + ({{#vardefineecho:attack12AP| {{Q|{{{10}}}|Attack 1 AP}} }}/100)) * {{Q|{{{10}}}|Attack 1 Chance Factor|1}} / {{#vardefineecho:attack12Cooldown | {{Q|{{{10}}}|Attack 1 Cooldown}} }} round 1}} }}
 +
| {{#vardefine: attack12InitialSelectionWeight | {{#expr: {{#vardefineecho:attack12Damage| {{Q|{{{ 4}}}|Attack 6 Damage}} }} * (1 + ({{#vardefineecho:attack12AP| {{Q|{{{ 4}}}|Attack 6 AP}} }}/100)) * {{Q|{{{ 4}}}|Attack 6 Chance Factor|1}} / {{#vardefineecho:attack12Cooldown | {{Q|{{{ 4}}}|Attack 6 Cooldown}} }} round 1}} }}
 +
}}
 
}}<!--
 
}}<!--
  
Line 126: Line 202:
 
-->{{#ifexpr: {{#var:maxSelectionWeight}} < {{#var:attack5InitialSelectionWeight|0}} | {{#vardefine: maxSelectionWeight| {{#var:attack5InitialSelectionWeight}} }} }}<!--
 
-->{{#ifexpr: {{#var:maxSelectionWeight}} < {{#var:attack5InitialSelectionWeight|0}} | {{#vardefine: maxSelectionWeight| {{#var:attack5InitialSelectionWeight}} }} }}<!--
 
-->{{#ifexpr: {{#var:maxSelectionWeight}} < {{#var:attack6InitialSelectionWeight|0}} | {{#vardefine: maxSelectionWeight| {{#var:attack6InitialSelectionWeight}} }} }}<!--
 
-->{{#ifexpr: {{#var:maxSelectionWeight}} < {{#var:attack6InitialSelectionWeight|0}} | {{#vardefine: maxSelectionWeight| {{#var:attack6InitialSelectionWeight}} }} }}<!--
 +
-->{{#ifexpr: {{#var:maxSelectionWeight}} < {{#var:attack7InitialSelectionWeight|0}} | {{#vardefine: maxSelectionWeight| {{#var:attack7InitialSelectionWeight}} }} }}<!--
 +
-->{{#ifexpr: {{#var:maxSelectionWeight}} < {{#var:attack8InitialSelectionWeight|0}} | {{#vardefine: maxSelectionWeight| {{#var:attack8InitialSelectionWeight}} }} }}<!--
 +
-->{{#ifexpr: {{#var:maxSelectionWeight}} < {{#var:attack9InitialSelectionWeight|0}} | {{#vardefine: maxSelectionWeight| {{#var:attack9InitialSelectionWeight}} }} }}<!--
 +
-->{{#ifexpr: {{#var:maxSelectionWeight}} < {{#var:attack10InitialSelectionWeight|0}} | {{#vardefine: maxSelectionWeight| {{#var:attack10InitialSelectionWeight}} }} }}<!--
 +
-->{{#ifexpr: {{#var:maxSelectionWeight}} < {{#var:attack11InitialSelectionWeight|0}} | {{#vardefine: maxSelectionWeight| {{#var:attack11InitialSelectionWeight}} }} }}<!--
 +
-->{{#ifexpr: {{#var:maxSelectionWeight}} < {{#var:attack12InitialSelectionWeight|0}} | {{#vardefine: maxSelectionWeight| {{#var:attack12InitialSelectionWeight}} }} }}<!--
  
 
2.3 Categorize attacks relative to highest initial selection weight into best/mid/worst
 
2.3 Categorize attacks relative to highest initial selection weight into best/mid/worst
Line 145: Line 227:
 
-->{{#if: {{#var:attack6Type}} |
 
-->{{#if: {{#var:attack6Type}} |
 
{{#vardefine: attack6SelectionCategory | {{#ifexpr: {{#var:attack6InitialSelectionWeight}} >= 0.95*{{#var:maxSelectionWeight}} | best {{#vardefine: numBestAttacks | {{#expr: {{#var:numBestAttacks}}+1}} }} | {{#ifexpr: {{#var:attack6InitialSelectionWeight}} < 0.25*{{#var:maxSelectionWeight}} | worst | mid {{#vardefine: numMidAttacks | {{#expr: {{#var:numMidAttacks}}+1}} }} }} }} }} }}<!--
 
{{#vardefine: attack6SelectionCategory | {{#ifexpr: {{#var:attack6InitialSelectionWeight}} >= 0.95*{{#var:maxSelectionWeight}} | best {{#vardefine: numBestAttacks | {{#expr: {{#var:numBestAttacks}}+1}} }} | {{#ifexpr: {{#var:attack6InitialSelectionWeight}} < 0.25*{{#var:maxSelectionWeight}} | worst | mid {{#vardefine: numMidAttacks | {{#expr: {{#var:numMidAttacks}}+1}} }} }} }} }} }}<!--
 +
2.3.7 Pawn attacks
 +
-->{{#if: {{#var:attack7Type}} |
 +
{{#vardefine: attack7SelectionCategory | {{#ifexpr: {{#var:attack7InitialSelectionWeight}} >= 0.95*{{#var:maxSelectionWeight}} | best {{#vardefine: numBestAttacks | {{#expr: {{#var:numBestAttacks}}+1}} }} | {{#ifexpr: {{#var:attack7InitialSelectionWeight}} < 0.25*{{#var:maxSelectionWeight}} | worst | mid {{#vardefine: numMidAttacks | {{#expr: {{#var:numMidAttacks}}+1}} }} }} }} }} }}<!--
 +
-->{{#if: {{#var:attack8Type}} |
 +
{{#vardefine: attack8SelectionCategory | {{#ifexpr: {{#var:attack8InitialSelectionWeight}} >= 0.95*{{#var:maxSelectionWeight}} | best {{#vardefine: numBestAttacks | {{#expr: {{#var:numBestAttacks}}+1}} }} | {{#ifexpr: {{#var:attack8InitialSelectionWeight}} < 0.25*{{#var:maxSelectionWeight}} | worst | mid {{#vardefine: numMidAttacks | {{#expr: {{#var:numMidAttacks}}+1}} }} }} }} }} }}<!--
 +
-->{{#if: {{#var:attack9Type}} |
 +
{{#vardefine: attack9SelectionCategory | {{#ifexpr: {{#var:attack9InitialSelectionWeight}} >= 0.95*{{#var:maxSelectionWeight}} | best {{#vardefine: numBestAttacks | {{#expr: {{#var:numBestAttacks}}+1}} }} | {{#ifexpr: {{#var:attack9InitialSelectionWeight}} < 0.25*{{#var:maxSelectionWeight}} | worst | mid {{#vardefine: numMidAttacks | {{#expr: {{#var:numMidAttacks}}+1}} }} }} }} }} }}<!--
 +
-->{{#if: {{#var:attack10Type}} |
 +
{{#vardefine: attack10SelectionCategory | {{#ifexpr: {{#var:attack10InitialSelectionWeight}} >= 0.95*{{#var:maxSelectionWeight}} | best {{#vardefine: numBestAttacks | {{#expr: {{#var:numBestAttacks}}+1}} }} | {{#ifexpr: {{#var:attack10InitialSelectionWeight}} < 0.25*{{#var:maxSelectionWeight}} | worst | mid {{#vardefine: numMidAttacks | {{#expr: {{#var:numMidAttacks}}+1}} }} }} }} }} }}<!--
 +
-->{{#if: {{#var:attack11Type}} |
 +
{{#vardefine: attack11SelectionCategory | {{#ifexpr: {{#var:attack11InitialSelectionWeight}} >= 0.95*{{#var:maxSelectionWeight}} | best {{#vardefine: numBestAttacks | {{#expr: {{#var:numBestAttacks}}+1}} }} | {{#ifexpr: {{#var:attack11InitialSelectionWeight}} < 0.25*{{#var:maxSelectionWeight}} | worst | mid {{#vardefine: numMidAttacks | {{#expr: {{#var:numMidAttacks}}+1}} }} }} }} }} }}<!--
 +
-->{{#if: {{#var:attack12Type}} |
 +
{{#vardefine: attack12SelectionCategory | {{#ifexpr: {{#var:attack12InitialSelectionWeight}} >= 0.95*{{#var:maxSelectionWeight}} | best {{#vardefine: numBestAttacks | {{#expr: {{#var:numBestAttacks}}+1}} }} | {{#ifexpr: {{#var:attack12InitialSelectionWeight}} < 0.25*{{#var:maxSelectionWeight}} | worst | mid {{#vardefine: numMidAttacks | {{#expr: {{#var:numMidAttacks}}+1}} }} }} }} }} }}<!--
  
 
2.4 Calculate selection chances
 
2.4 Calculate selection chances
Line 156: Line 251:
 
-->{{#if: {{#var:attack5Type}} | {{#vardefine:attack5SelectionChance|{{#expr: {{#switch: {{#var:attack5SelectionCategory}} | best = {{#var:bestCategoryPercentage}}/{{#var:numBestAttacks}} | mid = 0.25/{{#var:numMidAttacks}} | 0 }} }} }} }}<!--
 
-->{{#if: {{#var:attack5Type}} | {{#vardefine:attack5SelectionChance|{{#expr: {{#switch: {{#var:attack5SelectionCategory}} | best = {{#var:bestCategoryPercentage}}/{{#var:numBestAttacks}} | mid = 0.25/{{#var:numMidAttacks}} | 0 }} }} }} }}<!--
 
-->{{#if: {{#var:attack6Type}} | {{#vardefine:attack6SelectionChance|{{#expr: {{#switch: {{#var:attack6SelectionCategory}} | best = {{#var:bestCategoryPercentage}}/{{#var:numBestAttacks}} | mid = 0.25/{{#var:numMidAttacks}} | 0 }} }} }} }}<!--
 
-->{{#if: {{#var:attack6Type}} | {{#vardefine:attack6SelectionChance|{{#expr: {{#switch: {{#var:attack6SelectionCategory}} | best = {{#var:bestCategoryPercentage}}/{{#var:numBestAttacks}} | mid = 0.25/{{#var:numMidAttacks}} | 0 }} }} }} }}<!--
 +
-->{{#if: {{#var:attack7Type}} | {{#vardefine:attack7SelectionChance|{{#expr: {{#switch: {{#var:attack7SelectionCategory}} | best = {{#var:bestCategoryPercentage}}/{{#var:numBestAttacks}} | mid = 0.25/{{#var:numMidAttacks}} | 0 }} }} }} }}<!--
 +
-->{{#if: {{#var:attack8Type}} | {{#vardefine:attack8SelectionChance|{{#expr: {{#switch: {{#var:attack8SelectionCategory}} | best = {{#var:bestCategoryPercentage}}/{{#var:numBestAttacks}} | mid = 0.25/{{#var:numMidAttacks}} | 0 }} }} }} }}<!--
 +
-->{{#if: {{#var:attack9Type}} | {{#vardefine:attack9SelectionChance|{{#expr: {{#switch: {{#var:attack9SelectionCategory}} | best = {{#var:bestCategoryPercentage}}/{{#var:numBestAttacks}} | mid = 0.25/{{#var:numMidAttacks}} | 0 }} }} }} }}<!--
 +
-->{{#if: {{#var:attack10Type}} | {{#vardefine:attack10SelectionChance|{{#expr: {{#switch: {{#var:attack10SelectionCategory}} | best = {{#var:bestCategoryPercentage}}/{{#var:numBestAttacks}} | mid = 0.25/{{#var:numMidAttacks}} | 0 }} }} }} }}<!--
 +
-->{{#if: {{#var:attack11Type}} | {{#vardefine:attack11SelectionChance|{{#expr: {{#switch: {{#var:attack11SelectionCategory}} | best = {{#var:bestCategoryPercentage}}/{{#var:numBestAttacks}} | mid = 0.25/{{#var:numMidAttacks}} | 0 }} }} }} }}<!--
 +
-->{{#if: {{#var:attack12Type}} | {{#vardefine:attack12SelectionChance|{{#expr: {{#switch: {{#var:attack12SelectionCategory}} | best = {{#var:bestCategoryPercentage}}/{{#var:numBestAttacks}} | mid = 0.25/{{#var:numMidAttacks}} | 0 }} }} }} }}<!--
  
 
2.5 Calculate actual DPS  
 
2.5 Calculate actual DPS  
Line 164: Line 265:
 
     {{#if: {{#var:attack4Type}} |            +{{#var:attack4Damage}}*{{#var:attack4SelectionChance}} }}
 
     {{#if: {{#var:attack4Type}} |            +{{#var:attack4Damage}}*{{#var:attack4SelectionChance}} }}
 
     {{#if: {{#var:attack5Type}} |            +{{#var:attack5Damage}}*{{#var:attack5SelectionChance}} }}
 
     {{#if: {{#var:attack5Type}} |            +{{#var:attack5Damage}}*{{#var:attack5SelectionChance}} }}
     {{#if: {{#var:attack6Type}} |            +{{#var:attack6Damage}}*{{#var:attack6SelectionChance}} }} }}
+
     {{#if: {{#var:attack6Type}} |            +{{#var:attack6Damage}}*{{#var:attack6SelectionChance}} }}
 +
    {{#if: {{#var:attack7Type}} |            +{{#var:attack7Damage}}*{{#var:attack7SelectionChance}} }}
 +
    {{#if: {{#var:attack8Type}} |            +{{#var:attack8Damage}}*{{#var:attack8SelectionChance}} }}
 +
    {{#if: {{#var:attack9Type}} |            +{{#var:attack9Damage}}*{{#var:attack9SelectionChance}} }}
 +
    {{#if: {{#var:attack10Type}} |          +{{#var:attack10Damage}}*{{#var:attack10SelectionChance}} }}
 +
    {{#if: {{#var:attack11Type}} |          +{{#var:attack11Damage}}*{{#var:attack11SelectionChance}} }}
 +
    {{#if: {{#var:attack12Type}} |          +{{#var:attack12Damage}}*{{#var:attack12SelectionChance}} }} }}
 
}}<!--
 
}}<!--
 
-->{{#vardefine:weightedTimeTotal | {{#expr: {{#var:attack1Cooldown}}*{{#var:attack1SelectionChance}}
 
-->{{#vardefine:weightedTimeTotal | {{#expr: {{#var:attack1Cooldown}}*{{#var:attack1SelectionChance}}
Line 171: Line 278:
 
     {{#if: {{#var:attack4Type}} |          +{{#var:attack4Cooldown}}*{{#var:attack4SelectionChance}} }}
 
     {{#if: {{#var:attack4Type}} |          +{{#var:attack4Cooldown}}*{{#var:attack4SelectionChance}} }}
 
     {{#if: {{#var:attack5Type}} |          +{{#var:attack5Cooldown}}*{{#var:attack5SelectionChance}} }}
 
     {{#if: {{#var:attack5Type}} |          +{{#var:attack5Cooldown}}*{{#var:attack5SelectionChance}} }}
     {{#if: {{#var:attack6Type}} |          +{{#var:attack6Cooldown}}*{{#var:attack6SelectionChance}} }} }}
+
     {{#if: {{#var:attack6Type}} |          +{{#var:attack6Cooldown}}*{{#var:attack6SelectionChance}} }}
 +
    {{#if: {{#var:attack7Type}} |          +{{#var:attack7Cooldown}}*{{#var:attack7SelectionChance}} }}
 +
    {{#if: {{#var:attack8Type}} |          +{{#var:attack8Cooldown}}*{{#var:attack8SelectionChance}} }}
 +
    {{#if: {{#var:attack9Type}} |          +{{#var:attack9Cooldown}}*{{#var:attack9SelectionChance}} }}
 +
    {{#if: {{#var:attack10Type}} |        +{{#var:attack10Cooldown}}*{{#var:attack10SelectionChance}} }}
 +
    {{#if: {{#var:attack11Type}} |        +{{#var:attack11Cooldown}}*{{#var:attack11SelectionChance}} }}
 +
    {{#if: {{#var:attack12Type}} |        +{{#var:attack12Cooldown}}*{{#var:attack12SelectionChance}} }} }}
 
}}<!--
 
}}<!--
 
-->{{#vardefine:trueDPS| {{#expr:{{#var:weightedDamageTotal}}/{{#var:weightedTimeTotal}} round 2}} }}<!--
 
-->{{#vardefine:trueDPS| {{#expr:{{#var:weightedDamageTotal}}/{{#var:weightedTimeTotal}} round 2}} }}<!--
  
 
2.6 Calculate actual average AP  
 
2.6 Calculate actual average AP  
-->{{#vardefine:trueAP | {{#expr:  {{#var:attack1AP}}*{{#var:attack1SelectionChance}}
+
-->{{#vardefine:trueAP | {{#expr:  {{#vardefineecho: attack1WeightedAP | {{#expr: {{#var:attack1AP}}*{{#var:attack1SelectionChance}} }} }}
     {{#if: {{#var:attack2Type}} | +{{#var:attack2AP}}*{{#var:attack2SelectionChance}} }}
+
     {{#if: {{#var:attack2Type}} | +{{#vardefineecho: attack2WeightedAP | {{#expr: {{#var:attack2AP}}*{{#var:attack2SelectionChance}} }} }} }}
     {{#if: {{#var:attack3Type}} | +{{#var:attack3AP}}*{{#var:attack3SelectionChance}} }}
+
     {{#if: {{#var:attack3Type}} | +{{#vardefineecho: attack3WeightedAP | {{#expr: {{#var:attack3AP}}*{{#var:attack3SelectionChance}} }} }} }}
     {{#if: {{#var:attack4Type}} | +{{#var:attack4AP}}*{{#var:attack4SelectionChance}} }}
+
     {{#if: {{#var:attack4Type}} | +{{#vardefineecho: attack4WeightedAP | {{#expr: {{#var:attack4AP}}*{{#var:attack4SelectionChance}} }} }} }}
     {{#if: {{#var:attack5Type}} | +{{#var:attack5AP}}*{{#var:attack5SelectionChance}} }}
+
     {{#if: {{#var:attack5Type}} | +{{#vardefineecho: attack5WeightedAP | {{#expr: {{#var:attack5AP}}*{{#var:attack5SelectionChance}} }} }} }}
     {{#if: {{#var:attack6Type}} | +{{#var:attack6AP}}*{{#var:attack6SelectionChance}} }} round 2}}
+
     {{#if: {{#var:attack6Type}} | +{{#vardefineecho: attack6WeightedAP | {{#expr: {{#var:attack6AP}}*{{#var:attack6SelectionChance}} }} }} }}
 +
    {{#if: {{#var:attack7Type}} | +{{#vardefineecho: attack7WeightedAP | {{#expr: {{#var:attack7AP}}*{{#var:attack7SelectionChance}} }} }} }}
 +
    {{#if: {{#var:attack8Type}} | +{{#vardefineecho: attack8WeightedAP | {{#expr: {{#var:attack8AP}}*{{#var:attack8SelectionChance}} }} }} }}
 +
    {{#if: {{#var:attack9Type}} | +{{#vardefineecho: attack9WeightedAP | {{#expr: {{#var:attack9AP}}*{{#var:attack9SelectionChance}} }} }} }}
 +
    {{#if: {{#var:attack10Type}} | +{{#vardefineecho: attack10WeightedAP | {{#expr: {{#var:attack10AP}}*{{#var:attack10SelectionChance}} }} }} }}
 +
    {{#if: {{#var:attack11Type}} | +{{#vardefineecho: attack11WeightedAP | {{#expr: {{#var:attack11AP}}*{{#var:attack11SelectionChance}} }} }} }}
 +
    {{#if: {{#var:attack12Type}} | +{{#vardefineecho: attack12WeightedAP | {{#expr: {{#var:attack12AP}}*{{#var:attack12SelectionChance}} }} }} }} round 2}}
 
}}<!--
 
}}<!--
  

Revision as of 10:03, 20 April 2023

Documentation icon Template documentation[view] [edit] [history] [purge]

Summary

Returns the true DPS of a melee weapon or animal i.e. the DPS taking into account the melee verb system introduced in Version/1.1.2610. This value often disagrees with the listed melee DPS in-game but better represents the reality in most cases.

Parameters

The template takes up to tvelve parameters. All of them are optional.

  1. A weapon or a pawn. If absent, {{PAGENAME}} will be used.
  2. If 1) is a stuffable weapon: The material the weapon is made out of. If absent, the template will assume multipliers of 1 for all stats.
  3. If 1) is a weapon with quality: The weapons quality. If absent, the template will assume multipliers of 1 for all stats.
  4. If 1) is a weapon: the pawn that wields it. If absent, the template will asume that no pawn wields the weapon.
  5. If 4) is present: The artificial body part that replaces the body part of the pawns first attack, or that provides an additional attack. Provide false if the body part is missing without replacement.
  6. If 4) is present and pawn has at least 1 attacks: The artificial body part that replaces the body part of the pawns second attack, or that provides an additional attack. Provide false if the body part is missing without replacement.
  7. If 4) is present and pawn has at least 2 attacks: The artificial body part that replaces the body part of the pawns third attack, or that provides an additional attack. Provide false if the body part is missing without replacement.
  8. If 4) is present and pawn has at least 3 attacks: The artificial body part that replaces the body part of the pawns fourth attack, or that provides an additional attack. Provide false if the body part is missing without replacement.
  9. If 4) is present and pawn has at least 4 attacks: The artificial body part that replaces the body part of the pawns fifth attack, or that provides an additional attack. Provide false if the body part is missing without replacement.
  10. If 4) is present and pawn has at least 5 attacks: The artificial body part that replaces the body part of the pawns sixth attack, or that provides an additional attack. Provide false if the body part is missing without replacement.
  11. If 4) is present and pawn has at least 6 attacks: The artificial body part that provides an additional attack.
  12. If 4) and 11) is present: The artificial body part that provides an additional attack.

In short:

{{True Melee DPS Calculator|<weapon/pawn>|<material>|<quality>|<pawn>|<artificial body part/false>|<artificial body part/false>|<artificial body part/false>|<artificial body part/false>|<artificial body part/false>|<artificial body part/false>|<artificial body part>|<artificial body part>}}

Examples

Non-stuffable weapon without quality

A persona zeushammer:

{{True Melee DPS Calculator|Persona zeushammer}}

Has a true DPS of: 13.17

Stuffable weapon with quality

A longsword, made out of plasteel with a legendary quality:

{{True Melee DPS Calculator|Longsword|plasteel|Legendary}}

Has a true DPS of: 17.68

Pawn with no weapon

A grizzly bear:

{{True Melee DPS Calculator|Grizzly bear}}

Has a true DPS of: 8.67

Pawn with a weapon

A human with a left archotech arm, no teeth and an elbow blade wielding an ikwa, made out of plasteel of masterwork quality:

{{True Melee DPS Calculator|Ikwa|Plasteel|Masterwork|Human|Archotech arm||false||Elbow blade}}

Has a true DPS of: 12.98

Calling additional variables

The template defines a lot of useful variables that can be called. Below you can see a full table of them. This also means we can retrace the calculations step by step.

This example is for a human with an archotech left arm, an elbow blade at the right arm, two knee spikes and no teeth wielding a masterwork plasteel longsword.

{{True Melee DPS Calculator|Longsword|Plasteel|Masterwork|Human|Archotech arm||false||Elbow blade|Knee spike|Knee spike}}
{| class="wikitable"
! Attack Source !! Part name (artificial body part) !! Attack Type !! Damage !! AP !! Cooldown !! Weight !! Category !! Selection chance !! weighted Damage !! weighted Cooldown !! weighted AP
|-
! rowspan="4" | {{#var:weapon|''<weapon>''}}{{#if: {{#var:material}}{{#var:quality}} | <br/>({{#var:material}} {{#var:quality}}) }}
| {{Q|{{#var:weapon}}|Attack 1 Part}} || {{#var:attack1Type}} || {{#var:attack1Damage}} || {{#var:attack1AP}} || {{#var:attack1Cooldown}} || {{#var: attack1InitialSelectionWeight}} || {{#var:attack1SelectionCategory}} || {{#var:attack1SelectionChance}}
|{{#var:attack1WeightedDamage}} || {{#var:attack1WeightedCooldown}} || {{#var:attack1WeightedAP}}
|-
| {{Q|{{#var:weapon}}|Attack 2 Part}} || {{#var:attack2Type}} || {{#var:attack2Damage}} || {{#var:attack2AP}} || {{#var:attack2Cooldown}} || {{#var: attack2InitialSelectionWeight}} || {{#var:attack2SelectionCategory}} || {{#var:attack2SelectionChance}}
| {{#var:attack2WeightedDamage}} || {{#var:attack2WeightedCooldown}} || {{#var:attack2WeightedAP}}
|-
| {{Q|{{#var:weapon}}|Attack 3 Part}} || {{#var:attack3Type}} || {{#var:attack3Damage}} || {{#var:attack3AP}} || {{#var:attack3Cooldown}} || {{#var: attack3InitialSelectionWeight}} || {{#var:attack3SelectionCategory}} || {{#var:attack3SelectionChance}}
| {{#var:attack3WeightedDamage}} || {{#var:attack3WeightedCooldown}} || {{#var:attack3WeightedAP}}
|-
| {{Q|{{#var:weapon}}|Attack 4 Part}} || {{#var:attack4Type}} || {{#var:attack4Damage}} || {{#var:attack4AP}} || {{#var:attack4Cooldown}} || {{#var: attack4InitialSelectionWeight}} || {{#var:attack4SelectionCategory}} || {{#var:attack4SelectionChance}}
| {{#var:attack4WeightedDamage}} || {{#var:attack4WeightedCooldown}} || {{#var:attack4WeightedAP}}
|-
! rowspan="8" | {{#var:pawn|''<pawn>''}}
| {{#if:{{#var:5}}|{{Q|{{#var:5}}|Attack 1 Part}} ({{#var:5}})|{{Q|{{#var:pawn}}|Attack 1 Part}} }}
| {{#var:attack5Type}} || {{#var:attack5Damage}} || {{#var:attack5AP}} || {{#var:attack5Cooldown}} || {{#var: attack5InitialSelectionWeight}} || {{#var:attack5SelectionCategory}} || {{#var:attack5SelectionChance}}
| {{#var:attack5WeightedDamage}} || {{#var:attack5WeightedCooldown}} || {{#var:attack5WeightedAP}}
|-
| {{#if:{{#var:6}}|{{Q|{{#var:6}}|Attack 1 Part}} ({{#var:6}})|{{Q|{{#var:pawn}}|Attack 2 Part}} }}
| {{#var:attack6Type}} || {{#var:attack6Damage}} || {{#var:attack6AP}} || {{#var:attack6Cooldown}} || {{#var: attack6InitialSelectionWeight}} || {{#var:attack6SelectionCategory}} || {{#var:attack6SelectionChance}}
| {{#var:attack6WeightedDamage}} || {{#var:attack6WeightedCooldown}} || {{#var:attack6WeightedAP}}
|-
| {{#if:{{#var:7}}|{{Q|{{#var:7}}|Attack 1 Part}} ({{#var:7}})|{{Q|{{#var:pawn}}|Attack 3 Part}} }}
| {{#var:attack7Type}} || {{#var:attack7Damage}} || {{#var:attack7AP}} || {{#var:attack7Cooldown}} || {{#var: attack7InitialSelectionWeight}} || {{#var:attack7SelectionCategory}} || {{#var:attack7SelectionChance}}
| {{#var:attack7WeightedDamage}} || {{#var:attack7WeightedCooldown}} || {{#var:attack7WeightedAP}}
|-
| {{#if:{{#var:8}}|{{Q|{{#var:8}}|Attack 1 Part}} ({{#var:8}})|{{Q|{{#var:pawn}}|Attack 4 Part}} }}
| {{#var:attack8Type}} || {{#var:attack8Damage}} || {{#var:attack8AP}} || {{#var:attack8Cooldown}} || {{#var: attack8InitialSelectionWeight}} || {{#var:attack8SelectionCategory}} || {{#var:attack8SelectionChance}}
| {{#var:attack8WeightedDamage}} || {{#var:attack8WeightedCooldown}} || {{#var:attack8WeightedAP}}
|-
| {{#if:{{#var:9}}|{{Q|{{#var:9}}|Attack 1 Part}} ({{#var:9}})|{{Q|{{#var:pawn}}|Attack 5 Part}} }}
| {{#var:attack9Type}} || {{#var:attack9Damage}} || {{#var:attack9AP}} || {{#var:attack9Cooldown}} || {{#var: attack9InitialSelectionWeight}} || {{#var:attack9SelectionCategory}} || {{#var:attack9SelectionChance}}
| {{#var:attack9WeightedDamage}} || {{#var:attack9WeightedCooldown}} || {{#var:attack9WeightedAP}}
|-
| {{#if:{{#var:10}}|{{Q|{{#var:10}}|Attack 1 Part}} ({{#var:10}})|{{Q|{{#var:pawn}}|Attack 6 Part}} }}
| {{#var:attack10Type}} || {{#var:attack10Damage}} || {{#var:attack10AP}} || {{#var:attack10Cooldown}} || {{#var: attack10InitialSelectionWeight}} || {{#var:attack10SelectionCategory}} || {{#var:attack10SelectionChance}}
| {{#var:attack10WeightedDamage}} || {{#var:attack10WeightedCooldown}} || {{#var:attack10WeightedAP}}
|-
| {{#if:{{#var:11}}|{{Q|{{#var:11}}|Attack 1 Part}} ({{#var:11}}) }}
| {{#var:attack11Type}} || {{#var:attack11Damage}} || {{#var:attack11AP}} || {{#var:attack11Cooldown}} || {{#var: attack11InitialSelectionWeight}} || {{#var:attack11SelectionCategory}} || {{#var:attack11SelectionChance}}
| {{#var:attack11WeightedDamage}} || {{#var:attack11WeightedCooldown}} || {{#var:attack11WeightedAP}}
|-
| {{#if:{{#var:12}}|{{Q|{{#var:12}}|Attack 1 Part}} ({{#var:12}}) }}
| {{#var:attack12Type}} || {{#var:attack12Damage}} || {{#var:attack12AP}} || {{#var:attack12Cooldown}} || {{#var: attack12InitialSelectionWeight}} || {{#var:attack12SelectionCategory}} || {{#var:attack12SelectionChance}}
| {{#var:attack12WeightedDamage}} || {{#var:attack12WeightedCooldown}} || {{#var:attack12WeightedAP}}
|-
! colspan="9" rowspan="2" | SUM:
! {{#var:weightedDamageTotal}}
! {{#var:weightedTimeTotal}}
! rowspan="2" | {{#var:trueAP}} ''(True AP)''
|-
! colspan="2" | {{#var:trueDPS}} ''(True DPS)''
|}

15.26

Attack Source Part name (artificial body part) Attack Type Damage AP Cooldown Weight Category Selection chance weighted Damage weighted Cooldown weighted AP
<weapon>
(Plasteel Masterwork)
Poke 11.745 16.965 1.6 8.6 mid 0.0625 1.0603125
Stab 36.685 54.23 2.08 27.2 best 0.375 20.33625
Cut 36.685 54.23 2.08 27.2 best 0.375 20.33625
13.15875
Human LeftHand
RightHand
HeadAttackTool Blunt 14 21 2 8.5 mid 0.0625 1.3125
Teeth Blunt 8.2 12 2 4.6 worst 0 0
Bite 8.2 12 2 4.6 worst 0 0
Cut 18 27 2 11.4 mid 0.0625 1.6875
Stab 22 38 2.6 11.7 mid 0.0625 2.375
SUM: 31.6228125 2.0725 47.11 (True AP)
15.26 (True DPS)

Warning to editors

The encouragement above to reuse variables defined by this template means that you need to be extremely careful when changing names of variables or their definitions, since it might affect other templates as well.

Namely Template:Weapon Stats Table/Melee reuses the following variables defined in this template:

* {{#var:trueAP}}
* {{#var:attack1AP}}, {{#var:attack2AP}}, {{#var:attack3AP}}, {{#var:attack4AP}}
* {{#var:attack1Cooldown}}, {{#var:attack2Cooldown}}, {{#var:attack3Cooldown}}, {{#var:attack4Cooldown}}
* {{#var:attack1Damage}}, {{#var:attack2Damage}}, {{#var:attack3Damage}}, {{#var:attack4Damage}}
* {{#var:attack1SelectionChance}}, {{#var:attack2SelectionChance}}, {{#var:attack3SelectionChance}}, {{#var:attack4SelectionChance}}