Commit 6a99e7e7 by BellCodeEditor

save project

parent 42e09de6
Showing with 11 additions and 2 deletions
......@@ -7,6 +7,10 @@ class Hero: # 英雄类
self.max_hp = self.hp
def cure(self):
self.hp += 50
if self.hp>self.max_hp:
self.hp = self.max_hp
print(self.name+"使用治疗,血量增加:",60,"目前的血量为:",self.hp)
def combat(self, enemy): # 攻击功能
info1 = self.name+"对"+enemy.name+"发起进攻,"
......@@ -29,4 +33,9 @@ class Player(Hero): # 玩家英雄
print("英雄"+str(name)+"创建成功")
print("等级:"+str(self.level),"血量:"+str(self.hp),"攻击力:"+str(self.attack))
player = Player("后羿")
\ No newline at end of file
player = Player("后羿")
yase = Hero("亚瑟")
print("_"*30)
print(" 游戏开始")
while True:
player_choice = input("1,攻击、2,治疗")
\ No newline at end of file
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