Commit 84a5b49c by BellCodeEditor

auto save

parent d3c05340
Showing with 4 additions and 3 deletions
......@@ -8,10 +8,10 @@ class Hero(object):
def combat(self,thief): # 攻击
thief.hp-=thief.attack
if thief.hp>0:
print('%s对%s发起攻击,造成%s点的伤害,%s还剩下%s血量'%(self.name,thief.name,self.attack,thief.name,thief.hp))
else:
print('%s已阵亡'%(a.name))
yase = Hero("垭瑟")
houyi= Hero("后羿")
yase.combat(houyi)
\ No newline at end of file
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