Commit 8d39caf7 by BellCodeEditor

save project

parent e42e9158
Showing with 8 additions and 7 deletions
......@@ -35,8 +35,11 @@ class Player(Hero):
self.attack = 50
self.max_hp = self.hp
self.hero_type = hero_type
print("角色"+self.name+"创建成功,英雄类型为:", self.hero_type)
print("当前等级、血量、攻击力分别为:",self.level,self.hp,self.attack)
print("玩家角色后羿创建成功,英雄类型为:射手")
print("当前等级、血量、攻击力分别为:1,200,50")
print('-'*30)
print("电脑角色垭瑟创建成功,英雄类型为:战士")
print("当前等级、血量、攻击力分别为:1,250,40")
print('-'*30)
print(' 战斗开始')
def cure(self):
......@@ -51,6 +54,7 @@ yase = Hero("垭瑟")
while True:
print('-'*30)
a=input("请选择技能:1攻击/2治疗")
try:
if int(a)==1:
houyi.combat(yase)
elif int(a)==2:
......@@ -58,7 +62,7 @@ while True:
elif a=="q":
print('游戏结束')
break
else:
except:
print('重输!')
continue
b=random.randint(1,3)
......@@ -66,6 +70,3 @@ while True:
yase.cure()
else:
yase.combat(houyi)
\ No newline at end of file
\ 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