There is no d12 over STR+SIZ>61 because the step for STR+SIZ 111-120 is 2d10+1d2 and not 1d12+1d10
This is my own, dirty script:
from math import ceil
from math import fabs
def calcbd(num):
dices=2
results=[]
while not results:
if dices<3:
for i in [6,8,10]:
for j in [6,8,10]:
if i*(dices-1)+j+2==num:
results.append((dices,i,j))
else:
for i in [2,4,6,8,10]:
for j in [2,4,6,8,10]:
if i*(dices-1)+j+2==num:
results.append((dices,i,j))
dices+=1
choice=()
for i in results:
if i>choice:
choice=i
if i[1]==i[2] and i[0] <3:
return i
return choice
def print_and_method(STR,SIZ):
if STR+SIZ<51:
bd=""
dice=(ceil((STR+SIZ)/5)-5)*2
if dice<0:
bd="-1d"
else:
bd="+1d"
if dice ==0:
print 0
else:
print bd+str(int(fabs(dice)))
elif STR+SIZ > 50 and STR+SIZ <61:
print "+1d12"
elif STR+SIZ>60:
maxdmg=ceil((STR+SIZ)/10)*2
bd=calcbd(maxdmg)
if bd[1]==bd[2]:
print "+"+str(bd[0])+"d"+str(bd[1])
else:
print "+"+str(bd[0]-1)+"d"+str(bd[1])+"+1d"+str(bd[2])