Commit 7e21cee6 by BellCodeEditor

auto save

parent da60e227
Showing with 10 additions and 1 deletions
......@@ -15,8 +15,16 @@ class Hero(object):
else:
info3 = enemy.name + '还剩下' + str(enemy.hp) + '点生命值'
print(info1 + info2 + info3)
class player(Hero):
def __init__(self,name,hero_tyep):
super().__init__(name)
self.hp=200
self.attack=50
self.hero_tyep=hero_tyep
print("英雄",self.name,"已创建完毕,英雄的属性为",hero_tyep)
print("当前后羿等级,血量,攻击力为",self.level,self.hp,self.attack)
yase = Hero("垭瑟")
houyi= Hero("后羿")
houyi= Player("后羿","射手")
yase.combat(houyi)
\ 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