Commit dfaaf55e by BellCodeEditor

save project

parent fb57ebc6
Showing with 16 additions and 2 deletions
import random
class Hero(object):
def __init__(self, name):
self.name = name
......@@ -40,9 +40,23 @@ class Player(Hero):
houyi = Player("射手", "后羿")
yase = Hero("铠")
kai = Hero("铠")
while True:
print('-'*30)
print(' 战斗开始')
choice=input("请输入选择释放的技能:(1攻击/2治疗)")
if choice=='1':
houyi.combat(kai)
elif choice=='2':
houyi.cure()
elif choice=='q':
break
else:
print('重新输入')
continue
compter=random.randint(1,3)
if compter=='1':
kai.combat(houyi)
else :
kai.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