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

From RimWorld Wiki
Jump to navigation Jump to search
(simplification and making the cooldown available as a variable)
(fixed attack1Cooldown being applied twice. Simplification. Added comment about Template:Weapon Quality Table/Melee/Row reusing a lot of the variables)
Line 1: Line 1:
 
<includeonly><!--
 
<includeonly><!--
 +
 +
!!! WARNING !!!
 +
The following variables are reused by [[Template:Weapon Quality Table/Melee/Row]]. If you change them here you probably have to change them there as well:
 +
* {{#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}}
 +
 +
VARIABLES
 
-->{{#vardefine:name | {{{1|{{PAGENAME}} }}} }}<!--
 
-->{{#vardefine:name | {{{1|{{PAGENAME}} }}} }}<!--
 
-->{{#vardefine:material | {{{2|}}} }}<!--
 
-->{{#vardefine:material | {{{2|}}} }}<!--
Line 5: Line 15:
 
-->{{#vardefine:bluntFactor | {{Q|{{#var:material}}|Melee Blunt Damage Factor|1}} }}<!--
 
-->{{#vardefine:bluntFactor | {{Q|{{#var:material}}|Melee Blunt Damage Factor|1}} }}<!--
 
-->{{#vardefine:cooldownFactor | {{Q|{{#var:material}}|Melee Cooldown Factor|1}} }}<!--
 
-->{{#vardefine:cooldownFactor | {{Q|{{#var:material}}|Melee Cooldown Factor|1}} }}<!--
 +
-->{{#vardefine:attack1Type | {{Q|{{#var:name}}|Attack 1 Type}} }}<!--
 +
-->{{#vardefine:attack2Type | {{Q|{{#var:name}}|Attack 2 Type}} }}<!--
 +
-->{{#vardefine:attack3Type | {{Q|{{#var:name}}|Attack 3 Type}} }}<!--
 +
-->{{#vardefine:attack4Type | {{Q|{{#var:name}}|Attack 4 Type}} }}<!--
 +
-->{{#vardefine:attack5Type | {{Q|{{#var:name}}|Attack 5 Type}} }}<!--
 +
-->{{#vardefine:attack6Type | {{Q|{{#var:name}}|Attack 6 Type}} }}<!--
 
-->{{#vardefine:qualityFactor | {{#switch: {{lc:{{{3|}}} }}
 
-->{{#vardefine:qualityFactor | {{#switch: {{lc:{{{3|}}} }}
 
  | awful      = 0.8
 
  | awful      = 0.8
Line 16: Line 32:
 
}} }}<!--
 
}} }}<!--
 
-->{{#vardefine: attack1InitialSelectionWeight|}}{{#vardefine: attack1SelectionCategory|}}{{#vardefine: attack2InitialSelectionWeight|}}{{#vardefine: attack2SelectionCategory|}}{{#vardefine: attack3InitialSelectionWeight|}}{{#vardefine: attack3SelectionCategory|}}{{#vardefine: attack4InitialSelectionWeight|}}{{#vardefine: attack4SelectionCategory|}}{{#vardefine: attack5InitialSelectionWeight|}}{{#vardefine: attack5SelectionCategory|}}{{#vardefine: attack6InitialSelectionWeight|}}{{#vardefine: attack6SelectionCategory|}}<!--
 
-->{{#vardefine: attack1InitialSelectionWeight|}}{{#vardefine: attack1SelectionCategory|}}{{#vardefine: attack2InitialSelectionWeight|}}{{#vardefine: attack2SelectionCategory|}}{{#vardefine: attack3InitialSelectionWeight|}}{{#vardefine: attack3SelectionCategory|}}{{#vardefine: attack4InitialSelectionWeight|}}{{#vardefine: attack4SelectionCategory|}}{{#vardefine: attack5InitialSelectionWeight|}}{{#vardefine: attack5SelectionCategory|}}{{#vardefine: attack6InitialSelectionWeight|}}{{#vardefine: attack6SelectionCategory|}}<!--
 +
 +
CALCULATIONS
 
Define the damage type of the 1st attack so it knows which mat stat to use for the damage multiplier. Needs updating if new damage types added.
 
Define the damage type of the 1st attack so it knows which mat stat to use for the damage multiplier. Needs updating if new damage types added.
-->{{#switch: {{Q|{{#var: name}}|Attack 1 Type}}
+
-->{{#switch: {{#var:attack1Type}}
 
  | Arrow | ArrowHighVelocity | Bite | Bomb | BombSuper | Bullet | Cut | RangedStab | Scratch | Stab | Thump | Toxic bite | Toxic scratch =
 
  | Arrow | ArrowHighVelocity | Bite | Bomb | BombSuper | Bullet | Cut | RangedStab | Scratch | Stab | Thump | Toxic bite | Toxic scratch =
   {{#vardefine:attack1Damage | {{#expr: {{Q|{{#var: name}}|Attack 1 Damage}}*{{#var:qualityFactor}}*{{#var:sharpFactor}} }} }}
+
   {{#vardefine:attack1Damage | {{#expr: {{Q|{{#var:name}}|Attack 1 Damage}}*{{#var:qualityFactor}}*{{#var:sharpFactor}} }} }}
   {{#vardefine:attack1AP    | {{#expr: {{Q|{{#var: name}}|Attack 1 AP}}    *{{#var:qualityFactor}}*{{#var:sharpFactor}} }} }}
+
   {{#vardefine:attack1AP    | {{#expr: {{Q|{{#var:name}}|Attack 1 AP}}    *{{#var:qualityFactor}}*{{#var:sharpFactor}} }} }}
 
  | Blunt | Crush | Demolish | Poke =
 
  | Blunt | Crush | Demolish | Poke =
   {{#vardefine:attack1Damage | {{#expr: {{Q|{{#var: name}}|Attack 1 Damage}}*{{#var:qualityFactor}}*{{#var:bluntFactor}} }} }}
+
   {{#vardefine:attack1Damage | {{#expr: {{Q|{{#var:name}}|Attack 1 Damage}}*{{#var:qualityFactor}}*{{#var:bluntFactor}} }} }}
   {{#vardefine:attack1AP    | {{#expr: {{Q|{{#var: name}}|Attack 1 AP}}    *{{#var:qualityFactor}}*{{#var:bluntFactor}} }} }}
+
   {{#vardefine:attack1AP    | {{#expr: {{Q|{{#var:name}}|Attack 1 AP}}    *{{#var:qualityFactor}}*{{#var:bluntFactor}} }} }}
  | #default = {{Error|Unrecognised Damage Type: {{Q|{{#var: name}}|Attack 1 Type}} }}
+
  | #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 | ({{Q|{{#var:name}}|Attack 1 Cooldown}}*{{#var:cooldownFactor}}) }} round 1}} }}<!--
 
Define the damage type of the 2nd attack so it knows which mat stat to use for the damage multiplier. Needs updating if new damage types added.
 
Define the damage type of the 2nd attack so it knows which mat stat to use for the damage multiplier. Needs updating if new damage types added.
-->{{#if: {{Q|{{#var: name}}|Attack 2 Type}}|
+
-->{{#if: {{#var:attack2Type}} |
{{#switch: {{Q|{{#var: name}}|Attack 2 Type}}
+
{{#switch: {{#var:attack2Type}}
 
  | Arrow | ArrowHighVelocity | Bite | Bomb | BombSuper | Bullet | Cut | RangedStab | Scratch | Stab | Thump | Toxic bite | Toxic scratch =
 
  | Arrow | ArrowHighVelocity | Bite | Bomb | BombSuper | Bullet | Cut | RangedStab | Scratch | Stab | Thump | Toxic bite | Toxic scratch =
   {{#vardefine:attack2Damage| {{#expr: {{Q|{{#var: name}}|Attack 2 Damage}}*{{#var:qualityFactor}}*{{#var:sharpFactor}} }} }}
+
   {{#vardefine:attack2Damage| {{#expr: {{Q|{{#var:name}}|Attack 2 Damage}}*{{#var:qualityFactor}}*{{#var:sharpFactor}} }} }}
   {{#vardefine:attack2AP    | {{#expr: {{Q|{{#var: name}}|Attack 2 AP}}    *{{#var:qualityFactor}}*{{#var:sharpFactor}} }} }}
+
   {{#vardefine:attack2AP    | {{#expr: {{Q|{{#var:name}}|Attack 2 AP}}    *{{#var:qualityFactor}}*{{#var:sharpFactor}} }} }}
 
  | Blunt | Crush | Demolish | Poke =
 
  | Blunt | Crush | Demolish | Poke =
   {{#vardefine:attack2Damage| {{#expr: {{Q|{{#var: name}}|Attack 2 Damage}}*{{#var:qualityFactor}}*{{#var:bluntFactor}} }} }}
+
   {{#vardefine:attack2Damage| {{#expr: {{Q|{{#var:name}}|Attack 2 Damage}}*{{#var:qualityFactor}}*{{#var:bluntFactor}} }} }}
   {{#vardefine:attack2AP    | {{#expr: {{Q|{{#var: name}}|Attack 2 AP}}    *{{#var:qualityFactor}}*{{#var:bluntFactor}} }} }}
+
   {{#vardefine:attack2AP    | {{#expr: {{Q|{{#var:name}}|Attack 2 AP}}    *{{#var:qualityFactor}}*{{#var:bluntFactor}} }} }}
  | #default = {{Error|Unrecognised Damage Type: {{Q|{{#var: name}}|Attack 2 Type}} }}
+
  | #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 | ({{Q|{{#var:name}}|Attack 2 Cooldown}}*{{#var:cooldownFactor}}) }} round 1}} }}
 
}}<!--
 
}}<!--
 
Define the damage type of the 3rd attack so it knows which mat stat to use for the damage multiplier. Needs updating if new damage types added.
 
Define the damage type of the 3rd attack so it knows which mat stat to use for the damage multiplier. Needs updating if new damage types added.
-->{{#if: {{Q|{{#var: name}}|Attack 3 Type}}|
+
-->{{#if: {{#var:attack3Type}} |
{{#switch: {{Q|{{#var: name}}|Attack 3 Type}}
+
{{#switch: {{#var:attack3Type}}
 
  | Arrow | ArrowHighVelocity | Bite | Bomb | BombSuper | Bullet | Cut | RangedStab | Scratch | Stab | Thump | Toxic bite | Toxic scratch =
 
  | Arrow | ArrowHighVelocity | Bite | Bomb | BombSuper | Bullet | Cut | RangedStab | Scratch | Stab | Thump | Toxic bite | Toxic scratch =
   {{#vardefine:attack3Damage| {{#expr: {{Q|{{#var: name}}|Attack 3 Damage}}*{{#var:qualityFactor}}*{{#var:sharpFactor}} }} }}
+
   {{#vardefine:attack3Damage| {{#expr: {{Q|{{#var:name}}|Attack 3 Damage}}*{{#var:qualityFactor}}*{{#var:sharpFactor}} }} }}
   {{#vardefine:attack3AP    | {{#expr: {{Q|{{#var: name}}|Attack 3 AP}}    *{{#var:qualityFactor}}*{{#var:sharpFactor}} }} }}
+
   {{#vardefine:attack3AP    | {{#expr: {{Q|{{#var:name}}|Attack 3 AP}}    *{{#var:qualityFactor}}*{{#var:sharpFactor}} }} }}
 
  | Blunt | Crush | Demolish | Poke =
 
  | Blunt | Crush | Demolish | Poke =
   {{#vardefine:attack3Damage| {{#expr: {{Q|{{#var: name}}|Attack 3 Damage}}*{{#var:qualityFactor}}*{{#var:bluntFactor}} }} }}
+
   {{#vardefine:attack3Damage| {{#expr: {{Q|{{#var:name}}|Attack 3 Damage}}*{{#var:qualityFactor}}*{{#var:bluntFactor}} }} }}
   {{#vardefine:attack3AP    | {{#expr: {{Q|{{#var: name}}|Attack 3 AP}}    *{{#var:qualityFactor}}*{{#var:bluntFactor}} }} }}
+
   {{#vardefine:attack3AP    | {{#expr: {{Q|{{#var:name}}|Attack 3 AP}}    *{{#var:qualityFactor}}*{{#var:bluntFactor}} }} }}
  | #default = {{Error|Unrecognised Damage Type: {{Q|{{#var: name}}|Attack 3 Type}} }}
+
  | #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 | ({{Q|{{#var:name}}|Attack 3 Cooldown}}*{{#var:cooldownFactor}}) }} round 1}} }}
 
}}<!--
 
}}<!--
 
Define the damage type of the 4th attack so it knows which mat stat to use for the damage multiplier. Needs updating if new damage types added.
 
Define the damage type of the 4th attack so it knows which mat stat to use for the damage multiplier. Needs updating if new damage types added.
-->{{#if: {{Q|{{#var: name}}|Attack 4 Type}}|
+
-->{{#if: {{#var:attack4Type}} |
{{#switch: {{Q|{{#var: name}}|Attack 4 Type}}
+
{{#switch: {{#var:attack4Type}}
 
  | Arrow | ArrowHighVelocity | Bite | Bomb | BombSuper | Bullet | Cut | RangedStab | Scratch | Stab | Thump | Toxic bite | Toxic scratch =
 
  | Arrow | ArrowHighVelocity | Bite | Bomb | BombSuper | Bullet | Cut | RangedStab | Scratch | Stab | Thump | Toxic bite | Toxic scratch =
   {{#vardefine:attack4Damage| {{#expr: {{Q|{{#var: name}}|Attack 4 Damage}}*{{#var:qualityFactor}}*{{#var:sharpFactor}} }} }}
+
   {{#vardefine:attack4Damage| {{#expr: {{Q|{{#var:name}}|Attack 4 Damage}}*{{#var:qualityFactor}}*{{#var:sharpFactor}} }} }}
   {{#vardefine:attack4AP    | {{#expr: {{Q|{{#var: name}}|Attack 4 AP}}    *{{#var:qualityFactor}}*{{#var:sharpFactor}} }} }}
+
   {{#vardefine:attack4AP    | {{#expr: {{Q|{{#var:name}}|Attack 4 AP}}    *{{#var:qualityFactor}}*{{#var:sharpFactor}} }} }}
 
  | Blunt | Crush | Demolish | Poke =
 
  | Blunt | Crush | Demolish | Poke =
   {{#vardefine:attack4Damage| {{#expr: {{Q|{{#var: name}}|Attack 4 Damage}}*{{#var:qualityFactor}}*{{#var:bluntFactor}} }} }}
+
   {{#vardefine:attack4Damage| {{#expr: {{Q|{{#var:name}}|Attack 4 Damage}}*{{#var:qualityFactor}}*{{#var:bluntFactor}} }} }}
   {{#vardefine:attack4AP    | {{#expr: {{Q|{{#var: name}}|Attack 4 AP}}    *{{#var:qualityFactor}}*{{#var:bluntFactor}} }} }}
+
   {{#vardefine:attack4AP    | {{#expr: {{Q|{{#var:name}}|Attack 4 AP}}    *{{#var:qualityFactor}}*{{#var:bluntFactor}} }} }}
  | #default = {{Error|Unrecognised Damage Type: {{Q|{{#var: name}}|Attack 4 Type}} }}
+
  | #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 | ({{Q|{{#var:name}}|Attack 4 Cooldown}}*{{#var:cooldownFactor}}) }} round 1}} }}
 
}}<!--
 
}}<!--
 
Define the damage type of the 5th attack so it knows which mat stat to use for the damage multiplier. Needs updating if new damage types added.
 
Define the damage type of the 5th attack so it knows which mat stat to use for the damage multiplier. Needs updating if new damage types added.
-->{{#if: {{Q|{{#var: name}}|Attack 5 Type}}|
+
-->{{#if: {{#var:attack5Type}} |
{{#switch: {{Q|{{#var: name}}|Attack 5 Type}}
+
{{#switch: {{#var:attack5Type}}
 
  | Arrow | ArrowHighVelocity | Bite | Bomb | BombSuper | Bullet | Cut | RangedStab | Scratch | Stab | Thump | Toxic bite | Toxic scratch =
 
  | Arrow | ArrowHighVelocity | Bite | Bomb | BombSuper | Bullet | Cut | RangedStab | Scratch | Stab | Thump | Toxic bite | Toxic scratch =
   {{#vardefine:attack5Damage| {{#expr: {{Q|{{#var: name}}|Attack 5 Damage}}*{{#var:qualityFactor}}*{{#var:sharpFactor}} }} }}
+
   {{#vardefine:attack5Damage| {{#expr: {{Q|{{#var:name}}|Attack 5 Damage}}*{{#var:qualityFactor}}*{{#var:sharpFactor}} }} }}
   {{#vardefine:attack5AP    | {{#expr: {{Q|{{#var: name}}|Attack 5 AP}}    *{{#var:qualityFactor}}*{{#var:sharpFactor}} }} }}
+
   {{#vardefine:attack5AP    | {{#expr: {{Q|{{#var:name}}|Attack 5 AP}}    *{{#var:qualityFactor}}*{{#var:sharpFactor}} }} }}
 
  | Blunt | Crush | Demolish | Poke =
 
  | Blunt | Crush | Demolish | Poke =
   {{#vardefine:attack5Damage| {{#expr: {{Q|{{#var: name}}|Attack 5 Damage}}*{{#var:qualityFactor}}*{{#var:bluntFactor}} }} }}
+
   {{#vardefine:attack5Damage| {{#expr: {{Q|{{#var:name}}|Attack 5 Damage}}*{{#var:qualityFactor}}*{{#var:bluntFactor}} }} }}
   {{#vardefine:attack5AP    | {{#expr: {{Q|{{#var: name}}|Attack 5 AP}}    *{{#var:qualityFactor}}*{{#var:bluntFactor}} }} }}
+
   {{#vardefine:attack5AP    | {{#expr: {{Q|{{#var:name}}|Attack 5 AP}}    *{{#var:qualityFactor}}*{{#var:bluntFactor}} }} }}
  | #default = {{Error|Unrecognised Damage Type: {{Q|{{#var: name}}|Attack 5 Type}} }}
+
  | #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 | ({{Q|{{#var:name}}|Attack 5 Cooldown}}*{{#var:cooldownFactor}}) }} round 1}} }}
 
}}<!--
 
}}<!--
 
Define the damage type of the 6th attack so it knows which mat stat to use for the damage multiplier. Needs updating if new damage types added.
 
Define the damage type of the 6th attack so it knows which mat stat to use for the damage multiplier. Needs updating if new damage types added.
-->{{#if: {{Q|{{#var: name}}|Attack 6 Type}}|
+
-->{{#if: {{#var:attack6Type}} |
{{#switch: {{Q|{{#var: name}}|Attack 6 Type}}
+
{{#switch: {{#var:attack6Type}}
 
  | Arrow | ArrowHighVelocity | Bite | Bomb | BombSuper | Bullet | Cut | RangedStab | Scratch | Stab | Thump | Toxic bite | Toxic scratch =
 
  | Arrow | ArrowHighVelocity | Bite | Bomb | BombSuper | Bullet | Cut | RangedStab | Scratch | Stab | Thump | Toxic bite | Toxic scratch =
   {{#vardefine:attack6Damage| {{#expr: {{Q|{{#var: name}}|Attack 6 Damage}}*{{#var:qualityFactor}}*{{#var:sharpFactor}} }} }}
+
   {{#vardefine:attack6Damage| {{#expr: {{Q|{{#var:name}}|Attack 6 Damage}}*{{#var:qualityFactor}}*{{#var:sharpFactor}} }} }}
   {{#vardefine:attack6AP    | {{#expr: {{Q|{{#var: name}}|Attack 6 AP}}    *{{#var:qualityFactor}}*{{#var:sharpFactor}} }} }}
+
   {{#vardefine:attack6AP    | {{#expr: {{Q|{{#var:name}}|Attack 6 AP}}    *{{#var:qualityFactor}}*{{#var:sharpFactor}} }} }}
 
  | Blunt | Crush | Demolish | Poke =
 
  | Blunt | Crush | Demolish | Poke =
   {{#vardefine:attack6Damage| {{#expr: {{Q|{{#var: name}}|Attack 6 Damage}}*{{#var:qualityFactor}}*{{#var:bluntFactor}} }} }}
+
   {{#vardefine:attack6Damage| {{#expr: {{Q|{{#var:name}}|Attack 6 Damage}}*{{#var:qualityFactor}}*{{#var:bluntFactor}} }} }}
   {{#vardefine:attack6AP    | {{#expr: {{Q|{{#var: name}}|Attack 6 AP}}    *{{#var:qualityFactor}}*{{#var:bluntFactor}} }} }}
+
   {{#vardefine:attack6AP    | {{#expr: {{Q|{{#var:name}}|Attack 6 AP}}    *{{#var:qualityFactor}}*{{#var:bluntFactor}} }} }}
  | #default = {{Error|Unrecognised Damage Type: {{Q|{{#var: name}}|Attack 6 Type}} }}
+
  | #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 | ({{Q|{{#var:name}}|Attack 6 Cooldown}}*{{#var:cooldownFactor}}) }} round 1}} }}
 
}}<!--
 
}}<!--
 
Determine which attack has the highest weight to use as point of comparison for categorisation
 
Determine which attack has the highest weight to use as point of comparison for categorisation
-->{{#vardefine: maxSelectionWeight | {{#ifexpr: {{#var: attack1InitialSelectionWeight}} > {{#var: attack2InitialSelectionWeight|0}} | {{#var: attack1InitialSelectionWeight}} | {{#var: attack2InitialSelectionWeight}} }} }}<!--
+
-->{{#vardefine: maxSelectionWeight | {{#ifexpr: {{#var:attack1InitialSelectionWeight}} > {{#var:attack2InitialSelectionWeight|0}} | {{#var:attack1InitialSelectionWeight}} | {{#var:attack2InitialSelectionWeight}} }} }}<!--
-->{{#ifexpr: {{#var: maxSelectionWeight}} < {{#var: attack3InitialSelectionWeight|0}} | {{#vardefine: maxSelectionWeight| {{#var: attack3InitialSelectionWeight}} }} }}<!--
+
-->{{#ifexpr: {{#var:maxSelectionWeight}} < {{#var:attack3InitialSelectionWeight|0}} | {{#vardefine: maxSelectionWeight| {{#var:attack3InitialSelectionWeight}} }} }}<!--
-->{{#ifexpr: {{#var: maxSelectionWeight}} < {{#var: attack4InitialSelectionWeight|0}} | {{#vardefine: maxSelectionWeight| {{#var: attack4InitialSelectionWeight}} }} }}<!--
+
-->{{#ifexpr: {{#var:maxSelectionWeight}} < {{#var:attack4InitialSelectionWeight|0}} | {{#vardefine: maxSelectionWeight| {{#var:attack4InitialSelectionWeight}} }} }}<!--
-->{{#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}} }} }}<!--
 
Initialize vars for counting category sizes
 
Initialize vars for counting category sizes
 
-->{{#vardefine: numBestAttacks | 0}}{{#vardefine: numMidAttacks | 0}}<!--
 
-->{{#vardefine: numBestAttacks | 0}}{{#vardefine: numMidAttacks | 0}}<!--
 
Categorize attack 1 relative to max
 
Categorize attack 1 relative to max
-->{{#ifexpr: {{#var: attack1InitialSelectionWeight}} > (0.95*{{#var: maxSelectionWeight}}) or {{#var: attack1InitialSelectionWeight}} = (0.95*{{#var: maxSelectionWeight}}) | {{#vardefine: numBestAttacks | {{#expr: {{#var: numBestAttacks}}+1}}}} {{#vardefine: attack1SelectionCategory | best }}|  
+
-->{{#ifexpr: {{#var:attack1InitialSelectionWeight}} > (0.95*{{#var:maxSelectionWeight}}) or {{#var:attack1InitialSelectionWeight}} = (0.95*{{#var:maxSelectionWeight}}) | {{#vardefine: numBestAttacks | {{#expr: {{#var:numBestAttacks}}+1}}}} {{#vardefine: attack1SelectionCategory | best }}|  
{{#ifexpr: {{#var: attack1InitialSelectionWeight}} < (0.25*{{#var: maxSelectionWeight}}) | {{#vardefine: attack1SelectionCategory |worst}} | {{#vardefine: numMidAttacks | {{#expr: {{#var: numMidAttacks}}+1}}}} {{#vardefine: attack1SelectionCategory | mid }}}} }}<!--
+
{{#ifexpr: {{#var:attack1InitialSelectionWeight}} < (0.25*{{#var:maxSelectionWeight}}) | {{#vardefine: attack1SelectionCategory |worst}} | {{#vardefine: numMidAttacks | {{#expr: {{#var:numMidAttacks}}+1}}}} {{#vardefine: attack1SelectionCategory | mid }}}} }}<!--
 
Categorize attack 2 relative to max
 
Categorize attack 2 relative to max
-->{{#if: {{Q|{{#var: name}}|Attack 2 Type}}|
+
-->{{#if: {{#var:attack2Type}} |
{{#ifexpr: {{#var: attack2InitialSelectionWeight}} > (0.95*{{#var: maxSelectionWeight}}) or {{#var: attack2InitialSelectionWeight}} = (0.95*{{#var: maxSelectionWeight}}) | {{#vardefine: numBestAttacks | {{#expr: {{#var: numBestAttacks}}+1}}}} {{#vardefine: attack2SelectionCategory | best }}|  
+
{{#ifexpr: {{#var:attack2InitialSelectionWeight}} > (0.95*{{#var:maxSelectionWeight}}) or {{#var:attack2InitialSelectionWeight}} = (0.95*{{#var:maxSelectionWeight}}) | {{#vardefine: numBestAttacks | {{#expr: {{#var:numBestAttacks}}+1}}}} {{#vardefine: attack2SelectionCategory | best }}|  
{{#ifexpr: {{#var: attack2InitialSelectionWeight}} < (0.25*{{#var: maxSelectionWeight}}) | {{#vardefine: attack2SelectionCategory |worst}} | {{#vardefine: numMidAttacks | {{#expr: {{#var: numMidAttacks}}+1}}}} {{#vardefine: attack2SelectionCategory | mid }}}} }} }}<!--
+
{{#ifexpr: {{#var:attack2InitialSelectionWeight}} < (0.25*{{#var:maxSelectionWeight}}) | {{#vardefine: attack2SelectionCategory |worst}} | {{#vardefine: numMidAttacks | {{#expr: {{#var:numMidAttacks}}+1}}}} {{#vardefine: attack2SelectionCategory | mid }}}} }} }}<!--
 
Categorize attack 3 relative to max
 
Categorize attack 3 relative to max
-->{{#if: {{Q|{{#var: name}}|Attack 3 Type}}|
+
-->{{#if: {{#var:attack3Type}} |
{{#ifexpr: {{#var: attack3InitialSelectionWeight}} > (0.95*{{#var: maxSelectionWeight}}) or {{#var: attack3InitialSelectionWeight}} = (0.95*{{#var: maxSelectionWeight}}) | {{#vardefine: numBestAttacks | {{#expr: {{#var: numBestAttacks}}+1}}}} {{#vardefine: attack3SelectionCategory | best }}|  
+
{{#ifexpr: {{#var:attack3InitialSelectionWeight}} > (0.95*{{#var:maxSelectionWeight}}) or {{#var:attack3InitialSelectionWeight}} = (0.95*{{#var:maxSelectionWeight}}) | {{#vardefine: numBestAttacks | {{#expr: {{#var:numBestAttacks}}+1}}}} {{#vardefine: attack3SelectionCategory | best }}|  
{{#ifexpr: {{#var: attack3InitialSelectionWeight}} < (0.25*{{#var: maxSelectionWeight}}) | {{#vardefine: attack3SelectionCategory |worst}} | {{#vardefine: numMidAttacks | {{#expr: {{#var: numMidAttacks}}+1}}}} {{#vardefine: attack3SelectionCategory | mid }}}} }} }}<!--
+
{{#ifexpr: {{#var:attack3InitialSelectionWeight}} < (0.25*{{#var:maxSelectionWeight}}) | {{#vardefine: attack3SelectionCategory |worst}} | {{#vardefine: numMidAttacks | {{#expr: {{#var:numMidAttacks}}+1}}}} {{#vardefine: attack3SelectionCategory | mid }}}} }} }}<!--
 
Categorize attack 4 relative to max
 
Categorize attack 4 relative to max
-->{{#if: {{Q|{{#var: name}}|Attack 4 Type}}|
+
-->{{#if: {{#var:attack4Type}} |
{{#ifexpr: {{#var: attack4InitialSelectionWeight}} > (0.95*{{#var: maxSelectionWeight}}) or {{#var: attack4InitialSelectionWeight}} = (0.95*{{#var: maxSelectionWeight}}) | {{#vardefine: numBestAttacks | {{#expr: {{#var: numBestAttacks}}+1}}}} {{#vardefine: attack4SelectionCategory | best }}|  
+
{{#ifexpr: {{#var:attack4InitialSelectionWeight}} > (0.95*{{#var:maxSelectionWeight}}) or {{#var:attack4InitialSelectionWeight}} = (0.95*{{#var:maxSelectionWeight}}) | {{#vardefine: numBestAttacks | {{#expr: {{#var:numBestAttacks}}+1}}}} {{#vardefine: attack4SelectionCategory | best }}|  
{{#ifexpr: {{#var: attack4InitialSelectionWeight}} < (0.25*{{#var: maxSelectionWeight}}) | {{#vardefine: attack4SelectionCategory |worst}} | {{#vardefine: numMidAttacks | {{#expr: {{#var: numMidAttacks}}+1}}}} {{#vardefine: attack4SelectionCategory | mid }}}} }} }}<!--
+
{{#ifexpr: {{#var:attack4InitialSelectionWeight}} < (0.25*{{#var:maxSelectionWeight}}) | {{#vardefine: attack4SelectionCategory |worst}} | {{#vardefine: numMidAttacks | {{#expr: {{#var:numMidAttacks}}+1}}}} {{#vardefine: attack4SelectionCategory | mid }}}} }} }}<!--
 
Categorize attack 5 relative to max
 
Categorize attack 5 relative to max
-->{{#if: {{Q|{{#var: name}}|Attack 5 Type}}|
+
-->{{#if: {{#var:attack5Type}} |
{{#ifexpr: {{#var: attack5InitialSelectionWeight}} > (0.95*{{#var: maxSelectionWeight}}) or {{#var: attack5InitialSelectionWeight}} = (0.95*{{#var: maxSelectionWeight}}) | {{#vardefine: numBestAttacks | {{#expr: {{#var: numBestAttacks}}+1}}}} {{#vardefine: attack5SelectionCategory | best }}|  
+
{{#ifexpr: {{#var:attack5InitialSelectionWeight}} > (0.95*{{#var:maxSelectionWeight}}) or {{#var:attack5InitialSelectionWeight}} = (0.95*{{#var:maxSelectionWeight}}) | {{#vardefine: numBestAttacks | {{#expr: {{#var:numBestAttacks}}+1}}}} {{#vardefine: attack5SelectionCategory | best }}|  
{{#ifexpr: {{#var: attack5InitialSelectionWeight}} < (0.25*{{#var: maxSelectionWeight}}) | {{#vardefine: attack5SelectionCategory |worst}} | {{#vardefine: numMidAttacks | {{#expr: {{#var: numMidAttacks}}+1}}}} {{#vardefine: attack5SelectionCategory | mid }}}} }} }}<!--
+
{{#ifexpr: {{#var:attack5InitialSelectionWeight}} < (0.25*{{#var:maxSelectionWeight}}) | {{#vardefine: attack5SelectionCategory |worst}} | {{#vardefine: numMidAttacks | {{#expr: {{#var:numMidAttacks}}+1}}}} {{#vardefine: attack5SelectionCategory | mid }}}} }} }}<!--
 
Categorize attack 6 relative to max
 
Categorize attack 6 relative to max
-->{{#if: {{Q|{{#var: name}}|Attack 6 Type}}|
+
-->{{#if: {{#var:attack6Type}} |
{{#ifexpr: {{#var: attack6InitialSelectionWeight}} > (0.95*{{#var: maxSelectionWeight}}) or {{#var: attack6InitialSelectionWeight}} = (0.95*{{#var: maxSelectionWeight}}) | {{#vardefine: numBestAttacks | {{#expr: {{#var: numBestAttacks}}+1}}}} {{#vardefine: attack6SelectionCategory | best }}|  
+
{{#ifexpr: {{#var:attack6InitialSelectionWeight}} > (0.95*{{#var:maxSelectionWeight}}) or {{#var:attack6InitialSelectionWeight}} = (0.95*{{#var:maxSelectionWeight}}) | {{#vardefine: numBestAttacks | {{#expr: {{#var:numBestAttacks}}+1}}}} {{#vardefine: attack6SelectionCategory | best }}|  
{{#ifexpr: {{#var: attack6InitialSelectionWeight}} < (0.25*{{#var: maxSelectionWeight}}) | {{#vardefine: attack6SelectionCategory |worst}} | {{#vardefine: numMidAttacks | {{#expr: {{#var: numMidAttacks}}+1}}}} {{#vardefine: attack6SelectionCategory | mid }}}} }} }}<!--
+
{{#ifexpr: {{#var:attack6InitialSelectionWeight}} < (0.25*{{#var:maxSelectionWeight}}) | {{#vardefine: attack6SelectionCategory |worst}} | {{#vardefine: numMidAttacks | {{#expr: {{#var:numMidAttacks}}+1}}}} {{#vardefine: attack6SelectionCategory | mid }}}} }} }}<!--
 
Sometimes there is no mid category, in which case it controls 100% of the selection chance, instead of only 75%
 
Sometimes there is no mid category, in which case it controls 100% of the selection chance, instead of only 75%
-->{{#ifeq: {{#var: numMidAttacks}} | 0 | {{#vardefine:bestCategoryPercentage|1.00}} | {{#vardefine:bestCategoryPercentage|0.75}}}}<!--
+
-->{{#ifeq: {{#var:numMidAttacks}} | 0 | {{#vardefine:bestCategoryPercentage|1.00}} | {{#vardefine:bestCategoryPercentage|0.75}}}}<!--
 
Define selection chances from category and number of attacks in category so we don't have to calc them twice and so they can be called.
 
Define selection chances from category and number of attacks in category so we don't have to calc them twice and so they can be called.
-->{{#vardefine:attack1SelectionChance|{{#expr: {{#ifeq: {{#var:attack1SelectionCategory}} | best | ({{#var:bestCategoryPercentage}}/{{#var: numBestAttacks}}) | {{#ifeq: {{#var:attack1SelectionCategory}} | mid | (0.25/{{#var: numMidAttacks}}) | 0}} }} }} }}<!--
+
-->{{#vardefine:attack1SelectionChance|{{#expr: {{#ifeq: {{#var:attack1SelectionCategory}} | best | ({{#var:bestCategoryPercentage}}/{{#var:numBestAttacks}}) | {{#ifeq: {{#var:attack1SelectionCategory}} | mid | (0.25/{{#var:numMidAttacks}}) | 0}} }} }} }}<!--
-->{{#vardefine:attack2SelectionChance|{{#expr: {{#ifeq: {{#var:attack2SelectionCategory}} | best | ({{#var:bestCategoryPercentage}}/{{#var: numBestAttacks}}) | {{#ifeq: {{#var:attack2SelectionCategory}} | mid | (0.25/{{#var: numMidAttacks}}) | 0}} }} }} }}<!--
+
-->{{#vardefine:attack2SelectionChance|{{#expr: {{#ifeq: {{#var:attack2SelectionCategory}} | best | ({{#var:bestCategoryPercentage}}/{{#var:numBestAttacks}}) | {{#ifeq: {{#var:attack2SelectionCategory}} | mid | (0.25/{{#var:numMidAttacks}}) | 0}} }} }} }}<!--
-->{{#vardefine:attack3SelectionChance|{{#expr: {{#ifeq: {{#var:attack3SelectionCategory}} | best | ({{#var:bestCategoryPercentage}}/{{#var: numBestAttacks}}) | {{#ifeq: {{#var:attack3SelectionCategory}} | mid | (0.25/{{#var: numMidAttacks}}) | 0}} }} }} }}<!--
+
-->{{#vardefine:attack3SelectionChance|{{#expr: {{#ifeq: {{#var:attack3SelectionCategory}} | best | ({{#var:bestCategoryPercentage}}/{{#var:numBestAttacks}}) | {{#ifeq: {{#var:attack3SelectionCategory}} | mid | (0.25/{{#var:numMidAttacks}}) | 0}} }} }} }}<!--
-->{{#vardefine:attack4SelectionChance|{{#expr: {{#ifeq: {{#var:attack4SelectionCategory}} | best | ({{#var:bestCategoryPercentage}}/{{#var: numBestAttacks}}) | {{#ifeq: {{#var:attack4SelectionCategory}} | mid | (0.25/{{#var: numMidAttacks}}) | 0}} }} }} }}<!--
+
-->{{#vardefine:attack4SelectionChance|{{#expr: {{#ifeq: {{#var:attack4SelectionCategory}} | best | ({{#var:bestCategoryPercentage}}/{{#var:numBestAttacks}}) | {{#ifeq: {{#var:attack4SelectionCategory}} | mid | (0.25/{{#var:numMidAttacks}}) | 0}} }} }} }}<!--
-->{{#vardefine:attack5SelectionChance|{{#expr: {{#ifeq: {{#var:attack5SelectionCategory}} | best | ({{#var:bestCategoryPercentage}}/{{#var: numBestAttacks}}) | {{#ifeq: {{#var:attack5SelectionCategory}} | mid | (0.25/{{#var: numMidAttacks}}) | 0}} }} }} }}<!--
+
-->{{#vardefine:attack5SelectionChance|{{#expr: {{#ifeq: {{#var:attack5SelectionCategory}} | best | ({{#var:bestCategoryPercentage}}/{{#var:numBestAttacks}}) | {{#ifeq: {{#var:attack5SelectionCategory}} | mid | (0.25/{{#var:numMidAttacks}}) | 0}} }} }} }}<!--
-->{{#vardefine:attack6SelectionChance|{{#expr: {{#ifeq: {{#var:attack6SelectionCategory}} | best | ({{#var:bestCategoryPercentage}}/{{#var: numBestAttacks}}) | {{#ifeq: {{#var:attack6SelectionCategory}} | mid | (0.25/{{#var: numMidAttacks}}) | 0}} }} }} }}<!--
+
-->{{#vardefine:attack6SelectionChance|{{#expr: {{#ifeq: {{#var:attack6SelectionCategory}} | best | ({{#var:bestCategoryPercentage}}/{{#var:numBestAttacks}}) | {{#ifeq: {{#var:attack6SelectionCategory}} | mid | (0.25/{{#var:numMidAttacks}}) | 0}} }} }} }}<!--
 
Calculate actual DPS  
 
Calculate actual DPS  
  
Line 138: Line 156:
  
  
-->{{#vardefine:weightedDamageTotal| {{#expr: {{#var:attack1Damage}} * {{#var:attack1SelectionChance}} }}}}{{#vardefine:weightedTimeTotal|{{#expr: {{Q|{{#var: name}}|Attack 1 Cooldown}}*{{#var:attack1Cooldown}} * {{#var:attack1SelectionChance}}}}}}<!--
+
-->{{#vardefine:weightedDamageTotal| {{#expr: {{#var:attack1Damage}} * {{#var:attack1SelectionChance}} }}}}{{#vardefine:weightedTimeTotal|{{#expr: {{#var:attack1Cooldown}} * {{#var:attack1SelectionChance}}}}}}<!--
  
-->{{#if: {{Q|{{#var: name}}|Attack 2 Type}}| {{#vardefine:weightedDamageTotal| {{#expr: {{#var:weightedDamageTotal}} + ({{#var:attack2Damage}} * {{#var:attack2SelectionChance}}) }}}}{{#vardefine:weightedTimeTotal|{{#expr: {{#var:weightedTimeTotal}}+({{#var:attack2Cooldown}} * {{#var:attack2SelectionChance}})}}}} }}<!--
+
-->{{#if: {{#var:attack2Type}} | {{#vardefine:weightedDamageTotal| {{#expr: {{#var:weightedDamageTotal}} + ({{#var:attack2Damage}} * {{#var:attack2SelectionChance}}) }}}}{{#vardefine:weightedTimeTotal|{{#expr: {{#var:weightedTimeTotal}}+({{#var:attack2Cooldown}} * {{#var:attack2SelectionChance}})}}}} }}<!--
  
-->{{#if: {{Q|{{#var: name}}|Attack 3 Type}}| {{#vardefine:weightedDamageTotal| {{#expr: {{#var:weightedDamageTotal}} + ({{#var:attack3Damage}} * {{#var:attack3SelectionChance}}) }}}}{{#vardefine:weightedTimeTotal|{{#expr: {{#var:weightedTimeTotal}}+({{#var:attack3Cooldown}} * {{#var:attack3SelectionChance}})}}}} }}<!--
+
-->{{#if: {{#var:attack3Type}} | {{#vardefine:weightedDamageTotal| {{#expr: {{#var:weightedDamageTotal}} + ({{#var:attack3Damage}} * {{#var:attack3SelectionChance}}) }}}}{{#vardefine:weightedTimeTotal|{{#expr: {{#var:weightedTimeTotal}}+({{#var:attack3Cooldown}} * {{#var:attack3SelectionChance}})}}}} }}<!--
  
-->{{#if: {{Q|{{#var: name}}|Attack 4 Type}}| {{#vardefine:weightedDamageTotal| {{#expr: {{#var:weightedDamageTotal}} + ({{#var:attack4Damage}} * {{#var:attack4SelectionChance}}) }}}}{{#vardefine:weightedTimeTotal|{{#expr: {{#var:weightedTimeTotal}}+({{#var:attack4Cooldown}} * {{#var:attack4SelectionChance}})}}}} }}<!--
+
-->{{#if: {{#var:attack4Type}} | {{#vardefine:weightedDamageTotal| {{#expr: {{#var:weightedDamageTotal}} + ({{#var:attack4Damage}} * {{#var:attack4SelectionChance}}) }}}}{{#vardefine:weightedTimeTotal|{{#expr: {{#var:weightedTimeTotal}}+({{#var:attack4Cooldown}} * {{#var:attack4SelectionChance}})}}}} }}<!--
  
-->{{#if: {{Q|{{#var: name}}|Attack 5 Type}}| {{#vardefine:weightedDamageTotal| {{#expr: {{#var:weightedDamageTotal}} + ({{#var:attack5Damage}} * {{#var:attack5SelectionChance}}) }}}}{{#vardefine:weightedTimeTotal|{{#expr: {{#var:weightedTimeTotal}}+({{#var:attack5Cooldown}} * {{#var:attack5SelectionChance}})}}}} }}<!--
+
-->{{#if: {{#var:attack5Type}} | {{#vardefine:weightedDamageTotal| {{#expr: {{#var:weightedDamageTotal}} + ({{#var:attack5Damage}} * {{#var:attack5SelectionChance}}) }}}}{{#vardefine:weightedTimeTotal|{{#expr: {{#var:weightedTimeTotal}}+({{#var:attack5Cooldown}} * {{#var:attack5SelectionChance}})}}}} }}<!--
  
-->{{#if: {{Q|{{#var: name}}|Attack 6 Type}}| {{#vardefine:weightedDamageTotal| {{#expr: {{#var:weightedDamageTotal}} + ({{#var:attack6Damage}} * {{#var:attack6SelectionChance}}) }}}}{{#vardefine:weightedTimeTotal|{{#expr: {{#var:weightedTimeTotal}}+({{#var:attack6Cooldown}} * {{#var:attack6SelectionChance}})}}}} }}<!--
+
-->{{#if: {{#var:attack6Type}} | {{#vardefine:weightedDamageTotal| {{#expr: {{#var:weightedDamageTotal}} + ({{#var:attack6Damage}} * {{#var:attack6SelectionChance}}) }}}}{{#vardefine:weightedTimeTotal|{{#expr: {{#var:weightedTimeTotal}}+({{#var:attack6Cooldown}} * {{#var:attack6SelectionChance}})}}}} }}<!--
  
 
-->{{#vardefine:trueDPS| {{#expr:{{#var:weightedDamageTotal}}/{{#var:weightedTimeTotal}} round 2}}}}<!--
 
-->{{#vardefine:trueDPS| {{#expr:{{#var:weightedDamageTotal}}/{{#var:weightedTimeTotal}} round 2}}}}<!--
Line 154: Line 172:
 
-->{{#vardefine:trueAP| {{#expr: (({{#var:attack1AP}} * {{#var:attack1SelectionChance}})<!--
 
-->{{#vardefine:trueAP| {{#expr: (({{#var:attack1AP}} * {{#var:attack1SelectionChance}})<!--
  
-->{{#if: {{Q|{{#var: name}}|Attack 2 Type}}|+({{#var:attack2AP}} * {{#var:attack2SelectionChance}})
+
-->{{#if: {{#var:attack2Type}}|+({{#var:attack2AP}} * {{#var:attack2SelectionChance}})
 
}}<!--
 
}}<!--
  
-->{{#if: {{Q|{{#var: name}}|Attack 3 Type}}|+({{#var:attack3AP}} * {{#var:attack3SelectionChance}})
+
-->{{#if: {{#var:attack3Type}}|+({{#var:attack3AP}} * {{#var:attack3SelectionChance}})
 
}}<!--
 
}}<!--
  
-->{{#if: {{Q|{{#var: name}}|Attack 4 Type}}|+({{#var:attack4AP}} * {{#var:attack4SelectionChance}})
+
-->{{#if: {{#var:attack4Type}}|+({{#var:attack4AP}} * {{#var:attack4SelectionChance}})
 
}}<!--
 
}}<!--
  
-->{{#if: {{Q|{{#var: name}}|Attack 5 Type}}|+({{#var:attack5AP}} * {{#var:attack5SelectionChance}})
+
-->{{#if: {{#var:attack5Type}}|+({{#var:attack5AP}} * {{#var:attack5SelectionChance}})
 
}}<!--
 
}}<!--
  
-->{{#if: {{Q|{{#var: name}}|Attack 6 Type}}|+({{#var:attack6AP}} * {{#var:attack6SelectionChance}})
+
-->{{#if: {{#var:attack6Type}}|+({{#var:attack6AP}} * {{#var:attack6SelectionChance}})
 
}})
 
}})
 
round 2}}
 
round 2}}
}}{{#var:trueDPS}}</includeonly><noinclude>
+
}}<!--
 +
 
 +
RETURNED VALUE
 +
-->{{#var:trueDPS}}</includeonly><noinclude>
 
{{Recode|reason = Update to allow for adding weapon verb sets to pawn verb sets}}
 
{{Recode|reason = Update to allow for adding weapon verb sets to pawn verb sets}}
 
{{Documentation}}
 
{{Documentation}}
 
</noinclude>
 
</noinclude>

Revision as of 05:37, 18 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: 13.05

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.54

Attack Source Part name (artificial body part) Attack Type Damage AP Cooldown Weight Category Selection chance weighted Damage weighted Cooldown weighted AP
<weapon>
(Plasteel )
Poke 11.745 16.965 (2*0.8) 8.6 mid 0.25
Stab 36.685 54.23 (2.6*0.8) 27.2 best 0.375
Cut 36.685 54.23 (2.6*0.8) 27.2 best 0.375
23.925 35.09 (2*0.8) 0
<pawn> 0
0
SUM: 30.45 1.96 44.91 (True AP)
15.54 (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}}