public void HeroLevelChangeUpdate(int nHeroId, int nHeroLevel, int nActorID = nDefaultSelfActorID) { CheckGetSelfPDBID(ref nActorID); PDBIDandHeroID multiKey = new PDBIDandHeroID(nActorID, nHeroId); if (!actorHeroDetail.ContainsKey(multiKey)) { return; } actorHeroDetail[multiKey].heroDetailInfo.nLv = nHeroLevel; }
public void UpdateHeroDetailInfo(IntPtr ptrParam, int nPtrLen) { IntPtrVaArgParseHelper helper = new IntPtrVaArgParseHelper(ptrParam, nPtrLen); int dwPDBID = helper.get <int>(); cmd_entity_hero_detail_info heroDetailInfo = helper.get <cmd_entity_hero_detail_info>(); PDBIDandHeroID multiKey = new PDBIDandHeroID(dwPDBID, heroDetailInfo.nHeroID); ActorHeroDetailInfo info = null; if (actorHeroDetail.TryGetValue(multiKey, out info) == false) { return; } info.heroDetailInfo = heroDetailInfo; cmd_count cmdCount = helper.get <cmd_count>(); info.cmdCount = cmdCount; for (int i = 0; i < cmdCount.nCount; i++) { cmd_match_room_hero_skill_desc skillDesc = helper.get <cmd_match_room_hero_skill_desc>(); info.heroSkillDesc.Add(skillDesc); } cmd_Return_Hero_Detail_Info returnHeroInfo; returnHeroInfo.nPDBID = dwPDBID; returnHeroInfo.nHeroID = heroDetailInfo.nHeroID; UIMsgCmdData uiReturnHeroInfo = null; if (eHeroDetailReqType == HeroDetailReqType.HDRT_INIT) { uiReturnHeroInfo = UIMsgCmdDataHelper.Instance.create <cmd_Return_Hero_Detail_Info>(WndMsgID.WND_MSG_HERODETAIL_HERODETAILINFO, ref returnHeroInfo); UISystem.Instance.SendWndMessage(WndMsgID.WND_MSG_HERODETAIL_HERODETAILINFO, uiReturnHeroInfo); } else if (eHeroDetailReqType == HeroDetailReqType.HDRT_REFRESH) { uiReturnHeroInfo = UIMsgCmdDataHelper.Instance.create <cmd_Return_Hero_Detail_Info>(WndMsgID.WND_MSG_HERODETAIL_HERODETAILINFOREFRESH, ref returnHeroInfo); UISystem.Instance.SendWndMessage(WndMsgID.WND_MSG_HERODETAIL_HERODETAILINFOREFRESH, uiReturnHeroInfo); } else if (eHeroDetailReqType == HeroDetailReqType.HDRT_LIFEHERO) { uiReturnHeroInfo = UIMsgCmdDataHelper.Instance.create <cmd_Return_Hero_Detail_Info>(WndMsgID.WND_MSG_OPEN_LIFEHERO_CULTURE_HERO_HINT, ref returnHeroInfo); UISystem.Instance.SendWndMessage(WndMsgID.WND_MSG_OPEN_LIFEHERO_CULTURE_HERO_HINT, uiReturnHeroInfo); } }
public void RequestHeroDetailInfo(PDBIDandHeroID nMultiKey, HeroDetailReqType eType = HeroDetailReqType.HDRT_INIT) { // 设置详细英雄界面信息请求标志位 eHeroDetailReqType = eType; cmd_entity_hero_info cmdHeroInfo = new cmd_entity_hero_info(); // Player界面取一次 ActorPlayerInfo playerInfo = null; if (actorPlayer.TryGetValue(nMultiKey.nPDBID, out playerInfo)) { foreach (var value in playerInfo.strongHeroInfoList) { if (value.nHeroID == nMultiKey.nHeroID) { cmdHeroInfo = value; break; } } } // Hero界面取一次 if (cmdHeroInfo.nHeroID == 0) { ActorHeroInfo heroInfo = null; if (actorHero.TryGetValue(nMultiKey.nPDBID, out heroInfo)) { heroInfo.dicEntityHeroInfo.TryGetValue(nMultiKey.nHeroID, out cmdHeroInfo); } } // nHeroID > 0,则表示该英雄有数据;bIsBuy > 0,则表示已购买 cmd_Request_Hero_Detail_Info reqHeroDetailInfo = new cmd_Request_Hero_Detail_Info(); reqHeroDetailInfo.nActorID = (uint)nMultiKey.nPDBID; reqHeroDetailInfo.nHeroID = nMultiKey.nHeroID; reqHeroDetailInfo.heroInfo = cmdHeroInfo; EntityEventHelper.Instance.SendCommand <cmd_Request_Hero_Detail_Info>(EntityFactory.MainHeroID, EntityLogicDef.ENTITY_CMD_QUERY_HERO_DETAIL_INFO, ref reqHeroDetailInfo); }
public ActorHeroDetailInfo GetActorHeroDetail(int heroID, int actorID = nDefaultSelfActorID, HeroDetailReqType eType = HeroDetailReqType.HDRT_INIT) { CheckGetSelfPDBID(ref actorID); ActorHeroDetailInfo info = null; PDBIDandHeroID multiKey = new PDBIDandHeroID(actorID, heroID); if (actorHeroDetail.TryGetValue(multiKey, out info)) { return(info); } else { info = new ActorHeroDetailInfo(); info.heroDetailInfo = new cmd_entity_hero_detail_info(); info.cmdCount.nCount = 0; info.heroSkillDesc = new List <cmd_match_room_hero_skill_desc>(); actorHeroDetail[multiKey] = info; } RequestHeroDetailInfo(multiKey, eType); return(info); }
public void UpgradeStartProAndExpend(IntPtr ptrParam, int nPtrLen) { IntPtrVaArgParseHelper helper = new IntPtrVaArgParseHelper(ptrParam, nPtrLen); cmd_entity_hero_diff_expend cmdHeroDetailInfo = helper.get <cmd_entity_hero_diff_expend>(); int dwPDBID = EntityFactory.MainHeroView.Property.GetNumProp(ENTITY_PROPERTY.PROPERTY_ID); PDBIDandHeroID multiKey = new PDBIDandHeroID(dwPDBID, cmdHeroDetailInfo.nHeroID); ActorHeroDetailInfo info = null; if (actorHeroDetail.TryGetValue(multiKey, out info) == false) { return; } info.heroDetailInfo.nStar = cmdHeroDetailInfo.nStarLv; info.heroDetailInfo.nStarExp = cmdHeroDetailInfo.nHaveCardCount; info.heroDetailInfo.nStarNeedExp = cmdHeroDetailInfo.nExpendCard; info.heroDetailInfo.fHP = cmdHeroDetailInfo.fHP; info.heroDetailInfo.fMA = cmdHeroDetailInfo.fMA; info.heroDetailInfo.fMagic = cmdHeroDetailInfo.fMagic; info.heroDetailInfo.fMD = cmdHeroDetailInfo.fMD; info.heroDetailInfo.fPA = cmdHeroDetailInfo.fPA; info.heroDetailInfo.fPD = cmdHeroDetailInfo.fPD; }
public void UpdateHeroInfo(IntPtr ptrParam, int nPtrLen) { int actorID = EntityFactory.MainHeroView.Property.GetNumProp(ENTITY_PROPERTY.PROPERTY_ID); IntPtrVaArgParseHelper helper = new IntPtrVaArgParseHelper(ptrParam, nPtrLen); int nCount = helper.get <int>(); for (int i = 0; i < nCount; ++i) { bool bNewBuy = false; bool bOldBuy = false; cmd_entity_hero_info data = helper.get <cmd_entity_hero_info>(); ActorPlayerInfo playInfo = null; ActorHeroInfo info = null; int nHeroID = data.nHeroID; bNewBuy = data.bIsBuy > 0; if (actorHero.TryGetValue(actorID, out info) == true) { // 英雄总览界面数据更新 if (info.dicEntityHeroInfo.ContainsKey(nHeroID) == true) { bOldBuy = info.dicEntityHeroInfo[nHeroID].bIsBuy > 0; info.dicEntityHeroInfo[nHeroID] = data; } else if (info.dicEntityNoHaveHeroInfo.ContainsKey(nHeroID) == true) { info.dicEntityNoHaveHeroInfo.Remove(nHeroID); info.dicEntityHeroInfo[nHeroID] = data; } } if ((actorPlayer.TryGetValue(actorID, out playInfo) == true)) { // 玩家界面数据更新 for (int j = 0; j < playInfo.strongHeroInfoList.Count; j++) { if (playInfo.strongHeroInfoList[j].nHeroID == nHeroID) { playInfo.strongHeroInfoList[j] = data; } } } PlayerHeroUpdateData msgData = new PlayerHeroUpdateData(); msgData.nHeroID = nHeroID; msgData.nReqPDBID = actorID; UISystem.Instance.SendWndMessage(WndMsgID.WND_MSG_HEROPREVIEWFRAME_GETHEROINFO, msgData); if (bNewBuy && !bOldBuy) { UISystem.Instance.SendWndMessage(WndMsgID.WND_ID_GAMEWAITINGROOMVIEW_ROOMBUYHERO, msgData); } // 英雄详细界面数据更新 PDBIDandHeroID multiKey = new PDBIDandHeroID(actorID, nHeroID); RequestHeroDetailInfo(multiKey, HeroDetailReqType.HDRT_REFRESH); } }