Commit a5226b89 by BellCodeEditor

save project

parent 652c9370
Showing with 25 additions and 18 deletions
......@@ -102,6 +102,8 @@ class Hero(object):
print(info)
exit()
self.tili=self.tili+2
if self.tili>self.max_tili:
self.tili=self.max_tili
print("出招后,体力回复2点,目前的体力为:",self.tili)
......@@ -120,6 +122,8 @@ class Hero(object):
print(info)
exit()
self.tili=self.tili+2
if self.tili>self.max_tili:
self.tili=self.max_tili
print("出招后,体力回复2点,目前的体力为:",self.tili)
......@@ -129,8 +133,6 @@ class Hero(object):
if sdfy==3:
info1 = self.name+"开启一级圣盾防御,体力减少7,目前的体力为:",self.tili
print(info1)
self.tili=self.tili+2
print("出招后,体力回复2点,目前的体力为:",self.tili)
elif sdfy==2:
enemy.hp -= ftsy
info1 = self.name+"开启二级圣盾防御,"
......@@ -138,8 +140,6 @@ class Hero(object):
info3 = enemy.name+"还剩下"+str(enemy.hp)+"血量"
info = info1+info2+info3
print(info)
self.tili=self.tili+2
print("出招后,体力回复2点,目前的体力为:",self.tili)
else:
enemy.hp -= ftsy
info1 = self.name+"开启三级圣盾防御,"
......@@ -147,8 +147,10 @@ class Hero(object):
info3 = enemy.name+"还剩下"+str(enemy.hp)+"血量"
info = info1+info2+info3
print(info)
self.tili=self.tili+2
print("出招后,体力回复2点,目前的体力为:",self.tili)
self.tili=self.tili+2
if self.tili>self.max_tili:
self.tili=self.max_tili
print("出招后,体力回复2点,目前的体力为:",self.tili)
def xiaocombat(self, enemy): #小招:强化
......@@ -161,6 +163,8 @@ class Hero(object):
info1 = self.name+"开启强化,血量增加:", 25,",目前的血量为:",self.hp+"被动值增加1点,目前的被动值为:",bd1+"体力减少4,目前的体力为:",self.tili
print(info1)
self.tili=self.tili+2
if self.tili>self.max_tili:
self.tili=self.max_tili
print("出招后,体力回复2点,目前的体力为:",self.tili)
......@@ -171,7 +175,7 @@ class Player(object):
self.level = 1
self.hp = 200
self.attack = 50
self.tili=5
self.=5
self.max_tili=10
self.max_hp = self.hp
self.hero_type = hero_type
......@@ -186,6 +190,8 @@ class Player(object):
self.hp=self.max_hp
print(self.name+"使用了治疗,血量增加:",50,",目前的血量为:",self.hp+"体力减少3,目前的体力为:",self.tili)
self.tili=self.tili+2
if self.tili>self.max_tili:
self.tili=self.max_tili
print("出招后,体力回复2点,目前的体力为:",self.tili)
......@@ -266,6 +272,8 @@ class Player(object):
print(info)
exit()
self.tili=self.tili+2
if self.tili>self.max_tili:
self.tili=self.max_tili
print("出招后,体力回复2点,目前的体力为:",self.tili)
......@@ -284,6 +292,8 @@ class Player(object):
print(info)
exit()
self.tili=self.tili+2
if self.tili>self.max_tili:
self.tili=self.max_tili
print("出招后,体力回复2点,目前的体力为:",self.tili)
......@@ -302,6 +312,8 @@ class Player(object):
print(info)
exit()
self.tili=self.tili+2
if self.tili>self.max_tili:
self.tili=self.max_tili
print("出招后,体力回复2点,目前的体力为:",self.tili)
......@@ -322,8 +334,6 @@ class Player(object):
info = info1+info2+info3
print(info)
exit()
self.tili=self.tili+2
print("出招后,体力回复2点,目前的体力为:",self.tili)
elif ls==2:
enemy.hp=enemy.hp-(self.attack+ls5)
if enemy.hp > 0:
......@@ -335,8 +345,6 @@ class Player(object):
info = info1+info2+info3
print(info)
exit()
self.tili=self.tili+2
print("出招后,体力回复2点,目前的体力为:",self.tili)
elif ls==3:
enemy.hp=enemy.hp-(self.attack+ls5)
if enemy.hp > 0:
......@@ -348,8 +356,6 @@ class Player(object):
info = info1+info2+info3
print(info)
exit()
self.tili=self.tili+2
print("出招后,体力回复2点,目前的体力为:",self.tili)
elif ls==4:
enemy.hp=enemy.hp-(self.attack+ls5)
if enemy.hp > 0:
......@@ -361,8 +367,6 @@ class Player(object):
info = info1+info2+info3
print(info)
exit()
self.tili=self.tili+2
print("出招后,体力回复2点,目前的体力为:",self.tili)
else:
enemy.hp=enemy.hp-(self.attack+ls5)
if enemy.hp > 0:
......@@ -374,8 +378,10 @@ class Player(object):
info = info1+info2+info3
print(info)
exit()
self.tili=self.tili+2
print("出招后,体力回复2点,目前的体力为:",self.tili)
self.tili=self.tili+2
if self.tili>self.max_tili:
self.tili=self.max_tili
print("出招后,体力回复2点,目前的体力为:",self.tili)
......@@ -385,7 +391,8 @@ print(30*"-")
print(" 战斗开始")
while True:
print(30*"-")
choice=input("请选择释放英雄技能(q退出/1攻击/2治疗/3强杀):")
if
choice=input("请选择释放英雄技能(q退出/a治疗/0普通攻击/1小招:连射/2中招:天降巨箭/3大招:金乌神箭):")
if choice=="q":
print("游戏结束")
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