Commit 53a1bd05 by BellCodeEditor

save project

parent 4a3e1d92
Showing with 9 additions and 2 deletions
......@@ -6,8 +6,15 @@ class Hero(object):
self.attack = 40
self.name = name
def combat(): # 攻击
???
def combat(self,enem):
enem.hp-=self.attack
info=str(self.name)+"对"+str(enem.name)+"发起进攻,造成"+str(self.attack)+"点伤害"+str(enem.name)
print(info) # 攻击
if enem.hp>0:
print(str(enem.name)+"还剩"+str(enem.hp-self.attack))
else:
print(str(enem.name)+"死了")
exit()
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