Commit d76a064c by BellCodeEditor

save project

parent e320542a
Showing with 15 additions and 3 deletions
import random
class Hero(object):
def __init__(self, name):
self.name = name
......@@ -41,8 +42,19 @@ class Player(Hero):
houyi = Player("射手", "后羿")
yase = Hero("垭瑟")
while True:
k=int(input('攻击:1 治疗:2'))
if k==1:
k=input('攻击:1 治疗:2')
if k=='1':
houyi.combat(yase)
if k==2:
else:
if k=='2':
houyi.cure()
else:
if k=='q':
break
else:
print('重新输入')
num=random.randint(1,3)
if num==1:
yase.cure()
if num==2 or num == 3:
yase.combat(houyi)
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