Commit 707e9827 by BellCodeEditor

save project

parent 61c3f3ce
Showing with 17 additions and 1 deletions
...@@ -21,11 +21,11 @@ class Hero(object): ...@@ -21,11 +21,11 @@ class Hero(object):
info3 = enemy.name+"还剩下"+str(enemy.hp)+"血量" info3 = enemy.name+"还剩下"+str(enemy.hp)+"血量"
info = info1+info2+info3 info = info1+info2+info3
print(info) print(info)
exit()
else: else:
info3 = enemy.name+"阵亡,游戏结束" info3 = enemy.name+"阵亡,游戏结束"
info = info1+info2+info3 info = info1+info2+info3
print(info) print(info)
exit()
class Player(Hero): class Player(Hero):
def __init__(self,hero_type,name): def __init__(self,hero_type,name):
...@@ -44,3 +44,18 @@ print(' 战斗开始') ...@@ -44,3 +44,18 @@ print(' 战斗开始')
while True: while True:
print("---------------------------------") print("---------------------------------")
chose = input("(1/2)") chose = input("(1/2)")
if choice == "q":
print("游戏结束")
break
elif choice == "1":
houyi.combat(yase)
elif choice == "2":
houyi.cure()
else:
print("重新输入")
continue
status = random.randint(1,3)
if status == 1:
yase.cure()
else:
yase.combat(honyi)
\ 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