Commit 3bb13e62 by BellCodeEditor

save project

parent bbdefd8b
Showing with 9 additions and 3 deletions
...@@ -17,8 +17,14 @@ class Hero(object): ...@@ -17,8 +17,14 @@ class Hero(object):
else: else:
info3 = enemy.name + '还剩下' + str(enemy.hp) + '点生命值' info3 = enemy.name + '还剩下' + str(enemy.hp) + '点生命值'
print(info1 + info2 + info3) print(info1 + info2 + info3)
class player(object):
def __init__(self, name,hero_type):
super().__init__(name)
self.hp = 3500
self.attack = 388
self.hero_type = hero_type
yase = Hero("垭瑟") yase = Hero("垭瑟")
houyi= Hero("后羿") houyi= Hero("后羿")
yase.combat(houyi) print("角色"+houyi.name+"创建英雄,英雄类型:",houyi.hero_type)
\ No newline at end of file print(" 当前等级、血量、攻击力分别为:",houyi,level,houyi.hp,houyi.attack)
\ 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