Commit 527394fd by BellCodeEditor

save project

parent bf0616ac
Showing with 26 additions and 5 deletions
......@@ -6,9 +6,31 @@ class Hero(object):
self.attack = 40
self.name = name
def combat(): # 攻击
???
def combat(name,): # 攻击info
enemy.hp -= self.attack
info1= self.name+"攻击"+enemy.name
info2= ",造成了"+str(seif.attack)+"点伤害"
if enemy.hp > 0:
info3="还剩血量"+str(enemy.hp)
ifon=ifon1+info2+info3
else:
yase = Hero("垭瑟")
houyi= Hero("后羿")
yase.combat(houyi)
\ No newline at end of file
yase = Hero("后羿")
yase.combat(houiy)
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