Commit b835f317 by BellCodeEditor

save project

parent 94159b44
Showing with 9 additions and 6 deletions
import random
class Hero(object): class Hero(object):
def __init__(self, name): def __init__(self, name):
self.name = name self.name = name
...@@ -38,6 +39,8 @@ class Player(Hero): ...@@ -38,6 +39,8 @@ class Player(Hero):
houyi = Player("射手", "后羿") houyi = Player("射手", "后羿")
yase = Hero("垭瑟") yase = Hero("垭瑟")
yase.combat(houyi)
yase.cure()
print('-'*30) print('-'*30)
print("战斗开始") print("战斗开始")
while True: while True:
...@@ -46,15 +49,14 @@ while True: ...@@ -46,15 +49,14 @@ while True:
if choie == "q": if choie == "q":
break break
elif choie == "1": elif choie == "1":
houyi=combat(yase) houyi.combat(yase)
elif choie == "2": elif choie == "2":
houyi=cute() houyi.cure()
else: else:
print("请重新输入1或者2!") print("请重新输入1或者2!")
continue continue
serty=random.ranint(1,3) serty=random.randint(1,3)
if serty==1: if serty==1:
yase.cute() yase.cure()
else: else:
yase.combat(houyi) 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