Commit 9f9c54be by BellCodeEditor

save project

parent 9e630043
Showing with 8 additions and 9 deletions
...@@ -32,7 +32,7 @@ class Player(Hero): ...@@ -32,7 +32,7 @@ class Player(Hero):
def __init__(self,hero_type,name): def __init__(self,hero_type,name):
super().__init__(name) super().__init__(name)
self.hp = 978 self.hp = 978
self.attack = 71 self.attack = 41
self.max_hp = self.hp self.max_hp = self.hp
self.hero_type = hero_type self.hero_type = hero_type
print("角色"+self.name+"创建成功,英雄类型为:", self.hero_type) print("角色"+self.name+"创建成功,英雄类型为:", self.hero_type)
...@@ -51,13 +51,13 @@ yase = Hero("蔡徐坤") ...@@ -51,13 +51,13 @@ yase = Hero("蔡徐坤")
while True: while True:
print('-'*30) print('-'*30)
a=input("请选择技能:1攻击/2治疗") a=input("请选择技能:1攻击/2治疗")
if a=="q": if int(a)==1:
print('游戏结束') houyi.combat(yase)
break
elif int(a)==2: elif int(a)==2:
houyi.cure() houyi.cure()
elif int(a)==1: elif a=="q":
houyi.combat(yase) print('游戏结束')
break
else: else:
print('重输!') print('重输!')
continue continue
...@@ -66,8 +66,6 @@ while True: ...@@ -66,8 +66,6 @@ while True:
yase.cure() yase.cure()
else: else:
yase.combat(houyi) yase.combat(houyi)
a=="q":
print('游戏结束')
break
\ No newline at end of file
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