Commit dfc9dbc7 by BellCodeEditor

save project

parent 8af8f328
Showing with 20 additions and 3 deletions
import random
class Hero(object): class Hero(object):
def __init__(self, name): def __init__(self, name):
self.name = name self.name = name
...@@ -40,5 +41,21 @@ houyi = Player("射手", "后羿") ...@@ -40,5 +41,21 @@ houyi = Player("射手", "后羿")
yase = Hero("垭瑟") yase = Hero("垭瑟")
print('-'*30) print('-'*30)
print(' 战斗开始') print(' 战斗开始')
print('-'*30) while True:
input('请选择释放技能 1 攻击 2 治疗:') print('-'*30)
\ No newline at end of file chiose=input('请选择释放技能 1 攻击 2 治疗:')
if chiose=='q':
print('游戏退出')
break
elif chiose=='1':
houyi.combat(yase)
elif chiose=='2':
houyi.cure()
else:
print('重新选择有效技能')
continue
i=random.randint(1,3)
if i==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