Commit 75862ad1 by BellCodeEditor

save project

parent 9c64796b
Showing with 7 additions and 2 deletions
...@@ -34,6 +34,11 @@ class Player(Hero): ...@@ -34,6 +34,11 @@ class Player(Hero):
self.hero_type=hero_type self.hero_type=hero_type
print("角色",self.name,"创建成功,英雄类型为:",self.hero_type) print("角色",self.name,"创建成功,英雄类型为:",self.hero_type)
print("当前等级、血量、攻击力分别为:",self.level,self.hp,self.attack) print("当前等级、血量、攻击力分别为:",self.level,self.hp,self.attack)
def cure(self):
blood=random.randint(30,50)
self.hp=self.hp+blood
if self.hp>self.max_hp:
self.hp=self.max_hp
print(-*30) print(-*30)
print(" 战斗开始") print(" 战斗开始")
...@@ -43,7 +48,7 @@ while Ture: ...@@ -43,7 +48,7 @@ while Ture:
if choice=="1": if choice=="1":
hoyi=combat(yase) hoyi=combat(yase)
elif choice=="2": elif choice=="2":
hoyi=care() hoyi=cure()
elif: choice=="q": elif: choice=="q":
print("游戏结束") print("游戏结束")
break break
...@@ -54,7 +59,7 @@ while Ture: ...@@ -54,7 +59,7 @@ while Ture:
if num==1: if num==1:
yase.combat(hoyi) yase.combat(hoyi)
else: else:
yase.care() yase.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