Commit 075dce1f by BellCodeEditor

save project

parent c72f6e74
Showing with 19 additions and 21 deletions
...@@ -51,23 +51,21 @@ houyi = Player("射手", "后羿") ...@@ -51,23 +51,21 @@ houyi = Player("射手", "后羿")
yase = Hero("垭瑟") yase = Hero("垭瑟")
print(30*'-') print(30*'-')
print(' 战斗开始') print(' 战斗开始')
while True: while True:#重复循环
print("-"*30) print("-" * 30)#打印30个"-"
choice=input("请选择释放英雄技能(1攻击/2治疗):") choice = input("请选择释放英雄技能(1攻击/2治疗)")#选择释放英雄技能(1攻击/2治疗)
if int(a)==1: if choice == "q":#如果输入q
houyi.combat(yase) print("游戏结束")#打印游戏结束
elif int(a)==2: break#结束循环
houyi.cure() elif choice == "1":#如果输入1
elif a=="q": houyi.combat(yase)#后羿攻击亚瑟
print('游戏结束') elif choice == "2":#如果输入2
break houyi.cure()#后羿治疗
else: else:#否则
print('重输!') print("请重新输入1或2")#打印请重新输入1或2
continue continue#结束循环
b=random.randint(1,3) status = random.randint(1,3)#随机数1-3
if b==3: if status == 1:#如果是1
yase.cure() yase.cure()#亚瑟治疗
else: else:#否则
yase.combat(houyi) yase.combat(houyi)#亚瑟攻击后羿
\ No newline at end of file
\ 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