Commit d89f5972 by BellCodeEditor

auto save

parent 67c3c0b2
Showing with 18 additions and 2 deletions
......@@ -27,6 +27,20 @@ class Hero(object):
print(info)
exit()
def jscombat(self, enemy):
info1 = self.name+"对"+enemy.name+"发起绝杀,"
info2 = "绝杀造成"+str(self.attack+5)+"点伤害,"
enemy.hp=enemy.hp-self.attack-5
if enemy.hp > 0:
info3 = enemy.name+"还剩下"+str(enemy.hp)+"血量"
info = info1+info2+info3
print(info)
else:
info3 = enemy.name+"阵亡,游戏结束"
info = info1+info2+info3
print(info)
exit()
class Player(Hero):
def __init__(self,hero_type,name):
super().__init__(name)
......@@ -62,8 +76,10 @@ while True:
else:
print("请重新输入")
continue
mun=random.randint(1,3)
if mun==1:
mun=random.randint(1,10)
if mun>0 and mun<4:
yase.cure()
elif mun==4:
yase.jscombat(houyi)
else:
yase.combat(houyi)
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