Commit 40dff1d6 by BellCodeEditor

auto save

parent 87ca5e74
Showing with 18 additions and 2 deletions
...@@ -35,8 +35,24 @@ class player(Hero): ...@@ -35,8 +35,24 @@ class player(Hero):
self.max_hp=self.hp self.max_hp=self.hp
print("角色"+self.name+"创建成功,英雄类型为:"+self.Hero_type) print("角色"+self.name+"创建成功,英雄类型为:"+self.Hero_type)
print('当前等级、血量、攻击力分别为:'+str(self.level)+'、'+str(self.hp)+'、'+str(self.attack)) print('当前等级、血量、攻击力分别为:'+str(self.level)+'、'+str(self.hp)+'、'+str(self.attack))
print('-'*30)
print(' 战斗开始')
yase = Hero("亚瑟") yase = Hero("亚瑟")
houyi=player("后羿","射手") houyi=player("后羿","射手")
yase.combat(houyi)
houyi.cure() while True:
print('-'*30)
a=input('请选择英雄技能:1攻击/2治疗')
if int(a)==1:
houyi.combat(yase)
elif int(a)==2:
houyi.cure()
elif a=="q":
print('游戏结束')
break
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