Commit 84115cc5 by BellCodeEditor

save project

parent ff912a59
Showing with 7 additions and 1 deletions
...@@ -7,7 +7,13 @@ class Hero(object): ...@@ -7,7 +7,13 @@ class Hero(object):
self.name = name self.name = name
def combat(): # 攻击 def combat(): # 攻击
??? enermy.hp -= self.attack
if enermy.hp > 0:
info1 = self.name+"对"+enermy.name+"发动了攻击\n"
info2 = enrmy.name+"血量降低了"+str(self.attack)+"\n"
info3 = enrmy.name+"还剩余"+str(self.hp)+"点的血量\n"
print(info1+info2+info3)
print(enermy.name+"嗝屁了")
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