Beispiel #1
0
    private static Texture[] PreloadTexture(GameObject tarObj, List <GameObject> parentPrefabList)
    {
        if (!IsSafe())
        {
            return(null);
        }
        Renderer[]         componentsInChildren = tarObj.GetComponentsInChildren <Renderer>(true);
        ListView <Texture> inList = new ListView <Texture>();

        foreach (Renderer renderer in componentsInChildren)
        {
            if ((renderer.sharedMaterials != null) && (renderer.sharedMaterials.Length > 0))
            {
                foreach (Material material in renderer.sharedMaterials)
                {
                    if ((material != null) && (material.mainTexture != null))
                    {
                        inList.Add(material.mainTexture);
                    }
                }
            }
        }
        foreach (NcSpriteTexture texture in tarObj.GetComponentsInChildren <NcSpriteTexture>(true))
        {
            if (texture.m_NcSpriteFactoryPrefab != null)
            {
                Texture[] collection = PreloadPrefab(texture.m_NcSpriteFactoryPrefab, parentPrefabList, false);
                if (collection != null)
                {
                    inList.AddRange(collection);
                }
            }
        }
        foreach (NcSpriteFactory factory in tarObj.GetComponentsInChildren <NcSpriteFactory>(true))
        {
            if (factory.m_SpriteList != null)
            {
                for (int i = 0; i < factory.m_SpriteList.Count; i++)
                {
                    if (factory.m_SpriteList[i].m_EffectPrefab != null)
                    {
                        Texture[] textureArray4 = PreloadPrefab(factory.m_SpriteList[i].m_EffectPrefab, parentPrefabList, true);
                        if (textureArray4 == null)
                        {
                            factory.m_SpriteList[i].m_EffectPrefab = null;
                        }
                        else
                        {
                            inList.AddRange(textureArray4);
                        }
                        if (factory.m_SpriteList[i].m_AudioClip != null)
                        {
                        }
                    }
                }
            }
        }
        return(LinqS.ToArray <Texture>(inList));
    }
Beispiel #2
0
        public static ListView <CUseable> CreateUsableListByRandowReward(RES_RANDOM_REWARD_TYPE type, int cnt, uint baseId)
        {
            ListView <CUseable> view = new ListView <CUseable>();

            if (type != RES_RANDOM_REWARD_TYPE.RES_RANDOM_REWARD_TYPE_NEST)
            {
                CUseable item = CreateUsableByRandowReward(type, cnt, baseId);
                if (item != null)
                {
                    view.Add(item);
                }
                return(view);
            }
            ResRandomRewardStore dataByKey = null;

            dataByKey = GameDataMgr.randomRewardDB.GetDataByKey(baseId);
            if (dataByKey != null)
            {
                for (int i = 0; i < dataByKey.astRewardDetail.Length; i++)
                {
                    if (dataByKey.astRewardDetail[i].bItemType == 0)
                    {
                        return(view);
                    }
                    if (dataByKey.astRewardDetail[i].bItemType >= 0x11)
                    {
                        return(view);
                    }
                    view.AddRange(CreateUsableListByRandowReward((RES_RANDOM_REWARD_TYPE)dataByKey.astRewardDetail[i].bItemType, (int)dataByKey.astRewardDetail[i].dwLowCnt, dataByKey.astRewardDetail[i].dwItemID));
                }
            }
            return(view);
        }
        public static ListView <CUseable> CreateUsableListByRandowReward(RES_RANDOM_REWARD_TYPE type, int cnt, uint baseId)
        {
            ListView <CUseable> view = new ListView <CUseable>();

            if (type != RES_RANDOM_REWARD_TYPE.RES_RANDOM_REWARD_TYPE_NEST)
            {
                CUseable item = CreateUsableByRandowReward(type, cnt, baseId);
                if (item != null)
                {
                    view.Add(item);
                }
                return(view);
            }
            ResRewardForWeal weal = new ResRewardForWeal();

            if (GameDataMgr.wealRewardDict.TryGetValue(baseId, out weal))
            {
                for (int i = 0; i < weal.astRewardDetail.Length; i++)
                {
                    if (weal.astRewardDetail[i].bItemType == 0)
                    {
                        return(view);
                    }
                    if (weal.astRewardDetail[i].bItemType >= 0x11)
                    {
                        return(view);
                    }
                    view.AddRange(CreateUsableListByRandowReward((RES_RANDOM_REWARD_TYPE)weal.astRewardDetail[i].bItemType, (int)weal.astRewardDetail[i].dwLowCnt, weal.astRewardDetail[i].dwItemID));
                }
            }
            return(view);
        }
Beispiel #4
0
        public override RefParamOperator TriggerEnter(PoolObjHandle <ActorRoot> src, PoolObjHandle <ActorRoot> atker, ITrigger inTrigger)
        {
            GameObject inSrc      = src ? src.handle.gameObject : null;
            GameObject gameObject = (inTrigger != null) ? inTrigger.GetTriggerObj() : null;

            if (!gameObject)
            {
                gameObject = (atker ? atker.handle.gameObject : null);
            }
            this.PlayAgeActionPrivate(AreaEventTrigger.EActTiming.Enter, inSrc, gameObject);
            ListView <Action> listView = this.PlayAgeActionPrivate(AreaEventTrigger.EActTiming.EnterDura, inSrc, gameObject);
            int num = this.RefObjList.Length;

            if (num > 0)
            {
                for (int i = 0; i < num; i++)
                {
                    this.PlayAgeActionPrivate(AreaEventTrigger.EActTiming.Enter, this.RefObjList[i], this.RefObjList[i]);
                    listView.AddRange(this.PlayAgeActionPrivate(AreaEventTrigger.EActTiming.EnterDura, this.RefObjList[i], this.RefObjList[i]));
                }
            }
            RefParamOperator refParamOperator = new RefParamOperator();

            refParamOperator.AddRefParam("TriggerActionAgeEnterDura", listView);
            return(refParamOperator);
        }
Beispiel #5
0
        public static ListView <CUseable> CreateUsableListByRandowReward(RES_RANDOM_REWARD_TYPE type, int cnt, uint baseId)
        {
            ListView <CUseable>  listView = new ListView <CUseable>();
            ResRandomRewardStore dataByKey;

            if (type != RES_RANDOM_REWARD_TYPE.RES_RANDOM_REWARD_TYPE_NEST)
            {
                CUseable cUseable = CUseableManager.CreateUsableByRandowReward(type, cnt, baseId);
                if (cUseable != null)
                {
                    listView.Add(cUseable);
                }
            }
            else if ((dataByKey = GameDataMgr.randomRewardDB.GetDataByKey(baseId)) != null)
            {
                for (int i = 0; i < dataByKey.astRewardDetail.Length; i++)
                {
                    if (dataByKey.astRewardDetail[i].bItemType == 0 || dataByKey.astRewardDetail[i].bItemType >= 18)
                    {
                        break;
                    }
                    listView.AddRange(CUseableManager.CreateUsableListByRandowReward((RES_RANDOM_REWARD_TYPE)dataByKey.astRewardDetail[i].bItemType, (int)dataByKey.astRewardDetail[i].dwLowCnt, dataByKey.astRewardDetail[i].dwItemID));
                }
            }
            return(listView);
        }
Beispiel #6
0
        private void ResetAssemblyList()
        {
            _assemblyList.Clear();
            var assemblies = AppDomain.CurrentDomain.GetAssemblies()
                             .Where(a => FilterAssembly(a, _assemblyList.FilterText));

            _assemblyList.AddRange(assemblies);
        }
Beispiel #7
0
        private void ResetMethodList()
        {
            var types = _typeList.Selections;

            _methodList.Title = $"Methods of {string.Join(",", types.Select(t => t.Name))}";

            _methodList.Clear();
            _methodList.AddRange(types.SelectMany(GetMethods).Where(FilterMethod));
        }
Beispiel #8
0
 public static T[] AppendElements<T>(T[] elements, T[] appendElements)
 {
     ListView<T> inList = new ListView<T>(elements);
     if (appendElements != null)
     {
         inList.AddRange(appendElements);
     }
     return LinqS.ToArray<T>(inList);
 }
        public static T[] AppendElements <T>(T[] elements, T[] appendElements)
        {
            ListView <T> listView = new ListView <T>(elements);

            if (appendElements != null)
            {
                listView.AddRange(appendElements);
            }
            return(LinqS.ToArray <T>(listView));
        }
Beispiel #10
0
        public override ListView <BehaviorNode> GetRunningNodes()
        {
            ListView <BehaviorNode> view = new ListView <BehaviorNode>();

            foreach (BehaviorTask task in this.m_children)
            {
                view.AddRange(task.GetRunningNodes());
            }
            return(view);
        }
        public override ListView <BehaviorNode> GetRunningNodes()
        {
            ListView <BehaviorNode> listView = new ListView <BehaviorNode>();

            foreach (BehaviorTask current in this.m_children)
            {
                listView.AddRange(current.GetRunningNodes());
            }
            return(listView);
        }
Beispiel #12
0
        public override ListView <BehaviorNode> GetRunningNodes()
        {
            ListView <BehaviorNode> listView = new ListView <BehaviorNode>();

            using (ListView <BehaviorTask> .Enumerator enumerator = this.m_children.GetEnumerator())
            {
                while (enumerator.MoveNext())
                {
                    BehaviorTask current = enumerator.get_Current();
                    listView.AddRange(current.GetRunningNodes());
                }
            }
            return(listView);
        }
Beispiel #13
0
        public override ListView <BehaviorNode> GetRunningNodes()
        {
            ListView <BehaviorNode> view        = new ListView <BehaviorNode>();
            BehaviorTask            currentTask = base.GetCurrentTask();

            if (currentTask == null)
            {
                currentTask = this.m_root;
            }
            if (currentTask != null)
            {
                view.AddRange(currentTask.GetRunningNodes());
            }
            return(view);
        }
Beispiel #14
0
        private void ResetTypeList()
        {
            var assemblies = _assemblyList.Selections;

            _typeList.Title = $"Types of {string.Join(",", assemblies.Select(a => a.GetName().Name))}";

            string filterText = _typeList.FilterText;

            _typeList.Clear();
            var types = assemblies
                        .SelectMany(a => a.GetTypes())
                        .Where(IsTypeSupported)
                        .Where(t => filterText == null || t.Name.Contains(filterText, StringComparison.OrdinalIgnoreCase));

            _typeList.AddRange(types);
        }
Beispiel #15
0
        public ListView <COMDT_FRIEND_INFO> GetAllFriend()
        {
            ListView <COMDT_FRIEND_INFO> view       = this._map[1];
            ListView <COMDT_FRIEND_INFO> collection = this._map[4];
            ListView <COMDT_FRIEND_INFO> friendList = new ListView <COMDT_FRIEND_INFO>();

            friendList.AddRange(collection);
            for (int i = 0; i < view.Count; i++)
            {
                if (!Singleton <CFriendContoller> .instance.FilterSameFriend(view[i], friendList))
                {
                    friendList.Add(view[i]);
                }
            }
            return(friendList);
        }
        public RewardWidget(GameObject node, ActivityView view) : base(node, view)
        {
            this._elementTmpl = Utility.FindChild(node, "Template");
            float height = this._elementTmpl.GetComponent <RectTransform>().rect.height;
            ListView <ActivityPhase> listView = new ListView <ActivityPhase>(view.activity.PhaseList.Count);

            listView.AddRange(view.activity.PhaseList);
            listView.Sort(new Comparison <ActivityPhase>(RewardWidget.APSort));
            this._rewardList = new ListView <RewardWidget.RewardListItem>();
            for (int i = 0; i < listView.Count; i++)
            {
                GameObject gameObject;
                if (i > 0)
                {
                    gameObject = (GameObject)Object.Instantiate(this._elementTmpl);
                    gameObject.transform.SetParent(this._elementTmpl.transform.parent);
                    gameObject.transform.localPosition = this._rewardList[i - 1].root.transform.localPosition + new Vector3(0f, -(height + 5f), 0f);
                    gameObject.transform.localScale    = Vector3.one;
                    gameObject.transform.localRotation = Quaternion.identity;
                }
                else
                {
                    this._elementTmpl.SetActive(true);
                    gameObject = this._elementTmpl;
                }
                RewardWidget.RewardListItem item = new RewardWidget.RewardListItem(gameObject, this, listView[i]);
                this._rewardList.Add(item);
            }
            if (this._rewardList.Count == 0)
            {
                this._elementTmpl.SetActive(false);
            }
            node.GetComponent <RectTransform>().sizeDelta = new Vector2(node.GetComponent <RectTransform>().sizeDelta.x, (this._rewardList.Count > 0) ? (height * (float)this._rewardList.Count + (float)(this._rewardList.Count - 1) * 5f) : 0f);
            Singleton <CUIEventManager> .GetInstance().AddUIEventListener(enUIEventID.Activity_ClickGet, new CUIEventManager.OnUIEventHandler(this.OnClickGet));

            this.Validate();
        }
Beispiel #17
0
    private static Texture[] PreloadTexture(GameObject tarObj, List <GameObject> parentPrefabList)
    {
        if (!NcEffectBehaviour.IsSafe())
        {
            return(null);
        }
        Renderer[]         componentsInChildren = tarObj.GetComponentsInChildren <Renderer>(true);
        ListView <Texture> listView             = new ListView <Texture>();

        Renderer[] array = componentsInChildren;
        for (int i = 0; i < array.Length; i++)
        {
            Renderer renderer = array[i];
            if (renderer.sharedMaterials != null && renderer.sharedMaterials.Length > 0)
            {
                Material[] sharedMaterials = renderer.sharedMaterials;
                for (int j = 0; j < sharedMaterials.Length; j++)
                {
                    Material material = sharedMaterials[j];
                    if (material != null && material.mainTexture != null)
                    {
                        listView.Add(material.mainTexture);
                    }
                }
            }
        }
        NcSpriteTexture[] componentsInChildren2 = tarObj.GetComponentsInChildren <NcSpriteTexture>(true);
        NcSpriteTexture[] array2 = componentsInChildren2;
        for (int k = 0; k < array2.Length; k++)
        {
            NcSpriteTexture ncSpriteTexture = array2[k];
            if (ncSpriteTexture.m_NcSpriteFactoryPrefab != null)
            {
                Texture[] array3 = NcEffectBehaviour.PreloadPrefab(ncSpriteTexture.m_NcSpriteFactoryPrefab, parentPrefabList, false);
                if (array3 != null)
                {
                    listView.AddRange(array3);
                }
            }
        }
        NcSpriteFactory[] componentsInChildren3 = tarObj.GetComponentsInChildren <NcSpriteFactory>(true);
        NcSpriteFactory[] array4 = componentsInChildren3;
        for (int l = 0; l < array4.Length; l++)
        {
            NcSpriteFactory ncSpriteFactory = array4[l];
            if (ncSpriteFactory.m_SpriteList != null)
            {
                for (int m = 0; m < ncSpriteFactory.m_SpriteList.get_Count(); m++)
                {
                    if (ncSpriteFactory.m_SpriteList.get_Item(m).m_EffectPrefab != null)
                    {
                        Texture[] array5 = NcEffectBehaviour.PreloadPrefab(ncSpriteFactory.m_SpriteList.get_Item(m).m_EffectPrefab, parentPrefabList, true);
                        if (array5 == null)
                        {
                            ncSpriteFactory.m_SpriteList.get_Item(m).m_EffectPrefab = null;
                        }
                        else
                        {
                            listView.AddRange(array5);
                        }
                        if (ncSpriteFactory.m_SpriteList.get_Item(m).m_AudioClip != null)
                        {
                        }
                    }
                }
            }
        }
        return(LinqS.ToArray <Texture>(listView));
    }
Beispiel #18
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);
                }
            }
        }
Beispiel #19
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);
                    }
                }
            }
        }
Beispiel #20
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);
                    }
                }
            }
        }
Beispiel #21
0
    public void AddPreloadActor(ref List <ActorPreloadTab> list, ref ActorMeta actorMeta, float spawnCnt, int ownerSkinID = 0)
    {
        ActorStaticData        inStaticData      = default(ActorStaticData);
        IGameActorDataProvider actorDataProvider = Singleton <ActorDataCenter> .instance.GetActorDataProvider(GameActorDataProviderType.StaticBattleDataProvider);

        actorDataProvider.GetActorStaticData(ref actorMeta, ref inStaticData);
        ActorServerData        actorServerData    = default(ActorServerData);
        IGameActorDataProvider actorDataProvider2 = Singleton <ActorDataCenter> .instance.GetActorDataProvider(GameActorDataProviderType.ServerDataProvider);

        actorDataProvider2.GetActorServerData(ref actorMeta, ref actorServerData);
        CActorInfo actorInfo = CActorInfo.GetActorInfo(inStaticData.TheResInfo.ResPath, enResourceType.BattleScene);

        if (actorInfo == null)
        {
            return;
        }
        for (int i = 0; i < list.get_Count(); i++)
        {
            ActorPreloadTab actorPreloadTab = list.get_Item(i);
            if (actorPreloadTab.theActor.ActorType == actorMeta.ActorType && actorPreloadTab.theActor.ConfigId == actorMeta.ConfigId)
            {
                if (actorMeta.ActorType == ActorTypeDef.Actor_Type_Hero || actorMeta.ActorType == ActorTypeDef.Actor_Type_Call)
                {
                    int actorMarkID = this.GetActorMarkID(actorMeta);
                    if (actorMarkID != actorPreloadTab.MarkID)
                    {
                        goto IL_13B;
                    }
                    uint skillID = 0u;
                    if (actorDataProvider2.GetActorServerCommonSkillData(ref actorMeta, out skillID))
                    {
                        this.AnalyseSkill(ref actorPreloadTab, (int)skillID);
                    }
                }
                else if (actorMeta.ActorType == ActorTypeDef.Actor_Type_Monster && spawnCnt > 0f)
                {
                    actorPreloadTab.spawnCnt += spawnCnt;
                    list.set_Item(i, actorPreloadTab);
                }
                LoaderHelper.retCnt++;
                return;
            }
            IL_13B :;
        }
        ActorPreloadTab actorPreloadTab2 = new ActorPreloadTab();

        actorPreloadTab2.theActor = actorMeta;
        actorPreloadTab2.modelPrefab.assetPath    = actorInfo.GetArtPrefabName((ownerSkinID != 0) ? ownerSkinID : ((int)actorServerData.SkinId), -1);
        actorPreloadTab2.modelPrefab.nInstantiate = 1;
        actorPreloadTab2.spawnCnt   = spawnCnt;
        actorPreloadTab2.MarkID     = this.GetActorMarkID(actorMeta);
        actorPreloadTab2.ageActions = new List <AssetLoadBase>();
        actorPreloadTab2.parPrefabs = new List <AssetLoadBase>();
        actorPreloadTab2.mesPrefabs = new List <AssetLoadBase>();
        if (actorServerData.SkinId != 0u)
        {
            actorInfo.PreLoadAdvanceSkin(actorPreloadTab2.mesPrefabs, actorServerData.SkinId, -1);
        }
        actorPreloadTab2.spritePrefabs = new List <AssetLoadBase>();
        actorPreloadTab2.soundBanks    = new List <AssetLoadBase>();
        actorPreloadTab2.behaviorXml   = new List <AssetLoadBase>();
        ActorStaticSkillData actorStaticSkillData = default(ActorStaticSkillData);

        for (int j = 0; j < 8; j++)
        {
            actorDataProvider.GetActorStaticSkillData(ref actorMeta, (ActorSkillSlot)j, ref actorStaticSkillData);
            this.AnalyseSkill(ref actorPreloadTab2, actorStaticSkillData.SkillId);
            this.AnalysePassiveSkill(ref actorPreloadTab2, actorStaticSkillData.PassiveSkillId);
        }
        if (actorMeta.ActorType == ActorTypeDef.Actor_Type_Hero || actorMeta.ActorType == ActorTypeDef.Actor_Type_Call)
        {
            int skillID2;
            int skillID3;
            int skillID4;
            int passiveSkillID;
            this.GetMapSkills(out skillID2, out skillID3, out skillID4, out passiveSkillID);
            this.AnalyseSkill(ref actorPreloadTab2, skillID2);
            this.AnalyseSkill(ref actorPreloadTab2, skillID3);
            this.AnalyseSkill(ref actorPreloadTab2, skillID4);
            this.AnalysePassiveSkill(ref actorPreloadTab2, passiveSkillID);
            uint skillID5 = 0u;
            if (actorDataProvider2.GetActorServerCommonSkillData(ref actorMeta, out skillID5))
            {
                this.AnalyseSkill(ref actorPreloadTab2, (int)skillID5);
            }
            this.AnalyseHeroBornAndReviveAge(ref actorPreloadTab2, actorMeta.ConfigId);
            ResHeroCfgInfo dataByKey = GameDataMgr.heroDatabin.GetDataByKey((uint)actorMeta.ConfigId);
            if (dataByKey != null)
            {
                this.AnalysePassiveSkill(ref actorPreloadTab2, dataByKey.iPassiveID1);
                this.AnalysePassiveSkill(ref actorPreloadTab2, dataByKey.iPassiveID2);
            }
        }
        else if (actorMeta.ActorType == ActorTypeDef.Actor_Type_Monster)
        {
            ActorStaticData        actorStaticData    = default(ActorStaticData);
            IGameActorDataProvider actorDataProvider3 = Singleton <ActorDataCenter> .instance.GetActorDataProvider(GameActorDataProviderType.StaticBattleDataProvider);

            actorDataProvider3.GetActorStaticData(ref actorMeta, ref actorStaticData);
            int randomPassiveSkillRule = actorStaticData.TheBaseAttribute.RandomPassiveSkillRule;
            if (randomPassiveSkillRule > 0 && !this.randomSkillCheckerSet.ContainsKey(randomPassiveSkillRule))
            {
                this.randomSkillCheckerSet.Add(randomPassiveSkillRule, true);
                ResRandomSkillPassiveRule dataByKey2 = GameDataMgr.randomSkillPassiveDatabin.GetDataByKey((long)randomPassiveSkillRule);
                if (dataByKey2.astRandomSkillPassiveID1 != null && dataByKey2.astRandomSkillPassiveID1.Length > 0)
                {
                    for (int k = 0; k < dataByKey2.astRandomSkillPassiveID1.Length; k++)
                    {
                        this.AnalysePassiveSkill(ref actorPreloadTab2, dataByKey2.astRandomSkillPassiveID1[k].iParam);
                    }
                }
                if (dataByKey2.astRandomSkillPassiveID2 != null && dataByKey2.astRandomSkillPassiveID2.Length > 0)
                {
                    for (int l = 0; l < dataByKey2.astRandomSkillPassiveID2.Length; l++)
                    {
                        this.AnalysePassiveSkill(ref actorPreloadTab2, dataByKey2.astRandomSkillPassiveID2[l].iParam);
                    }
                }
            }
            ResMonsterCfgInfo dataCfgInfoByCurLevelDiff = MonsterDataHelper.GetDataCfgInfoByCurLevelDiff(actorMeta.ConfigId);
            if (dataCfgInfoByCurLevelDiff != null && dataCfgInfoByCurLevelDiff.iBufDropID != 0 && dataCfgInfoByCurLevelDiff.iBufDropRate > 0)
            {
                ShenFuSystem.PreLoadShenfuResource(dataCfgInfoByCurLevelDiff.iBufDropID, ref actorPreloadTab2, this);
            }
            if (actorStaticData.TheMonsterOnlyInfo.SoldierType == 8 && dataCfgInfoByCurLevelDiff != null)
            {
                ListView <Assets.Scripts.GameLogic.SoldierWave> listView = new ListView <Assets.Scripts.GameLogic.SoldierWave>();
                int iKillByCamp1ChangeSoldierWave = dataCfgInfoByCurLevelDiff.iKillByCamp1ChangeSoldierWave;
                int iKillByCamp2ChangeSoldierWave = dataCfgInfoByCurLevelDiff.iKillByCamp2ChangeSoldierWave;
                listView.AddRange(SoldierRegion.GetWavesForPreLoad(iKillByCamp1ChangeSoldierWave));
                listView.AddRange(SoldierRegion.GetWavesForPreLoad(iKillByCamp2ChangeSoldierWave));
                for (int m = 0; m < listView.Count; m++)
                {
                    Assets.Scripts.GameLogic.SoldierWave soldierWave = listView[m];
                    if (soldierWave != null && soldierWave.WaveInfo != null && soldierWave.WaveInfo.astNormalSoldierInfo != null && soldierWave.WaveInfo.astNormalSoldierInfo.Length > 0)
                    {
                        for (int n = 0; n < soldierWave.WaveInfo.astNormalSoldierInfo.Length; n++)
                        {
                            ResSoldierTypeInfo resSoldierTypeInfo = soldierWave.WaveInfo.astNormalSoldierInfo[n];
                            if (resSoldierTypeInfo.dwSoldierID == 0u)
                            {
                                break;
                            }
                            ActorMeta actorMeta2 = default(ActorMeta);
                            ActorMeta actorMeta3 = actorMeta2;
                            actorMeta3.ActorType = ActorTypeDef.Actor_Type_Monster;
                            actorMeta3.ConfigId  = (int)resSoldierTypeInfo.dwSoldierID;
                            actorMeta2           = actorMeta3;
                            this.AddPreloadActor(ref list, ref actorMeta2, resSoldierTypeInfo.dwSoldierNum * 2f, 0);
                        }
                    }
                }
            }
        }
        if (!string.IsNullOrEmpty(actorInfo.deadAgePath))
        {
            actorPreloadTab2.ageActions.Add(new AssetLoadBase
            {
                assetPath = actorInfo.deadAgePath
            });
        }
        if (!string.IsNullOrEmpty(actorInfo.BtResourcePath) && !this.behaviorXmlSet.ContainsKey(actorInfo.BtResourcePath))
        {
            actorPreloadTab2.behaviorXml.Add(new AssetLoadBase
            {
                assetPath = actorInfo.BtResourcePath
            });
            this.behaviorXmlSet.Add(actorInfo.BtResourcePath, true);
        }
        actorPreloadTab2.soundBanks = new List <AssetLoadBase>();
        this.AnalyseSoundBanks(ref actorPreloadTab2, ref actorInfo, ref actorServerData);
        list.Add(actorPreloadTab2);
        if (actorMeta.ActorType == ActorTypeDef.Actor_Type_Hero)
        {
            this.CheckCallMonsterSkill(actorInfo, ref list, ref actorMeta, (int)actorServerData.SkinId);
        }
        else if (actorMeta.ActorType == ActorTypeDef.Actor_Type_Organ)
        {
            this.CheckOrganSoldierWave(ref list, ref actorMeta, inStaticData);
        }
    }