Commit aa4323c7 by BellCodeEditor

auto save

parent 0456c9c9
Showing with 13 additions and 3 deletions
......@@ -5,7 +5,17 @@ class Hero(object):
self.hp = 250
self.attack = 40
self.name = name
def gongji(self,houyi):
self.hp-=houyi.attack
a=self.name+"对"+houyi.name+"发起进攻,"
b="造成"+str(salf.attack)+"点伤害,"
if self.hp>0:
c=houyi.name+"还剩下"+str(self.hp)+"点血量。"
abc=a+b+c
print(abc)
else:
c=houyi.name+"阵亡,游戏结束"
abc=a+b+c
print(abc)
exit()
yase = 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