public int Get_HeroMaxHP(uint heroCfgID) { CHeroInfo info2; int totalValue = -1; CRoleInfo masterRoleInfo = Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo(); if (masterRoleInfo.GetHeroInfo(heroCfgID, out info2, true)) { if (info2 != null) { totalValue = info2.mActorValue[RES_FUNCEFT_TYPE.RES_FUNCEFT_MAXHP].totalValue; } return(totalValue); } if (masterRoleInfo.IsFreeHero(heroCfgID)) { totalValue = ((CCustomHeroData)CHeroDataFactory.CreateCustomHeroData(heroCfgID)).heroMaxHP; } return(totalValue); }
public int Get_HeroMaxHP(uint heroCfgID) { int result = -1; CRoleInfo masterRoleInfo = Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo(); CHeroInfo cHeroInfo; if (masterRoleInfo.GetHeroInfo(heroCfgID, out cHeroInfo, true)) { if (cHeroInfo != null) { result = cHeroInfo.mActorValue[RES_FUNCEFT_TYPE.RES_FUNCEFT_MAXHP].totalValue; } } else if (masterRoleInfo.IsFreeHero(heroCfgID)) { result = ((CCustomHeroData)CHeroDataFactory.CreateCustomHeroData(heroCfgID)).heroMaxHP; } return(result); }