Commit dfd4504b by BellCodeEditor

save project

parent af66433f
Showing with 16 additions and 1 deletions
...@@ -28,6 +28,19 @@ class Hero(object): ...@@ -28,6 +28,19 @@ class Hero(object):
print('你干嘛啊~~') print('你干嘛啊~~')
exit() exit()
#def combat(self, enemy):
#info1 = self.name+"对"+enemy.name+"射出灼日之矢,"
#info2 = "造成"+str(self.attack+50)+"点伤害,"
#enemy.hp -= self.attack+50
#if enemy.hp > 0:
#info = info1+info2+info3
#else:
#info3 = enemy.name+"阵亡,游戏结束"
#info = info1+info2+info3
#print(info)
#print('你干嘛啊~~')
#exit()
class Player(Hero): class Player(Hero):
def __init__(self,hero_type,name): def __init__(self,hero_type,name):
super().__init__(name) super().__init__(name)
...@@ -52,9 +65,11 @@ while True: ...@@ -52,9 +65,11 @@ while True:
print('-'*30) print('-'*30)
a=input("请选择技能:1攻击/2治疗:") a=input("请选择技能:1攻击/2治疗:")
if int(a)==1: if int(a)==1:
houyi.combat(yase) houyi.combat(yase)
elif int(a)==2: elif int(a)==2:
houyi.cure() houyi.cure()
#elif int(a)==3
#houyi.zhuorizhishi()
elif a=="q": elif a=="q":
print('游戏结束') print('游戏结束')
break break
......
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