Commit e7ffeecb by BellCodeEditor

save project

parent f9362009
Showing with 12 additions and 7 deletions
class Hero(object):
class Hero(object):
def __init__(self, name): def __init__(self, name):
self.level = 1 self.level = 1
self.hp = 3500 self.hp = 3500
...@@ -25,14 +26,18 @@ class Hero(object): ...@@ -25,14 +26,18 @@ class Hero(object):
class Player(Hero): class Player(Hero):
def __init__(self,name,hero_type): def __init__(self,name,hero_type):
super().__init__(name) super().__init__(name)
self.hp=3500 self.hp=3000
self.attack=450 self.attack=450
self.hero_type=hero_type self.hero_type=hero_type
self.max_hp=self.hp
print('角色'+self.name+'创建成功,类型为:'+hero_type) print('角色'+self.name+'创建成功,类型为:'+hero_type)
print('等级,血量,攻击力:',self.level,self.hp,self.attack) print('等级,血量,攻击力:',self.level,self.hp,self.attack)
ailin=Player('艾琳','射手') ailin=Player('艾琳','射手')
#houyi = Hero("后羿") houyi = Hero("后羿")
#yase = Hero("垭瑟") print('_'*30)
#houyi.combat(yase) print(' 战斗开始')
ailin.cure() while True:
\ No newline at end of file print('_'*30)
a=input('请选择攻击1\治疗2:')
\ 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