Commit 994e29b9 by BellCodeEditor

save project

parent 4d1a0077
Showing with 7 additions and 6 deletions
...@@ -43,12 +43,12 @@ class Player(Hero): ...@@ -43,12 +43,12 @@ class Player(Hero):
print("当前等级、血量、攻击力分别为:",self.level,self.hp,self.attack) print("当前等级、血量、攻击力分别为:",self.level,self.hp,self.attack)
print('-'*30) print('-'*30)
print(' 战斗开始') print(' 战斗开始')
def cure(self): def curt(self):
c=random.randint(35,50) blood=random.randint(30,50)
self.hp+=c self.hp=self.hp+blood
if self.hp>self.max_hp: if self.hp > self.max.max_hp:
self.hp=self.max_hp self.hp = self.max_hp
print(self.name+"使用了治疗,血量增加:",str(c),",目前的血量为:",self.hp) print(self.name+"使用了治疗数,血量增加:"blood",目前血量为:
houyi = Player("射手", "后羿") houyi = Player("射手", "后羿")
yase = Hero("垭瑟") yase = Hero("垭瑟")
...@@ -74,3 +74,4 @@ while true: ...@@ -74,3 +74,4 @@ while true:
yase.cure() yase.cure()
else: else:
yase.combat(houyi) yase.combat(houyi)
print(self.name+"使用了治疗数,血量增加:"60",目前血量为:",5)
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