Difference between revisions of "Template:Ranged Weapon Comparison/datapoints"

From RimWorld Wiki
Jump to navigation Jump to search
(10 intermediate revisions by the same user not shown)
Line 1: Line 1:
{{#vardefine:dps|{{Q|{{{name}}}|Maximum {{#if:{{{bandolier|}}}|Bandolier |}}DPS|0}}}}{{#expr:{{#var:dps}}*{{Q|{{{name}}}|Accuracy (Touch) Base|0}}/100}}, {{#expr:{{#var:dps}}*{{Q|{{{name}}}|Accuracy (Short) Base|0}}/100}}, {{#expr:{{#var:dps}}*{{Q|{{{name}}}|Accuracy (Medium) Base|0}}/100}}, {{#expr:{{#var:dps}}*{{Q|{{{name}}}|Accuracy (Long) Base|0}}/100}}
+
{{#vardefine:dps|{{Q|{{{name}}}|Maximum {{#if:{{{bandolier|}}}|Bandolier|}}{{#if:{{{triggerhappy|}}}|Triggerhappy|}} DPS|0}}}}{{#vardefine:range|{{Q|{{{name}}}|Range|0}}}}{{#vardefine:dpsTouch|{{#expr:{{#var:dps}}*{{Q|{{{name}}}|Accuracy (Touch) Base|0}}/100}}}}{{#vardefine:dpsShort|{{#expr:{{#var:dps}}*{{Q|{{{name}}}|Accuracy (Short) Base|0}}/100}}}}{{#vardefine:dpsMedium|{{#expr:{{#var:dps}}*{{Q|{{{name}}}|Accuracy (Medium) Base|0}}/100}}}}{{#vardefine:dpsLong|{{#expr:{{#var:dps}}*{{Q|{{{name}}}|Accuracy (Long) Base|0}}/100}}}}<!--
 +
Python code for generation:
 +
output=''
 +
suffix=''
 +
Range=12-3
 +
for i in range(Range):
 +
    output+='{{#ifexpr:{{#var:range}}>min|,{{#expr:{{#var:dpsTouch}}*interpolate_a+{{#var:dpsShort}}*interpolate_b}}'.replace('interpolate_b',str(i/Range)).replace('interpolate_a',str(1-i/Range)).replace('min', str(3+i))
 +
for i in range(Range):
 +
    suffix+='}}'
 +
Range=25-12
 +
for i in range(Range):
 +
    output+='{{#ifexpr:{{#var:range}}>min|,{{#expr:{{#var:dpsShort}}*interpolate_a+{{#var:dpsMedium}}*interpolate_b}}'.replace('interpolate_b',str(i/Range)).replace('interpolate_a',str(1-i/Range)).replace('min', str(12+i))
 +
for i in range(Range):
 +
    suffix+='}}'
 +
Range=40-25
 +
for i in range(Range):
 +
    output+='{{#ifexpr:{{#var:range}}>min|,{{#expr:{{#var:dpsMedium}}*interpolate_a+{{#var:dpsLong}}*interpolate_b}}'.replace('interpolate_b',str(i/Range)).replace('interpolate_a',str(1-i/Range)).replace('min', str(25+i))
 +
for i in range(Range):
 +
    suffix+='}}'
 +
Range=45-40
 +
for i in range(Range):
 +
    output+='{{#ifexpr:{{#var:range}}>min|,{{#var:dpsLong}}'.replace('interpolate_b',str(i/Range)).replace('interpolate_a',str(1-i/Range)).replace('min', str(40+i))
 +
for i in range(Range):
 +
    suffix+='}}'
 +
print(output+suffix)
 +
-->{{#var:dpsTouch}},{{#var:dpsTouch}},{{#var:dpsTouch}}{{#ifexpr:{{#var:range}}>3|,{{#expr:{{#var:dpsTouch}}*1.0+{{#var:dpsShort}}*0.0}}{{#ifexpr:{{#var:range}}>4|,{{#expr:{{#var:dpsTouch}}*0.8888888888888888+{{#var:dpsShort}}*0.1111111111111111}}{{#ifexpr:{{#var:range}}>5|,{{#expr:{{#var:dpsTouch}}*0.7777777777777778+{{#var:dpsShort}}*0.2222222222222222}}{{#ifexpr:{{#var:range}}>6|,{{#expr:{{#var:dpsTouch}}*0.6666666666666667+{{#var:dpsShort}}*0.3333333333333333}}{{#ifexpr:{{#var:range}}>7|,{{#expr:{{#var:dpsTouch}}*0.5555555555555556+{{#var:dpsShort}}*0.4444444444444444}}{{#ifexpr:{{#var:range}}>8|,{{#expr:{{#var:dpsTouch}}*0.4444444444444444+{{#var:dpsShort}}*0.5555555555555556}}{{#ifexpr:{{#var:range}}>9|,{{#expr:{{#var:dpsTouch}}*0.33333333333333337+{{#var:dpsShort}}*0.6666666666666666}}{{#ifexpr:{{#var:range}}>10|,{{#expr:{{#var:dpsTouch}}*0.2222222222222222+{{#var:dpsShort}}*0.7777777777777778}}{{#ifexpr:{{#var:range}}>11|,{{#expr:{{#var:dpsTouch}}*0.11111111111111116+{{#var:dpsShort}}*0.8888888888888888}}{{#ifexpr:{{#var:range}}>12|,{{#expr:{{#var:dpsShort}}*1.0+{{#var:dpsMedium}}*0.0}}{{#ifexpr:{{#var:range}}>13|,{{#expr:{{#var:dpsShort}}*0.9230769230769231+{{#var:dpsMedium}}*0.07692307692307693}}{{#ifexpr:{{#var:range}}>14|,{{#expr:{{#var:dpsShort}}*0.8461538461538461+{{#var:dpsMedium}}*0.15384615384615385}}{{#ifexpr:{{#var:range}}>15|,{{#expr:{{#var:dpsShort}}*0.7692307692307692+{{#var:dpsMedium}}*0.23076923076923078}}{{#ifexpr:{{#var:range}}>16|,{{#expr:{{#var:dpsShort}}*0.6923076923076923+{{#var:dpsMedium}}*0.3076923076923077}}{{#ifexpr:{{#var:range}}>17|,{{#expr:{{#var:dpsShort}}*0.6153846153846154+{{#var:dpsMedium}}*0.38461538461538464}}{{#ifexpr:{{#var:range}}>18|,{{#expr:{{#var:dpsShort}}*0.5384615384615384+{{#var:dpsMedium}}*0.46153846153846156}}{{#ifexpr:{{#var:range}}>19|,{{#expr:{{#var:dpsShort}}*0.46153846153846156+{{#var:dpsMedium}}*0.5384615384615384}}{{#ifexpr:{{#var:range}}>20|,{{#expr:{{#var:dpsShort}}*0.3846153846153846+{{#var:dpsMedium}}*0.6153846153846154}}{{#ifexpr:{{#var:range}}>21|,{{#expr:{{#var:dpsShort}}*0.3076923076923077+{{#var:dpsMedium}}*0.6923076923076923}}{{#ifexpr:{{#var:range}}>22|,{{#expr:{{#var:dpsShort}}*0.23076923076923073+{{#var:dpsMedium}}*0.7692307692307693}}{{#ifexpr:{{#var:range}}>23|,{{#expr:{{#var:dpsShort}}*0.15384615384615385+{{#var:dpsMedium}}*0.8461538461538461}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}{{#ifexpr:{{#var:range}}>24|,{{#expr:{{#var:dpsShort}}*0.07692307692307687+{{#var:dpsMedium}}*0.9230769230769231}}{{#ifexpr:{{#var:range}}>25|,{{#expr:{{#var:dpsMedium}}*1.0+{{#var:dpsLong}}*0.0}}{{#ifexpr:{{#var:range}}>26|,{{#expr:{{#var:dpsMedium}}*0.9333333333333333+{{#var:dpsLong}}*0.06666666666666667}}{{#ifexpr:{{#var:range}}>27|,{{#expr:{{#var:dpsMedium}}*0.8666666666666667+{{#var:dpsLong}}*0.13333333333333333}}{{#ifexpr:{{#var:range}}>28|,{{#expr:{{#var:dpsMedium}}*0.8+{{#var:dpsLong}}*0.2}}{{#ifexpr:{{#var:range}}>29|,{{#expr:{{#var:dpsMedium}}*0.7333333333333334+{{#var:dpsLong}}*0.26666666666666666}}{{#ifexpr:{{#var:range}}>30|,{{#expr:{{#var:dpsMedium}}*0.6666666666666667+{{#var:dpsLong}}*0.3333333333333333}}{{#ifexpr:{{#var:range}}>31|,{{#expr:{{#var:dpsMedium}}*0.6+{{#var:dpsLong}}*0.4}}{{#ifexpr:{{#var:range}}>32|,{{#expr:{{#var:dpsMedium}}*0.5333333333333333+{{#var:dpsLong}}*0.4666666666666667}}{{#ifexpr:{{#var:range}}>33|,{{#expr:{{#var:dpsMedium}}*0.4666666666666667+{{#var:dpsLong}}*0.5333333333333333}}{{#ifexpr:{{#var:range}}>34|,{{#expr:{{#var:dpsMedium}}*0.4+{{#var:dpsLong}}*0.6}}{{#ifexpr:{{#var:range}}>35|,{{#expr:{{#var:dpsMedium}}*0.33333333333333337+{{#var:dpsLong}}*0.6666666666666666}}{{#ifexpr:{{#var:range}}>36|,{{#expr:{{#var:dpsMedium}}*0.2666666666666667+{{#var:dpsLong}}*0.7333333333333333}}{{#ifexpr:{{#var:range}}>37|,{{#expr:{{#var:dpsMedium}}*0.19999999999999996+{{#var:dpsLong}}*0.8}}{{#ifexpr:{{#var:range}}>38|,{{#expr:{{#var:dpsMedium}}*0.1333333333333333+{{#var:dpsLong}}*0.8666666666666667}}{{#ifexpr:{{#var:range}}>39|,{{#expr:{{#var:dpsMedium}}*0.06666666666666665+{{#var:dpsLong}}*0.9333333333333333}}{{#ifexpr:{{#var:range}}>40|,{{#var:dpsLong}}{{#ifexpr:{{#var:range}}>41|,{{#var:dpsLong}}{{#ifexpr:{{#var:range}}>42|,{{#var:dpsLong}}{{#ifexpr:{{#var:range}}>43|,{{#var:dpsLong}}{{#ifexpr:{{#var:range}}>44|,{{#var:dpsLong}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}

Revision as of 06:34, 24 December 2024

0,0,0