Commit 31f27822 by BellCodeEditor

auto save

parent ae354a80
Showing with 2 additions and 6 deletions
...@@ -10,7 +10,7 @@ class Hero(object): ...@@ -10,7 +10,7 @@ class Hero(object):
def cure(self): # 治疗 def cure(self): # 治疗
self.hp += self.jia self.hp += self.jia
if self.hp>slef.max_hp: if self.hp>self.max_hp:
self.hp=self.max_hp self.hp=self.max_hp
print(self.name+"使用了治疗,血量增加:", self.jia,",目前的血量为:",self.hp) print(self.name+"使用了治疗,血量增加:", self.jia,",目前的血量为:",self.hp)
...@@ -41,11 +41,7 @@ class Player(Hero): ...@@ -41,11 +41,7 @@ class Player(Hero):
print('-'*30) print('-'*30)
print(' 战斗开始') print(' 战斗开始')
def cure(self): def cure(self):
c=random.randint(35,50) super.cure()
self.hp+=c
if self.hp>self.max_hp:
self.hp=self.max_hp
print(self.name+"使用了治疗,血量增加:",str(c),",目前的血量为:",self.hp)
houyi = Player("射手", "后羿") houyi = Player("射手", "后羿")
yase = Hero("垭瑟") yase = 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