Commit c07d0887 by BellCodeEditor

save project

parent 4053bfdb
Showing with 18 additions and 1 deletions
import random
num=random.randint
class Hero(object): class Hero(object):
def __init__(self, name): def __init__(self, name):
self.name = name self.name = name
...@@ -43,6 +45,20 @@ print(" 战斗开始 ") ...@@ -43,6 +45,20 @@ print(" 战斗开始 ")
while True: while True:
print(' _ '*10) print(' _ '*10)
choice=input("1/attack or 2/cure") choice=input("1/attack or 2/cure")
if choice == "q":
print("游戏结束")
break
elif choice == "1":
houyi.combat(yase)
elif choice == "2":
houyi.cure()
else:
print("Error,inout again")
continue
status = random.randint(1,3)
if status == 1:
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