Commit e333295f by BellCodeEditor

save project

parent af260b5a
Showing with 4 additions and 4 deletions
# 英雄角色类
class Hero(object):
class Hero(object):
def __init__(self, name):
self.level = 1
self.hp = 250
......@@ -8,10 +8,10 @@ class Hero(object):
def combat(self,beigongji): # 攻击
beigongji.hp=beigongji.hp-self.attack
info1=print("垭瑟攻击后羿")
info2=print("攻击伤害:"self.attack)
info1=print(self.name+"攻击"+beigongji)
info2=print("攻击伤害:"str(self.attack))
info3=print("剩余血量:"+str(beigongji.hp))
info=str(info1)+str(info2)+str(info3)
info=info1+info2+info3
print(info)
......
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