Commit a5ea875b by BellCodeEditor

save project

parent 327a03a1
Showing with 9 additions and 3 deletions
...@@ -43,6 +43,8 @@ houyi = Player("射手", "后羿") ...@@ -43,6 +43,8 @@ houyi = Player("射手", "后羿")
yase = Hero("亚瑟") yase = Hero("亚瑟")
print(" "*30) print(" "*30)
print(" "*4,"战斗开始") print(" "*4,"战斗开始")
b=random.randint(1,3)
while True: while True:
print(" "*30) print(" "*30)
chose=input("请选择(1/攻击 2/治疗)") chose=input("请选择(1/攻击 2/治疗)")
...@@ -55,10 +57,13 @@ while True: ...@@ -55,10 +57,13 @@ while True:
elif chose=="2": elif chose=="2":
houyi.cure() houyi.cure()
else: else:
print("无效,请重新输入,(1/攻击 2/治疗)") if b==1:
houyi.combat(yase)
else:
houyi.cure()
a=random.randint(1,3) a=random.randint(1,3)
if a==1: if a==1:
yase.cure()
else:
yase.combat(houyi) yase.combat(houyi)
else:
yase.cure()
\ 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