Commit 83ec2b90 by BellCodeEditor

save project

parent ac13dee0
Showing with 6 additions and 1 deletions
...@@ -11,11 +11,16 @@ class Hero(object): ...@@ -11,11 +11,16 @@ class Hero(object):
info1 = self.name+"对"+enemy.name+"发起攻击" info1 = self.name+"对"+enemy.name+"发起攻击"
info2 = self.name+"攻击力为"+str(self.attack)+"," info2 = self.name+"攻击力为"+str(self.attack)+","
if enemy.hp>0: if enemy.hp>0:
info3 = enemy.name+"血量剩"+str(enemy.hp)
info = info1+info2+info3
print(info)
else:
info3 = "血量为零,哟西" info3 = "血量为零,哟西"
info = info1+info2+info3
print(info) print(info)
exit() exit()
yase=Hero("亚索") yase=Hero("亚索")
yase=Hero("后羿") houyi=Hero("后羿")
while True: while True:
houyi.combat(yase) houyi.combat(yase)
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