Commit 994e29b9 by BellCodeEditor

save project

parent 4d1a0077
Showing with 9 additions and 9 deletions
...@@ -43,13 +43,13 @@ class Player(Hero): ...@@ -43,13 +43,13 @@ 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("垭瑟")
houyi = player("射手"后羿") houyi = player("射手"后羿")
...@@ -73,4 +73,5 @@ while true: ...@@ -73,4 +73,5 @@ while true:
if num == 1: if num == 1:
yase.cure() yase.cure()
else: else:
yase.combat(houyi) yase.combat(houyi)
\ No newline at end of file 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