Commit 0136a27d by BellCodeEditor

save project

parent fc4d75c9
Showing with 5 additions and 2 deletions
...@@ -42,7 +42,7 @@ class Player(Hero): ...@@ -42,7 +42,7 @@ class Player(Hero):
print("当前等级、血量、攻击力分别为:1,250,40") print("当前等级、血量、攻击力分别为:1,250,40")
print('-'*30) print('-'*30)
print(' 战斗开始') print(' 战斗开始')
def cure(self): def ure(self):
c=random.randint(35,50) c=random.randint(35,50)
self.hp+=c self.hp+=c
if self.hp>self.max_hp: if self.hp>self.max_hp:
...@@ -58,10 +58,13 @@ while True: ...@@ -58,10 +58,13 @@ while True:
if int(a)==1: if int(a)==1:
houyi.combat(yase) houyi.combat(yase)
elif int(a)==2: elif int(a)==2:
houyi.cure() houyi.ure()
elif a=="q": elif a=="q":
print('游戏结束') print('游戏结束')
break break
else:
print('重输!')
continue
except: except:
print('重输!') print('重输!')
continue continue
......
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