Commit a200f1a5 by BellCodeEditor

save project

parent 7ccf4b47
Showing with 5 additions and 6 deletions
...@@ -8,14 +8,13 @@ class Hero(object): ...@@ -8,14 +8,13 @@ class Hero(object):
def combat (self,enemy):#gj def combat (self,enemy):#gj
info1= enemy.name+"对"+enemy.name+"发起进攻" info1= enemy.name+"对"+enemy.name+"发起进攻"
info2 = "造成了" + str(self.attack) + "真实伤害," info2 = "造成了" + str(self.attack) + "真实伤害,"
if enemy.hp<=0 if enemy.hp<0
print(enemy.name+"阵亡") print(enemy.name+"阵亡")
e exit()
else:enemy.hp>0 else:
pass
info3=enemy.name+"还剩"+str(enemy.hp-enemy.attack)+"点伤害" info3=enemy.name+"还剩"+str(enemy.hp-enemy.attack)+"点伤害"
info=info1+info2+info3
print(info)
yase = Hero("垭瑟") yase = Hero("垭瑟")
houyi= Hero("后羿") houyi= Hero("后羿")
......
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