Commit c85de5f3 by BellCodeEditor

save project

parent bd826128
Showing with 13 additions and 20 deletions
...@@ -39,31 +39,24 @@ class Player(Hero): ...@@ -39,31 +39,24 @@ class Player(Hero):
print("="*30) print("="*30)
print("战斗开始!") print("战斗开始!")
player = Player("射手", "后羿")
computer = Hero("垭瑟")
while True: while True:
print("="*30) print("="*30)
choice=input("1攻击/2治疗/Q(大:") choice=input("1攻击/2治疗/Q(大写)挂机:")
if choice=="1": if choice=="1":
pass player.combat(computer)
elif choice=="2": elif choice=="2":
pass player.cure()
elif choice=="Q": elif choice=="Q":
break() pass
else: else:
print("只能选择一或二") print("只能选择一或二或Q")
continue
c_choice=random.randint(1,7) c_choice=random.randint(1,7)
if c_choice<3: if c_choice<3:
pass computer.combat(player)
else: else:
pass computer.cure()
print("="*30) \ No newline at end of file
houyi = Player("射手", "后羿")
yase = Hero("垭瑟")
houyi.combat(yase)
yase.combat(houyi)
houyi.cure()
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