Commit 4c8031e9 by BellCodeEditor

save project

parent 5718872a
Showing with 14 additions and 7 deletions
import random
class Hero(object): class Hero(object):
def __init__(self, name): def __init__(self, name):
self.name = name self.name = name
...@@ -44,18 +45,24 @@ print(" 开始 ") ...@@ -44,18 +45,24 @@ print(" 开始 ")
print("*"*30) print("*"*30)
while True: while True:
ui=input("1/2:") ui=input("1/2:")
p=random.randint(1,2)
if ui=="1": if ui=="1":
print("*"*30) print("*"*30)
houyi.combat(yase) houyi.combat(yase)
if p==1:
yase.cure()
if p==2:
yase.combat(houyi) yase.combat(houyi)
print("*"*30) print("*"*30)
if ui=="2": elif ui=="2":
print("*"*30) print("*"*30)
houyi.cure() houyi.cure()
if p==1:
yase.cure() yase.cure()
if p==2:
yase.combat(houyi)
print("*"*30) print("*"*30)
# elif ui=="q":
# exit()
# else:
# print("*"*50)
# print("*"*30) \ 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