private void SetHeroList() { if (this.m_heroListCamp1.get_Count() != 0) { return; } CPlayerKDAStat playerKDAStat = Singleton <BattleLogic> .GetInstance().battleStat.m_playerKDAStat; DictionaryView <uint, PlayerKDA> .Enumerator enumerator = playerKDAStat.GetEnumerator(); while (enumerator.MoveNext()) { KeyValuePair <uint, PlayerKDA> current = enumerator.Current; PlayerKDA value = current.get_Value(); if (value.PlayerCamp == COM_PLAYERCAMP.COM_PLAYERCAMP_1) { ListView <HeroKDA> .Enumerator enumerator2 = value.GetEnumerator(); while (enumerator2.MoveNext()) { this.m_heroListCamp1.Add(enumerator2.Current); this.m_teamFightDataCamp1.Add(new Dictionary <uint, TeamFightData>()); } } else if (value.PlayerCamp == COM_PLAYERCAMP.COM_PLAYERCAMP_2) { ListView <HeroKDA> .Enumerator enumerator3 = value.GetEnumerator(); while (enumerator3.MoveNext()) { this.m_heroListCamp2.Add(enumerator3.Current); this.m_teamFightDataCamp2.Add(new Dictionary <uint, TeamFightData>()); } } } Debug.Log("!"); }
private void OnTeamFightDamageUpdate() { if (Singleton <WatchController> .GetInstance().CanShowActorIRPosMap()) { this.SetHeroList(); uint curTime = Singleton <WatchController> .GetInstance().CurFrameNo *Singleton <WatchController> .GetInstance().FrameDelta / 1000u; CPlayerKDAStat playerKDAStat = Singleton <BattleLogic> .GetInstance().battleStat.m_playerKDAStat; DictionaryView <uint, PlayerKDA> .Enumerator enumerator = playerKDAStat.GetEnumerator(); while (enumerator.MoveNext()) { KeyValuePair <uint, PlayerKDA> current = enumerator.Current; PlayerKDA value = current.get_Value(); if (value.PlayerCamp == COM_PLAYERCAMP.COM_PLAYERCAMP_1) { ListView <HeroKDA> .Enumerator enumerator2 = value.GetEnumerator(); while (enumerator2.MoveNext()) { this.SetFightDataSingle(enumerator2.Current, this.m_heroListCamp1, curTime, this.m_teamFightDataCamp1); } } else if (value.PlayerCamp == COM_PLAYERCAMP.COM_PLAYERCAMP_2) { ListView <HeroKDA> .Enumerator enumerator3 = value.GetEnumerator(); while (enumerator3.MoveNext()) { this.SetFightDataSingle(enumerator3.Current, this.m_heroListCamp2, curTime, this.m_teamFightDataCamp2); } } } } }
public void BattleStart() { if (this._heroWrapDict != null) { return; } this._lastUpdateFrame = 0u; Player playerByUid = Singleton <GamePlayerCenter> .GetInstance().GetPlayerByUid(Singleton <WatchController> .GetInstance().TargetUID); this.TargetHeroId = ((playerByUid == null) ? Singleton <GamePlayerCenter> .GetInstance().GetHostPlayer().Captain.get_handle().ObjID : playerByUid.Captain.get_handle().ObjID); this._heroWrapDict = new DictionaryView <uint, HeroInfoItem>(); List <HeroKDA> list = new List <HeroKDA>(); List <HeroKDA> list2 = new List <HeroKDA>(); CPlayerKDAStat playerKDAStat = Singleton <BattleLogic> .GetInstance().battleStat.m_playerKDAStat; DictionaryView <uint, PlayerKDA> .Enumerator enumerator = playerKDAStat.GetEnumerator(); while (enumerator.MoveNext()) { KeyValuePair <uint, PlayerKDA> current = enumerator.get_Current(); PlayerKDA value = current.get_Value(); if (value.PlayerCamp == 1) { ListView <HeroKDA> .Enumerator enumerator2 = value.GetEnumerator(); while (enumerator2.MoveNext()) { list.Add(enumerator2.get_Current()); } } else if (value.PlayerCamp == 2) { ListView <HeroKDA> .Enumerator enumerator3 = value.GetEnumerator(); while (enumerator3.MoveNext()) { list2.Add(enumerator3.get_Current()); } } } this.InitCampInfoUIList(1, list, this._camp1BaseList, this._camp1EquipList); this.InitCampInfoUIList(2, list2, this._camp2BaseList, this._camp2EquipList); this.PickHero(this.TargetHeroId); this.ValidateCampMoney(); this.RegisterEvents(); this._isBottomFold = false; this._isCampFold_1 = false; this.OnClickCampFold_1(null); this._isCampFold_2 = false; this.OnClickCampFold_2(null); this._isViewHide = false; float step = 150u * Singleton <WatchController> .GetInstance().FrameDelta * 0.001f; this.moneySample = new SampleData(step); this.expSample = new SampleData(step); this._lastSampleTime = 0f; }
private void UpdateKDAView() { if ((null != this._root) && !Singleton <CUIManager> .GetInstance().GetForm(s_battleStateViewUIForm).IsHided()) { CPlayerKDAStat playerKDAStat = Singleton <BattleLogic> .GetInstance().battleStat.m_playerKDAStat; int num = 0; int num2 = 0; DictionaryView <uint, PlayerKDA> .Enumerator enumerator = playerKDAStat.GetEnumerator(); while (enumerator.MoveNext()) { KeyValuePair <uint, PlayerKDA> current = enumerator.Current; PlayerKDA rkda = current.Value; HeroItem item = null; if (rkda.PlayerCamp == COM_PLAYERCAMP.COM_PLAYERCAMP_1) { IEnumerator <HeroKDA> enumerator2 = rkda.GetEnumerator(); while (enumerator2.MoveNext()) { item = (num >= this._heroList0.Length) ? null : this._heroList0[num++]; if (item != null) { item.Visible = true; item.Validate(enumerator2.Current); } } } else if (rkda.PlayerCamp == COM_PLAYERCAMP.COM_PLAYERCAMP_2) { IEnumerator <HeroKDA> enumerator3 = rkda.GetEnumerator(); while (enumerator3.MoveNext()) { item = (num2 >= this._heroList1.Length) ? null : this._heroList1[num2++]; if (item != null) { item.Visible = true; item.Validate(enumerator3.Current); } } } } while (num < this._heroList0.Length) { this._heroList0[num++].Visible = false; } while (num2 < this._heroList1.Length) { this._heroList1[num2++].Visible = false; } } }
public void Init(bool bWin) { this.m_allAchievements = new bool[8]; this.m_curAchievemnt = RES_SHOW_ACHIEVEMENT_TYPE.RES_SHOW_ACHIEVEMENT_COUNT; if ((Singleton <BattleLogic> .GetInstance().battleStat != null) && (Singleton <BattleLogic> .GetInstance().battleStat.m_playerKDAStat != null)) { PlayerKDA hostKDA = Singleton <BattleLogic> .GetInstance().battleStat.m_playerKDAStat.GetHostKDA(); if (hostKDA != null) { uint mvpPlayer = Singleton <BattleStatistic> .instance.GetMvpPlayer(hostKDA.PlayerCamp, bWin); if ((mvpPlayer != 0) && (mvpPlayer == hostKDA.PlayerId)) { this.m_allAchievements[7] = true; } COMDT_ACNT_INFO acntInfo = Singleton <BattleStatistic> .GetInstance().acntInfo; if (acntInfo != null) { if (acntInfo.dwCurWeekContinousWinNum == 15) { this.m_allAchievements[0] = true; } else if (acntInfo.dwCurWeekContinousWinNum == 10) { this.m_allAchievements[2] = true; } else if (acntInfo.dwCurWeekContinousWinNum == 5) { this.m_allAchievements[4] = true; } } IEnumerator <HeroKDA> enumerator = hostKDA.GetEnumerator(); while (enumerator.MoveNext()) { HeroKDA current = enumerator.Current; if (current != null) { if (current.LegendaryNum > 0) { this.m_allAchievements[5] = true; } if (current.PentaKillNum > 0) { this.m_allAchievements[1] = true; } if (current.QuataryKillNum > 0) { this.m_allAchievements[3] = true; } if (current.TripleKillNum > 0) { this.m_allAchievements[6] = true; } } } } } }
private void UpdateListCamp(bool forceUpdate) { if (forceUpdate || !this.m_bListCampInited) { this.m_playerListCamp1.Clear(); this.m_playerListCamp2.Clear(); List <Player> allPlayers = Singleton <GamePlayerCenter> .get_instance().GetAllPlayers(); for (int i = 0; i < allPlayers.get_Count(); i++) { if (allPlayers.get_Item(i).PlayerCamp == 1) { this.m_playerListCamp1.Add(allPlayers.get_Item(i)); } else if (allPlayers.get_Item(i).PlayerCamp == 2) { this.m_playerListCamp2.Add(allPlayers.get_Item(i)); } } this.m_heroListCamp1.Clear(); this.m_heroListCamp2.Clear(); CPlayerKDAStat playerKDAStat = Singleton <BattleLogic> .GetInstance().battleStat.m_playerKDAStat; DictionaryView <uint, PlayerKDA> .Enumerator enumerator = playerKDAStat.GetEnumerator(); while (enumerator.MoveNext()) { KeyValuePair <uint, PlayerKDA> current = enumerator.get_Current(); PlayerKDA value = current.get_Value(); if (value.PlayerCamp == 1) { ListView <HeroKDA> .Enumerator enumerator2 = value.GetEnumerator(); while (enumerator2.MoveNext()) { this.m_heroListCamp1.Add(enumerator2.get_Current()); } } else if (value.PlayerCamp == 2) { ListView <HeroKDA> .Enumerator enumerator3 = value.GetEnumerator(); while (enumerator3.MoveNext()) { this.m_heroListCamp2.Add(enumerator3.get_Current()); } } } } }
private void UpdateListCamp(bool forceUpdate) { if (forceUpdate || !this.m_bListCampInited) { this.m_playerListCamp1.Clear(); this.m_playerListCamp2.Clear(); List <Player> allPlayers = Singleton <GamePlayerCenter> .instance.GetAllPlayers(); for (int i = 0; i < allPlayers.Count; i++) { if (allPlayers[i].PlayerCamp == COM_PLAYERCAMP.COM_PLAYERCAMP_1) { this.m_playerListCamp1.Add(allPlayers[i]); } else if (allPlayers[i].PlayerCamp == COM_PLAYERCAMP.COM_PLAYERCAMP_2) { this.m_playerListCamp2.Add(allPlayers[i]); } } this.m_heroListCamp1.Clear(); this.m_heroListCamp2.Clear(); DictionaryView <uint, PlayerKDA> .Enumerator enumerator = Singleton <BattleLogic> .GetInstance().battleStat.m_playerKDAStat.GetEnumerator(); while (enumerator.MoveNext()) { KeyValuePair <uint, PlayerKDA> current = enumerator.Current; PlayerKDA rkda = current.Value; if (rkda.PlayerCamp == COM_PLAYERCAMP.COM_PLAYERCAMP_1) { ListView <HeroKDA> .Enumerator enumerator2 = rkda.GetEnumerator(); while (enumerator2.MoveNext()) { this.m_heroListCamp1.Add(enumerator2.Current); } } else if (rkda.PlayerCamp == COM_PLAYERCAMP.COM_PLAYERCAMP_2) { ListView <HeroKDA> .Enumerator enumerator3 = rkda.GetEnumerator(); while (enumerator3.MoveNext()) { this.m_heroListCamp2.Add(enumerator3.Current); } } } } }
public void BattleStart() { if (this._heroWrapDict == null) { this._heroWrapDict = new DictionaryView <uint, HeroInfoItem>(); List <HeroKDA> heroList = new List <HeroKDA>(); List <HeroKDA> list2 = new List <HeroKDA>(); DictionaryView <uint, PlayerKDA> .Enumerator enumerator = Singleton <BattleLogic> .GetInstance().battleStat.m_playerKDAStat.GetEnumerator(); while (enumerator.MoveNext()) { KeyValuePair <uint, PlayerKDA> current = enumerator.Current; PlayerKDA rkda = current.Value; if (rkda.PlayerCamp == COM_PLAYERCAMP.COM_PLAYERCAMP_1) { ListView <HeroKDA> .Enumerator enumerator2 = rkda.GetEnumerator(); while (enumerator2.MoveNext()) { heroList.Add(enumerator2.Current); } } else if (rkda.PlayerCamp == COM_PLAYERCAMP.COM_PLAYERCAMP_2) { ListView <HeroKDA> .Enumerator enumerator3 = rkda.GetEnumerator(); while (enumerator3.MoveNext()) { list2.Add(enumerator3.Current); } } } this.InitCampInfoUIList(COM_PLAYERCAMP.COM_PLAYERCAMP_1, heroList, this._camp1BaseList, this._camp1EquipList); this.InitCampInfoUIList(COM_PLAYERCAMP.COM_PLAYERCAMP_2, list2, this._camp2BaseList, this._camp2EquipList); Player playerByUid = Singleton <GamePlayerCenter> .GetInstance().GetPlayerByUid(Singleton <WatchController> .GetInstance().TargetUID); this.PickHero((playerByUid == null) ? Singleton <GamePlayerCenter> .GetInstance().GetHostPlayer().Captain.handle.ObjID : playerByUid.Captain.handle.ObjID); this.ValidateCampMoney(); this.RegisterEvents(); this._isBottomFold = false; this._isCampFold_1 = false; this.OnClickCampFold_1(null); this._isCampFold_2 = false; this.OnClickCampFold_2(null); this._isViewHide = false; } }
private GameObject ShowClickVictoryTipsBtn(NewbieGuideWeakConf conf, NewbieWeakGuideControl inControl) { CUIFormScript form = Singleton <CUIManager> .GetInstance().GetForm(SettlementSystem.SettlementFormName); if (form == null) { return(null); } Transform transform = form.GetWidget(24).transform; GameObject gameObject = transform.FindChild("Btn").gameObject; PlayerKDA playerKDA = null; if (Singleton <BattleLogic> .GetInstance().battleStat != null && Singleton <BattleLogic> .GetInstance().battleStat.m_playerKDAStat != null) { playerKDA = Singleton <BattleLogic> .GetInstance().battleStat.m_playerKDAStat.GetHostKDA(); } string text = string.Empty; if (playerKDA != null) { ListView <HeroKDA> .Enumerator enumerator = playerKDA.GetEnumerator(); uint key = 0u; while (enumerator.MoveNext()) { HeroKDA current = enumerator.get_Current(); if (current != null) { key = (uint)current.HeroId; break; } } ResHeroCfgInfo dataByKey = GameDataMgr.heroDatabin.GetDataByKey(key); if (dataByKey != null) { text = dataByKey.szName; } else { text = Singleton <CTextManager> .GetInstance().GetText("WinTrick_Tips_DefaultHeroName"); } } else { text = Singleton <CTextManager> .GetInstance().GetText("WinTrick_Tips_DefaultHeroName"); } transform.FindChild("Panel_Guide").gameObject.CustomSetActive(true); transform.FindChild("Panel_Guide/Text").GetComponent <Text>().text = Singleton <CTextManager> .GetInstance().GetText("WinTrick_Tips_text", new string[] { text }); return(this.AddEffectInternal(gameObject, conf, inControl, form)); }
private void onBattleEuipFormClose(CUIEvent uiEvent) { if (!this.IsBattleEquipGuideComplete()) { CSkillButtonManager cSkillButtonManager = (Singleton <CBattleSystem> .GetInstance().FightForm != null) ? Singleton <CBattleSystem> .GetInstance().FightForm.m_skillButtonManager : null; if (cSkillButtonManager != null) { SkillButton button = cSkillButtonManager.GetButton(SkillSlotType.SLOT_SKILL_9); PlayerKDA hostKDA = Singleton <BattleStatistic> .GetInstance().m_playerKDAStat.GetHostKDA(); if (hostKDA == null) { return; } bool flag = false; ListView <HeroKDA> .Enumerator enumerator = hostKDA.GetEnumerator(); while (enumerator.MoveNext()) { if (enumerator.get_Current().Equips.Length > 0) { flag = true; break; } } if (button != null && button.m_button.activeSelf && flag) { CUIFormScript form = Singleton <CUIManager> .GetInstance().GetForm(FightForm.s_skillBtnFormPath); if (form != null) { Transform transform = form.GetWidget(27).transform.FindChild("Panel_Guide"); if (transform != null) { transform.gameObject.CustomSetActive(true); CUITimerScript component = transform.FindChild("Timer").GetComponent <CUITimerScript>(); component.ResetTime(); component.ReStartTimer(); CRoleInfo masterRoleInfo = Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo(); if (masterRoleInfo != null) { masterRoleInfo.SetClientBits(6, true, true); } } } } } } }
private void OnCampDragonChange() { if (this._root == null) { this.Clear(); } else { int num = 0; int num2 = 0; DictionaryView <uint, PlayerKDA> .Enumerator enumerator = Singleton <BattleLogic> .GetInstance().battleStat.m_playerKDAStat.GetEnumerator(); while (enumerator.MoveNext()) { KeyValuePair <uint, PlayerKDA> current = enumerator.Current; PlayerKDA rkda = current.Value; if (rkda.PlayerCamp == COM_PLAYERCAMP.COM_PLAYERCAMP_1) { ListView <HeroKDA> .Enumerator enumerator2 = rkda.GetEnumerator(); while (enumerator2.MoveNext()) { num += enumerator2.Current.numKillDragon + enumerator2.Current.numKillBaron; } } else if (rkda.PlayerCamp == COM_PLAYERCAMP.COM_PLAYERCAMP_2) { ListView <HeroKDA> .Enumerator enumerator3 = rkda.GetEnumerator(); while (enumerator3.MoveNext()) { num2 += enumerator3.Current.numKillDragon + enumerator3.Current.numKillBaron; } } } this._campDragonText_1.text = num.ToString(); this._campDragonText_2.text = num2.ToString(); } }
private void OnCampDragonChange() { if (!this._root) { this.Clear(); return; } int num = 0; int num2 = 0; CPlayerKDAStat playerKDAStat = Singleton <BattleLogic> .GetInstance().battleStat.m_playerKDAStat; DictionaryView <uint, PlayerKDA> .Enumerator enumerator = playerKDAStat.GetEnumerator(); while (enumerator.MoveNext()) { KeyValuePair <uint, PlayerKDA> current = enumerator.Current; PlayerKDA value = current.get_Value(); if (value.PlayerCamp == COM_PLAYERCAMP.COM_PLAYERCAMP_1) { ListView <HeroKDA> .Enumerator enumerator2 = value.GetEnumerator(); while (enumerator2.MoveNext()) { num += enumerator2.Current.numKillDragon + enumerator2.Current.numKillBaron; } } else if (value.PlayerCamp == COM_PLAYERCAMP.COM_PLAYERCAMP_2) { ListView <HeroKDA> .Enumerator enumerator3 = value.GetEnumerator(); while (enumerator3.MoveNext()) { num2 += enumerator3.Current.numKillDragon + enumerator3.Current.numKillBaron; } } } this._campDragonText_1.set_text(num.ToString()); this._campDragonText_2.set_text(num2.ToString()); }
public HeroInfoSideItem(COM_PLAYERCAMP _listCamp, HeroKDA _heroKDA, int _listIndex, GameObject goNode) { this.listCamp = _listCamp; this.listIndex = _listIndex; this._headImg = Utility.GetComponetInChild <Image>(goNode, "Head"); this._reviveTxt = Utility.GetComponetInChild <Text>(goNode, "Revive"); this._levelText = Utility.GetComponetInChild <Text>(goNode, "Level"); this._skill3Bg = Utility.FindChild(goNode, "Skill-bg"); this._skill3Canbe = Utility.FindChild(goNode, "Skill-canbe"); this._nameText = Utility.GetComponetInChild <Text>(goNode, "Name"); this._heroInfo = _heroKDA; this._skill3Bg.CustomSetActive(true); this._nameText.gameObject.CustomSetActive(false); CPlayerKDAStat playerKDAStat = Singleton <BattleLogic> .GetInstance().battleStat.m_playerKDAStat; DictionaryView <uint, PlayerKDA> .Enumerator enumerator = playerKDAStat.GetEnumerator(); bool flag = false; while (enumerator.MoveNext()) { KeyValuePair <uint, PlayerKDA> current = enumerator.Current; PlayerKDA value = current.get_Value(); if (value.PlayerCamp == _listCamp) { ListView <HeroKDA> .Enumerator enumerator2 = value.GetEnumerator(); while (enumerator2.MoveNext()) { if (enumerator2.Current.HeroId == _heroKDA.HeroId) { this._nameText.gameObject.CustomSetActive(true); this._nameText.set_text(value.PlayerName); flag = true; break; } } } if (flag) { break; } } this._headImg.SetSprite(string.Format("{0}{1}", CUIUtility.s_Sprite_Dynamic_BustCircle_Dir, CSkinInfo.GetHeroSkinPic((uint)this._heroInfo.HeroId, 0u)), Singleton <CBattleSystem> .GetInstance().WatchFormScript, true, false, false, false); this.ValidateLevel(); this.ValidateReviceCD(); this.ValidateSkill3(); }
private static void Show3DModel(CUIFormScript belongForm) { CUI3DImageScript cUI3DImageScript = null; Transform transform = belongForm.transform.Find("Root/Panel_Award/3DImage"); if (transform != null) { cUI3DImageScript = transform.GetComponent <CUI3DImageScript>(); } if (cUI3DImageScript == null) { return; } CPlayerKDAStat playerKDAStat = Singleton <BattleLogic> .GetInstance().battleStat.m_playerKDAStat; PlayerKDA hostKDA = playerKDAStat.GetHostKDA(); if (hostKDA == null) { return; } ListView <HeroKDA> .Enumerator enumerator = hostKDA.GetEnumerator(); uint num = 0u; while (enumerator.MoveNext()) { HeroKDA current = enumerator.get_Current(); if (current != null) { num = (uint)current.HeroId; break; } } int heroWearSkinId = (int)Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo().GetHeroWearSkinId(num); GameObject gameObject = cUI3DImageScript.AddGameObject(CUICommonSystem.GetHeroPrefabPath(num, heroWearSkinId, true).ObjectName, false, false); CHeroAnimaSystem instance = Singleton <CHeroAnimaSystem> .GetInstance(); instance.Set3DModel(gameObject); if (gameObject == null) { return; } instance.InitAnimatList(); instance.InitAnimatSoundList(num, (uint)heroWearSkinId); }
public void Init(bool bWin) { this.m_allAchievements = new bool[8]; this.m_curAchievemnt = 8; if (Singleton <BattleLogic> .GetInstance().battleStat == null || Singleton <BattleLogic> .GetInstance().battleStat.m_playerKDAStat == null) { return; } PlayerKDA hostKDA = Singleton <BattleLogic> .GetInstance().battleStat.m_playerKDAStat.GetHostKDA(); if (hostKDA == null) { return; } uint mvpPlayer = Singleton <BattleStatistic> .get_instance().GetMvpPlayer(hostKDA.PlayerCamp, bWin); if (mvpPlayer != 0u && mvpPlayer == hostKDA.PlayerId) { this.m_allAchievements[7] = true; } COMDT_ACNT_INFO acntInfo = Singleton <BattleStatistic> .GetInstance().acntInfo; if (acntInfo != null) { if (acntInfo.dwCurWeekContinousWinNum == 15u) { this.m_allAchievements[0] = true; } else if (acntInfo.dwCurWeekContinousWinNum == 10u) { this.m_allAchievements[2] = true; } else if (acntInfo.dwCurWeekContinousWinNum == 5u) { this.m_allAchievements[4] = true; } } ListView <HeroKDA> .Enumerator enumerator = hostKDA.GetEnumerator(); while (enumerator.MoveNext()) { HeroKDA current = enumerator.get_Current(); if (current != null) { if (current.LegendaryNum > 0) { this.m_allAchievements[5] = true; } if (current.PentaKillNum > 0) { this.m_allAchievements[1] = true; } if (current.QuataryKillNum > 0) { this.m_allAchievements[3] = true; } if (current.TripleKillNum > 0) { this.m_allAchievements[6] = true; } } } }
public void CalculateKDA(COMDT_GAME_INFO gameInfo) { CRoleInfo masterRoleInfo = this.GetMasterRoleInfo(); DebugHelper.Assert(masterRoleInfo != null, "masterRoleInfo is null"); if (masterRoleInfo != null) { PlayerKDA hostKDA = Singleton <BattleStatistic> .GetInstance().m_playerKDAStat.GetHostKDA(); if (hostKDA != null) { int num = 0; int num2 = 0; int num3 = 0; int num4 = 0; int num5 = 0; int num6 = 0; int num7 = 0; int num8 = 0; int num9 = 0; int num10 = 0; int num11 = 0; int num12 = 0; ListView <HeroKDA> .Enumerator enumerator = hostKDA.GetEnumerator(); while (enumerator.MoveNext()) { if (enumerator.Current != null) { num += enumerator.Current.LegendaryNum; num2 += enumerator.Current.PentaKillNum; num3 += enumerator.Current.QuataryKillNum; num4 += enumerator.Current.TripleKillNum; num5 += enumerator.Current.DoubleKillNum; num8 += !enumerator.Current.bHurtMost ? 0 : 1; num9 += !enumerator.Current.bHurtTakenMost ? 0 : 1; num10 += !enumerator.Current.bGetCoinMost ? 0 : 1; num11 += !enumerator.Current.bAsssistMost ? 0 : 1; num12 += !enumerator.Current.bKillMost ? 0 : 1; } } if (gameInfo.bGameResult == 1) { uint mvpPlayer = Singleton <BattleStatistic> .instance.GetMvpPlayer(hostKDA.PlayerCamp, true); if (mvpPlayer != 0) { num6 = (mvpPlayer != hostKDA.PlayerId) ? 0 : 1; } } else if (gameInfo.bGameResult == 2) { uint num14 = Singleton <BattleStatistic> .instance.GetMvpPlayer(hostKDA.PlayerCamp, false); if (num14 != 0) { num7 = (num14 != hostKDA.PlayerId) ? 0 : 1; } } bool flag = false; bool flag2 = false; bool flag3 = false; bool flag4 = false; bool flag5 = false; bool flag6 = false; bool flag7 = false; bool flag8 = false; bool flag9 = false; bool flag10 = false; bool flag11 = false; bool flag12 = false; int index = 0; ListView <COMDT_STATISTIC_KEY_VALUE_INFO> inList = new ListView <COMDT_STATISTIC_KEY_VALUE_INFO>(); while (index < masterRoleInfo.pvpDetail.stKVDetail.dwNum) { COMDT_STATISTIC_KEY_VALUE_INFO comdt_statistic_key_value_info = masterRoleInfo.pvpDetail.stKVDetail.astKVDetail[index]; switch (comdt_statistic_key_value_info.dwKey) { case 13: comdt_statistic_key_value_info.dwValue += (uint)num6; flag6 = true; break; case 14: comdt_statistic_key_value_info.dwValue += (uint)num7; flag7 = true; break; case 15: comdt_statistic_key_value_info.dwValue += (uint)num; flag5 = true; break; case 0x10: comdt_statistic_key_value_info.dwValue += (uint)num5; flag = true; break; case 0x11: comdt_statistic_key_value_info.dwValue += (uint)num4; flag2 = true; break; case 0x1b: comdt_statistic_key_value_info.dwValue += (uint)num3; flag3 = true; break; case 0x1c: comdt_statistic_key_value_info.dwValue += (uint)num2; flag4 = true; break; case 0x1d: comdt_statistic_key_value_info.dwValue += (uint)num8; flag8 = true; break; case 30: comdt_statistic_key_value_info.dwValue += (uint)num10; flag10 = true; break; case 0x1f: comdt_statistic_key_value_info.dwValue += (uint)num9; flag9 = true; break; case 0x20: comdt_statistic_key_value_info.dwValue += (uint)num11; flag11 = true; break; case 0x21: comdt_statistic_key_value_info.dwValue += (uint)num12; flag12 = true; break; } index++; } COMDT_STATISTIC_KEY_VALUE_INFO item = null; if (!flag) { item = new COMDT_STATISTIC_KEY_VALUE_INFO { dwKey = 0x10, dwValue = (uint)num5 }; inList.Add(item); } if (!flag2) { item = new COMDT_STATISTIC_KEY_VALUE_INFO { dwKey = 0x11, dwValue = (uint)num4 }; inList.Add(item); } if (!flag3) { item = new COMDT_STATISTIC_KEY_VALUE_INFO { dwKey = 0x1b, dwValue = (uint)num3 }; inList.Add(item); } if (!flag4) { item = new COMDT_STATISTIC_KEY_VALUE_INFO { dwKey = 0x1c, dwValue = (uint)num2 }; inList.Add(item); } if (!flag5) { item = new COMDT_STATISTIC_KEY_VALUE_INFO { dwKey = 15, dwValue = (uint)num }; inList.Add(item); } if (!flag6) { item = new COMDT_STATISTIC_KEY_VALUE_INFO { dwKey = 13, dwValue = (uint)num6 }; inList.Add(item); } if (!flag7) { item = new COMDT_STATISTIC_KEY_VALUE_INFO { dwKey = 14, dwValue = (uint)num7 }; inList.Add(item); } if (!flag8) { item = new COMDT_STATISTIC_KEY_VALUE_INFO { dwKey = 0x1d, dwValue = (uint)num8 }; inList.Add(item); } if (!flag9) { item = new COMDT_STATISTIC_KEY_VALUE_INFO { dwKey = 0x1f, dwValue = (uint)num9 }; inList.Add(item); } if (!flag10) { item = new COMDT_STATISTIC_KEY_VALUE_INFO { dwKey = 30, dwValue = (uint)num10 }; inList.Add(item); } if (!flag11) { item = new COMDT_STATISTIC_KEY_VALUE_INFO { dwKey = 0x20, dwValue = (uint)num11 }; inList.Add(item); } if (!flag12) { item = new COMDT_STATISTIC_KEY_VALUE_INFO { dwKey = 0x21, dwValue = (uint)num12 }; inList.Add(item); } if (inList.Count > 0) { masterRoleInfo.pvpDetail.stKVDetail.dwNum += (uint)inList.Count; inList.AddRange(masterRoleInfo.pvpDetail.stKVDetail.astKVDetail); masterRoleInfo.pvpDetail.stKVDetail.astKVDetail = LinqS.ToArray <COMDT_STATISTIC_KEY_VALUE_INFO>(inList); } } } }
public void BattleStart() { if (this._heroWrapDict != null) { return; } this._lastUpdateFrame = 0u; this.TargetHeroId = Singleton <GamePlayerCenter> .GetInstance().GetHostPlayer().Captain.handle.ObjID; this._heroWrapDict = new DictionaryView <uint, HeroInfoItem>(); if (WatchForm.IsNeedShowCampMidInterface()) { this._heroWrapSideDict = new DictionaryView <uint, HeroInfoSideItem>(); } List <HeroKDA> list = new List <HeroKDA>(); List <HeroKDA> list2 = new List <HeroKDA>(); CPlayerKDAStat playerKDAStat = Singleton <BattleLogic> .GetInstance().battleStat.m_playerKDAStat; DictionaryView <uint, PlayerKDA> .Enumerator enumerator = playerKDAStat.GetEnumerator(); while (enumerator.MoveNext()) { KeyValuePair <uint, PlayerKDA> current = enumerator.Current; PlayerKDA value = current.get_Value(); if (value.PlayerCamp == COM_PLAYERCAMP.COM_PLAYERCAMP_1) { ListView <HeroKDA> .Enumerator enumerator2 = value.GetEnumerator(); while (enumerator2.MoveNext()) { list.Add(enumerator2.Current); } } else if (value.PlayerCamp == COM_PLAYERCAMP.COM_PLAYERCAMP_2) { ListView <HeroKDA> .Enumerator enumerator3 = value.GetEnumerator(); while (enumerator3.MoveNext()) { list2.Add(enumerator3.Current); } } } this.InitCampInfoUIList(COM_PLAYERCAMP.COM_PLAYERCAMP_1, list, this._camp1BaseList, this._camp1EquipList, this._camp1BaseSideList); this.InitCampInfoUIList(COM_PLAYERCAMP.COM_PLAYERCAMP_2, list2, this._camp2BaseList, this._camp2EquipList, this._camp2BaseSideList); Singleton <WatchController> .GetInstance().SwitchObserveCamp(COM_PLAYERCAMP.COM_PLAYERCAMP_COUNT); this.FocusHero(this.TargetHeroId); this.ValidateCampMoney(); if (this._heroInfoHud != null) { this._heroInfoHud.FightStart(); } this.RegisterEvents(); this._isBottomFold = false; this._isCampFold_1 = false; this.OnClickCampFold_1(null); this._isCampFold_2 = false; this.OnClickCampFold_2(null); this._isBottomLong = true; this.OnClickBottomEquipFold(null); this._isViewHide = false; float step = 150u * Singleton <WatchController> .GetInstance().FrameDelta * 0.001f; this.moneySample = new SampleData(step); this.expSample = new SampleData(step); this.dragonKillInfos.Clear(); this._lastSampleTime = 0f; Moba_Camera mobaCamera = MonoSingleton <CameraSystem> .GetInstance().MobaCamera; this.m_targetScaleVal = 1.2f; if (null != mobaCamera) { mobaCamera.currentZoomRate = 1.2f; mobaCamera.CameraUpdate(); } }
public void CalculateKDA(COMDT_GAME_INFO gameInfo) { CRoleInfo masterRoleInfo = this.GetMasterRoleInfo(); DebugHelper.Assert(masterRoleInfo != null, "masterRoleInfo is null"); if (masterRoleInfo != null) { PlayerKDA hostKDA = Singleton <BattleStatistic> .GetInstance().m_playerKDAStat.GetHostKDA(); if (hostKDA != null) { int num = 0; int num2 = 0; int num3 = 0; int num4 = 0; int num5 = 0; int num6 = 0; int num7 = 0; IEnumerator <HeroKDA> enumerator = hostKDA.GetEnumerator(); while (enumerator.MoveNext()) { if (enumerator.Current != null) { num += enumerator.Current.LegendaryNum; num2 += enumerator.Current.PentaKillNum; num3 += enumerator.Current.QuataryKillNum; num4 += enumerator.Current.TripleKillNum; num5 += enumerator.Current.DoubleKillNum; } } if (gameInfo.bGameResult == 1) { uint mvpPlayer = Singleton <BattleStatistic> .instance.GetMvpPlayer(hostKDA.PlayerCamp, true); if (mvpPlayer != 0) { num6 = (mvpPlayer != hostKDA.PlayerId) ? 0 : 1; } } else if (gameInfo.bGameResult == 2) { uint num9 = Singleton <BattleStatistic> .instance.GetMvpPlayer(hostKDA.PlayerCamp, false); if (num9 != 0) { num7 = (num9 != hostKDA.PlayerId) ? 0 : 1; } } bool flag = false; bool flag2 = false; bool flag3 = false; bool flag4 = false; bool flag5 = false; bool flag6 = false; bool flag7 = false; int index = 0; ListView <COMDT_STATISTIC_KEY_VALUE_INFO> inList = new ListView <COMDT_STATISTIC_KEY_VALUE_INFO>(); while (index < masterRoleInfo.pvpDetail.stKVDetail.dwNum) { COMDT_STATISTIC_KEY_VALUE_INFO comdt_statistic_key_value_info = masterRoleInfo.pvpDetail.stKVDetail.astKVDetail[index]; switch (((RES_STATISTIC_SETTLE_DATA_TYPE)comdt_statistic_key_value_info.dwKey)) { case RES_STATISTIC_SETTLE_DATA_TYPE.RES_STATISTIC_SETTLE_DATA_TYPE_MVP_CNT: comdt_statistic_key_value_info.dwValue += (uint)num6; flag6 = true; break; case RES_STATISTIC_SETTLE_DATA_TYPE.RES_STATISTIC_SETTLE_DATA_TYPE_LOSE_SOUL: comdt_statistic_key_value_info.dwValue += (uint)num7; flag7 = true; break; case RES_STATISTIC_SETTLE_DATA_TYPE.RES_STATISTIC_SETTLE_DATA_TYPE_GODLIKE_CNT: comdt_statistic_key_value_info.dwValue += (uint)num; flag5 = true; break; case RES_STATISTIC_SETTLE_DATA_TYPE.RES_STATISTIC_SETTLE_DATA_TYPE_DOUBLE_KILL_CNT: comdt_statistic_key_value_info.dwValue += (uint)num5; flag = true; break; case RES_STATISTIC_SETTLE_DATA_TYPE.RES_STATISTIC_SETTLE_DATA_TYPE_TRIPLE_KILL_CNT: comdt_statistic_key_value_info.dwValue += (uint)num4; flag2 = true; break; case RES_STATISTIC_SETTLE_DATA_TYPE.RES_STATISTIC_SETTLE_DATA_TYPE_QUATARY_KILL_CNT: comdt_statistic_key_value_info.dwValue += (uint)num3; flag3 = true; break; case RES_STATISTIC_SETTLE_DATA_TYPE.RES_STATISTIC_SETTLE_DATA_TYPE_PENTA_KILL_CNT: comdt_statistic_key_value_info.dwValue += (uint)num2; flag4 = true; break; } index++; } COMDT_STATISTIC_KEY_VALUE_INFO item = null; if (!flag) { item = new COMDT_STATISTIC_KEY_VALUE_INFO { dwKey = 0x10, dwValue = (uint)num5 }; inList.Add(item); } if (!flag2) { item = new COMDT_STATISTIC_KEY_VALUE_INFO { dwKey = 0x11, dwValue = (uint)num4 }; inList.Add(item); } if (!flag3) { item = new COMDT_STATISTIC_KEY_VALUE_INFO { dwKey = 0x1b, dwValue = (uint)num3 }; inList.Add(item); } if (!flag4) { item = new COMDT_STATISTIC_KEY_VALUE_INFO { dwKey = 0x1c, dwValue = (uint)num2 }; inList.Add(item); } if (!flag5) { item = new COMDT_STATISTIC_KEY_VALUE_INFO { dwKey = 15, dwValue = (uint)num }; inList.Add(item); } if (!flag6) { item = new COMDT_STATISTIC_KEY_VALUE_INFO { dwKey = 13, dwValue = (uint)num6 }; inList.Add(item); } if (!flag7) { item = new COMDT_STATISTIC_KEY_VALUE_INFO { dwKey = 14, dwValue = (uint)num7 }; inList.Add(item); } if (inList.Count > 0) { masterRoleInfo.pvpDetail.stKVDetail.dwNum += (uint)inList.Count; inList.AddRange(masterRoleInfo.pvpDetail.stKVDetail.astKVDetail); masterRoleInfo.pvpDetail.stKVDetail.astKVDetail = LinqS.ToArray <COMDT_STATISTIC_KEY_VALUE_INFO>(inList); } } } }
public void CalculateKDA(COMDT_GAME_INFO gameInfo) { CRoleInfo masterRoleInfo = this.GetMasterRoleInfo(); DebugHelper.Assert(masterRoleInfo != null, "masterRoleInfo is null"); if (masterRoleInfo == null) { return; } PlayerKDA hostKDA = Singleton <BattleStatistic> .GetInstance().m_playerKDAStat.GetHostKDA(); if (hostKDA != null) { int num = 0; int num2 = 0; int num3 = 0; int num4 = 0; int num5 = 0; int num6 = 0; int num7 = 0; int num8 = 0; int num9 = 0; int num10 = 0; int num11 = 0; int num12 = 0; ListView <HeroKDA> .Enumerator enumerator = hostKDA.GetEnumerator(); while (enumerator.MoveNext()) { if (enumerator.get_Current() != null) { num += enumerator.get_Current().LegendaryNum; num2 += enumerator.get_Current().PentaKillNum; num3 += enumerator.get_Current().QuataryKillNum; num4 += enumerator.get_Current().TripleKillNum; num5 += enumerator.get_Current().DoubleKillNum; num8 += ((!enumerator.get_Current().bHurtMost) ? 0 : 1); num9 += ((!enumerator.get_Current().bHurtTakenMost) ? 0 : 1); num10 += ((!enumerator.get_Current().bGetCoinMost) ? 0 : 1); num11 += ((!enumerator.get_Current().bAsssistMost) ? 0 : 1); num12 += ((!enumerator.get_Current().bKillMost) ? 0 : 1); } } if (gameInfo.bGameResult == 1) { uint mvpPlayer = Singleton <BattleStatistic> .get_instance().GetMvpPlayer(hostKDA.PlayerCamp, true); if (mvpPlayer != 0u) { num6 = ((mvpPlayer != hostKDA.PlayerId) ? 0 : 1); } } else if (gameInfo.bGameResult == 2) { uint mvpPlayer2 = Singleton <BattleStatistic> .get_instance().GetMvpPlayer(hostKDA.PlayerCamp, false); if (mvpPlayer2 != 0u) { num7 = ((mvpPlayer2 != hostKDA.PlayerId) ? 0 : 1); } } bool flag = false; bool flag2 = false; bool flag3 = false; bool flag4 = false; bool flag5 = false; bool flag6 = false; bool flag7 = false; bool flag8 = false; bool flag9 = false; bool flag10 = false; bool flag11 = false; bool flag12 = false; int num13 = 0; ListView <COMDT_STATISTIC_KEY_VALUE_INFO> listView = new ListView <COMDT_STATISTIC_KEY_VALUE_INFO>(); while ((long)num13 < (long)((ulong)masterRoleInfo.pvpDetail.stKVDetail.dwNum)) { COMDT_STATISTIC_KEY_VALUE_INFO cOMDT_STATISTIC_KEY_VALUE_INFO = masterRoleInfo.pvpDetail.stKVDetail.astKVDetail[num13]; switch (cOMDT_STATISTIC_KEY_VALUE_INFO.dwKey) { case 13u: cOMDT_STATISTIC_KEY_VALUE_INFO.dwValue += (uint)num6; flag6 = true; break; case 14u: cOMDT_STATISTIC_KEY_VALUE_INFO.dwValue += (uint)num7; flag7 = true; break; case 15u: cOMDT_STATISTIC_KEY_VALUE_INFO.dwValue += (uint)num; flag5 = true; break; case 16u: cOMDT_STATISTIC_KEY_VALUE_INFO.dwValue += (uint)num5; flag = true; break; case 17u: cOMDT_STATISTIC_KEY_VALUE_INFO.dwValue += (uint)num4; flag2 = true; break; case 27u: cOMDT_STATISTIC_KEY_VALUE_INFO.dwValue += (uint)num3; flag3 = true; break; case 28u: cOMDT_STATISTIC_KEY_VALUE_INFO.dwValue += (uint)num2; flag4 = true; break; case 29u: cOMDT_STATISTIC_KEY_VALUE_INFO.dwValue += (uint)num8; flag8 = true; break; case 30u: cOMDT_STATISTIC_KEY_VALUE_INFO.dwValue += (uint)num10; flag10 = true; break; case 31u: cOMDT_STATISTIC_KEY_VALUE_INFO.dwValue += (uint)num9; flag9 = true; break; case 32u: cOMDT_STATISTIC_KEY_VALUE_INFO.dwValue += (uint)num11; flag11 = true; break; case 33u: cOMDT_STATISTIC_KEY_VALUE_INFO.dwValue += (uint)num12; flag12 = true; break; } num13++; } if (!flag) { listView.Add(new COMDT_STATISTIC_KEY_VALUE_INFO { dwKey = 16u, dwValue = (uint)num5 }); } if (!flag2) { listView.Add(new COMDT_STATISTIC_KEY_VALUE_INFO { dwKey = 17u, dwValue = (uint)num4 }); } if (!flag3) { listView.Add(new COMDT_STATISTIC_KEY_VALUE_INFO { dwKey = 27u, dwValue = (uint)num3 }); } if (!flag4) { listView.Add(new COMDT_STATISTIC_KEY_VALUE_INFO { dwKey = 28u, dwValue = (uint)num2 }); } if (!flag5) { listView.Add(new COMDT_STATISTIC_KEY_VALUE_INFO { dwKey = 15u, dwValue = (uint)num }); } if (!flag6) { listView.Add(new COMDT_STATISTIC_KEY_VALUE_INFO { dwKey = 13u, dwValue = (uint)num6 }); } if (!flag7) { listView.Add(new COMDT_STATISTIC_KEY_VALUE_INFO { dwKey = 14u, dwValue = (uint)num7 }); } if (!flag8) { listView.Add(new COMDT_STATISTIC_KEY_VALUE_INFO { dwKey = 29u, dwValue = (uint)num8 }); } if (!flag9) { listView.Add(new COMDT_STATISTIC_KEY_VALUE_INFO { dwKey = 31u, dwValue = (uint)num9 }); } if (!flag10) { listView.Add(new COMDT_STATISTIC_KEY_VALUE_INFO { dwKey = 30u, dwValue = (uint)num10 }); } if (!flag11) { listView.Add(new COMDT_STATISTIC_KEY_VALUE_INFO { dwKey = 32u, dwValue = (uint)num11 }); } if (!flag12) { listView.Add(new COMDT_STATISTIC_KEY_VALUE_INFO { dwKey = 33u, dwValue = (uint)num12 }); } if (listView.get_Count() > 0) { masterRoleInfo.pvpDetail.stKVDetail.dwNum += (uint)listView.get_Count(); listView.AddRange(masterRoleInfo.pvpDetail.stKVDetail.astKVDetail); masterRoleInfo.pvpDetail.stKVDetail.astKVDetail = LinqS.ToArray <COMDT_STATISTIC_KEY_VALUE_INFO>(listView); } } }