Commit be05edd6 by BellCodeEditor

save project

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