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

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

Latest revision as of 15:01, 25 December 2024

0