Commit 20e97cf5 by BellCodeEditor

auto save

parent 1e762677
Showing with 6 additions and 3 deletions
......@@ -6,9 +6,12 @@ class Hero(object):
self.attack = 40
self.name = name
def combat(self,hero): # 攻击
s=self.name
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("垭瑟")
......
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