Commit 08659830 by BellCodeEditor

save project

parent 1c060379
Showing with 7 additions and 0 deletions
......@@ -21,12 +21,19 @@ class Hero: # 英雄类
print(info)
exit()
def cure(self):
self.hp=self.hp+60
if self.hp>self.max_hp:
self.hp=self.max_hp
print(self.name+"使用了治疗,血量增加:",60,"目前血量为",self.hp)
class Player(Hero): # 玩家英雄
def __init__(self,name):
super().__init__(name)
self.hp=200
self.attack=50
self.max_hp = self.hp
player = Player("后羿")
print("玩家的血量值为:",player.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