-
Notifications
You must be signed in to change notification settings - Fork 0
/
ไอballonkirby.py
64 lines (64 loc) · 1.61 KB
/
ไอballonkirby.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
"""Prepro"""
def role(atk):
"Job role"
if atk == "sword":
return 4
elif atk == "magic":
return 2
elif atk == "sleep":
return 0
elif atk == "master":
return 9
def opoatk1(atk):
"Opponent attack"
if atk == "waddle dee":
return 1
if atk == "waddle doo":
return 3
if atk == "laser ball":
return 2
else:
return 0
def opolife1(life):
"Opponent life"
if life == "waddle dee":
return 2
if life == "waddle doo":
return 5
if life == "laser ball":
return 3
else:
return 0
def main():
"""77KIRBY Adventure"""
life = int(input())
num = 0
opoatk = 0
opolife = 0
while life > 0:
job = input().lower()
attack = role(job)
opo = input().lower()
opoatk = opoatk1(opo)
opolife = opolife1(opo)
print("------------")
if opo == "none":
print("%s HP left" %life)
print('''Kirby won!\nYou had defeated %d enemies''' %num)
print("------------")
break
elif opo == "heal":
life += 2
else:
life -= opoatk
opolife -= attack
if life <= 0:
print('''%d HP left\nGameOver!\nYou had defeated %d enemies''' %(life, num))
print("------------")
break
elif opolife <= 0:
print("- %s had defeated -" %opo)
num += 1
print("%s HP left" %life)
print("------------")
main()