Commit 637d4439 by BellCodeEditor

save project

parent 164f74ef
Showing with 10 additions and 2 deletions
...@@ -25,7 +25,13 @@ class Hero(object): ...@@ -25,7 +25,13 @@ class Hero(object):
info = info1+info2+info3 info = info1+info2+info3
print(info) print(info)
exit() exit()
def dazhao(self,enemy):
if self.hp>self.max_hp/2:
enemy.hp-=150
self.hp-=self.max_hp/2
print(self.name+"使用大招,对"+enemy+"造成150伤害"+enemy+"血量:"+str(enemy.hp)+self.name+"血量"+str(self.hp))
else:
pass
class Player(Hero): class Player(Hero):
def __init__(self,hero_type,name): def __init__(self,hero_type,name):
super().__init__(name) super().__init__(name)
...@@ -50,9 +56,11 @@ while True: ...@@ -50,9 +56,11 @@ while True:
print("-"*30) print("-"*30)
aaa=input("请选择释放英雄技能(1攻击/2治疗/q退出)") aaa=input("请选择释放英雄技能(1攻击/2治疗/q退出)")
if aaa=="1": if aaa=="1":
houyi.combat(yase) houyi.combat("yase")
elif aaa=="2": elif aaa=="2":
houyi.cure() houyi.cure()
elif aaa=="3":
houyi.dazhao("yase")
elif aaa=="q": elif aaa=="q":
exit() exit()
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