Commit 8089e96a by BellCodeEditor

save project

parent 83c100cd
Showing with 20 additions and 9 deletions
class Hero: class Hero:
def __init__(self,hp,attack): def __init__(self,hp,attack,name):
self.HP=hp self.HP=hp
self.Attack=attack self.Attack=attack
self.level=1 self.level=1
self.Name=name
def UpGrade(SB):
SB.level+=1
SB.HP+=300
SB.Attack+=30
YaSe=Hero(5000,250) def ComBot(A,B):
B.HP-=A.Attack
info1=A.Name+"对"+B.Name+"发起进攻"
info2=",共造成"+str(A.Attack)+"点伤害"
if B.HP>0:
info3=B.Name+"还剩下"+str(B.HP)+"点生命"
else:
info3=B.Name+"死亡,游戏结束,"+A.Name+"胜利"
print(info1+info2+info3)
exit()
print(info1+info2+info3)
def UpGrade(SB): YaSe=Hero(5000,250,"亚瑟")
SB.level+=1 HouYi=Hero(3000,400,"后羿")
SB.HP+=300
SB.Attack+=30
UpGrade(YaSe)
print(YaSe.HP)
\ 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