-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpidms.py
More file actions
43 lines (35 loc) · 971 Bytes
/
pidms.py
File metadata and controls
43 lines (35 loc) · 971 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
import random
slmht=12
slmatk=1
slmdef=1
plhth=25
platk=2
pldef=2
ha=3
while slmht > 0:
print("The slime has", slmht, "health, you have", plhth, "Do you attack, run or heal")
choice=input("attack, run or heal?: ")
slmatkon=random.randint(0,1)
helhelt= plhth+ha
dubistmiss=random.randint(0,1)
attack=random.randint(1,2)
if choice == "attack":
if dubistmiss == "1":
print("You missed! the health of the slime is:", slmht)
else:
slmht=slmht-attack
print("you attacked the slime. It's health is now:", slmht)
elif choice == "heal":
if helhelt >= 25:
print("You cannot heal at this high health")
else:
plhth += ha
print("You healed", ha, "health. You now have", plhth, "health")
elif choice == "run":
print("You ran away, seriously?")
if slmatkon == 1:
plhth -= slmatk
print("The slime attacked you! you have", plhth, "health")
if slmht <= 1:
print("The slime is die")
break