Commit 87d915e1 by BellCodeEditor

save project

parent ab61d438
Showing with 32 additions and 1 deletions
...@@ -13,12 +13,43 @@ class Hero(object): ...@@ -13,12 +13,43 @@ class Hero(object):
else: else:
print(self.name+'对'+enemy.name+'发起攻击,造成'+str(self.attack)+'伤害'+enemy.name+'阵亡,游戏结束') print(self.name+'对'+enemy.name+'发起攻击,造成'+str(self.attack)+'伤害'+enemy.name+'阵亡,游戏结束')
exit() exit()
class Player(Hero) class Player(Hero)
def__init__(self,name) def__init__(self,name)
super().__init__(name) super().__init__(name)
self.hp(200) self.hp(200)
self.attack(3999) self.attack(3999)
Player=Player('后羿') 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= Hero("后羿")
......
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