Commit 9895c340 by BellCodeEditor

save project

parent 03f4293c
Showing with 8 additions and 1 deletions
......@@ -20,6 +20,11 @@ class Hero: # 英雄类
info = info1+info2+info3
print(info)
exit()
def cure(self):
self.hp=self.hp+60
if self.hp>self.max_hp:
self.hp==250
print(self.name+"使用治疗,血量增加了",60,"目前血量为"+str(self.hp))
class Player(Hero): # 玩家英雄
......@@ -30,5 +35,7 @@ class Player(Hero): # 玩家英雄
self.type=type
print("创建了一个角色为"+self.name)
print("角色属性,血量,攻击力分别为:"+self.type+","+str(self.hp)+","+str(self.attack))
player = Player("后羿","射手")
houyi = Player("后羿","射手")
hero=Hero("s")
hero.cure()
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