-
Notifications
You must be signed in to change notification settings - Fork 0
/
ex36.py
73 lines (63 loc) · 1.59 KB
/
ex36.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
#!/usr/bin/env python
from random import randint
from sys import exit
import time
dice_roll = (randint(1,20))
d20 = int(dice_roll)
# while True
# need a while loop here to cycle through the battle
def fight_dragon():
# This is how I will calculate the D20 values:
print "You rolled %d "% dice_roll
# Start the dragon with no damage
dragon_damage = 0
if d20 == 1:
print "CRITICAL FAILURE! Talk about whiffing it!"
#dead()
print dragon_damage
# exit(0)
if d20 < 5:
print "Wow, talk about a miss!"
#dragon()
print dragon_damage
# exit(0)
if d20 < 10:
print "you missed, but barely stay upright."
#dragon()
print dragon_damage
# exit(0)
if d20 <= 15:
print "Hit! you do damage!"
#dragon() ++dragon_damage
dragon_damage += 1
print dragon_damage
if dragon_damage > 4:
#win()
print "You won!"
exit(0)
else:
print "You ready yourself again:"
if d20 <= 19:
print "You hit HARD!"
#dragon() ++dragon_damage X3
dragon_damage += 3
print dragon_damage
if dragon_damage > 4:
#win()
print "You won!"
else:
print "Get ready."
# exit(0)
if d20 == 20:
print "Natural 20? instant kill!!!"
#killed_dragon()
dragon_damage = 10
print dragon_damage
print "You won!"
exit(0)
else:
print "That isn't supposed to happen... You find a glorkum.s"
exit(0)
#
while True:
fight_dragon()