Editing Template:True Melee DPS Calculator

Jump to navigation Jump to search

Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.

Latest revision Your text
Line 1: Line 1:
 
<includeonly><!--
 
<includeonly><!--
  
!!! WARNINGS !!!
+
!!! WARNING !!!
This template needs to be highly optimised since it's called more than 100 times on some pages. Always check the "Preprocessor visited node count" when editing.
 
 
 
 
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:
 
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:trueAP}}
Line 11: Line 9:
 
* {{#var:attack1SelectionChance}}, {{#var:attack2SelectionChance}}, {{#var:attack3SelectionChance}}, {{#var:attack4SelectionChance}}
 
* {{#var:attack1SelectionChance}}, {{#var:attack2SelectionChance}}, {{#var:attack3SelectionChance}}, {{#var:attack4SelectionChance}}
  
1. VARIABLES
+
VARIABLES
1.1 Important variables
+
-->{{#vardefine:name | {{{1|{{PAGENAME}} }}} }}<!--
-->{{#vardefine:name           | {{{1|{{PAGENAME}} }}} }}<!--
+
-->{{#vardefine:material | {{{2|}}} }}<!--
-->{{#switch: {{#show:{{#var:name}}|?Type|link=none}}
+
-->{{#vardefine:sharpFactor | {{Q|{{#var:material}}|Melee Sharp Damage Factor|1}} }}<!--
| Animal | Mechanoid = {{#vardefine:pawn|{{#var:name}} }} {{#vardefine:weapon|}}
+
-->{{#vardefine:bluntFactor | {{Q|{{#var:material}}|Melee Blunt Damage Factor|1}} }}<!--
| #default =          {{#vardefine:pawn|{{{4|}}} }}      {{#vardefine:weapon|{{#var:name}} }}
+
-->{{#vardefine:cooldownFactor | {{Q|{{#var:material}}|Melee Cooldown Factor|1}} }}<!--
}}<!--
+
-->{{#vardefine:attack1Type | {{Q|{{#var:name}}|Attack 1 Type}} }}<!--
-->{{#vardefine:material      | {{{2|}}} }}<!--
+
-->{{#vardefine:attack2Type | {{Q|{{#var:name}}|Attack 2 Type}} }}<!--
-->{{#vardefine:cooldownFactor | {{#show:{{#var:material}}|?Melee Cooldown Factor|link=none|default=1}} }}<!--
+
-->{{#vardefine:attack3Type | {{Q|{{#var:name}}|Attack 3 Type}} }}<!--
-->{{#vardefine:quality        | {{{ 3|}}} }}<!--
+
-->{{#vardefine:attack4Type | {{Q|{{#var:name}}|Attack 4 Type}} }}<!--
-->{{#vardefine:attack1Type   | {{#show:{{#var:weapon}}|?Attack 1 Type|link=none}} }}<!--
+
-->{{#vardefine:attack5Type | {{Q|{{#var:name}}|Attack 5 Type}} }}<!--
-->{{#vardefine:attack2Type   | {{#show:{{#var:weapon}}|?Attack 2 Type|link=none}} }}<!--
+
-->{{#vardefine:attack6Type | {{Q|{{#var:name}}|Attack 6 Type}} }}<!--
-->{{#vardefine:attack3Type   | {{#show:{{#var:weapon}}|?Attack 3 Type|link=none}} }}<!--
+
-->{{#vardefine:qualityFactor | {{#switch: {{lc:{{{3|}}} }}
-->{{#vardefine:attack4Type   | {{#show:{{#var:weapon}}|?Attack 4 Type|link=none}} }}<!--
+
  | awful      = 0.8
-->{{#vardefine: 5            | {{{ 5|}}} }}<!--
+
  | poor      = 0.9
-->{{#vardefine: 6            | {{{ 6|}}} }}<!--
+
  | normal    = 1
-->{{#vardefine: 7            | {{{ 7|}}} }}<!--
+
  | good      = 1.1
-->{{#vardefine: 8            | {{{ 8|}}} }}<!--
+
  | excellent  = 1.2
-->{{#vardefine: 9            | {{{ 9|}}} }}<!--
+
  | masterwork = 1.45
-->{{#vardefine:10            | {{{10|}}} }}<!--
+
  | legendary = 1.65
-->{{#vardefine:11            | {{{11|}}} }}<!--
+
  | #default   = 1
-->{{#vardefine:12            | {{{12|}}} }}<!--
+
}} }}<!--
-->{{#switch: {{lc:{{{3|}}} }}
+
-->{{#vardefine: attack1InitialSelectionWeight|}}{{#vardefine: attack1SelectionCategory|}}{{#vardefine: attack2InitialSelectionWeight|}}{{#vardefine: attack2SelectionCategory|}}{{#vardefine: attack3InitialSelectionWeight|}}{{#vardefine: attack3SelectionCategory|}}{{#vardefine: attack4InitialSelectionWeight|}}{{#vardefine: attack4SelectionCategory|}}{{#vardefine: attack5InitialSelectionWeight|}}{{#vardefine: attack5SelectionCategory|}}{{#vardefine: attack6InitialSelectionWeight|}}{{#vardefine: attack6SelectionCategory|}}<!--
  | awful      = {{#vardefine:sharpAndQualityFactor | {{#expr: 0.8  * {{#show:{{#var:material}}|?Melee Sharp Damage Factor|link=none|default=1}} }} }} {{#vardefine:bluntAndQualityFactor | {{#expr: 0.8 * {{#show:{{#var:material}}|?Melee Blunt Damage Factor|link=none|default=1}} }} }}
 
  | poor      = {{#vardefine:sharpAndQualityFactor | {{#expr: 0.9  * {{#show:{{#var:material}}|?Melee Sharp Damage Factor|link=none|default=1}} }} }} {{#vardefine:bluntAndQualityFactor | {{#expr: 0.9  * {{#show:{{#var:material}}|?Melee Blunt Damage Factor|link=none|default=1}} }} }}
 
  | good      = {{#vardefine:sharpAndQualityFactor | {{#expr: 1.1  * {{#show:{{#var:material}}|?Melee Sharp Damage Factor|link=none|default=1}} }} }} {{#vardefine:bluntAndQualityFactor | {{#expr: 1.1 * {{#show:{{#var:material}}|?Melee Blunt Damage Factor|link=none|default=1}} }} }}
 
  | excellent = {{#vardefine:sharpAndQualityFactor | {{#expr: 1.2 * {{#show:{{#var:material}}|?Melee Sharp Damage Factor|link=none|default=1}} }} }} {{#vardefine:bluntAndQualityFactor | {{#expr: 1.2  * {{#show:{{#var:material}}|?Melee Blunt Damage Factor|link=none|default=1}} }} }}
 
| masterwork = {{#vardefine:sharpAndQualityFactor | {{#expr: 1.45 * {{#show:{{#var:material}}|?Melee Sharp Damage Factor|link=none|default=1}} }} }} {{#vardefine:bluntAndQualityFactor | {{#expr: 1.45 * {{#show:{{#var:material}}|?Melee Blunt Damage Factor|link=none|default=1}} }} }}
 
| legendary  = {{#vardefine:sharpAndQualityFactor | {{#expr: 1.65 * {{#show:{{#var:material}}|?Melee Sharp Damage Factor|link=none|default=1}} }} }} {{#vardefine:bluntAndQualityFactor | {{#expr: 1.65 * {{#show:{{#var:material}}|?Melee Blunt Damage Factor|link=none|default=1}} }} }}
 
| #default  = {{#vardefine:sharpAndQualityFactor | {{#expr: 1    * {{#show:{{#var:material}}|?Melee Sharp Damage Factor|link=none|default=1}} }} }} {{#vardefine:bluntAndQualityFactor | {{#expr: 1    * {{#show:{{#var:material}}|?Melee Blunt Damage Factor|link=none|default=1}} }} }}
 
}}<!--
 
  
WIP: Do we need to consider Melee Hit Chance? After all it's affected by manipulation
+
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.
-->{{#if: {{#var:pawn}} |
+
-->{{#switch: {{#var:attack1Type}}
  {{#vardefine:attack5Type  | {{#if: {{#var: 5}} | {{#ifeq: {{#var: 5}} | false || {{#show:{{#var: 5}}|?Attack 1 Type|link=none}} }} | {{#show:{{#var:pawn}}|?Attack 1 Type|link=none}} }} }}
+
  | Arrow | ArrowHighVelocity | Bite | Bomb | BombSuper | Bullet | Cut | RangedStab | Scratch | Stab | Thump | Toxic bite | Toxic scratch =
{{#vardefine:attack6Type  | {{#if: {{#var: 6}} | {{#ifeq: {{#var: 6}} | false || {{#show:{{#var: 6}}|?Attack 1 Type|link=none}} }} | {{#show:{{#var:pawn}}|?Attack 2 Type|link=none}} }} }}
+
  {{#vardefine:attack1Damage | {{#expr: {{Q|{{#var:name}}|Attack 1 Damage}}*{{#var:qualityFactor}}*{{#var:sharpFactor}} }} }}
{{#vardefine:attack7Type  | {{#if: {{#var: 7}} | {{#ifeq: {{#var: 7}} | false || {{#show:{{#var: 7}}|?Attack 1 Type|link=none}} }} | {{#show:{{#var:pawn}}|?Attack 3 Type|link=none}} }} }}
+
  {{#vardefine:attack1AP    | {{#expr: {{Q|{{#var:name}}|Attack 1 AP}}   *{{#var:qualityFactor}}*{{#var:sharpFactor}} }} }}
{{#vardefine:attack8Type  | {{#if: {{#var: 8}} | {{#ifeq: {{#var: 8}} | false || {{#show:{{#var: 8}}|?Attack 1 Type|link=none}} }} | {{#show:{{#var:pawn}}|?Attack 4 Type|link=none}} }} }}<!-- humans have four attacks. To allow for humans with two elbow blades and knee spikes each we need four extra attacks -->
+
| Blunt | Crush | Demolish | Poke =
{{#vardefine:attack9Type  | {{#if: {{#var: 9}} | {{#ifeq: {{#var: 9}} | false || {{#show:{{#var: 9}}|?Attack 1 Type|link=none}} }} | {{#show:{{#var:pawn}}|?Attack 5 Type|link=none}} }} }}
+
  {{#vardefine:attack1Damage | {{#expr: {{Q|{{#var:name}}|Attack 1 Damage}}*{{#var:qualityFactor}}*{{#var:bluntFactor}} }} }}
{{#vardefine:attack10Type | {{#if: {{#var:10}} | {{#ifeq: {{#var:10}} | false || {{#show:{{#var:10}}|?Attack 1 Type|link=none}} }} | {{#show:{{#var:pawn}}|?Attack 6 Type|link=none}} }} }}<!-- maximum number of attacks for all pawns. Further attacks can therefore only come from artificial body parts -->
+
  {{#vardefine:attack1AP    | {{#expr: {{Q|{{#var:name}}|Attack 1 AP}}   *{{#var:qualityFactor}}*{{#var:bluntFactor}} }} }}
{{#vardefine:attack11Type | {{#show:{{#var:11}}|?Attack 1 Type|link=none}} }}
+
  | #default = {{Error|Unrecognised Damage Type: {{#var:attack1Type}} }}
  {{#vardefine:attack12Type | {{#show:{{#var:12}}|?Attack 1 Type|link=none}} }}
 
| {{#vardefine:attack5Type|}}{{#vardefine:attack6Type|}}{{#vardefine:attack7Type|}}{{#vardefine:attack8Type|}}{{#vardefine:attack9Type|}}{{#vardefine:attack10Type|}}{{#vardefine:attack11Type|}}{{#vardefine:attack12Type|}}
 
 
}}<!--
 
}}<!--
 
+
-->{{#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}} }}<!--
1.2 Clearing variables in case the page is called multiple times on the same page
+
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.
-->{{#vardefine:attack1InitialSelectionWeight | }}{{#vardefine:attack1SelectionCategory |}}{{#vardefine:attack1AP | }}{{#vardefine:attack1Cooldown | }}{{#vardefine:attack1Damage | }}<!--
+
-->{{#if: {{#var:attack2Type}} |
-->{{#vardefine:attack2InitialSelectionWeight | }}{{#vardefine:attack2SelectionCategory |}}{{#vardefine:attack2AP | }}{{#vardefine:attack2Cooldown | }}{{#vardefine:attack2Damage | }}<!--
+
{{#switch: {{#var:attack2Type}}
-->{{#vardefine:attack3InitialSelectionWeight | }}{{#vardefine:attack3SelectionCategory |}}{{#vardefine:attack3AP | }}{{#vardefine:attack3Cooldown | }}{{#vardefine:attack3Damage | }}<!--
+
| Arrow | ArrowHighVelocity | Bite | Bomb | BombSuper | Bullet | Cut | RangedStab | Scratch | Stab | Thump | Toxic bite | Toxic scratch =
-->{{#vardefine:attack4InitialSelectionWeight | }}{{#vardefine:attack4SelectionCategory |}}{{#vardefine:attack4AP | }}{{#vardefine:attack4Cooldown | }}{{#vardefine:attack4Damage | }}<!--
+
  {{#vardefine:attack2Damage| {{#expr: {{Q|{{#var:name}}|Attack 2 Damage}}*{{#var:qualityFactor}}*{{#var:sharpFactor}} }} }}
-->{{#vardefine:attack5InitialSelectionWeight |0}}{{#vardefine:attack5SelectionCategory |}}{{#vardefine:attack5AP |0}}{{#vardefine:attack5Cooldown |0}}{{#vardefine:attack5Damage |0}}<!--
+
  {{#vardefine:attack2AP    | {{#expr: {{Q|{{#var:name}}|Attack 2 AP}}   *{{#var:qualityFactor}}*{{#var:sharpFactor}} }} }}
-->{{#vardefine:attack6InitialSelectionWeight |0}}{{#vardefine:attack6SelectionCategory |}}{{#vardefine:attack6AP |0}}{{#vardefine:attack6Cooldown |0}}{{#vardefine:attack6Damage |0}}<!--
 
-->{{#vardefine:attack7InitialSelectionWeight |0}}{{#vardefine:attack7SelectionCategory |}}{{#vardefine:attack7AP |0}}{{#vardefine:attack7Cooldown |0}}{{#vardefine:attack7Damage |0}}<!--
 
-->{{#vardefine:attack8InitialSelectionWeight |0}}{{#vardefine:attack8SelectionCategory |}}{{#vardefine:attack8AP |0}}{{#vardefine:attack8Cooldown |0}}{{#vardefine:attack8Damage |0}}<!--
 
-->{{#vardefine:attack9InitialSelectionWeight |0}}{{#vardefine:attack9SelectionCategory |}}{{#vardefine:attack9AP |0}}{{#vardefine:attack9Cooldown |0}}{{#vardefine:attack9Damage |0}}<!--
 
-->{{#vardefine:attack10InitialSelectionWeight|0}}{{#vardefine:attack10SelectionCategory|}}{{#vardefine:attack10AP|0}}{{#vardefine:attack10Cooldown|0}}{{#vardefine:attack10Damage|0}}<!--
 
-->{{#vardefine:attack11InitialSelectionWeight| }}{{#vardefine:attack11SelectionCategory|}}{{#vardefine:attack11AP| }}{{#vardefine:attack11Cooldown| }}{{#vardefine:attack11Damage| }}<!--
 
-->{{#vardefine:attack12InitialSelectionWeight| }}{{#vardefine:attack12SelectionCategory|}}{{#vardefine:attack12AP| }}{{#vardefine:attack12Cooldown| }}{{#vardefine:attack12Damage| }}<!--
 
-->{{#vardefine:attack1SelectionChance |}}{{#vardefineecho:attack1WeightedDamage |}}{{#vardefineecho:attack1WeightedCooldown |}}{{#vardefineecho:attack1WeightedAP |}}<!--
 
-->{{#vardefine:attack2SelectionChance |}}{{#vardefineecho:attack2WeightedDamage |}}{{#vardefineecho:attack2WeightedCooldown |}}{{#vardefineecho:attack2WeightedAP |}}<!--
 
-->{{#vardefine:attack3SelectionChance |}}{{#vardefineecho:attack3WeightedDamage |}}{{#vardefineecho:attack3WeightedCooldown |}}{{#vardefineecho:attack3WeightedAP |}}<!--
 
-->{{#vardefine:attack4SelectionChance |}}{{#vardefineecho:attack4WeightedDamage |}}{{#vardefineecho:attack4WeightedCooldown |}}{{#vardefineecho:attack4WeightedAP |}}<!--
 
-->{{#vardefine:attack5SelectionChance |}}{{#vardefineecho:attack5WeightedDamage |}}{{#vardefineecho:attack5WeightedCooldown |}}{{#vardefineecho:attack5WeightedAP |}}<!--
 
-->{{#vardefine:attack6SelectionChance |}}{{#vardefineecho:attack6WeightedDamage |}}{{#vardefineecho:attack6WeightedCooldown |}}{{#vardefineecho:attack6WeightedAP |}}<!--
 
-->{{#vardefine:attack7SelectionChance |}}{{#vardefineecho:attack7WeightedDamage |}}{{#vardefineecho:attack7WeightedCooldown |}}{{#vardefineecho:attack7WeightedAP |}}<!--
 
-->{{#vardefine:attack8SelectionChance |}}{{#vardefineecho:attack8WeightedDamage |}}{{#vardefineecho:attack8WeightedCooldown |}}{{#vardefineecho:attack8WeightedAP |}}<!--
 
-->{{#vardefine:attack9SelectionChance |}}{{#vardefineecho:attack9WeightedDamage |}}{{#vardefineecho:attack9WeightedCooldown |}}{{#vardefineecho:attack9WeightedAP |}}<!--
 
-->{{#vardefine:attack10SelectionChance|}}{{#vardefineecho:attack10WeightedDamage|}}{{#vardefineecho:attack10WeightedCooldown|}}{{#vardefineecho:attack10WeightedAP|}}<!--
 
-->{{#vardefine:attack11SelectionChance|}}{{#vardefineecho:attack11WeightedDamage|}}{{#vardefineecho:attack11WeightedCooldown|}}{{#vardefineecho:attack11WeightedAP|}}<!--
 
-->{{#vardefine:attack12SelectionChance|}}{{#vardefineecho:attack12WeightedDamage|}}{{#vardefineecho:attack12WeightedCooldown|}}{{#vardefineecho:attack12WeightedAP|}}<!--
 
-->{{#vardefine:numBestAttacks|0}}{{#vardefine:numMidAttacks|0}}<!--
 
 
 
2. CALCULATIONS
 
2.1 Define the damage type of the attacks so it knows which material stat to use for the damage multiplier. Needs updating if new damage types added. Only include damage types that are "Category = Melee Weapons" and "Armor Category = Blunt". The statements default to Sharp damage if no fitting damage type is found.
 
2.1.2 Weapon attacks
 
2.1.1.1 First weapon attack
 
-->{{#if: {{#var:attack1Type}} | {{#vardefine:attack1InitialSelectionWeight | {{#expr: {{#switch: {{#var:attack1Type}}
 
 
  | Blunt | Crush | Demolish | Poke =
 
  | Blunt | Crush | Demolish | Poke =
    {{#vardefineecho:attack1Damage | {{#expr: {{#show:{{#var:weapon}}|?Attack 1 Damage|link=none}} * {{#var:bluntAndQualityFactor}} }} }}
+
  {{#vardefine:attack2Damage| {{#expr: {{Q|{{#var:name}}|Attack 2 Damage}}*{{#var:qualityFactor}}*{{#var:bluntFactor}} }} }}
    * (1 + ({{#vardefineecho:attack1AP | {{#expr: {{#show:{{#var:weapon}}|?Attack 1 AP|link=none}} * {{#var:bluntAndQualityFactor}} }} }}/100))
+
  {{#vardefine:attack2AP    | {{#expr: {{Q|{{#var:name}}|Attack 2 AP}}    *{{#var:qualityFactor}}*{{#var:bluntFactor}} }} }}
    * {{#show:{{#var:weapon}}|?Attack 1 Chance Factor|link=none|default=1}}
+
| #default = {{Error|Unrecognised Damage Type: {{#var:attack2Type}} }}
    / {{#vardefineecho:attack1Cooldown | {{#expr: {{#show:{{#var:weapon}}|?Attack 1 Cooldown|link=none}} * {{#var:cooldownFactor}} }} }}
+
}}
| #default =
+
{{#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}} }}
    {{#vardefineecho:attack1Damage | {{#expr: {{#show:{{#var:weapon}}|?Attack 1 Damage|link=none}} * {{#var:sharpAndQualityFactor}} }} }}
+
}}<!--
    * (1 + ({{#vardefineecho:attack1AP | {{#expr: {{#show:{{#var:weapon}}|?Attack 1 AP|link=none}} * {{#var:sharpAndQualityFactor}} }} }}/100))
+
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.
    * {{#show:{{#var:weapon}}|?Attack 1 Chance Factor|link=none|default=1}}
+
-->{{#if: {{#var:attack3Type}} |
    / {{#vardefineecho:attack1Cooldown | {{#expr: {{#show:{{#var:weapon}}|?Attack 1 Cooldown|link=none}} * {{#var:cooldownFactor}} }} }}
+
{{#switch: {{#var:attack3Type}}
}} round 1}} }}<!--
+
| Arrow | ArrowHighVelocity | Bite | Bomb | BombSuper | Bullet | Cut | RangedStab | Scratch | Stab | Thump | Toxic bite | Toxic scratch =
2.1.1.2 Second weapon attack
+
  {{#vardefine:attack3Damage| {{#expr: {{Q|{{#var:name}}|Attack 3 Damage}}*{{#var:qualityFactor}}*{{#var:sharpFactor}} }} }}
-->{{#if: {{#var:attack2Type}} | {{#vardefine:attack2InitialSelectionWeight | {{#expr: {{#switch: {{#var:attack2Type}}
+
  {{#vardefine:attack3AP    | {{#expr: {{Q|{{#var:name}}|Attack 3 AP}}    *{{#var:qualityFactor}}*{{#var:sharpFactor}} }} }}
 
  | Blunt | Crush | Demolish | Poke =
 
  | Blunt | Crush | Demolish | Poke =
    {{#vardefineecho:attack2Damage | {{#expr: {{#show:{{#var:weapon}}|?Attack 2 Damage|link=none}} * {{#var:bluntAndQualityFactor}} }} }}
+
  {{#vardefine:attack3Damage| {{#expr: {{Q|{{#var:name}}|Attack 3 Damage}}*{{#var:qualityFactor}}*{{#var:bluntFactor}} }} }}
    * (1 + ({{#vardefineecho:attack2AP | {{#expr: {{#show:{{#var:weapon}}|?Attack 2 AP|link=none}} * {{#var:bluntAndQualityFactor}} }} }}/100))
+
  {{#vardefine:attack3AP    | {{#expr: {{Q|{{#var:name}}|Attack 3 AP}}    *{{#var:qualityFactor}}*{{#var:bluntFactor}} }} }}
    * {{#show:{{#var:weapon}}|?Attack 2 Chance Factor|link=none|default=1}}
+
| #default = {{Error|Unrecognised Damage Type: {{#var:attack3Type}} }}
    / {{#vardefineecho:attack2Cooldown | {{#expr: {{#show:{{#var:weapon}}|?Attack 2 Cooldown|link=none}} * {{#var:cooldownFactor}} }} }}
+
}}
| #default =
+
{{#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}} }}
    {{#vardefineecho:attack2Damage | {{#expr: {{#show:{{#var:weapon}}|?Attack 2 Damage|link=none}} * {{#var:sharpAndQualityFactor}} }} }}
+
}}<!--
    * (1 + ({{#vardefineecho:attack2AP | {{#expr: {{#show:{{#var:weapon}}|?Attack 2 AP|link=none}} * {{#var:sharpAndQualityFactor}} }} }}/100))
+
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.
    * {{#show:{{#var:weapon}}|?Attack 2 Chance Factor|link=none|default=1}}
+
-->{{#if: {{#var:attack4Type}} |
    / {{#vardefineecho:attack2Cooldown | {{#expr: {{#show:{{#var:weapon}}|?Attack 2 Cooldown|link=none}} * {{#var:cooldownFactor}} }} }}
+
{{#switch: {{#var:attack4Type}}
}} round 1}} }}<!--
+
| Arrow | ArrowHighVelocity | Bite | Bomb | BombSuper | Bullet | Cut | RangedStab | Scratch | Stab | Thump | Toxic bite | Toxic scratch =
2.1.1.3 Third weapon attack
+
  {{#vardefine:attack4Damage| {{#expr: {{Q|{{#var:name}}|Attack 4 Damage}}*{{#var:qualityFactor}}*{{#var:sharpFactor}} }} }}
-->{{#if: {{#var:attack3Type}} | {{#vardefine:attack3InitialSelectionWeight | {{#expr: {{#switch: {{#var:attack3Type}}
+
  {{#vardefine:attack4AP    | {{#expr: {{Q|{{#var:name}}|Attack 4 AP}}    *{{#var:qualityFactor}}*{{#var:sharpFactor}} }} }}
 
  | Blunt | Crush | Demolish | Poke =
 
  | Blunt | Crush | Demolish | Poke =
    {{#vardefineecho:attack3Damage | {{#expr: {{#show:{{#var:weapon}}|?Attack 3 Damage|link=none}} * {{#var:bluntAndQualityFactor}} }} }}
+
  {{#vardefine:attack4Damage| {{#expr: {{Q|{{#var:name}}|Attack 4 Damage}}*{{#var:qualityFactor}}*{{#var:bluntFactor}} }} }}
    * (1 + ({{#vardefineecho:attack3AP | {{#expr: {{#show:{{#var:weapon}}|?Attack 3 AP|link=none}} * {{#var:bluntAndQualityFactor}} }} }}/100))
+
  {{#vardefine:attack4AP    | {{#expr: {{Q|{{#var:name}}|Attack 4 AP}}    *{{#var:qualityFactor}}*{{#var:bluntFactor}} }} }}
    * {{#show:{{#var:weapon}}|?Attack 3 Chance Factor|link=none|default=1}}
+
| #default = {{Error|Unrecognised Damage Type: {{#var:attack4Type}} }}
    / {{#vardefineecho:attack3Cooldown | {{#expr: {{#show:{{#var:weapon}}|?Attack 3 Cooldown|link=none}} * {{#var:cooldownFactor}} }} }}
+
}}
| #default =
+
{{#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}} }}
    {{#vardefineecho:attack3Damage | {{#expr: {{#show:{{#var:weapon}}|?Attack 3 Damage|link=none}} * {{#var:sharpAndQualityFactor}} }} }}
+
}}<!--
    * (1 + ({{#vardefineecho:attack3AP | {{#expr: {{#show:{{#var:weapon}}|?Attack 3 AP|link=none}} * {{#var:sharpAndQualityFactor}} }} }}/100))
+
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.
    * {{#show:{{#var:weapon}}|?Attack 3 Chance Factor|link=none|default=1}}
+
-->{{#if: {{#var:attack5Type}} |
    / {{#vardefineecho:attack3Cooldown | {{#expr: {{#show:{{#var:weapon}}|?Attack 3 Cooldown|link=none}} * {{#var:cooldownFactor}} }} }}
+
{{#switch: {{#var:attack5Type}}
}} round 1}} }}<!--
+
| Arrow | ArrowHighVelocity | Bite | Bomb | BombSuper | Bullet | Cut | RangedStab | Scratch | Stab | Thump | Toxic bite | Toxic scratch =
2.1.1.4 Fourth weapon attack
+
  {{#vardefine:attack5Damage| {{#expr: {{Q|{{#var:name}}|Attack 5 Damage}}*{{#var:qualityFactor}}*{{#var:sharpFactor}} }} }}
-->{{#if: {{#var:attack4Type}} | {{#vardefine:attack4InitialSelectionWeight | {{#expr: {{#switch: {{#var:attack4Type}}
+
  {{#vardefine:attack5AP    | {{#expr: {{Q|{{#var:name}}|Attack 5 AP}}    *{{#var:qualityFactor}}*{{#var:sharpFactor}} }} }}
 
  | Blunt | Crush | Demolish | Poke =
 
  | Blunt | Crush | Demolish | Poke =
    {{#vardefineecho:attack4Damage | {{#expr: {{#show:{{#var:weapon}}|?Attack 4 Damage|link=none}} * {{#var:bluntAndQualityFactor}} }} }}
+
  {{#vardefine:attack5Damage| {{#expr: {{Q|{{#var:name}}|Attack 5 Damage}}*{{#var:qualityFactor}}*{{#var:bluntFactor}} }} }}
    * (1 + ({{#vardefineecho:attack4AP | {{#expr: {{#show:{{#var:weapon}}|?Attack 4 AP|link=none}} * {{#var:bluntAndQualityFactor}} }} }}/100))
+
  {{#vardefine:attack5AP    | {{#expr: {{Q|{{#var:name}}|Attack 5 AP}}   *{{#var:qualityFactor}}*{{#var:bluntFactor}} }} }}
    * {{#show:{{#var:weapon}}|?Attack 4 Chance Factor|link=none|default=1}}
+
| #default = {{Error|Unrecognised Damage Type: {{#var:attack5Type}} }}
    / {{#vardefineecho:attack4Cooldown | {{#expr: {{#show:{{#var:weapon}}|?Attack 4 Cooldown|link=none}} * {{#var:cooldownFactor}} }} }}
+
}}
| #default =
+
{{#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}} }}
    {{#vardefineecho:attack4Damage | {{#expr: {{#show:{{#var:weapon}}|?Attack 4 Damage|link=none}} * {{#var:sharpAndQualityFactor}} }} }}
 
    * (1 + ({{#vardefineecho:attack4AP | {{#expr: {{#show:{{#var:weapon}}|?Attack 4 AP|link=none}} * {{#var:sharpAndQualityFactor}} }} }}/100))
 
    * {{#show:{{#var:weapon}}|?Attack 4 Chance Factor|link=none|default=1}}
 
    / {{#vardefineecho:attack4Cooldown | {{#expr: {{#show:{{#var:weapon}}|?Attack 4 Cooldown|link=none}} * {{#var:cooldownFactor}} }} }}
 
}} round 1}} }} }} }} }} }}<!--
 
2.1.2 Pawn attacks
 
2.1.2.1 First pawn attack
 
-->{{#if: {{#var:attack5Type}} |
 
{{#if: {{#var: 5}}
 
| {{#vardefine:attack5InitialSelectionWeight | {{#expr: {{#vardefineecho:attack5Damage| {{#show:{{#var: 5}}|?Attack 1 Damage|link=none}} }} * (1 + ({{#vardefineecho:attack5AP| {{#show:{{#var: 5}}|?Attack 1 AP|link=none}} }}/100)) * {{#show:{{#var: 5}}|?Attack 1 Chance Factor|link=none|default=1}} / {{#vardefineecho:attack5Cooldown | {{#show:{{#var: 5}}|?Attack 1 Cooldown|link=none}} }} round 1}} }}
 
| {{#vardefine:attack5InitialSelectionWeight | {{#expr: {{#vardefineecho:attack5Damage| {{#show:{{#var:pawn}}|?Attack 1 Damage|link=none}} }} * (1 + ({{#vardefineecho:attack5AP| {{#show:{{#var:pawn}}|?Attack 1 AP|link=none}} }}/100)) * {{#show:{{#var:pawn}}|?Attack 1 Chance Factor|link=none|default=1}} / {{#vardefineecho:attack5Cooldown | {{#show:{{#var:pawn}}|?Attack 1 Cooldown|link=none}} }} round 1}} }}
 
}}
 
 
}}<!--
 
}}<!--
2.1.2.2 Second pawn attack
+
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: {{#var:attack6Type}} |
 
-->{{#if: {{#var:attack6Type}} |
{{#if: {{#var: 6}}
+
{{#switch: {{#var:attack6Type}}
  | {{#vardefine:attack6InitialSelectionWeight | {{#expr: {{#vardefineecho:attack6Damage| {{#show:{{#var: 6}}|?Attack 1 Damage|link=none}} }} * (1 + ({{#vardefineecho:attack6AP| {{#show:{{#var: 6}}|?Attack 1 AP|link=none}} }}/100)) * {{#show:{{#var: 6}}|?Attack 1 Chance Factor|link=none|default=1}} / {{#vardefineecho:attack6Cooldown | {{#show:{{#var: 6}}|?Attack 1 Cooldown|link=none}} }} round 1}} }}
+
  | Arrow | ArrowHighVelocity | Bite | Bomb | BombSuper | Bullet | Cut | RangedStab | Scratch | Stab | Thump | Toxic bite | Toxic scratch =
| {{#vardefine:attack6InitialSelectionWeight | {{#expr: {{#vardefineecho:attack6Damage| {{#show:{{#var:pawn}}|?Attack 2 Damage|link=none}} }} * (1 + ({{#vardefineecho:attack6AP| {{#show:{{#var:pawn}}|?Attack 2 AP|link=none}} }}/100)) * {{#show:{{#var:pawn}}|?Attack 2 Chance Factor|link=none|default=1}} / {{#vardefineecho:attack6Cooldown | {{#show:{{#var:pawn}}|?Attack 2 Cooldown|link=none}} }} round 1}} }}
+
  {{#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}} }} }}
 +
| Blunt | Crush | Demolish | Poke =
 +
  {{#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}} }} }}
 +
| #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}} }}
 
}}<!--
 
}}<!--
2.1.2.3 Third pawn attack
+
Determine which attack has the highest weight to use as point of comparison for categorisation
-->{{#if: {{#var:attack7Type}} |
+
-->{{#vardefine: maxSelectionWeight | {{#ifexpr: {{#var:attack1InitialSelectionWeight}} > {{#var:attack2InitialSelectionWeight|0}} | {{#var:attack1InitialSelectionWeight}} | {{#var:attack2InitialSelectionWeight}} }} }}<!--
{{#if: {{#var: 7}}
+
-->{{#ifexpr: {{#var:maxSelectionWeight}} < {{#var:attack3InitialSelectionWeight|0}} | {{#vardefine: maxSelectionWeight| {{#var:attack3InitialSelectionWeight}} }} }}<!--
| {{#vardefine:attack7InitialSelectionWeight | {{#expr: {{#vardefineecho:attack7Damage| {{#show:{{#var: 7}}|?Attack 1 Damage|link=none}} }} * (1 + ({{#vardefineecho:attack7AP| {{#show:{{#var: 7}}|?Attack 1 AP|link=none}} }}/100)) * {{#show:{{#var: 7}}|?Attack 1 Chance Factor|link=none|default=1}} / {{#vardefineecho:attack7Cooldown | {{#show:{{#var: 7}}|?Attack 1 Cooldown|link=none}} }} round 1}} }}
+
-->{{#ifexpr: {{#var:maxSelectionWeight}} < {{#var:attack4InitialSelectionWeight|0}} | {{#vardefine: maxSelectionWeight| {{#var:attack4InitialSelectionWeight}} }} }}<!--
| {{#vardefine:attack7InitialSelectionWeight | {{#expr: {{#vardefineecho:attack7Damage| {{#show:{{#var:pawn}}|?Attack 3 Damage|link=none}} }} * (1 + ({{#vardefineecho:attack7AP| {{#show:{{#var:pawn}}|?Attack 3 AP|link=none}} }}/100)) * {{#show:{{#var:pawn}}|?Attack 3 Chance Factor|link=none|default=1}} / {{#vardefineecho:attack7Cooldown | {{#show:{{#var:pawn}}|?Attack 3 Cooldown|link=none}} }} round 1}} }}
+
-->{{#ifexpr: {{#var:maxSelectionWeight}} < {{#var:attack5InitialSelectionWeight|0}} | {{#vardefine: maxSelectionWeight| {{#var:attack5InitialSelectionWeight}} }} }}<!--
}}
+
-->{{#ifexpr: {{#var:maxSelectionWeight}} < {{#var:attack6InitialSelectionWeight|0}} | {{#vardefine: maxSelectionWeight| {{#var:attack6InitialSelectionWeight}} }} }}<!--
 +
Initialize vars for counting category sizes
 +
-->{{#vardefine: numBestAttacks | 0}}{{#vardefine: numMidAttacks | 0}}<!--
 +
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.25*{{#var:maxSelectionWeight}}) | {{#vardefine: attack1SelectionCategory |worst}} | {{#vardefine: numMidAttacks | {{#expr: {{#var:numMidAttacks}}+1}}}} {{#vardefine: attack1SelectionCategory | mid }}}} }}<!--
 +
Categorize attack 2 relative to max
 +
-->{{#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.25*{{#var:maxSelectionWeight}}) | {{#vardefine: attack2SelectionCategory |worst}} | {{#vardefine: numMidAttacks | {{#expr: {{#var:numMidAttacks}}+1}}}} {{#vardefine: attack2SelectionCategory | mid }}}} }} }}<!--
 +
Categorize attack 3 relative to max
 +
-->{{#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.25*{{#var:maxSelectionWeight}}) | {{#vardefine: attack3SelectionCategory |worst}} | {{#vardefine: numMidAttacks | {{#expr: {{#var:numMidAttacks}}+1}}}} {{#vardefine: attack3SelectionCategory | mid }}}} }} }}<!--
 +
Categorize attack 4 relative to max
 +
-->{{#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.25*{{#var:maxSelectionWeight}}) | {{#vardefine: attack4SelectionCategory |worst}} | {{#vardefine: numMidAttacks | {{#expr: {{#var:numMidAttacks}}+1}}}} {{#vardefine: attack4SelectionCategory | mid }}}} }} }}<!--
 +
Categorize attack 5 relative to max
 +
-->{{#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.25*{{#var:maxSelectionWeight}}) | {{#vardefine: attack5SelectionCategory |worst}} | {{#vardefine: numMidAttacks | {{#expr: {{#var:numMidAttacks}}+1}}}} {{#vardefine: attack5SelectionCategory | mid }}}} }} }}<!--
 +
Categorize attack 6 relative to max
 +
-->{{#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.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%
 +
-->{{#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.
 +
-->{{#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: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: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}} }} }} }}<!--
 +
Calculate actual DPS
 +
 
 +
(bestDamage*bestSelectionWeight + midDamage*midSelectionWeight) / (bestCooldownTime*bestSelectionWeight + midCoolDownTime*midSelectionWeight) = DPS
 +
 
 +
 
 +
 
 +
-->{{#vardefine:weightedDamageTotal| {{#expr: {{#var:attack1Damage}} * {{#var:attack1SelectionChance}} }}}}{{#vardefine:weightedTimeTotal|{{#expr: {{#var:attack1Cooldown}} * {{#var:attack1SelectionChance}}}}}}<!--
 +
 
 +
-->{{#if: {{#var:attack2Type}} | {{#vardefine:weightedDamageTotal| {{#expr: {{#var:weightedDamageTotal}} + ({{#var:attack2Damage}} * {{#var:attack2SelectionChance}}) }}}}{{#vardefine:weightedTimeTotal|{{#expr: {{#var:weightedTimeTotal}}+({{#var:attack2Cooldown}} * {{#var:attack2SelectionChance}})}}}} }}<!--
 +
 
 +
-->{{#if: {{#var:attack3Type}} | {{#vardefine:weightedDamageTotal| {{#expr: {{#var:weightedDamageTotal}} + ({{#var:attack3Damage}} * {{#var:attack3SelectionChance}}) }}}}{{#vardefine:weightedTimeTotal|{{#expr: {{#var:weightedTimeTotal}}+({{#var:attack3Cooldown}} * {{#var:attack3SelectionChance}})}}}} }}<!--
 +
 
 +
-->{{#if: {{#var:attack4Type}} | {{#vardefine:weightedDamageTotal| {{#expr: {{#var:weightedDamageTotal}} + ({{#var:attack4Damage}} * {{#var:attack4SelectionChance}}) }}}}{{#vardefine:weightedTimeTotal|{{#expr: {{#var:weightedTimeTotal}}+({{#var:attack4Cooldown}} * {{#var:attack4SelectionChance}})}}}} }}<!--
 +
 
 +
-->{{#if: {{#var:attack5Type}} | {{#vardefine:weightedDamageTotal| {{#expr: {{#var:weightedDamageTotal}} + ({{#var:attack5Damage}} * {{#var:attack5SelectionChance}}) }}}}{{#vardefine:weightedTimeTotal|{{#expr: {{#var:weightedTimeTotal}}+({{#var:attack5Cooldown}} * {{#var:attack5SelectionChance}})}}}} }}<!--
 +
 
 +
-->{{#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}}}}<!--
 +
Calculate actual avg AP
 +
-->{{#vardefine:trueAP| {{#expr: (({{#var:attack1AP}} * {{#var:attack1SelectionChance}})<!--
 +
 
 +
-->{{#if: {{#var:attack2Type}}|+({{#var:attack2AP}} * {{#var:attack2SelectionChance}})
 
}}<!--
 
}}<!--
2.1.2.4 Fourth pawn attack
+
 
-->{{#if: {{#var:attack8Type}} |
+
-->{{#if: {{#var:attack3Type}}|+({{#var:attack3AP}} * {{#var:attack3SelectionChance}})
{{#if: {{#var: 8}}
 
| {{#vardefine:attack8InitialSelectionWeight | {{#expr: {{#vardefineecho:attack8Damage| {{#show:{{#var: 8}}|?Attack 1 Damage|link=none}} }} * (1 + ({{#vardefineecho:attack8AP| {{#show:{{#var: 8}}|?Attack 1 AP|link=none}} }}/100)) * {{#show:{{#var: 8}}|?Attack 1 Chance Factor|link=none|default=1}} / {{#vardefineecho:attack8Cooldown | {{#show:{{#var: 8}}|?Attack 1 Cooldown|link=none}} }} round 1}} }}
 
| {{#vardefine:attack8InitialSelectionWeight | {{#expr: {{#vardefineecho:attack8Damage| {{#show:{{#var:pawn}}|?Attack 4 Damage|link=none}} }} * (1 + ({{#vardefineecho:attack8AP| {{#show:{{#var:pawn}}|?Attack 4 AP|link=none}} }}/100)) * {{#show:{{#var:pawn}}|?Attack 4 Chance Factor|link=none|default=1}} / {{#vardefineecho:attack8Cooldown | {{#show:{{#var:pawn}}|?Attack 4 Cooldown|link=none}} }} round 1}} }}
 
}}
 
 
}}<!--
 
}}<!--
2.1.2.5 Fifth pawn attack
+
 
-->{{#if: {{#var:attack9Type}} |
+
-->{{#if: {{#var:attack4Type}}|+({{#var:attack4AP}} * {{#var:attack4SelectionChance}})
{{#if: {{#var: 9}}
 
| {{#vardefine:attack9InitialSelectionWeight | {{#expr: {{#vardefineecho:attack9Damage| {{#show:{{#var: 9}}|?Attack 1 Damage|link=none}} }} * (1 + ({{#vardefineecho:attack9AP| {{#show:{{#var: 9}}|?Attack 1 AP|link=none}} }}/100)) * {{#show:{{#var: 9}}|?Attack 1 Chance Factor|link=none|default=1}} / {{#vardefineecho:attack9Cooldown | {{#show:{{#var: 9}}|?Attack 1 Cooldown|link=none}} }} round 1}} }}
 
| {{#vardefine:attack9InitialSelectionWeight | {{#expr: {{#vardefineecho:attack9Damage| {{#show:{{#var:pawn}}|?Attack 5 Damage|link=none}} }} * (1 + ({{#vardefineecho:attack9AP| {{#show:{{#var:pawn}}|?Attack 5 AP|link=none}} }}/100)) * {{#show:{{#var:pawn}}|?Attack 5 Chance Factor|link=none|default=1}} / {{#vardefineecho:attack9Cooldown | {{#show:{{#var:pawn}}|?Attack 5 Cooldown|link=none}} }} round 1}} }}
 
}}
 
 
}}<!--
 
}}<!--
2.1.2.6 Sixth pawn attack
+
 
-->{{#if: {{#var:attack10Type}} |
+
-->{{#if: {{#var:attack5Type}}|+({{#var:attack5AP}} * {{#var:attack5SelectionChance}})
{{#if: {{#var:10}}
 
| {{#vardefine:attack10InitialSelectionWeight | {{#expr: {{#vardefineecho:attack10Damage| {{#show:{{#var:10}}|?Attack 1 Damage|link=none}} }} * (1 + ({{#vardefineecho:attack10AP| {{#show:{{#var:10}}|?Attack 1 AP|link=none}} }}/100)) * {{#show:{{#var:10}}|?Attack 1 Chance Factor|link=none|default=1}} / {{#vardefineecho:attack10Cooldown | {{#show:{{#var:10}}|?Attack 1 Cooldown|link=none}} }} round 1}} }}
 
| {{#vardefine:attack10InitialSelectionWeight | {{#expr: {{#vardefineecho:attack10Damage| {{#show:{{#var:pawn}}|?Attack 6 Damage|link=none}} }} * (1 + ({{#vardefineecho:attack10AP| {{#show:{{#var:pawn}}|?Attack 6 AP|link=none}} }}/100)) * {{#show:{{#var:pawn}}|?Attack 6 Chance Factor|link=none|default=1}} / {{#vardefineecho:attack10Cooldown | {{#show:{{#var:pawn}}|?Attack 6 Cooldown|link=none}} }} round 1}} }}
 
}}
 
 
}}<!--
 
}}<!--
2.1.2.7 Seventh pawn attack
 
-->{{#if: {{#var:attack11Type}} |
 
{{#vardefine:attack11InitialSelectionWeight | {{#expr: {{#vardefineecho:attack11Damage| {{#show:{{#var:11}}|?Attack 1 Damage|link=none}} }} * (1 + ({{#vardefineecho:attack11AP| {{#show:{{#var:11}}|?Attack 1 AP|link=none}} }}/100)) * {{#show:{{#var:11}}|?Attack 1 Chance Factor|link=none|default=1}} / {{#vardefineecho:attack11Cooldown | {{#show:{{#var:11}}|?Attack 1 Cooldown|link=none}} }} round 1}} }}<!--
 
2.1.2.8 Eighth pawn attack
 
-->{{#if: {{#var:attack12Type}} |
 
{{#vardefine:attack12InitialSelectionWeight | {{#expr: {{#vardefineecho:attack12Damage| {{#show:{{#var:12}}|?Attack 1 Damage|link=none}} }} * (1 + ({{#vardefineecho:attack12AP| {{#show:{{#var:12}}|?Attack 1 AP|link=none}} }}/100)) * {{#show:{{#var:12}}|?Attack 1 Chance Factor|link=none|default=1}} / {{#vardefineecho:attack12Cooldown | {{#show:{{#var:12}}|?Attack 1 Cooldown|link=none}} }} round 1}} }}
 
}} }}<!--
 
  
2.2 Determine which attack has the highest weight to use as point of comparison for categorisation
+
-->{{#if: {{#var:attack6Type}}|+({{#var:attack6AP}} * {{#var:attack6SelectionChance}})
-->{{#vardefine:maxSelectionWeight | {{#ifexpr: {{#var:attack1InitialSelectionWeight|0}} > {{#var:attack2InitialSelectionWeight|0}} | {{#var:attack1InitialSelectionWeight|0}} | {{#var:attack2InitialSelectionWeight|0}} }} }}<!--
+
}})
-->{{#if: {{#var:attack3Type }} | {{#ifexpr: {{#var:maxSelectionWeight}} < {{#var:attack3InitialSelectionWeight }} | {{#vardefine:maxSelectionWeight | {{#var:attack3InitialSelectionWeight }} }} }}<!--
+
round 2}}
-->{{#if: {{#var:attack4Type }} | {{#ifexpr: {{#var:maxSelectionWeight}} < {{#var:attack4InitialSelectionWeight }} | {{#vardefine:maxSelectionWeight | {{#var:attack4InitialSelectionWeight }} }} }} }} }}<!--
+
}}<!--
-->{{#if: {{#var:attack5Type }} | {{#ifexpr: {{#var:maxSelectionWeight}} < {{#var:attack5InitialSelectionWeight }} | {{#vardefine:maxSelectionWeight | {{#var:attack5InitialSelectionWeight }} }} }} }}<!--
 
-->{{#if: {{#var:attack6Type }} | {{#ifexpr: {{#var:maxSelectionWeight}} < {{#var:attack6InitialSelectionWeight }} | {{#vardefine:maxSelectionWeight | {{#var:attack6InitialSelectionWeight }} }} }} }}<!--
 
-->{{#if: {{#var:attack7Type }} | {{#ifexpr: {{#var:maxSelectionWeight}} < {{#var:attack7InitialSelectionWeight }} | {{#vardefine:maxSelectionWeight | {{#var:attack7InitialSelectionWeight }} }} }} }}<!--
 
-->{{#if: {{#var:attack8Type }} | {{#ifexpr: {{#var:maxSelectionWeight}} < {{#var:attack8InitialSelectionWeight }} | {{#vardefine:maxSelectionWeight | {{#var:attack8InitialSelectionWeight }} }} }} }}<!--
 
-->{{#if: {{#var:attack9Type }} | {{#ifexpr: {{#var:maxSelectionWeight}} < {{#var:attack9InitialSelectionWeight }} | {{#vardefine:maxSelectionWeight | {{#var:attack9InitialSelectionWeight }} }} }} }}<!--
 
-->{{#if: {{#var:attack10Type}} | {{#ifexpr: {{#var:maxSelectionWeight}} < {{#var:attack10InitialSelectionWeight}} | {{#vardefine:maxSelectionWeight | {{#var:attack10InitialSelectionWeight}} }} }} }}<!--
 
-->{{#if: {{#var:attack11Type}} | {{#ifexpr: {{#var:maxSelectionWeight}} < {{#var:attack11InitialSelectionWeight}} | {{#vardefine:maxSelectionWeight | {{#var:attack11InitialSelectionWeight}} }} }}<!--
 
-->{{#if: {{#var:attack12Type}} | {{#ifexpr: {{#var:maxSelectionWeight}} < {{#var:attack12InitialSelectionWeight}} | {{#vardefine:maxSelectionWeight | {{#var:attack12InitialSelectionWeight}} }} }} }} }}<!--
 
 
 
2.3 Categorize attacks relative to highest initial selection weight into best/mid/worst
 
2.3.1 Weapon attacks
 
-->{{#if: {{#var:attack1Type }} |
 
{{#vardefine:attack1SelectionCategory  | {{#ifexpr: {{#var:attack1InitialSelectionWeight }} >= 0.95*{{#var:maxSelectionWeight}} | best {{#vardefine:numBestAttacks | {{#expr: {{#var:numBestAttacks}}+1}} }} | {{#ifexpr: {{#var:attack1InitialSelectionWeight }} < 0.25*{{#var:maxSelectionWeight}} | worst | mid {{#vardefine:numMidAttacks | {{#expr: {{#var:numMidAttacks}}+1}} }} }} }} }}<!--
 
-->{{#if: {{#var:attack2Type }} |
 
{{#vardefine:attack2SelectionCategory  | {{#ifexpr: {{#var:attack2InitialSelectionWeight }} >= 0.95*{{#var:maxSelectionWeight}} | best {{#vardefine:numBestAttacks | {{#expr: {{#var:numBestAttacks}}+1}} }} | {{#ifexpr: {{#var:attack2InitialSelectionWeight }} < 0.25*{{#var:maxSelectionWeight}} | worst | mid {{#vardefine:numMidAttacks | {{#expr: {{#var:numMidAttacks}}+1}} }} }} }} }}<!--
 
-->{{#if: {{#var:attack3Type }} |
 
{{#vardefine:attack3SelectionCategory  | {{#ifexpr: {{#var:attack3InitialSelectionWeight }} >= 0.95*{{#var:maxSelectionWeight}} | best {{#vardefine:numBestAttacks | {{#expr: {{#var:numBestAttacks}}+1}} }} | {{#ifexpr: {{#var:attack3InitialSelectionWeight }} < 0.25*{{#var:maxSelectionWeight}} | worst | mid {{#vardefine:numMidAttacks | {{#expr: {{#var:numMidAttacks}}+1}} }} }} }} }}<!--
 
-->{{#if: {{#var:attack4Type }} |
 
{{#vardefine:attack4SelectionCategory  | {{#ifexpr: {{#var:attack4InitialSelectionWeight }} >= 0.95*{{#var:maxSelectionWeight}} | best {{#vardefine:numBestAttacks | {{#expr: {{#var:numBestAttacks}}+1}} }} | {{#ifexpr: {{#var:attack4InitialSelectionWeight }} < 0.25*{{#var:maxSelectionWeight}} | worst | mid {{#vardefine:numMidAttacks | {{#expr: {{#var:numMidAttacks}}+1}} }} }} }} }} }} }} }} }}<!--
 
2.3.2 Pawn attacks
 
-->{{#if: {{#var:attack5Type  | {{#var: 5}} }} |
 
{{#vardefine:attack5SelectionCategory  | {{#ifexpr: {{#var:attack5InitialSelectionWeight }} >= 0.95*{{#var:maxSelectionWeight}} | best {{#vardefine:numBestAttacks | {{#expr: {{#var:numBestAttacks}}+1}} }} | {{#ifexpr: {{#var:attack5InitialSelectionWeight }} < 0.25*{{#var:maxSelectionWeight}} | worst | mid {{#vardefine:numMidAttacks | {{#expr: {{#var:numMidAttacks}}+1}} }} }} }} }}<!--
 
-->{{#if: {{#var:attack6Type  | {{#var: 6}} }} |
 
{{#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}} }} }} }} }}<!--
 
-->{{#if: {{#var:attack7Type  | {{#var: 7}} }} |
 
{{#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  | {{#var: 8}} }} |
 
{{#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  | {{#var: 9}} }} |
 
{{#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 | {{#var:10}} }} |
 
{{#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
 
Sometimes there is no mid category, in which case it controls 100% of the selection chance, instead of only 75%
 
-->{{#vardefine:bestCategoryPercentage| {{#ifeq: {{#var:numMidAttacks}} | 0 | 1 | 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.
 
-->{{#if: {{#var:attack1Type                }} | {{#vardefine:attack1SelectionChance | {{#expr: {{#switch: {{#var:attack1SelectionCategory }} | mid = 0.25 / {{#var:numMidAttacks}} | best = {{#var:bestCategoryPercentage}} / {{#var:numBestAttacks}} | 0 }} }} }}<!--
 
-->{{#if: {{#var:attack2Type                }} | {{#vardefine:attack2SelectionChance | {{#expr: {{#switch: {{#var:attack2SelectionCategory }} | mid = 0.25 / {{#var:numMidAttacks}} | best = {{#var:bestCategoryPercentage}} / {{#var:numBestAttacks}} | 0 }} }} }}<!--
 
-->{{#if: {{#var:attack3Type                }} | {{#vardefine:attack3SelectionChance | {{#expr: {{#switch: {{#var:attack3SelectionCategory }} | mid = 0.25 / {{#var:numMidAttacks}} | best = {{#var:bestCategoryPercentage}} / {{#var:numBestAttacks}} | 0 }} }} }}<!--
 
-->{{#if: {{#var:attack4Type                }} | {{#vardefine:attack4SelectionChance | {{#expr: {{#switch: {{#var:attack4SelectionCategory }} | mid = 0.25 / {{#var:numMidAttacks}} | best = {{#var:bestCategoryPercentage}} / {{#var:numBestAttacks}} | 0 }} }} }} }} }} }} }}<!--
 
-->{{#if: {{#var:attack5Type  | {{#var: 5}} }} | {{#vardefine:attack5SelectionChance | {{#expr: {{#switch: {{#var:attack5SelectionCategory }} | mid = 0.25 / {{#var:numMidAttacks}} | best = {{#var:bestCategoryPercentage}} / {{#var:numBestAttacks}} | 0 }} }} }}<!--
 
-->{{#if: {{#var:attack6Type  | {{#var: 6}} }} | {{#vardefine:attack6SelectionChance | {{#expr: {{#switch: {{#var:attack6SelectionCategory }} | mid = 0.25 / {{#var:numMidAttacks}} | best = {{#var:bestCategoryPercentage}} / {{#var:numBestAttacks}} | 0 }} }} }}<!--
 
-->{{#if: {{#var:attack7Type  | {{#var: 7}} }} | {{#vardefine:attack7SelectionChance | {{#expr: {{#switch: {{#var:attack7SelectionCategory }} | mid = 0.25 / {{#var:numMidAttacks}} | best = {{#var:bestCategoryPercentage}} / {{#var:numBestAttacks}} | 0 }} }} }}<!--
 
-->{{#if: {{#var:attack8Type  | {{#var: 8}} }} | {{#vardefine:attack8SelectionChance | {{#expr: {{#switch: {{#var:attack8SelectionCategory }} | mid = 0.25 / {{#var:numMidAttacks}} | best = {{#var:bestCategoryPercentage}} / {{#var:numBestAttacks}} | 0 }} }} }}<!--
 
-->{{#if: {{#var:attack9Type  | {{#var: 9}} }} | {{#vardefine:attack9SelectionChance | {{#expr: {{#switch: {{#var:attack9SelectionCategory }} | mid = 0.25 / {{#var:numMidAttacks}} | best = {{#var:bestCategoryPercentage}} / {{#var:numBestAttacks}} | 0 }} }} }}<!--
 
-->{{#if: {{#var:attack10Type | {{#var:10}} }} | {{#vardefine:attack10SelectionChance| {{#expr: {{#switch: {{#var:attack10SelectionCategory}} | mid = 0.25 / {{#var:numMidAttacks}} | best = {{#var:bestCategoryPercentage}} / {{#var:numBestAttacks}} | 0 }} }} }}<!--
 
-->{{#if: {{#var:attack11Type              }} | {{#vardefine:attack11SelectionChance| {{#expr: {{#switch: {{#var:attack11SelectionCategory}} | mid = 0.25 / {{#var:numMidAttacks}} | best = {{#var:bestCategoryPercentage}} / {{#var:numBestAttacks}} | 0 }} }} }}<!--
 
-->{{#if: {{#var:attack12Type              }} | {{#vardefine:attack12SelectionChance| {{#expr: {{#switch: {{#var:attack12SelectionCategory}} | mid = 0.25 / {{#var:numMidAttacks}} | best = {{#var:bestCategoryPercentage}} / {{#var:numBestAttacks}} | 0 }} }} }} }} }} }} }} }} }} }} }}<!--
 
 
 
2.5 Calculate actual DPS
 
(bestDamage*bestSelectionWeight + midDamage*midSelectionWeight) / (bestCooldownTime*bestSelectionWeight + midCoolDownTime*midSelectionWeight) = DPS
 
-->{{#vardefine:weightedDamageTotal | {{#expr: 0
 
    {{#if: {{#var:attack1Type                }} | +{{#vardefineecho:attack1WeightedDamage  | {{#expr: {{#var:attack1Damage }} * {{#var:attack1SelectionChance }} }} }}
 
    {{#if: {{#var:attack2Type                }} | +{{#vardefineecho:attack2WeightedDamage  | {{#expr: {{#var:attack2Damage }} * {{#var:attack2SelectionChance }} }} }}
 
    {{#if: {{#var:attack3Type                }} | +{{#vardefineecho:attack3WeightedDamage  | {{#expr: {{#var:attack3Damage }} * {{#var:attack3SelectionChance }} }} }}
 
    {{#if: {{#var:attack4Type                }} | +{{#vardefineecho:attack4WeightedDamage  | {{#expr: {{#var:attack4Damage }} * {{#var:attack4SelectionChance }} }} }} }} }} }} }}
 
    {{#if: {{#var:attack5Type  | {{#var: 5}} }} | +{{#vardefineecho:attack5WeightedDamage  | {{#expr: {{#var:attack5Damage }} * {{#var:attack5SelectionChance }} }} }}
 
    {{#if: {{#var:attack6Type  | {{#var: 6}} }} | +{{#vardefineecho:attack6WeightedDamage  | {{#expr: {{#var:attack6Damage }} * {{#var:attack6SelectionChance }} }} }}
 
    {{#if: {{#var:attack7Type  | {{#var: 7}} }} | +{{#vardefineecho:attack7WeightedDamage  | {{#expr: {{#var:attack7Damage }} * {{#var:attack7SelectionChance }} }} }}
 
    {{#if: {{#var:attack8Type  | {{#var: 8}} }} | +{{#vardefineecho:attack8WeightedDamage  | {{#expr: {{#var:attack8Damage }} * {{#var:attack8SelectionChance }} }} }}
 
    {{#if: {{#var:attack9Type  | {{#var: 9}} }} | +{{#vardefineecho:attack9WeightedDamage  | {{#expr: {{#var:attack9Damage }} * {{#var:attack9SelectionChance }} }} }}
 
    {{#if: {{#var:attack10Type | {{#var:10}} }} | +{{#vardefineecho:attack10WeightedDamage | {{#expr: {{#var:attack10Damage}} * {{#var:attack10SelectionChance}} }} }}
 
    {{#if: {{#var:attack11Type              }} | +{{#vardefineecho:attack11WeightedDamage | {{#expr: {{#var:attack11Damage}} * {{#var:attack11SelectionChance}} }} }}
 
    {{#if: {{#var:attack12Type              }} | +{{#vardefineecho:attack12WeightedDamage | {{#expr: {{#var:attack12Damage}} * {{#var:attack12SelectionChance}} }} }} }} }} }} }} }} }} }} }}
 
}} }}<!--
 
-->{{#vardefine:weightedTimeTotal | {{#expr: 0
 
    {{#if: {{#var:attack1Type                }} | +{{#vardefineecho:attack1WeightedCooldown  | {{#expr: {{#var:attack1Cooldown }} * {{#var:attack1SelectionChance }} }} }}
 
    {{#if: {{#var:attack2Type                }} | +{{#vardefineecho:attack2WeightedCooldown  | {{#expr: {{#var:attack2Cooldown }} * {{#var:attack2SelectionChance }} }} }}
 
    {{#if: {{#var:attack3Type                }} | +{{#vardefineecho:attack3WeightedCooldown  | {{#expr: {{#var:attack3Cooldown }} * {{#var:attack3SelectionChance }} }} }}
 
    {{#if: {{#var:attack4Type                }} | +{{#vardefineecho:attack4WeightedCooldown  | {{#expr: {{#var:attack4Cooldown }} * {{#var:attack4SelectionChance }} }} }} }} }} }} }}
 
    {{#if: {{#var:attack5Type  | {{#var: 5}} }} | +{{#vardefineecho:attack5WeightedCooldown  | {{#expr: {{#var:attack5Cooldown }} * {{#var:attack5SelectionChance }} }} }}
 
    {{#if: {{#var:attack6Type  | {{#var: 6}} }} | +{{#vardefineecho:attack6WeightedCooldown  | {{#expr: {{#var:attack6Cooldown }} * {{#var:attack6SelectionChance }} }} }}
 
    {{#if: {{#var:attack7Type  | {{#var: 7}} }} | +{{#vardefineecho:attack7WeightedCooldown  | {{#expr: {{#var:attack7Cooldown }} * {{#var:attack7SelectionChance }} }} }}
 
    {{#if: {{#var:attack8Type  | {{#var: 8}} }} | +{{#vardefineecho:attack8WeightedCooldown  | {{#expr: {{#var:attack8Cooldown }} * {{#var:attack8SelectionChance }} }} }}
 
    {{#if: {{#var:attack9Type  | {{#var: 9}} }} | +{{#vardefineecho:attack9WeightedCooldown  | {{#expr: {{#var:attack9Cooldown }} * {{#var:attack9SelectionChance }} }} }}
 
    {{#if: {{#var:attack10Type | {{#var:10}} }} | +{{#vardefineecho:attack10WeightedCooldown | {{#expr: {{#var:attack10Cooldown}} * {{#var:attack10SelectionChance}} }} }}
 
    {{#if: {{#var:attack11Type              }} | +{{#vardefineecho:attack11WeightedCooldown | {{#expr: {{#var:attack11Cooldown}} * {{#var:attack11SelectionChance}} }} }}
 
    {{#if: {{#var:attack12Type              }} | +{{#vardefineecho:attack12WeightedCooldown | {{#expr: {{#var:attack12Cooldown}} * {{#var:attack12SelectionChance}} }} }} }} }} }} }} }} }} }} }}
 
}} }}<!--
 
-->{{#vardefine:trueDPS | {{#expr:{{#var:weightedDamageTotal}}/{{#var:weightedTimeTotal}} round 2}} }}<!--
 
 
 
2.6 Calculate actual average AP
 
-->{{#vardefine:trueAP | {{#expr: 0
 
    {{#if: {{#var:attack1Type                }} | +{{#vardefineecho:attack1WeightedAP  | {{#expr: {{#var:attack1AP }} * {{#var:attack1SelectionChance }} }} }}
 
    {{#if: {{#var:attack2Type                }} | +{{#vardefineecho:attack2WeightedAP  | {{#expr: {{#var:attack2AP }} * {{#var:attack2SelectionChance }} }} }}
 
    {{#if: {{#var:attack3Type                }} | +{{#vardefineecho:attack3WeightedAP  | {{#expr: {{#var:attack3AP }} * {{#var:attack3SelectionChance }} }} }}
 
    {{#if: {{#var:attack4Type                }} | +{{#vardefineecho:attack4WeightedAP  | {{#expr: {{#var:attack4AP }} * {{#var:attack4SelectionChance }} }} }} }} }} }} }}
 
    {{#if: {{#var:attack5Type  | {{#var: 5}} }} | +{{#vardefineecho:attack5WeightedAP  | {{#expr: {{#var:attack5AP }} * {{#var:attack5SelectionChance }} }} }}
 
    {{#if: {{#var:attack6Type  | {{#var: 6}} }} | +{{#vardefineecho:attack6WeightedAP  | {{#expr: {{#var:attack6AP }} * {{#var:attack6SelectionChance }} }} }}
 
    {{#if: {{#var:attack7Type  | {{#var: 7}} }} | +{{#vardefineecho:attack7WeightedAP  | {{#expr: {{#var:attack7AP }} * {{#var:attack7SelectionChance }} }} }}
 
    {{#if: {{#var:attack8Type  | {{#var: 8}} }} | +{{#vardefineecho:attack8WeightedAP  | {{#expr: {{#var:attack8AP }} * {{#var:attack8SelectionChance }} }} }}
 
    {{#if: {{#var:attack9Type  | {{#var: 9}} }} | +{{#vardefineecho:attack9WeightedAP  | {{#expr: {{#var:attack9AP }} * {{#var:attack9SelectionChance }} }} }}
 
    {{#if: {{#var:attack10Type | {{#var:10}} }} | +{{#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}} }}<!--
 
  
3. RETURNED VALUE
+
RETURNED VALUE
 
-->{{#var:trueDPS}}</includeonly><noinclude>
 
-->{{#var:trueDPS}}</includeonly><noinclude>
 +
{{Recode|reason = Update to allow for adding weapon verb sets to pawn verb sets}}
 
{{Documentation}}
 
{{Documentation}}
<!--{{True Melee DPS Calculator|Longsword|Gold|Good|Human}} Example for most common use case. Enable this line and disable Documentation for performance testing. -->
 
 
</noinclude>
 
</noinclude>

Please note that all contributions to RimWorld Wiki are considered to be released under the CC BY-SA 3.0 (see RimWorld Wiki:Copyrights for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource. Do not submit copyrighted work without permission!

Cancel Editing help (opens in new window)