Commit 20e97cf5 by BellCodeEditor

auto save

parent 1e762677
Showing with 7 additions and 4 deletions
......@@ -6,10 +6,13 @@ class Hero(object):
self.attack = 40
self.name = name
def combat(self,hero): # 攻击
s=self.name
print(s)
def combat(self,hero_): # 攻击
hero_.hp-=hero_.attack
s1=self.name+'对'+hero_.name+'发起了攻击,'
s2=hero_.name+'血量-'+str(self.attack)+','
s3=hero_.name+'血量:'+str(hero_.hp)+'。'
s=s1+s2+s3
print(s)
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