Commit 2bd98de8 by BellCodeEditor

save project

parent a1a1a342
Showing with 9 additions and 1 deletions
......@@ -36,7 +36,15 @@ class Player(Hero):
self.attack = 80
self.max_hp = self.hp
print("英雄:"+self.name+"创建成功,"+"\n英雄类型:"+self.herotype+"\n攻击力:"+str(self.attack))
def cure(self):
cure_hp = random.randint(40,60)
self.hp = self.hp + cure_hp
if self.hp>self.max_hp:
print("已进行治疗。治疗数值超出上限,治疗后血量为:",self.hp,"最大生命值为:",self.max_hp)
self.hp = self.max_hp
print(self.name+"使用了治疗术,血量增加:",str(60),"目前血量为",self.max_hp)
yase = Hero("亚瑟","坦克")
houyi = Player("后羿","射手")
print("-"*30)
......
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