Commit 872af8ad by BellCodeEditor

save project

parent 75dd898c
Showing with 2 additions and 1 deletions
......@@ -9,7 +9,8 @@ class Hero(object):
def combat(self,ememy): # 攻击
info1=self.name+"对"+ememy.name+"发起攻击,"
info2="造成"+str(self.attack)+"点伤害,"
if(ememy.hp>0):
ememy.hp-=self.attack
if ememy.hp>0:
info3=ememy.name+"还剩下"+str(ememy.hp)
info=info1+info2+info3
print(info)
......
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