Difference between revisions of "Template:Weapon DPS Chart"

From RimWorld Wiki
Jump to navigation Jump to search
m (no redirect)
 
(5 intermediate revisions by one other user not shown)
Line 5: Line 5:
 
{{#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 | 1 | {{ #expr: 0.8*{{Q|{{#var: name}}| Accuracy (Medium) Base}}/100}}}}}}
 
{{#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 | 1 | {{ #expr: 0.8*{{Q|{{#var: name}}| Accuracy (Long) Base}}/100}}}}}}
{{#vardefine: DPS |{{#expr: {{Q|{{#var: name}}|Maximum DPS}} }}}}
+
{{#vardefine: DPS |{{#expr: {{Q|{{#var: name}}|Maximum DPS}} * 0.9}}}}
 
|}}
 
|}}
  
Line 69: Line 69:
 
{{#ifexpr: {{#var:range}} > 2|  
 
{{#ifexpr: {{#var:range}} > 2|  
 
{{#vardefine: XAxisString | {{#var: XAxisString}}, 3}}
 
{{#vardefine: XAxisString | {{#var: XAxisString}}, 3}}
{{#vardefine: YAxisString | {{#var: YAxisString}}, {{#expr: {{#var: TouchAccuracy}} * {{#var: DPS}} * ({{{3|1}}}^3) }}}}
+
{{#vardefine: YAxisString | {{#var: YAxisString}}, {{#expr: {{#var: TouchAccuracy}} * {{#var: DPS}} }}}}
  
 
{{#ifexpr: {{#var:range}} > 11|  
 
{{#ifexpr: {{#var:range}} > 11|  
 
{{#vardefine: XAxisString | {{#var: XAxisString}}, 12}}
 
{{#vardefine: XAxisString | {{#var: XAxisString}}, 12}}
{{#vardefine: YAxisString | {{#var: YAxisString}}, {{#expr: {{#var: ShortAccuracy}} * {{#var: DPS}} * ({{{3|1}}}^12) }}}}
+
{{#vardefine: YAxisString | {{#var: YAxisString}}, {{#expr: {{#var: ShortAccuracy}} * {{#var: DPS}} }}}}
  
 
{{#ifexpr: {{#var:range}} > 24|  
 
{{#ifexpr: {{#var:range}} > 24|  
 
{{#vardefine: XAxisString | {{#var: XAxisString}}, 25}}
 
{{#vardefine: XAxisString | {{#var: XAxisString}}, 25}}
{{#vardefine: YAxisString | {{#var: YAxisString}}, {{#expr: {{#var: MediumAccuracy}} * {{#var: DPS}}} * ({{{3|1}}}^25) }}}
+
{{#vardefine: YAxisString | {{#var: YAxisString}}, {{#expr: {{#var: MediumAccuracy}} * {{#var: DPS}}}}}}
  
 
{{#ifexpr: {{#var:range}} > 39|  
 
{{#ifexpr: {{#var:range}} > 39|  
 
{{#vardefine: XAxisString | {{#var: XAxisString}}, 40}}
 
{{#vardefine: XAxisString | {{#var: XAxisString}}, 40}}
{{#vardefine: YAxisString | {{#var: YAxisString}}, {{#expr: {{#var: LongAccuracy}} * {{#var: DPS}} * ({{{3|1}}}^40)}} }}
+
{{#vardefine: YAxisString | {{#var: YAxisString}}, {{#expr: {{#var: LongAccuracy}} * {{#var: DPS}} }}}}
  
 
{{#vardefine: XAxisString | {{#var: XAxisString}}, {{#var:range}}}}
 
{{#vardefine: XAxisString | {{#var: XAxisString}}, {{#var:range}}}}
{{#vardefine: YAxisString | {{#var: YAxisString}}, {{#expr: {{#var: LongAccuracy}} * {{#var: DPS}} * ({{{3|1}}}^{{#var:range}}) }}}}
+
{{#vardefine: YAxisString | {{#var: YAxisString}}, {{#expr: {{#var: LongAccuracy}} * {{#var: DPS}} }}}}
  
 
|
 
|
 
{{#vardefine: XAxisString | {{#var: XAxisString}}, {{#var:range}}}}
 
{{#vardefine: XAxisString | {{#var: XAxisString}}, {{#var:range}}}}
{{#vardefine: YAxisString | {{#var: YAxisString}}, {{#expr: ({{{3|1}}}^{{#var:range}})* ((40-{{#var:range}})*{{#var: MediumAccuracy}} + ({{#var:range}}-25)*{{#var: LongAccuracy}})*{{#var:DPS}}/(40-25)) }}  }}
+
{{#vardefine: YAxisString | {{#var: YAxisString}}, {{#expr: ((40-{{#var:range}})*{{#var: MediumAccuracy}} + ({{#var:range}}-25)*{{#var: LongAccuracy}})*{{#var:DPS}}/(40-25) }}  }}
 
}}
 
}}
 
|
 
|
 
{{#vardefine: XAxisString | {{#var: XAxisString}}, {{#var:range}}}}
 
{{#vardefine: XAxisString | {{#var: XAxisString}}, {{#var:range}}}}
{{#vardefine: YAxisString | {{#var: YAxisString}}, {{#expr: ({{{3|1}}}^{{#var:range}})* ((25-{{#var:range}})*{{#var: ShortAccuracy}} + ({{#var:range}}-12)*{{#var: MediumAccuracy}})*{{#var:DPS}}/(25-12) }}  }}
+
{{#vardefine: YAxisString | {{#var: YAxisString}}, {{#expr: ((25-{{#var:range}})*{{#var: ShortAccuracy}} + ({{#var:range}}-12)*{{#var: MediumAccuracy}})*{{#var:DPS}}/(25-12) }}  }}
 
}}
 
}}
 
|
 
|
 
{{#vardefine: XAxisString | {{#var: XAxisString}}, {{#var:range}}}}
 
{{#vardefine: XAxisString | {{#var: XAxisString}}, {{#var:range}}}}
{{#vardefine: YAxisString | {{#var: YAxisString}}, {{#expr: ({{{3|1}}}^{{#var:range}})* ((12-{{#var:range}})*{{#var: TouchAccuracy}} + ({{#var:range}}-3)*{{#var: ShortAccuracy}})*{{#var:DPS}}/(12-3) }}  }}
+
{{#vardefine: YAxisString | {{#var: YAxisString}}, {{#expr: ((12-{{#var:range}})*{{#var: TouchAccuracy}} + ({{#var:range}}-3)*{{#var: ShortAccuracy}})*{{#var:DPS}}/(12-3) }}  }}
 
}}
 
}}
 
|}}
 
|}}
{{GraphChart|width=400
+
{{Graph:Chart|width=400
 
|height=200
 
|height=200
 
|type=area
 
|type=area
Line 110: Line 110:
 
|x= {{#var: XAxisString}}
 
|x= {{#var: XAxisString}}
 
|y1= {{#var: YAxisString}}
 
|y1= {{#var: YAxisString}}
}}</includeonly>
+
}}</includeonly><noinclude>
<noinclude>
 
 
{{Documentation}}
 
{{Documentation}}
 
</noinclude>
 
</noinclude>

Latest revision as of 10:19, 6 January 2024

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[edit]

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:




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:




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: