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

From RimWorld Wiki
Jump to navigation Jump to search
Line 1: Line 1:
 
{{#vardefine:name | {{{ 1 | {{PAGENAME}}}}} }}
 
{{#vardefine:name | {{{ 1 | {{PAGENAME}}}}} }}
 
 
{{#vardefine:material | {{{2|}}} }}
 
{{#vardefine:material | {{{2|}}} }}
 
 
{{#switch: {{#lc:{{{ 3 |}}}}}
 
{{#switch: {{#lc:{{{ 3 |}}}}}
 
  | awful =      {{#vardefine:qualityFactor | 0.80}}
 
  | awful =      {{#vardefine:qualityFactor | 0.80}}
Line 13: Line 11:
 
  | #default  =  {{#vardefine:qualityFactor | 1.00}}
 
  | #default  =  {{#vardefine:qualityFactor | 1.00}}
 
}}
 
}}
 
+
<noinclude>
 
{{#vardefine:name | Persona monosword}}
 
{{#vardefine:name | Persona monosword}}
 
{{#vardefine:qualityFactor | 1.45}}
 
{{#vardefine:qualityFactor | 1.45}}
Line 24: Line 22:
 
{{#vardefine:material | plasteel}}
 
{{#vardefine:material | plasteel}}
  
 +
{{#vardefine:name | Gladius }}
 +
{{#vardefine:qualityFactor | 1.0}}
 +
{{#vardefine:material | steel}}
 +
 +
</noinclude>
 
{{#switch: {{Q|{{#var: name}}|Attack 1 Type}}
 
{{#switch: {{Q|{{#var: name}}|Attack 1 Type}}
 
| Cut
 
| Cut
Line 46: Line 49:
 
| {{Error|Unrecognised Damage Type: {{Q|{{#var: name}}|Attack 1 Type}}}}
 
| {{Error|Unrecognised Damage Type: {{Q|{{#var: name}}|Attack 1 Type}}}}
 
}}
 
}}
 +
{{#vardefine: attack1InitialSelectionWeight | {{#expr: {{#var:attack1Damage}} * (1 + {{#var:attack1AP}}) * {{Q|{{#var: name}}|Attack 1 Chance Factor|1}} / ({{Q|{{#var: name}}|Attack 1 Cooldown}}*{{Q|{{#var: material}}|Melee Cooldown Factor|1}}) round 1}} }}
  
 +
{{#if: {{Q|{{#var: name}}|Attack 2 Type}}|
 
{{#switch: {{Q|{{#var: name}}|Attack 2 Type}}
 
{{#switch: {{Q|{{#var: name}}|Attack 2 Type}}
 
| Cut
 
| Cut
Line 69: Line 74:
 
| {{Error|Unrecognised Damage Type: {{Q|{{#var: name}}|Attack 2 Type}}}}
 
| {{Error|Unrecognised Damage Type: {{Q|{{#var: name}}|Attack 2 Type}}}}
 
}}
 
}}
 +
{{#vardefine: attack2InitialSelectionWeight | {{#expr: {{#var:attack2Damage}} * (1 + {{#var:attack2AP}}) * {{Q|{{#var: name}}|Attack 2 Chance Factor|1}} / ({{Q|{{#var: name}}|Attack 2 Cooldown}}*{{Q|{{#var: material}}|Melee Cooldown Factor|1}}) round 1}} }}
 +
}}
 +
 +
{{#if: {{Q|{{#var: name}}|Attack 3 Type}}|
 
{{#switch: {{Q|{{#var: name}}|Attack 3 Type}}
 
{{#switch: {{Q|{{#var: name}}|Attack 3 Type}}
 
| Cut
 
| Cut
Line 91: Line 100:
 
| {{Error|Unrecognised Damage Type: {{Q|{{#var: name}}|Attack 3 Type}}}}
 
| {{Error|Unrecognised Damage Type: {{Q|{{#var: name}}|Attack 3 Type}}}}
 
}}
 
}}
 +
{{#vardefine: attack3InitialSelectionWeight | {{#expr: {{#var:attack3Damage}} * (1 + {{#var:attack3AP}}) * {{Q|{{#var: name}}|Attack 3 Chance Factor|1}} / ({{Q|{{#var: name}}|Attack 3 Cooldown}}*{{Q|{{#var: material}}|Melee Cooldown Factor|1}}) round 1}} }}
 +
}}
 +
 +
{{#if: {{Q|{{#var: name}}|Attack 4 Type}}|
 
{{#switch: {{Q|{{#var: name}}|Attack 4 Type}}
 
{{#switch: {{Q|{{#var: name}}|Attack 4 Type}}
 
| Cut
 
| Cut
Line 113: Line 126:
 
| {{Error|Unrecognised Damage Type: {{Q|{{#var: name}}|Attack 4 Type}}}}
 
| {{Error|Unrecognised Damage Type: {{Q|{{#var: name}}|Attack 4 Type}}}}
 
}}
 
}}
 
{{#vardefine: attack1InitialSelectionWeight | {{#expr: {{#var:attack1Damage}} * (1 + {{#var:attack1AP}}) * {{Q|{{#var: name}}|Attack 1 Chance Factor|1}} / ({{Q|{{#var: name}}|Attack 1 Cooldown}}*{{Q|{{#var: material}}|Melee Cooldown Factor|1}}) round 1}} }}
 
{{#vardefine: attack2InitialSelectionWeight | {{#expr: {{#var:attack2Damage}} * (1 + {{#var:attack2AP}}) * {{Q|{{#var: name}}|Attack 2 Chance Factor|1}} / ({{Q|{{#var: name}}|Attack 2 Cooldown}}*{{Q|{{#var: material}}|Melee Cooldown Factor|1}}) round 1}} }}
 
{{#vardefine: attack3InitialSelectionWeight | {{#expr: {{#var:attack3Damage}} * (1 + {{#var:attack3AP}}) * {{Q|{{#var: name}}|Attack 3 Chance Factor|1}} / ({{Q|{{#var: name}}|Attack 3 Cooldown}}*{{Q|{{#var: material}}|Melee Cooldown Factor|1}}) round 1}} }}
 
 
{{#vardefine: attack4InitialSelectionWeight | {{#expr: {{#var:attack4Damage}} * (1 + {{#var:attack4AP}}) * {{Q|{{#var: name}}|Attack 4 Chance Factor|1}} / ({{Q|{{#var: name}}|Attack 4 Cooldown}}*{{Q|{{#var: material}}|Melee Cooldown Factor|1}}) round 1}} }}
 
{{#vardefine: attack4InitialSelectionWeight | {{#expr: {{#var:attack4Damage}} * (1 + {{#var:attack4AP}}) * {{Q|{{#var: name}}|Attack 4 Chance Factor|1}} / ({{Q|{{#var: name}}|Attack 4 Cooldown}}*{{Q|{{#var: material}}|Melee Cooldown Factor|1}}) round 1}} }}
 +
}}
  
  
{{#var: attack1InitialSelectionWeight}}
 
  
{{#var: attack2InitialSelectionWeight}}
 
  
{{#var: attack3InitialSelectionWeight}}
 
  
{{#var: attack4InitialSelectionWeight}}
 
  
{{#vardefine: maxSelectionWeight | {{#ifexpr: {{#var: attack1InitialSelectionWeight}} > {{#var: attack2InitialSelectionWeight}} | {{#var: attack1InitialSelectionWeight}} | {{#var: attack2InitialSelectionWeight}} }} }}
+
{{#vardefine: maxSelectionWeight | {{#ifexpr: {{#var: attack1InitialSelectionWeight}} > {{#var: attack2InitialSelectionWeight|0}} | {{#var: attack1InitialSelectionWeight}} | {{#var: attack2InitialSelectionWeight}} }} }}
{{#ifexpr: {{#var: maxSelectionWeight}} < {{#var: attack3InitialSelectionWeight}} | {{#vardefine: maxSelectionWeight| {{#var: attack3InitialSelectionWeight}} }} }}
+
{{#ifexpr: {{#var: maxSelectionWeight}} < {{#var: attack3InitialSelectionWeight|0}} | {{#vardefine: maxSelectionWeight| {{#var: attack3InitialSelectionWeight}} }} }}
{{#ifexpr: {{#var: maxSelectionWeight}} < {{#var: attack4InitialSelectionWeight}} | {{#vardefine: maxSelectionWeight| {{#var: attack4InitialSelectionWeight}} }} }}
+
{{#ifexpr: {{#var: maxSelectionWeight}} < {{#var: attack4InitialSelectionWeight|0}} | {{#vardefine: maxSelectionWeight| {{#var: attack4InitialSelectionWeight}} }} }}
  
 
{{#vardefine: numBestAttacks | 0}}
 
{{#vardefine: numBestAttacks | 0}}
 
{{#vardefine: numMidAttacks | 0}}
 
{{#vardefine: numMidAttacks | 0}}
  
{{Q|{{#var:name}}|Attack 1 Part}} = {{#ifexpr: {{#var: attack1InitialSelectionWeight}} > (0.95*{{#var: maxSelectionWeight}}) or {{#var: attack1InitialSelectionWeight}} = (0.95*{{#var: maxSelectionWeight}}) | Best {{#vardefine: numBestAttacks | {{#expr: {{#var: numBestAttacks}}+1}}}} {{#vardefine: attack1SelectionCategory | best }}|  
+
{{#ifexpr: {{#var: attack1InitialSelectionWeight}} > (0.95*{{#var: maxSelectionWeight}}) or {{#var: attack1InitialSelectionWeight}} = (0.95*{{#var: maxSelectionWeight}}) | Best {{#vardefine: numBestAttacks | {{#expr: {{#var: numBestAttacks}}+1}}}} {{#vardefine: attack1SelectionCategory | best }}|  
 
{{#ifexpr: {{#var: attack1InitialSelectionWeight}} < (0.25*{{#var: maxSelectionWeight}}) | Worst | Mid  {{#vardefine: numMidAttacks | {{#expr: {{#var: numMidAttacks}}+1}}}} {{#vardefine: attack1SelectionCategory | mid }}}}
 
{{#ifexpr: {{#var: attack1InitialSelectionWeight}} < (0.25*{{#var: maxSelectionWeight}}) | Worst | Mid  {{#vardefine: numMidAttacks | {{#expr: {{#var: numMidAttacks}}+1}}}} {{#vardefine: attack1SelectionCategory | mid }}}}
}} {{#var:attack1SelectionCategory}}
+
}}
  
{{Q|{{#var:name}}|Attack 2 Part}} = {{#ifexpr: {{#var: attack2InitialSelectionWeight}} > (0.95*{{#var: maxSelectionWeight}}) or {{#var: attack2InitialSelectionWeight}} = (0.95*{{#var: maxSelectionWeight}}) | Best {{#vardefine: numBestAttacks | {{#expr: {{#var: numBestAttacks}}+1}}}} {{#vardefine: attack2SelectionCategory | best }}|  
+
{{#if: {{Q|{{#var: name}}|Attack 2 Type}}|
 +
{{#ifexpr: {{#var: attack2InitialSelectionWeight}} > (0.95*{{#var: maxSelectionWeight}}) or {{#var: attack2InitialSelectionWeight}} = (0.95*{{#var: maxSelectionWeight}}) | Best {{#vardefine: numBestAttacks | {{#expr: {{#var: numBestAttacks}}+1}}}} {{#vardefine: attack2SelectionCategory | best }}|  
 
{{#ifexpr: {{#var: attack2InitialSelectionWeight}} < (0.25*{{#var: maxSelectionWeight}}) | Worst | Mid  {{#vardefine: numMidAttacks | {{#expr: {{#var: numMidAttacks}}+1}}}} {{#vardefine: attack2SelectionCategory | mid }}}}
 
{{#ifexpr: {{#var: attack2InitialSelectionWeight}} < (0.25*{{#var: maxSelectionWeight}}) | Worst | Mid  {{#vardefine: numMidAttacks | {{#expr: {{#var: numMidAttacks}}+1}}}} {{#vardefine: attack2SelectionCategory | mid }}}}
}} {{#var:attack2SelectionCategory}}
+
}}
 +
}}
  
{{Q|{{#var:name}}|Attack 3 Part}} = {{#ifexpr: {{#var: attack3InitialSelectionWeight}} > (0.95*{{#var: maxSelectionWeight}}) or {{#var: attack3InitialSelectionWeight}} = (0.95*{{#var: maxSelectionWeight}}) | Best {{#vardefine: numBestAttacks | {{#expr: {{#var: numBestAttacks}}+1}}}} {{#vardefine: attack3SelectionCategory | best }}|  
+
{{#if: {{Q|{{#var: name}}|Attack 3 Type}}|
 +
{{#ifexpr: {{#var: attack3InitialSelectionWeight}} > (0.95*{{#var: maxSelectionWeight}}) or {{#var: attack3InitialSelectionWeight}} = (0.95*{{#var: maxSelectionWeight}}) | Best {{#vardefine: numBestAttacks | {{#expr: {{#var: numBestAttacks}}+1}}}} {{#vardefine: attack3SelectionCategory | best }}|  
 
{{#ifexpr: {{#var: attack3InitialSelectionWeight}} < (0.25*{{#var: maxSelectionWeight}}) | Worst | Mid  {{#vardefine: numMidAttacks | {{#expr: {{#var: numMidAttacks}}+1}}}} {{#vardefine: attack3SelectionCategory | mid }}}}
 
{{#ifexpr: {{#var: attack3InitialSelectionWeight}} < (0.25*{{#var: maxSelectionWeight}}) | Worst | Mid  {{#vardefine: numMidAttacks | {{#expr: {{#var: numMidAttacks}}+1}}}} {{#vardefine: attack3SelectionCategory | mid }}}}
}} {{#var:attack3SelectionCategory}}
+
}}
 +
}}
  
{{Q|{{#var:name}}|Attack 4 Part}} = {{#ifexpr: {{#var: attack4InitialSelectionWeight}} > (0.95*{{#var: maxSelectionWeight}}) or {{#var: attack4InitialSelectionWeight}} = (0.95*{{#var: maxSelectionWeight}}) | Best {{#vardefine: numBestAttacks | {{#expr: {{#var: numBestAttacks}}+1}}}} {{#vardefine: attack4SelectionCategory | best }}|  
+
{{#if: {{Q|{{#var: name}}|Attack 4 Type}}|
 +
{{#ifexpr: {{#var: attack4InitialSelectionWeight}} > (0.95*{{#var: maxSelectionWeight}}) or {{#var: attack4InitialSelectionWeight}} = (0.95*{{#var: maxSelectionWeight}}) | Best {{#vardefine: numBestAttacks | {{#expr: {{#var: numBestAttacks}}+1}}}} {{#vardefine: attack4SelectionCategory | best }}|  
 
{{#ifexpr: {{#var: attack4InitialSelectionWeight}} < (0.25*{{#var: maxSelectionWeight}}) | Worst | Mid  {{#vardefine: numMidAttacks | {{#expr: {{#var: numMidAttacks}}+1}}}} {{#vardefine: attack4SelectionCategory | mid }}}}
 
{{#ifexpr: {{#var: attack4InitialSelectionWeight}} < (0.25*{{#var: maxSelectionWeight}}) | Worst | Mid  {{#vardefine: numMidAttacks | {{#expr: {{#var: numMidAttacks}}+1}}}} {{#vardefine: attack4SelectionCategory | mid }}}}
}} {{#var:attack4SelectionCategory}}
+
}}
 +
}}
 +
 
 +
<!--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}}}}  
 +
 
 +
 
 +
 
 +
 
  
  
  
<!--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}}}}
 
  
True DPS =
+
{{#vardefine:trueDPS| {{#expr: ({{Q|{{#var:name}}|Attack 1 Damage}}/{{Q|{{#var:name}}|Attack 1 Cooldown}} * {{#ifeq: {{#var:attack1SelectionCategory}} | best | ({{#var:bestCategoryPercentage}}/{{#var: numBestAttacks}}) | {{#ifeq: {{#var:attack1SelectionCategory}} | mid | (0.25/{{#var: numMidAttacks}}) | 0}} }})<!--
  
({{Q|{{#var:name}}|Attack 1 Damage}}/{{Q|{{#var:name}}|Attack 1 Cooldown}} * {{#ifeq: {{#var:attack1SelectionCategory}} | best | ({{#var:bestCategoryPercentage}}/{{#var: numBestAttacks}}) | {{#ifeq: {{#var:attack1SelectionCategory}} | mid | (0.25/{{#var: numMidAttacks}}) | 0}} }})+
+
-->{{#if: {{Q|{{#var: name}}|Attack 2 Type}}|+({{Q|{{#var:name}}|Attack 2 Damage}}/{{Q|{{#var:name}}|Attack 2 Cooldown}} * {{#ifeq: {{#var:attack2SelectionCategory}} | best | ({{#var:bestCategoryPercentage}}/{{#var: numBestAttacks}}) | {{#ifeq: {{#var:attack2SelectionCategory}} | mid | (0.25/{{#var: numMidAttacks}}) | 0}} }})
 +
}}<!--
  
({{Q|{{#var:name}}|Attack 2 Damage}}/{{Q|{{#var:name}}|Attack 2 Cooldown}} * {{#ifeq: {{#var:attack2SelectionCategory}} | best | ({{#var:bestCategoryPercentage}}/{{#var: numBestAttacks}}) | {{#ifeq: {{#var:attack2SelectionCategory}} | mid | (0.25/{{#var: numMidAttacks}}) | 0}} }})+
+
-->{{#if: {{Q|{{#var: name}}|Attack 3 Type}}|+({{Q|{{#var:name}}|Attack 3 Damage}}/{{Q|{{#var:name}}|Attack 3 Cooldown}} * {{#ifeq: {{#var:attack3SelectionCategory}} | best | ({{#var:bestCategoryPercentage}}/{{#var: numBestAttacks}}) | {{#ifeq: {{#var:attack3SelectionCategory}} | mid | (0.25/{{#var: numMidAttacks}}) | 0}} }})
 +
}}<!--
  
({{Q|{{#var:name}}|Attack 3 Damage}}/{{Q|{{#var:name}}|Attack 3 Cooldown}} * {{#ifeq: {{#var:attack3SelectionCategory}} | best | ({{#var:bestCategoryPercentage}}/{{#var: numBestAttacks}}) | {{#ifeq: {{#var:attack3SelectionCategory}} | mid | (0.25/{{#var: numMidAttacks}}) | 0}} }}) +
+
-->{{#if: {{Q|{{#var: name}}|Attack 4 Type}}|+({{Q|{{#var:name}}|Attack 4 Damage}}/{{Q|{{#var:name}}|Attack 4 Cooldown}} * {{#ifeq: {{#var:attack4SelectionCategory}} | best | ({{#var:bestCategoryPercentage}}/{{#var: numBestAttacks}}) | {{#ifeq: {{#var:attack4SelectionCategory}} | mid | (0.25/{{#var: numMidAttacks}}) | 0}} }})
 +
}}
 +
}}
 +
}}
 +
{{#vardefine:trueAP| {{#expr: ({{Q|{{#var:name}}|Attack 1 AP}} * {{#ifeq: {{#var:attack1SelectionCategory}} | best | ({{#var:bestCategoryPercentage}}/{{#var: numBestAttacks}}) | {{#ifeq: {{#var:attack1SelectionCategory}} | mid | (0.25/{{#var: numMidAttacks}}) | 0}} }})<!--
  
({{Q|{{#var:name}}|Attack 4 Damage}}/{{Q|{{#var:name}}|Attack 4 Cooldown}} * {{#ifeq: {{#var:attack4SelectionCategory}} | best | ({{#var:bestCategoryPercentage}}/{{#var: numBestAttacks}}) | {{#ifeq: {{#var:attack4SelectionCategory}} | mid | (0.25/{{#var: numMidAttacks}}) | 0}} }})
+
-->{{#if: {{Q|{{#var: name}}|Attack 2 Type}}|+({{Q|{{#var:name}}|Attack 2 AP}} * {{#ifeq: {{#var:attack2SelectionCategory}} | best | ({{#var:bestCategoryPercentage}}/{{#var: numBestAttacks}}) | {{#ifeq: {{#var:attack2SelectionCategory}} | mid | (0.25/{{#var: numMidAttacks}}) | 0}} }})
 +
}}<!--
  
 +
-->{{#if: {{Q|{{#var: name}}|Attack 3 Type}}|+({{Q|{{#var:name}}|Attack 3 AP}} * {{#ifeq: {{#var:attack3SelectionCategory}} | best | ({{#var:bestCategoryPercentage}}/{{#var: numBestAttacks}}) | {{#ifeq: {{#var:attack3SelectionCategory}} | mid | (0.25/{{#var: numMidAttacks}}) | 0}} }})
 +
}}<!--
 +
 +
-->{{#if: {{Q|{{#var: name}}|Attack 4 Type}}|+({{Q|{{#var:name}}|Attack 4 AP}} * {{#ifeq: {{#var:attack4SelectionCategory}} | best | ({{#var:bestCategoryPercentage}}/{{#var: numBestAttacks}}) | {{#ifeq: {{#var:attack4SelectionCategory}} | mid | (0.25/{{#var: numMidAttacks}}) | 0}} }})
 +
}}
 +
}}
 +
}}
 +
<noinclude>
 +
{| class="wikitable"
 +
|-
 +
! Part name !! Weight !! Category
 +
|-
 +
| {{Q|{{#var:name}}|Attack 1 Part}} || {{#var: attack1InitialSelectionWeight}} || {{#var:attack1SelectionCategory}}
 +
|-
 +
| {{Q|{{#var:name}}|Attack 2 Part}} || {{#var: attack2InitialSelectionWeight}} || {{#var:attack2SelectionCategory}}
 +
|-
 +
| {{Q|{{#var:name}}|Attack 3 Part}} || {{#var: attack3InitialSelectionWeight}} || {{#var:attack3SelectionCategory}}
 +
|-
 +
| {{Q|{{#var:name}}|Attack 4 Part}} || {{#var: attack4InitialSelectionWeight}} || {{#var:attack4SelectionCategory}}
 +
|}
 +
True DPS = {{#var:trueDPS}}
  
True avg dam=
+
True AP = {{#var:trueAP}}
True avg Ap=
+
</noinclude>

Revision as of 14:46, 22 September 2021





















Mid

Best

Best








Part name Weight Category
Handle 5.1 mid
Point 9.9 best
Edge 9.9 best

True DPS = 7.125

True AP = 21.25