Difference between revisions of "Template:Weapon DPS Chart"

From RimWorld Wiki
Jump to navigation Jump to search
Line 1: Line 1:
 
<includeonly>{{#vardefine: name | {{{1|{{PAGENAME}} }}} }}  
 
<includeonly>{{#vardefine: name | {{{1|{{PAGENAME}} }}} }}  
 
{{#if: {{{2|}}} |  
 
{{#if: {{{2|}}} |  
 
+
{{#ifeq: {{{2|}}} | Awful |
{{#ifeq: {{{2|}}} | Awful | |
+
{{#vardefine: TouchAccuracy  | {{#ifexpr: {{ #expr: 0.8*{{Q|{{#var: name}}| Accuracy (Touch) Base}}  round 2}} > 100 | 1 | {{ #expr: 0.8*{{Q|{{#var: name}}| Accuracy (Touch) Base}}/100}}}}}}
{{#vardefine: TouchAccuracy  | {{#ifexpr: {{ #expr: 0.8*{{Q|{{#var: name}}| Accuracy (Touch) Base}}  round 2}} > 100 | 100 | {{ #expr: 0.8*{{Q|{{#var: name}}| Accuracy (Touch) Base}} round 0}}}}%}}
+
{{#vardefine: ShorthAccuracy  | {{#ifexpr: {{ #expr: 0.8*{{Q|{{#var: name}}| Accuracy (Short) Base}}  round 2}} > 100 | 1 | {{ #expr: 0.8*{{Q|{{#var: name}}| Accuracy (Short) Base}}/100}}}}}}
{{#vardefine: ShorthAccuracy  | {{#ifexpr: {{ #expr: 0.8*{{Q|{{#var: name}}| Accuracy (Short) Base}}  round 2}} > 100 | 100 | {{ #expr: 0.8*{{Q|{{#var: name}}| Accuracy (Short) Base}} round 0}}}}%}}
+
{{#vardefine: MediumAccuracy  | {{#ifexpr: {{ #expr: 0.8*{{Q|{{#var: name}}| Accuracy (Medium) Base}} round 2}} > 100 | 1 | {{ #expr: 0.8*{{Q|{{#var: name}}| Accuracy (Medium) Base}}/100}}}}}}
{{#vardefine: MediumAccuracy  | {{#ifexpr: {{ #expr: 0.8*{{Q|{{#var: name}}| Accuracy (Medium) Base}} round 2}} > 100 | 100 | {{ #expr: 0.8*{{Q|{{#var: name}}| Accuracy (Medium) Base}} round 0}}}}%}}
+
{{#vardefine: LongAccuracy    | {{#ifexpr: {{ #expr: 0.8*{{Q|{{#var: name}}| Accuracy (Long) Base}}  round 2}} > 100 | 1 | {{ #expr: 0.8*{{Q|{{#var: name}}| Accuracy (Long) Base}}/100}}}}}}
{{#vardefine: LongAccuracy    | {{#ifexpr: {{ #expr: 0.8*{{Q|{{#var: name}}| Accuracy (Long) Base}}  round 2}} > 100 | 100 | {{ #expr: 0.8*{{Q|{{#var: name}}| Accuracy (Long) Base}} round 0}}}}%}}
 
 
{{#vardefine: DPS |{{#expr: {{Q|{{#var: name}}|Maximum DPS}} }}}}
 
{{#vardefine: DPS |{{#expr: {{Q|{{#var: name}}|Maximum DPS}} }}}}
}}
+
|}}
  
{{#ifeq: {{{2|}}} | Poor | |
+
{{#ifeq: {{{2|}}} | Poor |
{{#vardefine: TouchAccuracy  | {{#ifexpr: {{ #expr: 0.9*{{Q|{{#var: name}}| Accuracy (Touch) Base}}  round 2}} > 100 | 100 | {{ #expr: 0.9*{{Q|{{#var: name}}| Accuracy (Touch) Base}} round 0}}}}%}}
+
{{#vardefine: TouchAccuracy  | {{#ifexpr: {{ #expr: 0.9*{{Q|{{#var: name}}| Accuracy (Touch) Base}}  round 2}} > 100 | 1 | {{ #expr: 0.9*{{Q|{{#var: name}}| Accuracy (Touch) Base}}/100}}}}}}
{{#vardefine: ShorthAccuracy  | {{#ifexpr: {{ #expr: 0.9*{{Q|{{#var: name}}| Accuracy (Short) Base}}  round 2}} > 100 | 100 | {{ #expr: 0.9*{{Q|{{#var: name}}| Accuracy (Short) Base}} round 0}}}}%}}
+
{{#vardefine: ShorthAccuracy  | {{#ifexpr: {{ #expr: 0.9*{{Q|{{#var: name}}| Accuracy (Short) Base}}  round 2}} > 100 | 1 | {{ #expr: 0.9*{{Q|{{#var: name}}| Accuracy (Short) Base}}/100}}}}}}
{{#vardefine: MediumAccuracy  | {{#ifexpr: {{ #expr: 0.9*{{Q|{{#var: name}}| Accuracy (Medium) Base}} round 2}} > 100 | 100 | {{ #expr: 0.9*{{Q|{{#var: name}}| Accuracy (Medium) Base}} round 0}}}}%}}
+
{{#vardefine: MediumAccuracy  | {{#ifexpr: {{ #expr: 0.9*{{Q|{{#var: name}}| Accuracy (Medium) Base}} round 2}} > 100 | 1 | {{ #expr: 0.9*{{Q|{{#var: name}}| Accuracy (Medium) Base}}/100}}}}}}
{{#vardefine: LongAccuracy    | {{#ifexpr: {{ #expr: 0.9*{{Q|{{#var: name}}| Accuracy (Long) Base}}  round 2}} > 100 | 100 | {{ #expr: 0.9*{{Q|{{#var: name}}| Accuracy (Long) Base}} round 0}}}}%}}
+
{{#vardefine: LongAccuracy    | {{#ifexpr: {{ #expr: 0.9*{{Q|{{#var: name}}| Accuracy (Long) Base}}  round 2}} > 100 | 1 | {{ #expr: 0.9*{{Q|{{#var: name}}| Accuracy (Long) Base}}/100}}}}}}
 
{{#vardefine: DPS |{{#expr: {{Q|{{#var: name}}|Maximum DPS}}}}}}
 
{{#vardefine: DPS |{{#expr: {{Q|{{#var: name}}|Maximum DPS}}}}}}
}}
+
|}}
  
{{#ifeq: {{{2|}}} | Normal | |
+
{{#ifeq: {{{2|}}} | Normal |
{{#vardefine: TouchAccuracy  | {{#ifexpr: {{ #expr: 1.0*{{Q|{{#var: name}}| Accuracy (Touch) Base}}  round 2}} > 100 | 100 | {{ #expr: 1.0*{{Q|{{#var: name}}| Accuracy (Touch) Base}} round 0}}}}%}}
+
{{#vardefine: TouchAccuracy  | {{#ifexpr: {{ #expr: 1.0*{{Q|{{#var: name}}| Accuracy (Touch) Base}}  round 2}} > 100 | 1 | {{ #expr: 1.0*{{Q|{{#var: name}}| Accuracy (Touch) Base}}/100}}}}}}
{{#vardefine: ShorthAccuracy  | {{#ifexpr: {{ #expr: 1.0*{{Q|{{#var: name}}| Accuracy (Short) Base}}  round 2}} > 100 | 100 | {{ #expr: 1.0*{{Q|{{#var: name}}| Accuracy (Short) Base}} round 0}}}}%}}
+
{{#vardefine: ShorthAccuracy  | {{#ifexpr: {{ #expr: 1.0*{{Q|{{#var: name}}| Accuracy (Short) Base}}  round 2}} > 100 | 1 | {{ #expr: 1.0*{{Q|{{#var: name}}| Accuracy (Short) Base}}/100}}}}}}
{{#vardefine: MediumAccuracy  | {{#ifexpr: {{ #expr: 1.0*{{Q|{{#var: name}}| Accuracy (Medium) Base}} round 2}} > 100 | 100 | {{ #expr: 1.0*{{Q|{{#var: name}}| Accuracy (Medium) Base}} round 0}}}}%}}
+
{{#vardefine: MediumAccuracy  | {{#ifexpr: {{ #expr: 1.0*{{Q|{{#var: name}}| Accuracy (Medium) Base}} round 2}} > 100 | 1 | {{ #expr: 1.0*{{Q|{{#var: name}}| Accuracy (Medium) Base}}/100}}}}}}
{{#vardefine: LongAccuracy    | {{#ifexpr: {{ #expr: 1.0*{{Q|{{#var: name}}| Accuracy (Long) Base}}  round 2}} > 100 | 100 | {{ #expr: 1.0*{{Q|{{#var: name}}| Accuracy (Long) Base}} round 0}}}}%}}
+
{{#vardefine: LongAccuracy    | {{#ifexpr: {{ #expr: 1.0*{{Q|{{#var: name}}| Accuracy (Long) Base}}  round 2}} > 100 | 1 | {{ #expr: 1.0*{{Q|{{#var: name}}| Accuracy (Long) Base}}/100}}}}}}
 
{{#vardefine: DPS |{{#expr: {{Q|{{#var: name}}|Maximum DPS}}}}}}
 
{{#vardefine: DPS |{{#expr: {{Q|{{#var: name}}|Maximum DPS}}}}}}
}}
+
|}}
  
{{#ifeq: {{{2|}}} | Good | |
+
{{#ifeq: {{{2|}}} | Good |
{{#vardefine: TouchAccuracy  | {{#ifexpr: {{ #expr: 1.1*{{Q|{{#var: name}}| Accuracy (Touch) Base}}  round 2}} > 100 | 100 | {{ #expr: 1.1*{{Q|{{#var: name}}| Accuracy (Touch) Base}} round 0}}}}%}}
+
{{#vardefine: TouchAccuracy  | {{#ifexpr: {{ #expr: 1.1*{{Q|{{#var: name}}| Accuracy (Touch) Base}}  round 2}} > 100 | 1 | {{ #expr: 1.1*{{Q|{{#var: name}}| Accuracy (Touch) Base}}/100}}}}}}
{{#vardefine: ShorthAccuracy  | {{#ifexpr: {{ #expr: 1.1*{{Q|{{#var: name}}| Accuracy (Short) Base}}  round 2}} > 100 | 100 | {{ #expr: 1.1*{{Q|{{#var: name}}| Accuracy (Short) Base}} round 0}}}}%}}
+
{{#vardefine: ShorthAccuracy  | {{#ifexpr: {{ #expr: 1.1*{{Q|{{#var: name}}| Accuracy (Short) Base}}  round 2}} > 100 | 1 | {{ #expr: 1.1*{{Q|{{#var: name}}| Accuracy (Short) Base}}/100}}}}}}
{{#vardefine: MediumAccuracy  | {{#ifexpr: {{ #expr: 1.1*{{Q|{{#var: name}}| Accuracy (Medium) Base}} round 2}} > 100 | 100 | {{ #expr: 1.1*{{Q|{{#var: name}}| Accuracy (Medium) Base}} round 0}}}}%}}
+
{{#vardefine: MediumAccuracy  | {{#ifexpr: {{ #expr: 1.1*{{Q|{{#var: name}}| Accuracy (Medium) Base}} round 2}} > 100 | 1 | {{ #expr: 1.1*{{Q|{{#var: name}}| Accuracy (Medium) Base}}/100}}}}}}
{{#vardefine: LongAccuracy    | {{#ifexpr: {{ #expr: 1.1*{{Q|{{#var: name}}| Accuracy (Long) Base}}  round 2}} > 100 | 100 | {{ #expr: 1.1*{{Q|{{#var: name}}| Accuracy (Long) Base}} round 0}}}}%}}
+
{{#vardefine: LongAccuracy    | {{#ifexpr: {{ #expr: 1.1*{{Q|{{#var: name}}| Accuracy (Long) Base}}  round 2}} > 100 | 1 | {{ #expr: 1.1*{{Q|{{#var: name}}| Accuracy (Long) Base}}/100}}}}}}
{{#vardefine: DPS |{{#expr: {{Q|{{#var: name}}|Maximum DPS}}}}}}
+
{{#vardefine: DPS |{{#expr: {{Q|{{#var: name}}|Maximum DPS}} }} }}
}}
+
|}}
  
{{#ifeq: {{{2|}}} | Excellent | |
+
{{#ifeq: {{{2|}}} | Excellent |
{{#vardefine: TouchAccuracy  | {{#ifexpr: {{ #expr: 1.2*{{Q|{{#var: name}}| Accuracy (Touch) Base}}  round 2}} > 100 | 100 | {{ #expr: 1.2*{{Q|{{#var: name}}| Accuracy (Touch) Base}} round 0}}}}%}}
+
{{#vardefine: TouchAccuracy  | {{#ifexpr: {{ #expr: 1.2*{{Q|{{#var: name}}| Accuracy (Touch) Base}}  round 2}} > 100 | 1 | {{ #expr: 1.2*{{Q|{{#var: name}}| Accuracy (Touch) Base}}/100}}}}}}
{{#vardefine: ShorthAccuracy  | {{#ifexpr: {{ #expr: 1.2*{{Q|{{#var: name}}| Accuracy (Short) Base}}  round 2}} > 100 | 100 | {{ #expr: 1.2*{{Q|{{#var: name}}| Accuracy (Short) Base}} round 0}}}}%}}
+
{{#vardefine: ShorthAccuracy  | {{#ifexpr: {{ #expr: 1.2*{{Q|{{#var: name}}| Accuracy (Short) Base}}  round 2}} > 100 | 1 | {{ #expr: 1.2*{{Q|{{#var: name}}| Accuracy (Short) Base}}/100}}}}}}
{{#vardefine: MediumAccuracy  | {{#ifexpr: {{ #expr: 1.2*{{Q|{{#var: name}}| Accuracy (Medium) Base}} round 2}} > 100 | 100 | {{ #expr: 1.2*{{Q|{{#var: name}}| Accuracy (Medium) Base}} round 0}}}}%}}
+
{{#vardefine: MediumAccuracy  | {{#ifexpr: {{ #expr: 1.2*{{Q|{{#var: name}}| Accuracy (Medium) Base}} round 2}} > 100 | 1 | {{ #expr: 1.2*{{Q|{{#var: name}}| Accuracy (Medium) Base}}/100}}}}}}
{{#vardefine: LongAccuracy    | {{#ifexpr: {{ #expr: 1.2*{{Q|{{#var: name}}| Accuracy (Long) Base}}  round 2}} > 100 | 100 | {{ #expr: 1.2*{{Q|{{#var: name}}| Accuracy (Long) Base}} round 0}}}}%}}
+
{{#vardefine: LongAccuracy    | {{#ifexpr: {{ #expr: 1.2*{{Q|{{#var: name}}| Accuracy (Long) Base}}  round 2}} > 100 | 1 | {{ #expr: 1.2*{{Q|{{#var: name}}| Accuracy (Long) Base}}/100}}}}}}
{{#vardefine: DPS |{{#expr: {{Q|{{#var: name}}|Maximum DPS}}}}
+
{{#vardefine: DPS |{{#expr: {{Q|{{#var: name}}|Maximum DPS}} }} }}
}}
+
|}}
  
{{#ifeq: {{{2|}}} | Masterwork | |
+
{{#ifeq: {{{2|}}} | Masterwork |
{{#vardefine: TouchAccuracy  | {{#ifexpr: {{ #expr: 1.35*{{Q|{{#var: name}}| Accuracy (Touch) Base}}  round 2}} > 100 | 100 | {{ #expr: 1.35*{{Q|{{#var: name}}| Accuracy (Touch) Base}} round 0}}}}%}}
+
{{#vardefine: TouchAccuracy  | {{#ifexpr: {{ #expr: 1.35*{{Q|{{#var: name}}| Accuracy (Touch) Base}}  round 2}} > 100 | 1 | {{ #expr: 1.35*{{Q|{{#var: name}}| Accuracy (Touch) Base}}/100}}}}}}
{{#vardefine: ShorthAccuracy  | {{#ifexpr: {{ #expr: 1.35*{{Q|{{#var: name}}| Accuracy (Short) Base}}  round 2}} > 100 | 100 | {{ #expr: 1.35*{{Q|{{#var: name}}| Accuracy (Short) Base}} round 0}}}}%}}
+
{{#vardefine: ShorthAccuracy  | {{#ifexpr: {{ #expr: 1.35*{{Q|{{#var: name}}| Accuracy (Short) Base}}  round 2}} > 100 | 1 | {{ #expr: 1.35*{{Q|{{#var: name}}| Accuracy (Short) Base}}/100}}}}}}
{{#vardefine: MediumAccuracy  | {{#ifexpr: {{ #expr: 1.35*{{Q|{{#var: name}}| Accuracy (Medium) Base}} round 2}} > 100 | 100 | {{ #expr: 1.35*{{Q|{{#var: name}}| Accuracy (Medium) Base}} round 0}}}}%}}
+
{{#vardefine: MediumAccuracy  | {{#ifexpr: {{ #expr: 1.35*{{Q|{{#var: name}}| Accuracy (Medium) Base}} round 2}} > 100 | 1 | {{ #expr: 1.35*{{Q|{{#var: name}}| Accuracy (Medium) Base}}/100}}}}}}
{{#vardefine: LongAccuracy    | {{#ifexpr: {{ #expr: 1.35*{{Q|{{#var: name}}| Accuracy (Long) Base}}  round 2}} > 100 | 100 | {{ #expr: 1.35*{{Q|{{#var: name}}| Accuracy (Long) Base}} round 0}}}}%}}
+
{{#vardefine: LongAccuracy    | {{#ifexpr: {{ #expr: 1.35*{{Q|{{#var: name}}| Accuracy (Long) Base}}  round 2}} > 100 | 1 | {{ #expr: 1.35*{{Q|{{#var: name}}| Accuracy (Long) Base}}/100}}}}}}
 
{{#vardefine: DPS |{{#expr: {{Q|{{#var: name}}|Maximum DPS}} * 1.25}}}}
 
{{#vardefine: DPS |{{#expr: {{Q|{{#var: name}}|Maximum DPS}} * 1.25}}}}
}}
+
|}}
  
{{#ifeq: {{{2|}}} | Legendary | |
+
{{#ifeq: {{{2|}}} | Legendary |
{{#vardefine: TouchAccuracy  | {{#ifexpr: {{ #expr: 1.5*{{Q|{{#var: name}}| Accuracy (Touch) Base}}  round 2}} > 100 | 100 | {{ #expr: 1.5*{{Q|{{#var: name}}| Accuracy (Touch) Base}} round 0}}}}%}}
+
{{#vardefine: TouchAccuracy  | {{#ifexpr: {{ #expr: 1.5*{{Q|{{#var: name}}| Accuracy (Touch) Base}}  round 2}} > 100 | 1 | {{ #expr: 1.5*{{Q|{{#var: name}}| Accuracy (Touch) Base}}/100}}}}}}
{{#vardefine: ShorthAccuracy  | {{#ifexpr: {{ #expr: 1.5*{{Q|{{#var: name}}| Accuracy (Short) Base}}  round 2}} > 100 | 100 | {{ #expr: 1.5*{{Q|{{#var: name}}| Accuracy (Short) Base}} round 0}}}}%}}
+
{{#vardefine: ShorthAccuracy  | {{#ifexpr: {{ #expr: 1.5*{{Q|{{#var: name}}| Accuracy (Short) Base}}  round 2}} > 100 | 1 | {{ #expr: 1.5*{{Q|{{#var: name}}| Accuracy (Short) Base}}/100}}}}}}
{{#vardefine: MediumAccuracy  | {{#ifexpr: {{ #expr: 1.5*{{Q|{{#var: name}}| Accuracy (Medium) Base}} round 2}} > 100 | 100 | {{ #expr: 1.5*{{Q|{{#var: name}}| Accuracy (Medium) Base}} round 0}}}}%}}
+
{{#vardefine: MediumAccuracy  | {{#ifexpr: {{ #expr: 1.5*{{Q|{{#var: name}}| Accuracy (Medium) Base}} round 2}} > 100 | 1 | {{ #expr: 1.5*{{Q|{{#var: name}}| Accuracy (Medium) Base}}/100}}}}}}
{{#vardefine: LongAccuracy    | {{#ifexpr: {{ #expr: 1.5*{{Q|{{#var: name}}| Accuracy (Long) Base}}  round 2}} > 100 | 100 | {{ #expr: 1.5*{{Q|{{#var: name}}| Accuracy (Long) Base}} round 0}}}}%}}
+
{{#vardefine: LongAccuracy    | {{#ifexpr: {{ #expr: 1.5*{{Q|{{#var: name}}| Accuracy (Long) Base}}  round 2}} > 100 | 1 | {{ #expr: 1.5*{{Q|{{#var: name}}| Accuracy (Long) Base}}/100}}}}}}
 
{{#vardefine: DPS |{{#expr: {{Q|{{#var: name}}|Maximum DPS}} * 1.5}}}}
 
{{#vardefine: DPS |{{#expr: {{Q|{{#var: name}}|Maximum DPS}} * 1.5}}}}
}}
+
|}}
  
 
|  
 
|  
Line 65: Line 64:
 
{{#vardefine: DPS | {{Q|{{#var: name}}|Maximum DPS}} }}
 
{{#vardefine: DPS | {{Q|{{#var: name}}|Maximum DPS}} }}
 
}}
 
}}
 +
 +
{{#var: TouchAccuracy }}
 +
{{#var: ShortAccuracy }}
 +
{{#var: MediumAccuracy }}
 +
{{#var: LongAccuracy }}
 +
{{#var: DPS }}
  
 
{{GraphChart|width=400
 
{{GraphChart|width=400
Line 76: Line 81:
 
|yAxisTitle=DPS|type=line
 
|yAxisTitle=DPS|type=line
 
|x= 1, 3, 12, 25, 40, 46
 
|x= 1, 3, 12, 25, 40, 46
|y= {{#expr: {{Q|{{#var: name}}|Accuracy (Touch) Base}}/100 * {{Q|{{#var: name}}|Maximum DPS}}}}, {{#expr: {{Q|{{#var: name}}|Accuracy (Touch) Base}}/100 * {{Q|{{#var: name}}|Maximum DPS}}}}, {{#expr: {{Q|{{#var: name}}|Accuracy (Short) Base}}/100 * {{Q|{{#var: name}}|Maximum DPS}}}}, {{#expr: {{Q|{{#var: name}}|Accuracy (Medium) Base}}/100 * {{Q|{{#var: name}}|Maximum DPS}}}}, {{#expr: {{Q|{{#var: name}}|Accuracy (Long) Base}}/100 * {{Q|{{#var: name}}|Maximum DPS}}}}, {{#expr: {{Q|{{#var: name}}|Accuracy (Long) Base}}/100 * {{Q|{{#var: name}}|Maximum DPS}}}}
+
|y= {{#expr: {{#var: TouchAccuracy}} * {{#var: DPS}} }}, {{#expr: {{#var: TouchAccuracy}} * {{#var: DPS}} }}, {{#expr: {{#var: ShortAccuracy}} * {{#var: DPS}} }}, {{#expr: {{#var: MediumAccuracy}} * {{#var: DPS}} }}, {{#expr: {{#var: LongAccuracy}} * {{#var: DPS}} }}
 
}}
 
}}
 
</includeonly>
 
</includeonly>

Revision as of 01:37, 27 January 2021


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

Creates a graph showing the optimum DPS that a ranged weapon is capable of at each range, assuming perfect Pawn accuracy. The dimensions and display are standardized to offer ease of comparison.

Usage

Without parameters, the template will display the chart for the current PAGENAME, assuming normal quality. For example, if the following was used on the assault rifle page:

{{Weapon DPS Chart}}

it would produce:


0.6 0.7 0.65 0.55 10.88


The first parameter, if present, allows the weapon to be chosen if it is not used on the page of the weapon in question. The template will display the chart for the chosen weapon, assuming normal quality. For example, if the following was used on any page:

{{Weapon DPS Chart|Sniper rifle}}

it would produce:


0.5 0.7 0.86 0.88 4.31


The second parameter, if present, allows the quality of the weapon to be chosen. It can be used with or without first parameter. The template will display the chart for the chosen weapon and quality. For example, if the following was used on the minigun page

{{Weapon DPS Chart||Legendary}}

it would produce:


0.225 0.7 0.375 0.27 55.14