# Untitled

Sep 3rd, 2019
152
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
1. import random
2.
3. def combatDrill(numDice, bonusDamage, rolls):
4.     damage = 0
5.     heat = 0
6.     for i in range(rolls):
7.         dice = [random.randint(1,6) for r in range(numDice)]
8.         bonusDice = 0
9.         while 1 in dice:
10.             dice.sort(reverse=True)
11.             dice.pop()
12.             dice = dice + [random.randint(1,6) for r in range(2)]
13.             heat += 1
14.             bonusDice += 1
15.         dice.sort(reverse=True)
16.         damage += sum( dice[ :numDice + bonusDice] )
17.     print(f'Damage:{damage/rolls} Heat:{heat/rolls}')
18.
19. def combatDrillCrit(numDice, bonusDamage, rolls):
20.     damage = 0
21.     heat = 0
22.     for i in range(rolls):
23.         dice = [random.randint(1,6) for r in range(numDice)]
24.         bonusDice = 0
25.         while 1 in dice:
26.             dice.sort(reverse=True)
27.             dice.pop()
28.             dice = dice + [random.randint(1,6) for r in range(2)]
29.             heat += 1
30.             bonusDice += 1
31.         dice.sort(reverse=True)
32.         damage += sum( dice[ :int(numDice/2) + bonusDice] )
33.     print(f'Damage:{damage/rolls} Heat:{heat/rolls}')
34.
35. def combatDrillWeakCrit(numDice, bonusDamage, rolls):
36.     damage = 0
37.     heat = 0
38.     for i in range(rolls):
39.         dice = [random.randint(1,6) for r in range(numDice)]
40.         dice.sort(reverse=True)
41.         dice = dice[:int(numDice/2)]
42.         while 1 in dice:
43.             dice.sort(reverse=True)
44.             dice.pop()
45.             dice = dice + [random.randint(1,6) for r in range(2)]
46.             heat += 1
47.         damage += sum(dice)
48.     print(f'Damage:{damage/rolls} Heat:{heat/rolls}')
49.
50. combatDrillCrit(8, 0, 1000000)
51. combatDrill(4,0,1000000)
52. combatDrillWeakCrit(8, 0, 1000000)
RAW Paste Data