Skip to content

Instantly share code, notes, and snippets.

@AlexanderFabisch
Created June 5, 2013 10:29
Show Gist options
  • Save AlexanderFabisch/5712984 to your computer and use it in GitHub Desktop.
Save AlexanderFabisch/5712984 to your computer and use it in GitHub Desktop.
Compare different skill runes for hungering arrow in Diablo 3.
max_hits = 3
puts "HA"
dps_ha = 1.15 * (0...max_hits).map do |i| 0.35**i end.reduce(:+)
puts sprintf("%.3f", dps_ha)
puts ""
puts "PA"
dps_pa = 1.15 * (0...max_hits).map do |i| 0.5**i end.reduce(:+)
puts sprintf("%.3f", dps_pa)
puts ""
puts "DA"
dps_da = (0...max_hits).map do |i| (1.15*1.7**i) * 0.35**i end.reduce(:+) # TODO (1.15+0.7*i)
puts sprintf("%.3f", dps_da)
puts ""
puts "SoT"
def calc_dps_sot cc, e
#cd = 1.0; mod = (1.15*(1-cc) + cc*(1.15*(1+cd) + (1+cc*cd)*e*0.5)) / (1+cc*cd)
mod = 1.15+e/2.0*cc
dps_sot = mod * (0...max_hits).map do |i| 0.35**i end.reduce(:+)
return dps_sot
end
ccs = (2..8).map do |cc| cc.to_f/10.0 end
puts "enemies\\cc\t" + (ccs.map do |cc| cc.to_s end.join("\t"))
puts ""
(1..10).each do |e|
print("#{e}\t\t")
ccs.each do |cc|
dps_sot = (1.15+e/2.0*cc) * (0...max_hits).map do |i| 0.35**i end.reduce(:+)
print("#{sprintf("%.3f", dps_sot)}\t")
end
puts ""
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment