Difference between revisions of "Template:Ranged Maximum DPS"

From RimWorld Wiki
Jump to navigation Jump to search
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
{{#vardefineecho:dps|{{#expr:{{Q|{{{name}}}|Maximum {{#if:{{{bandolier|}}}|Bandolier|}}{{#if:{{{triggerhappy|}}}|Triggerhappy|}} DPS|0}}*{{Apparel AP Calculation|armor1={{{armor|0}}}|ap={{#expr:{{Q|{{{name}}}|Armor Penetration|0}}*{{{damageFactor|1}}}}}}}/100*{{{damageFactor|1}}}}}}}<!--
+
<includeonly>{{#vardefine:dps|{{#expr:{{Q|{{{name}}}|Maximum {{#if:{{{bandolier|}}}|Bandolier|}}{{#if:{{{triggerhappy|}}}|Triggerhappy|}} DPS|0}}*{{Apparel AP Calculation|armor1={{{armor|0}}}|ap={{#expr:{{Q|{{{name}}}|Armor Penetration|0}}*{{{damageFactor|1}}}}}}}/100*{{{damageFactor|1}}}}}}}<!--
 
-->{{#vardefine:dpsTouch|{{#expr:{{#var:dps}}*{{Min|{{#expr:{{Q|{{{name}}}|Accuracy (Touch) Base|0}}*{{{accuracyFactor|1}}}/100}}|1}}}}}}<!--
 
-->{{#vardefine:dpsTouch|{{#expr:{{#var:dps}}*{{Min|{{#expr:{{Q|{{{name}}}|Accuracy (Touch) Base|0}}*{{{accuracyFactor|1}}}/100}}|1}}}}}}<!--
 
-->{{#vardefine:dpsShort|{{#expr:{{#var:dps}}*{{Min|{{#expr:{{Q|{{{name}}}|Accuracy (Short) Base|0}}*{{{accuracyFactor|1}}}/100}}|1}}}}}}<!--
 
-->{{#vardefine:dpsShort|{{#expr:{{#var:dps}}*{{Min|{{#expr:{{Q|{{{name}}}|Accuracy (Short) Base|0}}*{{{accuracyFactor|1}}}/100}}|1}}}}}}<!--
 
-->{{#vardefine:dpsMedium|{{#expr:{{#var:dps}}*{{Min|{{#expr:{{Q|{{{name}}}|Accuracy (Medium) Base|0}}*{{{accuracyFactor|1}}}/100}}|1}}}}}}<!--
 
-->{{#vardefine:dpsMedium|{{#expr:{{#var:dps}}*{{Min|{{#expr:{{Q|{{{name}}}|Accuracy (Medium) Base|0}}*{{{accuracyFactor|1}}}/100}}|1}}}}}}<!--
-->{{#vardefine:dpsLong|{{#expr:{{#var:dps}}*{{Min|{{#expr:{{Q|{{{name}}}|Accuracy (Long) Base|0}}*{{{accuracyFactor|1}}}/100}}|1}}}}}}
+
-->{{#vardefine:dpsLong|{{#expr:{{#var:dps}}*{{Min|{{#expr:{{Q|{{{name}}}|Accuracy (Long) Base|0}}*{{{accuracyFactor|1}}}/100}}|1}}}}}}</includeonly><noinclude>{{Documentation}}</noinclude>

Latest revision as of 11:53, 26 December 2024

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

Calculates maximum DPS and average DPS at various ranges for a ranged weapon. This template doesn't return any value, but assigns some variables

Parameters[edit]

  • name is the name of the ranged weapon.
  • armor (optional) is the armor value of the target.
  • accuracyFactor (optional) is the accuracy factor of the ranged weapon determined by quality.
  • damageFactor (optional) is the damage and AP factor of the ranged weapon determined by quality.
  • bandolier (optional) can be specified to simulate heavy bandolier usage. Can be empty or 1.
  • triggerhappy (optional) can be specified to simulate trigger happy trait. Can be empty or 1.

Assigned variables[edit]

  • dps is assigned to maximum DPS, which assumes all shots hit.
  • dpsTouch is assigned to the average DPS at Touch range, which assumes a perfect shooter.
  • dpsShort is assigned to the average DPS at Short range, which assumes a perfect shooter.
  • dpsMedium is assigned to the average DPS at Medium range, which assumes a perfect shooter.
  • dpsLong is assigned to the average DPS at Long range, which assumes a perfect shooter.