-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathsave.py
More file actions
48 lines (39 loc) · 845 Bytes
/
save.py
File metadata and controls
48 lines (39 loc) · 845 Bytes
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
# save.py
# Produces a saving throw yo :O
import random
Fort = 4
Reflex = 6
Will = 3
# Fortitude
roll = random.randint(1, 20)
fortRoll = (roll + Fort)
print("Roll", roll)
if roll == 1:
print("Save misses")
elif fortRoll <= 19:
# check if it saves
print("Succesfully saved!")
elif roll == 20:
print("Succesfully saved!")
# Reflex
roll = random.randint(1, 20)
reflexRoll = (roll + Reflex)
print("Roll", roll)
if roll == 1:
print("Save misses")
elif reflexRoll <= 19:
# check if it saves
print("Succesfully saved!")
elif roll == 20:
print("Succesfully saved!")
# Will
roll = random.randint(1, 20)
willRoll = (roll + Will)
print("Roll", roll)
if roll == 1:
print("Save misses")
elif willRoll <= 19:
# check if it saves
print("Succesfully saved!")
elif roll == 20:
print("Succesfully saved!")