예제 #1
0
        public EliteMonsterInfo AddData(Variant data)
        {
            uint             @uint = data["mid"]._uint;
            bool             flag  = !this.dicEMonInfo.ContainsKey(@uint);
            EliteMonsterInfo eliteMonsterInfo;

            if (flag)
            {
                eliteMonsterInfo = new EliteMonsterInfo(data.ContainsKey("kill_tm") ? data["kill_tm"]._uint : 0u, data.ContainsKey("respawntm") ? data["respawntm"]._uint : 0u, data.ContainsKey("killer_name") ? data["killer_name"]._str : "", data.ContainsKey("mapid") ? data["mapid"]._int : 0, (data.ContainsKey("mon_x") && data.ContainsKey("mon_y")) ? new Vector2((float)data["mon_x"]._int, (float)data["mon_y"]._int) : default(Vector2), @uint);
                this.dicEMonInfo.Add(@uint, eliteMonsterInfo);
                this.ReadRewardXml(@uint);
            }
            else
            {
                eliteMonsterInfo = this.dicEMonInfo[@uint];
            }
            return(eliteMonsterInfo);
        }
예제 #2
0
        public bool AddReportInfo(uint monId, EliteMonsterInfo message)
        {
            bool flag = this.dicMessageInfo.ContainsKey(monId);
            bool result;

            if (flag)
            {
                bool flag2 = this.dicMessageInfo[monId].lastKilledTime == message.lastKilledTime;
                if (flag2)
                {
                    result = false;
                    return(result);
                }
                this.dicMessageInfo[monId] = message;
            }
            else
            {
                this.dicMessageInfo.Add(monId, message);
            }
            result = true;
            return(result);
        }
        public EliteMonsterInfo AddData(Variant data)
        {
            uint             monId = data["mid"]._uint;
            EliteMonsterInfo monInfo;

            if (!dicEMonInfo.ContainsKey(monId))
            {
                monInfo = new EliteMonsterInfo(
                    lastKilledDate: data.ContainsKey("kill_tm") ? data["kill_tm"]._uint : 0,
                    respawnTime: data.ContainsKey("respawntm") ? data["respawntm"]._uint : 0,
                    killerName: data.ContainsKey("killer_name") ? data["killer_name"]._str : "",
                    mapId: data.ContainsKey("mapid") ? data["mapid"]._int : 0,
                    pos: data.ContainsKey("mon_x") && data.ContainsKey("mon_y") ? new Vector2(data["mon_x"]._int, data["mon_y"]._int) : Vector2.zero,
                    monId: monId);
                dicEMonInfo.Add(monId, monInfo);
                ReadRewardXml(monId);
            }
            else
            {
                monInfo = dicEMonInfo[monId];
            }
            return(monInfo);
        }
예제 #4
0
        private void RefreshEliteMonInfo(Variant data)
        {
            Dictionary <uint, EliteMonsterInfo> dicEMonInfo = ModelBase <A3_EliteMonsterModel> .getInstance().dicEMonInfo;

            bool flag = data.ContainsKey("elite_mon");

            if (flag)
            {
                List <Variant> arr = data["elite_mon"]._arr;
                for (int i = 0; i < arr.Count; i++)
                {
                    uint @uint = arr[i]["mid"]._uint;
                    bool flag2 = !dicEMonInfo.ContainsKey(@uint);
                    if (flag2)
                    {
                        ModelBase <A3_EliteMonsterModel> .getInstance().AddData(arr[i]);
                    }
                    else
                    {
                        dicEMonInfo[@uint] = new EliteMonsterInfo(arr[i].ContainsKey("kill_tm") ? arr[i]["kill_tm"]._uint : 0u, arr[i].ContainsKey("respawntm") ? arr[i]["respawntm"]._uint : 0u, arr[i].ContainsKey("killer_name") ? arr[i]["killer_name"]._str : null, arr[i].ContainsKey("mapid") ? arr[i]["mapid"]._int : 0, (arr[i].ContainsKey("mon_x") && arr[i].ContainsKey("mon_y")) ? new Vector2((float)arr[i]["mon_x"]._int, (float)arr[i]["mon_y"]._int) : default(Vector2), arr[i]["mid"]._uint);
                    }
                }
                uint up_lvl = ModelBase <PlayerModel> .getInstance().up_lvl;

                uint lvl = ModelBase <PlayerModel> .getInstance().lvl;

                int        num   = 30001;
                List <int> list  = new List <int>();
                bool       flag3 = data.ContainsKey("elite_mon");
                if (flag3)
                {
                    arr = data["elite_mon"]._arr;
                    for (int j = 0; j < arr.Count; j++)
                    {
                        list.Add(arr[j]["mid"]._int);
                    }
                }
                list.Sort();
                for (int k = 0; k < list.Count; k++)
                {
                    bool flag4 = up_lvl > XMLMgr.instance.GetSXML("monsters.monsters", "id==" + list[k]).getUint("zhuan");
                    if (flag4)
                    {
                        num = list[k];
                    }
                    else
                    {
                        bool flag5 = up_lvl == XMLMgr.instance.GetSXML("monsters.monsters", "id==" + list[k]).getUint("zhuan");
                        if (!flag5)
                        {
                            break;
                        }
                        bool flag6 = lvl >= XMLMgr.instance.GetSXML("monsters.monsters", "id==" + list[k]).getUint("zhuan");
                        if (!flag6)
                        {
                            num = list[k];
                            break;
                        }
                        num = list[k];
                    }
                }
                List <uint> list2 = new List <uint>();
                for (int l = 0; l < list.Count; l++)
                {
                    bool flag7 = list[l] <= num;
                    if (flag7)
                    {
                        foreach (Variant current in arr)
                        {
                            bool flag8 = current["mid"] == list[l];
                            if (flag8)
                            {
                                bool flag9 = current["kill_tm"] == 0;
                                if (flag9)
                                {
                                    IconAddLightMgr.getInstance().showOrHideFires("Open_Light_enterElite", null);
                                    break;
                                }
                                IconAddLightMgr.getInstance().showOrHideFires("jingyingguai_Light_enterElite", null);
                            }
                        }
                    }
                }
            }
        }
예제 #5
0
        private void RefreshEliteMonInfo(Variant data)
        {
            var            emonList = A3_EliteMonsterModel.getInstance().dicEMonInfo;
            List <Variant> listData;

            if (data.ContainsKey("elite_mon"))
            {
                listData = data["elite_mon"]._arr;
                for (int i = 0; i < listData.Count; i++)
                {
                    uint monId = listData[i]["mid"]._uint;

                    if (!emonList.ContainsKey(monId))
                    {
                        //emonList.Add(monId, new EliteMonsterInfo(
                        //    lastKilledDate: listData[i].ContainsKey("kill_tm") ? listData[i]["kill_tm"]._uint : 0,
                        //    respawnTime: listData[i].ContainsKey("respawntm") ? listData[i]["respawntm"]._uint : 0,
                        //    killerName: listData[i].ContainsKey("killer_name") ? listData[i]["killer_name"]._str : "",
                        //    mapId: listData[i].ContainsKey("mapid") ? listData[i]["mapid"]._int : 0,
                        //    pos: listData[i].ContainsKey("mon_x") && listData[i].ContainsKey("mon_y") ? new Vector2(listData[i]["mon_x"]._int, listData[i]["mon_y"]._int) : default(Vector2),
                        //    monId: listData[i]["mid"]._uint
                        //));
                        A3_EliteMonsterModel.getInstance().AddData(listData[i]);
                    }
                    else
                    {
                        emonList[monId] = new EliteMonsterInfo(
                            lastKilledDate: listData[i].ContainsKey("kill_tm") ? listData[i]["kill_tm"]._uint : 0,
                            respawnTime: listData[i].ContainsKey("respawntm") ? listData[i]["respawntm"]._uint : 0,
                            killerName: listData[i].ContainsKey("killer_name") ? listData[i]["killer_name"]._str : null,
                            mapId: listData[i].ContainsKey("mapid") ? listData[i]["mapid"]._int : 0,
                            pos: listData[i].ContainsKey("mon_x") && listData[i].ContainsKey("mon_y") ? new Vector2(listData[i]["mon_x"]._int, listData[i]["mon_y"]._int) : Vector2.zero,
                            monId: listData[i]["mid"]._uint
                            );
                    }
                    string name = "";
                    if (listData[i].ContainsKey("killer_name"))
                    {
                        name = listData[i]["killer_name"];
                    }
                    if (listData[i].ContainsKey("dmg_list") && listData[i]["dmg_list"].Count > 0)
                    {
                        debug.Log("伤害排行");
                        List <dmg_list> lst = new List <dmg_list>();
                        for (int j = 0; j < listData[i]["dmg_list"].Count; j++)
                        {
                            int      ranks = j;
                            dmg_list sl    = new dmg_list();
                            sl.mid      = listData[i]["mid"]._int;
                            sl.cid      = listData[i]["dmg_list"][j]["cid"]._int;
                            sl.name     = listData[i]["dmg_list"][j]["name"]._str;
                            sl.dmg      = listData[i]["dmg_list"][j]["dmg"]._int;
                            sl.rank     = ranks + 1;
                            sl.lat_name = name;
                            lst.Add(sl);
                            A3_EliteMonsterModel.getInstance().dic_dmg_lst[sl.mid] = lst;
                        }
                    }
                }
                //iconlight
                uint       zhuan = PlayerModel.getInstance().up_lvl;
                uint       lv    = PlayerModel.getInstance().lvl;
                int        mosid = 30001;//最后一个开启的怪物id
                List <int> mids  = new List <int>();
                if (data.ContainsKey("elite_mon"))
                {
                    listData = data["elite_mon"]._arr;
                    for (int i = 0; i < listData.Count; i++)
                    {
                        mids.Add(listData[i]["mid"]._int);
                    }
                }
                mids.Sort();
                for (int i = 0; i < mids.Count; i++)
                {
                    if (zhuan > XMLMgr.instance.GetSXML("monsters.monsters", "id==" + mids[i]).getUint("zhuan"))
                    {
                        mosid = mids[i];
                    }
                    else if (zhuan == XMLMgr.instance.GetSXML("monsters.monsters", "id==" + mids[i]).getUint("zhuan"))
                    {
                        if (lv >= XMLMgr.instance.GetSXML("monsters.monsters", "id==" + mids[i]).getUint("zhuan"))
                        {
                            mosid = mids[i];
                        }
                        else
                        {
                            mosid = mids[i]; break;
                        }
                    }
                    else
                    {
                        break;
                    }
                }
                List <uint> lsts = new List <uint>();
                for (int i = 0; i < mids.Count; i++)
                {
                    if (mids[i] <= mosid)
                    {
                        foreach (Variant v in listData)
                        {
                            if (v["mid"] == mids[i])
                            {
                                if (v["kill_tm"] == 0)
                                {
                                    //亮
                                    IconAddLightMgr.getInstance().showOrHideFires("Open_Light_enterElite", null);
                                    break;
                                }
                                else
                                {
                                    IconAddLightMgr.getInstance().showOrHideFires("jingyingguai_Light_enterElite", null);
                                }
                                //不亮
                            }
                        }
                    }
                }
            }
        }