Commit 138d1a11 by BellCodeEditor

save project

parent 139e8187
Showing with 4 additions and 0 deletions
......@@ -10,9 +10,13 @@ class Hero(object):
self.hp -=self.attack
info1 = str(self.name)+"对"+str(enemy.name)+"发动攻击,"
info2 = "造成"+str(self.attack)+"点攻击,"
if enemy.hp>0:
info3 = str(enemy.name)+"还剩下"+str(self.hp)+"血量"
else:
info3 = str(enemy.name)+"已死亡"
info = info1+info2+info3
print(info)
yase = Hero("垭瑟")
houyi= Hero("后羿")
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