Commit d6875591 by BellCodeEditor

save project

parent cffa2d31
Showing with 7 additions and 0 deletions
......@@ -5,6 +5,12 @@ class Hero: # 英雄类
self.hp = 250
self.attack = 40
self.max_hp = self.hp
def cure(self):
self.hp=self.hp+self.hp*0.3
if self.hp > self.max_hp:
self.hp=self.max_hp
print('他治疗了'+self.hp*0.3+'滴血')
def combat(self, enemy): # 攻击功能
......@@ -28,6 +34,7 @@ class Player(Hero): # 玩家英雄
self.hp = 88
self.attack = 999
self.max_hp=self.hp
self.a=a
print('角色'+self.name+'创建成功,类型为:',self.a)
print('该角色伤害,等级,血量分别为:',self.attack,self.level,self.hp)
......
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