Commit e379eaf1 by BellCodeEditor

save project

parent ed228c64
Showing with 7 additions and 2 deletions
...@@ -26,7 +26,12 @@ class Hero(object): ...@@ -26,7 +26,12 @@ class Hero(object):
info = info1+info2+info3 info = info1+info2+info3
print(info) print(info)
exit() exit()
def cure(self): # 治疗
blood = random.randint(30,50)
self = self + blood
if self.hp > self.max_hp:
self.hp = self.max_hp
print(self.name+"使用了治疗,血量增加:", 60,",目前的血量为:",self.hp)
class Player(Hero): class Player(Hero):
def __init__(self,hero_type,name): def __init__(self,hero_type,name):
super().__init__(name) super().__init__(name)
...@@ -48,7 +53,7 @@ while True: ...@@ -48,7 +53,7 @@ while True:
print("游戏结束") print("游戏结束")
break break
elif choice == "1": elif choice == "1":
hoyi. combat(yase) houyi.combat(yase)
elif choice == "2": elif choice == "2":
houyi.cure() houyi.cure()
else: else:
......
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