Commit 5d72469f by BellCodeEditor

save project

parent 28a9d7fb
Showing with 14 additions and 3 deletions
import random
class Hero(object):
def __init__(self, name):
self.name = name
......@@ -45,7 +44,18 @@ print(" 战斗开始")
while True:
print("-"*30)
l=input('请选择技能(1为攻击/2为治疗):')
if l=='q':
if l=='p':
print("游戏结束")
break
elif l=='1':
houyi.cure()
elif l=='2':
houyi.combat(yase)
else:
print("请重新选择技能")
continue
n=random.randint(1,3)
if n==1:
yase.cure()
else:
yase.combat(houyi)
\ 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