Commit 628de0b1 by BellCodeEditor

save project

parent 2b30d4a3
Showing with 5 additions and 2 deletions
...@@ -7,10 +7,13 @@ class Hero(object): ...@@ -7,10 +7,13 @@ class Hero(object):
self.name = name self.name = name
def combat(self,e): # 攻击 def combat(self,e): # 攻击
e.hp-=self.attack
hu1=self.name +"对"+self.name+"发起进攻" hu1=self.name +"对"+self.name+"发起进攻"
hu2=e.name+"造成"+str(self.attack)+"点伤害" hu2=e.name+"造成"+str(self.attack)+"点伤害"
if enimy.hp>0 if e.hp>0:
hu3=self.name+"还剩"+self.attack+"血量" hu3=self.name+"还剩"+str(self.attack)+"血量"
hu=hu1+hu2+hu3
print(hu)
else: else:
hu3=e.name+"阵亡,游戏结束" hu3=e.name+"阵亡,游戏结束"
yase = Hero("垭瑟") yase = 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