-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstrahd_battle_strahd_functions.py
74 lines (46 loc) · 1.83 KB
/
strahd_battle_strahd_functions.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
import random
import time
#--------------------------------------STRAHD COMBAT ACTIONS-----------------------------------------
#strahd attack 1: bite
def strahd_bite(attack_mod, competing_ac):
"""rolls a d20 and adds 12 to hit. rolls 2d6 for damage. Returns damage and updates Strahd's last move."""
bite_damage = 0
if random.randint(1,20) + attack_mod >= competing_ac: #if Strahd hits
print("Strahd sinks his fangs into you!")
#roll 2d6
i = 0
while i < 2:
bite_damage += random.randint(1,6)
i += 1
print(f"Strahd did {bite_damage} damage.")
else:
print("Strahd lunges for your exposed neck but misses!")
return (bite_damage, "bite")
#strahd attack 2: claw
def strahd_claws(attack_mod, competing_ac):
"""Rolls a d20 plus 12 to hit. Rolls a d4 + 2 for damage. Repeats. Returns damage and updates Strahd's last move."""
print("Strahd extends his claws and rears back with both hands.")
claw_damage_accumulator = 0
attack_counter = 0
#while loop to capture two attacks, one from each hand
while attack_counter < 2:
attack_to_hit = random.randint(1,20) + attack_mod
if attack_to_hit >= competing_ac: #if Strahd hits
print("Strahd slashes at you with a claw.")
damage = random.randint(1,4) + 2
claw_damage_accumulator += damage
else:
print("You are just out of his reach!")
attack_counter += 1
print(f"Strahd did {claw_damage_accumulator} damage.")
return (claw_damage_accumulator, "claw")
#strahd attack randomizer
def strahd_attack_action(attack_mod, competing_ac):
"""randomizes Strahd's claw attack or bite attack"""
if random.randint(1,2) == 1:
strahd_attack = strahd_bite(attack_mod, competing_ac)
else:
strahd_attack = strahd_claws(attack_mod, competing_ac)
print()
time.sleep(1)
return strahd_attack