Commit 2f71e772 by BellCodeEditor

save project

parent 9b500e3d
Showing with 8 additions and 5 deletions
...@@ -17,11 +17,14 @@ class Hero(object): ...@@ -17,11 +17,14 @@ class Hero(object):
print(info1 + info2 + info3) print(info1 + info2 + info3)
class Player(Hero): class Player(Hero):
def __init__(self): def __init__(self,name,hero_type):
super.__init__(name): super().__init__(name)
self.hp=2000 self.hp=2900
self.attack=150 self.attack=500
self.hero_type=hero_type
print("交涉"+self.name,self.hero_type)
print("当前等级,血量,攻击力",self.level,self.hp,self.attack)
yase = Hero("垭瑟") yase = Hero("垭瑟")
houyi= Hero("后羿") houyi= Player("后羿","色叟")
yase.combat(houyi) yase.combat(houyi)
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