Commit 519702ec by BellCodeEditor

save project

parent 4b13facb
Showing with 20 additions and 2 deletions
import random
class Hero(object):
def __init__(self, name):
self.name = name
......@@ -46,4 +47,22 @@ print('_ '*30)
print(' 战斗开始')
while True:
print('_ '*30)
input('治疗术按1,攻击按2:')
\ No newline at end of file
ch=input('治疗术按2,攻击按1:')
if ch=='q':
print('game 结束')
break
elif ch=='1':
houyi.combat(yase)
elif ch=='2':
houyi.cure()
else:
print("重新输入:")
continue
cnm=random. randin(1,3)
if cnm==1:
yase.combat(houyi)
else:
yase.cure()
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