Commit 038539a1 by BellCodeEditor

save project

parent aaeeb975
Showing with 7 additions and 12 deletions
...@@ -8,20 +8,15 @@ class Hero(object): ...@@ -8,20 +8,15 @@ class Hero(object):
enemy.hp-=self.attack enemy.hp-=self.attack
info1=self.name+"对"+enemy.name+"发起了进攻," info1=self.name+"对"+enemy.name+"发起了进攻,"
info2='造成'+str(self.attack)+"点伤害," info2='造成'+str(self.attack)+"点伤害,"
if enemy.hp<=0: if enemy.hp>=0:
info4=enemy.name+"阵亡了"+"游戏结束"
info=info1+info2+info3
print(info4)
exit()
else:
info3=enemy.name+'还剩下'+str(enemy.hp) info3=enemy.name+'还剩下'+str(enemy.hp)
info=info1+info2+info3 info=info1+info2+info3
print(info) print(info)
else:
print(enemy.name+"阵亡了"+"游戏结束")
exit()
yase = Hero("垭瑟") yase = Hero("垭瑟")
houyi= Hero("后羿") houyi= Hero("后羿")
yase.combat(houyi) for i in range(9):
yase.combat(houyi) yase.combat(houyi)
yase.combat(houyi)
yase.combat(houyi)
yase.combat(houyi)
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