Commit 7807148b by BellCodeEditor

save project

parent ba8f43d5
Showing with 6 additions and 3 deletions
...@@ -6,9 +6,12 @@ class Hero(object): ...@@ -6,9 +6,12 @@ class Hero(object):
self.attack = attack self.attack = attack
self.name = name self.name = name
def combat(self,enamy) def combat(self,enamy):
info1=self.name+"对"+enamy.name+"发起进攻"
enamy.attack-=self.attack
info2=self.name+"对"+enamy.name+"造成"+str(self.attack)+"点伤害,"+enamy.name+"剩"+str(enamy.attack)
if enamy.attack==0:
yase = Hero(5,1000,500",垭瑟") yase = Hero(5,1000,500",垭瑟")
houyi= Hero(5,100,50",后羿") houyi= Hero(5,100,50",后羿")
......
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