Commit be05edd6 by BellCodeEditor

save project

parent ce201330
Showing with 16 additions and 9 deletions
......@@ -4,7 +4,7 @@ class Hero(object):
self.name = name
self.level = 1
self.hp = 250
self.attack = 40
self.attack = random.randint(25,40)
self.max_hp = self.hp
def cure(self): # 治疗
......@@ -49,18 +49,24 @@ print('-'*30)
print(' 战斗开始')
while True:
print('-'*30)
v=input("请选择英雄技能:1攻击2治疗")
if v=="q":
v1=input("请选择英雄1技能:1攻击2治疗")
v2=input("请选择英雄2技能:1攻击2治疗")
if v1=="q":
break
elif v=="1":
elif v1=="1":
houyi.combat(yase)
elif v=="2":
elif v1=="2":
houyi.cure()
else:
print("请输入1或2")
continue
n=random.randint(1,3)
if n==1:
yase.cure()
if v2=="q":
break
elif v2=="1":
yase.combat(houyi)
elif v2=="2":
yase.cure()
else:
yase.combat(houyi)
print("请输入1或2")
continue
\ 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