Commit e7fcfc2d by BellCodeEditor

save project

parent 2eecd050
Showing with 6 additions and 4 deletions
......@@ -11,11 +11,13 @@ class Hero:
def combat(self,c):
# into1=self.name,"对",c.name,"发起进攻","造成了",self.attack,"点伤害",c.name,"还剩下",c.hp-self.attack,"滴血"
# print(into1)
if combat.hp>0:
c.hp-=self.attack
if c.hp>0:
into1=self.name,"对",c.name,"发起进攻","造成了",self.attack,"点伤害",c.name,"还剩下",c.hp-self.attack,"滴血"
print(into1)
else:
print("您已阵亡")
exit()
yase=Hero("亚瑟")
houyi=Hero("后羿")
\ No newline at end of file
yase=Hero("亚瑟",3890,345678)
houyi=Hero("后羿",12367,24567)
Hero.combat(yase,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