Skip to content

Instantly share code, notes, and snippets.

@dbgarf
Created March 26, 2019 18:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dbgarf/f885ddbd5b9d6134f9ae318ae9158459 to your computer and use it in GitHub Desktop.
Save dbgarf/f885ddbd5b9d6134f9ae318ae9158459 to your computer and use it in GitHub Desktop.
poe bleed dps calculator
import random
def bleed_multiplier(min_d, max_d, aps, chance, duration, trials=10000, ruthless=True, fossil=True, rys=True):
min_new = min_d
max_new = max_d
if rys:
min_new = int(0.7*min_d)
max_new = int(1.4*max_d)
totals = []
# simulate a set of trials
for i in range(0, trials):
bleeds = []
# simulation of each trial in the set
for t in range(0, int(aps*duration)):
if random.randint(0, 99) < chance:
bleed = random.randint(min_new, max_new)
if fossil and random.randint(0, 99) < 60:
bleed *= 2
if ruthless:
if t % 3 == 2:
bleed = int(bleed*1.5472)
else:
bleed = int(bleed/1.3767)
# generate the total for this trial by taking the 8 largest bleed instances
bleeds.append(bleed)
bleeds.sort(reverse=True)
total = sum(bleeds[0:8])
totals.append(total)
avg = sum(totals) / trials
return (2 * avg) / (min_d + max_d)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment