Skip to content

Instantly share code, notes, and snippets.

@JonnoFTW
Last active July 18, 2016 02:51
Show Gist options
  • Save JonnoFTW/857114a9bb9a9ed7729ffcb257a9c2a1 to your computer and use it in GitHub Desktop.
Save JonnoFTW/857114a9bb9a9ed7729ffcb257a9c2a1 to your computer and use it in GitHub Desktop.
import numpy as np
np.seterr(all='ignore')
results = set()
base_dmg = 117
rapier_dmg = 320
bfs_dmg = 55
dae_dmg = 81
bf_cleave = 0.35
dae_chance = 1 - 0.3
dae_multiplier = 2.2
dae_cost = 5520
bf_cost = 4500
rap_cost = 6200
slots = 6
enemy_dmg_reduction = 0.526 # assuming they have 15 armour
def cleave_dmg(bfs, dae, rap):
return (base_dmg + 120 + bfs_dmg*bfs + dae_dmg*dae + rapier_dmg*rap) * (bf_cleave*bfs)*(dae_chance**dae+(1-dae_chance**dae)*dae_multiplier)
def attack_dmg(bfs, dae, rap):
total_dmg = (base_dmg + bfs_dmg*bfs + dae_dmg*dae + rapier_dmg*rap)
return (total_dmg*enemy_dmg_reduction + total_dmg*(bf_cleave*bfs))*(dae_chance**dae+(1-dae_chance**dae)*dae_multiplier)
for b in range(0,slots):
for d in range(0, slots):
for r in range(0, slots):
if sum([b,d,r]) <= slots:
cost = b*bf_cost+d*dae_cost+r*rap_cost
c_dmg = cleave_dmg(b,d,r)
a_dmg = attack_dmg(b,d,r)
results.add((b,d,r,
c_dmg,
attack_dmg(b,d,r),
cost,
np.float64(cost)/c_dmg,
np.float64(cost)/a_dmg,
sum([b,d,r])))
print "Battlefuries | Daedeloi | Rapiers | Cleave Dmg | Attack Dmg | Cost | Cost/Cleave Dmg | Cost/Attack Dmg| Items"
print ":------------|:---------|:--------|:-----------|:-----------|:-----|:----------------|:---------------|:-----"
for i in sorted(results, key=lambda x:x[3], reverse=True):
print "|".join(map(lambda x:"{0:.0f}".format(x),i))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment