Commit e0359fc9 by BellCodeEditor

save project

parent 781dd375
Showing with 6 additions and 0 deletions
...@@ -5,6 +5,12 @@ class Hero(object): ...@@ -5,6 +5,12 @@ class Hero(object):
self.hp = 3500 self.hp = 3500
self.attack = 388 self.attack = 388
self.hero_type=hero_type self.hero_type=hero_type
self.max_hp=self.hp
def cure(self):
self.hp=self.hp+60
if self.hp>self.max_hp
self.hp=selt.max_hp
print("使用了治疗术增加了",60,"当前血量为",self.hp)
rint('英雄'+self.name+'英雄创建成功,类型为',self.hero_type) rint('英雄'+self.name+'英雄创建成功,类型为',self.hero_type)
rint("血量,攻击力,等级",self.hp,self.attack,self.level) rint("血量,攻击力,等级",self.hp,self.attack,self.level)
def combat(self,enemy): # 攻击 def combat(self,enemy): # 攻击
......
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