Commit 5ebf6adb by BellCodeEditor

save project

parent b0e7aa64
Showing with 17 additions and 8 deletions
...@@ -27,7 +27,11 @@ class Hero(object): ...@@ -27,7 +27,11 @@ class Hero(object):
info = info1+info2+info3 info = info1+info2+info3
print(info) print(info)
exit() exit()
#def shengji(self) def shengji(self):
self.level+=1
self.hp+=10
self.attack+=10
self.max_hp+=10
class Player(Hero): class Player(Hero):
def __init__(self,hero_type,name): def __init__(self,hero_type,name):
super().__init__(name) super().__init__(name)
...@@ -56,20 +60,25 @@ while True: ...@@ -56,20 +60,25 @@ while True:
houyi.cure() houyi.cure()
elif a=='q': elif a=='q':
print("退出游戏") print("退出游戏")
exit() break
else: else:
print("重新输入") print("重新输入")
continue continue
#b = random.randint(1,2) #b = random.randint(1,2)
if yase.hp==150:
houyi.shengji()
b = input("你要使用什么技能?(1攻击/2治疗/q退出)") b = input("你要使用什么技能?(1攻击/2治疗/q退出)")
if b=='1': if b=='1':
yase.combat(houyi) yase.combat(houyi)
if b=='2': elif b=='2':
yase.cure() yase.cure()
elif a=='q': elif b=='q':
print("退出游戏") print("游戏结束")
exit() break
# b = random.randid else:
print("请重新输入")
continue
# houyi.combat(yase) # houyi.combat(yase)
# yase.combat(houyi) # yase.combat(houyi)
# houyi.cure() # houyi.cure()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment