Commit d831ea48 by BellCodeEditor

save project

parent c917a210
Showing with 19 additions and 5 deletions
import random
t=random.randint(1,3)
class Hero(object): class Hero(object):
def __init__(self, name): def __init__(self, name):
self.name = name self.name = name
...@@ -43,9 +45,21 @@ print("-"*30) ...@@ -43,9 +45,21 @@ print("-"*30)
print( "战斗开始") print( "战斗开始")
print("-"*30) print("-"*30)
while True: while True:
i=input("请选择治疗()2、攻击(1)") i=input("请选择治疗(2)、攻击(1)")
if i= if i=="1":
print("攻击成功") print("攻击成功")
if i= houyi.combat(yase)
elif i=="2":
print("治疗成功") print("治疗成功")
cure() houyi.cure()
\ No newline at end of file elif i=="p":
break
else:
print("输入错误,请重新输入")
if t==1:
print("攻击成功")
yase.combat(houyi)
elif t==2:
print("治疗成功")
yase.cure()
continue
\ 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