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("!");
        }
Exemplo n.º 2
0
        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 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);
                        }
                    }
                }
            }
        }
Exemplo n.º 4
0
        public void DoFightOver()
        {
            if (!this.m_bIsRecordMomentsEnable || !this.m_bIsStartRecordOk)
            {
                return;
            }
            this.UpdateRecordEvent(default(PoolObjHandle <ActorRoot>), CRecordUseSDK.RECORD_EVENT_PRIORITY.RECORD_EVENT_TYPE_INVALID);
            this.m_lGameEndTime = GameJoy.get_getSystemCurrentTimeMillis() - this.m_lGameStartTime;
            if (this.m_hostActor)
            {
                this.m_strHostPlayerName = this.m_hostActor.get_handle().name;
                uint mvpPlayer = Singleton <BattleStatistic> .get_instance().GetMvpPlayer(this.m_hostActor.get_handle().TheActorMeta.ActorCamp, true);

                if (mvpPlayer != 0u && mvpPlayer == this.m_hostActor.get_handle().TheActorMeta.PlayerId)
                {
                    this.m_bIsMvp = true;
                }
            }
            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)
                {
                    this.m_iHostPlaterKillNum   = hostKDA.numKill;
                    this.m_iHostPlaterDeadNum   = hostKDA.numDead;
                    this.m_iHostPlaterAssistNum = hostKDA.numAssist;
                }
            }
            this.StopMomentsRecording();
        }
Exemplo n.º 5
0
        public void OnActorRevive(ref DefaultGameEventParam prm)
        {
            uint hostPlayerId = Singleton <GamePlayerCenter> .get_instance().HostPlayerId;

            if (prm.src && prm.src.get_handle().TheActorMeta.PlayerId == hostPlayerId)
            {
                PlayerKDA playerKDA = Singleton <BattleStatistic> .GetInstance().m_playerKDAStat.GetPlayerKDA(hostPlayerId);

                if (playerKDA == null)
                {
                    return;
                }
                ListView <CHostHeroDamage> .Enumerator enumerator = playerKDA.m_hostHeroDamage.GetEnumerator();
                while (enumerator.MoveNext())
                {
                    if (enumerator.get_Current() != null)
                    {
                        enumerator.get_Current().OnActorRevive(ref prm);
                    }
                }
                if (prm.src == this.m_hostActor)
                {
                    this.OnDeadInfoFormClose(null);
                }
            }
        }
Exemplo n.º 6
0
        private int SortByCoinAndPos(Player left, Player right)
        {
            PlayerKDA playerKDA = Singleton <BattleStatistic> .get_instance().m_playerKDAStat.GetPlayerKDA(left.PlayerId);

            PlayerKDA playerKDA2 = Singleton <BattleStatistic> .get_instance().m_playerKDAStat.GetPlayerKDA(right.PlayerId);

            return((playerKDA2.TotalCoin - playerKDA.TotalCoin) * 10 + (left.CampPos - right.CampPos));
        }
Exemplo n.º 7
0
        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;
        }
Exemplo n.º 8
0
    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));
    }
Exemplo n.º 9
0
        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;
                }
            }
        }
Exemplo n.º 10
0
    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);
                            }
                        }
                    }
                }
            }
        }
    }
Exemplo n.º 11
0
        private void UpdateSelfKDADisplay()
        {
            CPlayerKDAStat playerKDAStat = Singleton <BattleLogic> .GetInstance().battleStat.m_playerKDAStat;

            if (playerKDAStat != null)
            {
                PlayerKDA hostKDA = playerKDAStat.GetHostKDA();
                if ((hostKDA != null) && (this._root != null))
                {
                    Utility.GetComponetInChild <Text>(this._root, "Kill").text   = SimpleNumericString.GetNumeric(hostKDA.numKill);
                    Utility.GetComponetInChild <Text>(this._root, "Death").text  = SimpleNumericString.GetNumeric(hostKDA.numDead);
                    Utility.GetComponetInChild <Text>(this._root, "Assist").text = SimpleNumericString.GetNumeric(hostKDA.numAssist);
                }
            }
        }
Exemplo n.º 12
0
        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());
                        }
                    }
                }
            }
        }
Exemplo n.º 13
0
        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);
                        }
                    }
                }
            }
        }
Exemplo n.º 14
0
        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 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();
        }
Exemplo n.º 16
0
        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;
            }
        }
Exemplo n.º 17
0
        private void UpdateSelfKDADisplay()
        {
            CPlayerKDAStat playerKDAStat = Singleton <BattleLogic> .GetInstance().battleStat.m_playerKDAStat;

            if (playerKDAStat == null)
            {
                return;
            }
            PlayerKDA hostKDA = playerKDAStat.GetHostKDA();

            if (hostKDA == null || this._root == null)
            {
                return;
            }
            Utility.GetComponetInChild <Text>(this._root, "Kill").set_text(SimpleNumericString.GetNumeric(hostKDA.numKill));
            Utility.GetComponetInChild <Text>(this._root, "Death").set_text(SimpleNumericString.GetNumeric(hostKDA.numDead));
            Utility.GetComponetInChild <Text>(this._root, "Assist").set_text(SimpleNumericString.GetNumeric(hostKDA.numAssist));
        }
Exemplo n.º 18
0
        private static void SetPlayerStat(CUIFormScript formScript, GameObject item, PlayerKDA playerKDA, HeroKDA kda)
        {
            Text componetInChild = Utility.GetComponetInChild <Text>(item, "Txt_PlayerName");

            componetInChild.text  = playerKDA.PlayerName;
            componetInChild.color = (playerKDA.PlayerCamp != COM_PLAYERCAMP.COM_PLAYERCAMP_1) ? new Color(0.545f, 0f, 0f, 1f) : new Color(0.031f, 0.961f, 0f, 1f);
            ResHeroCfgInfo dataByKey = GameDataMgr.heroDatabin.GetDataByKey((uint)kda.HeroId);

            DebugHelper.Assert(dataByKey != null);
            item.transform.Find("Txt_HeroName").gameObject.GetComponent <Text>().text = StringHelper.UTF8BytesToString(ref dataByKey.szName);
            string str  = (kda.numKill >= 10) ? kda.numKill.ToString() : string.Format(" {0} ", kda.numKill.ToString());
            string str2 = (kda.numDead >= 10) ? kda.numDead.ToString() : string.Format(" {0} ", kda.numDead.ToString());

            item.transform.Find("Txt_KDA").gameObject.GetComponent <Text>().text       = string.Format("{0} / {1}", str, str2);
            item.transform.Find("Txt_Hurt").gameObject.GetComponent <Text>().text      = kda.hurtToEnemy.ToString();
            item.transform.Find("Txt_HurtTaken").gameObject.GetComponent <Text>().text = kda.hurtTakenByEnemy.ToString();
            item.transform.Find("Txt_Heal").gameObject.GetComponent <Text>().text      = kda.hurtToHero.ToString();
            item.transform.Find("KillerImg").gameObject.GetComponent <Image>().SetSprite(string.Format("{0}{1}", CUIUtility.s_Sprite_Dynamic_Icon_Dir, CSkinInfo.GetHeroSkinPic((uint)kda.HeroId, 0)), formScript, true, false, false);
            item.CustomSetActive(true);
        }
Exemplo n.º 19
0
        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());
        }
Exemplo n.º 21
0
        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;
                    }
                }
            }
        }
Exemplo n.º 22
0
        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();
            }
        }
Exemplo n.º 23
0
        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);
                    }
                }
            }
        }
Exemplo n.º 24
0
        private void InitHeroDeadInfoForm()
        {
            this.m_hostActor = Singleton <GamePlayerCenter> .get_instance().GetHostPlayer().Captain;

            if (this.m_hostActor)
            {
                PlayerKDA playerKDA = Singleton <BattleStatistic> .GetInstance().m_playerKDAStat.GetPlayerKDA(Singleton <GamePlayerCenter> .get_instance().HostPlayerId);

                if (playerKDA == null)
                {
                    return;
                }
                ListView <CHostHeroDamage> .Enumerator enumerator = playerKDA.m_hostHeroDamage.GetEnumerator();
                while (enumerator.MoveNext())
                {
                    if (enumerator.get_Current() != null && this.m_hostActor.get_handle().ObjID == enumerator.get_Current().GetHostHeroObjId())
                    {
                        uint[]       arrDiffTypeHurtValue = new uint[4];
                        uint[]       array         = new uint[2];
                        uint         uiTotalDamage = 0u;
                        int          allActorsTotalDamageAndTopActorId = enumerator.get_Current().GetAllActorsTotalDamageAndTopActorId(ref array, 2, ref uiTotalDamage, ref arrDiffTypeHurtValue);
                        uint         uiObjId      = 0u;
                        ActorTypeDef actorTypeDef = ActorTypeDef.Invalid;
                        enumerator.get_Current().GetKillerObjId(ref uiObjId, ref actorTypeDef);
                        DOUBLE_INT_INFO[] array2 = new DOUBLE_INT_INFO[12];
                        int[]             array3 = new int[3];
                        for (int i = 0; i < 1 + allActorsTotalDamageAndTopActorId; i++)
                        {
                            if (i == 0)
                            {
                                enumerator.get_Current().GetActorDamage(uiObjId, ref array2);
                            }
                            else
                            {
                                enumerator.get_Current().GetActorDamage(array[i - 1], ref array2);
                            }
                            for (int j = 0; j <= 11; j++)
                            {
                                array3[i] += array2[j].iValue;
                            }
                        }
                        int num = (array3[0] <= array3[1]) ? array3[1] : array3[0];
                        num = ((num <= array3[2]) ? array3[2] : num);
                        for (int k = 0; k < 1 + allActorsTotalDamageAndTopActorId; k++)
                        {
                            if (k == 0)
                            {
                                Transform trHeroPanel = this.m_heroDeadInfoForm.transform.FindChild("PanelDeadInfo/KillerGounp/PanelKiller");
                                this.InitHeroPanelInfo(uiObjId, trHeroPanel, array3[k], uiTotalDamage, array3[k] == num, enumerator.get_Current());
                            }
                            else if (allActorsTotalDamageAndTopActorId == 2)
                            {
                                Transform trHeroPanel2 = this.m_heroDeadInfoForm.transform.FindChild("PanelDeadInfo/KillerGounp/PanelAssister" + (k - 1));
                                this.InitHeroPanelInfo(array[k - 1], trHeroPanel2, array3[k], uiTotalDamage, array3[k] == num, enumerator.get_Current());
                            }
                            else
                            {
                                Transform trHeroPanel3 = this.m_heroDeadInfoForm.transform.FindChild("PanelDeadInfo/KillerGounp/PanelAssister" + k);
                                this.InitHeroPanelInfo(array[k - 1], trHeroPanel3, array3[k], uiTotalDamage, array3[k] == num, enumerator.get_Current());
                            }
                        }
                        int   num2             = 0;
                        ulong hostHeroDeadTime = enumerator.get_Current().GetHostHeroDeadTime();
                        if (hostHeroDeadTime == (ulong)Singleton <BattleStatistic> .get_instance().m_battleDeadStat.m_uiFBTime)
                        {
                            num2 |= 2;
                        }
                        if (actorTypeDef == ActorTypeDef.Actor_Type_Organ)
                        {
                            num2 |= 4;
                        }
                        this.InitDeadInfoPanelBottomText(hostHeroDeadTime, arrDiffTypeHurtValue, uiTotalDamage, num2);
                        this.ResetFormSize(1 + allActorsTotalDamageAndTopActorId);
                        break;
                    }
                }
            }
        }
Exemplo n.º 25
0
        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);
                }
            }
        }
Exemplo n.º 26
0
        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);
                    }
                }
            }
        }