Exemple #1
0
 public override void onShowed()
 {
     a3_dartproxy.getInstance().sendDartGo();//查看军团镖车信息
     legionLvl = A3_LegionModel.getInstance().myLegion.lvl;
     InterfaceMgr.getInstance().changeState(InterfaceMgr.STATE_FUNCTIONBAR);
     initText(legionLvl);
 }
        void SetApply_Info_Tip()
        {
            Apply_Info info;

            if (A3_cityOfWarModel.getInstance().checkMineClan() != null)
            {
                info = A3_cityOfWarModel.getInstance().checkMineClan();
            }
            else
            {
                info = A3_cityOfWarModel.getInstance().GetApplyInfo_One(3);
            }
            if (info == null)
            {
                Minimum = 0;
            }
            else
            {
                Minimum = info.apply_num;
            }
            mineCost = Minimum + A3_cityOfWarModel.getInstance().min_cost;
            if (mineCost > A3_LegionModel.getInstance().myLegion.gold)
            {
                mineCost = 0;
            }
            inputTip.transform.FindChild("lastcount").GetComponent <Text>().text = Minimum.ToString();
            inputCost.text = mineCost.ToString();
        }
Exemple #3
0
 public override void onShowed()
 {
     if (uiData == null)
     {
         if (current != null)
         {
             current.onShowed();
         }
         else
         {
             tab.setSelectedIndex(0);
             OnSwitch(tab);
         }
     }
     else
     {
         int index = (int)uiData[0];
         if (uiData.Count > 1)
         {
             A3_LegionModel.getInstance().showtype = (int)uiData[1];
         }
         tab.setSelectedIndex(index);
         OnSwitch(tab);
     }
     if (teamList != null && (teamList == current || currentTeam == current))
     {
         TeamProxy.getInstance().SetTeamPanelInfo();
     }
     if (GRMap.GAME_CAMERA != null)
     {
         GRMap.GAME_CAMERA.SetActive(false);
     }
     Toclose = false;
     UiEventCenter.getInstance().onWinOpen(uiName);
 }
        public void RefresAward()
        {
            for (int i = 0; i < dic_away.Count; i++)
            {
                if (A3_LegionModel.getInstance().build_clan_get >= dic_away[i + 1].limit_donate)
                {
                    away[i + 1].transform.FindChild("this").gameObject.SetActive(true);
                    away[i + 1].transform.FindChild("ok").gameObject.SetActive(false);
                }
                else
                {
                    away[i + 1].transform.FindChild("this").gameObject.SetActive(false);
                    away[i + 1].transform.FindChild("ok").gameObject.SetActive(false);
                }
            }
            if (A3_LegionModel.getInstance().build_awd.Count > 0)
            {
                foreach (int key in A3_LegionModel.getInstance().build_awd.Keys)
                {
                    if (away.ContainsKey(key))
                    {
                        away[key].transform.FindChild("this").gameObject.SetActive(false);
                        away[key].transform.FindChild("ok").gameObject.SetActive(true);
                    }
                }
            }


            /*exp*/
            int   x   = dic_away[dic_away.Keys.Last()].limit_donate;
            float num = A3_LegionModel.getInstance().build_clan_get >= x ? 1 : (A3_LegionModel.getInstance().build_clan_get / (float)x);

            exp.transform.localScale = new Vector3(num, 1, 1);
        }
        public void RefreshTxt()
        {
            int num = A3_VipModel.getInstance().vip_exchange_num(22);

            today_build_count.text = ContMgr.getCont("a3_legion_build0") + (num - A3_LegionModel.getInstance().build_count).ToString() + "/" + num;
            personal_give.text     = ContMgr.getCont("a3_legion_build1") + A3_LegionModel.getInstance().build_my_get.ToString();
            today_build_money.text = A3_LegionModel.getInstance().build_clan_get.ToString();
        }
 public Apply_Info checkMineClan()
 {
     if (A3_LegionModel.getInstance().myLegion != null)
     {
         foreach (Apply_Info info in apply_list)
         {
             if (info.clan_id == A3_LegionModel.getInstance().myLegion.id)
             {
                 return(info);
             }
         }
     }
     return(null);
 }
        //选择功能按钮
        private void OnOptionBtnClick(GameObject go)
        {
            dialog.next();

            int taskId = 0;

            if (int.TryParse(go.name, out taskId))
            {
                List <string> ldesc = tkModel.GetDialogkDesc(taskId);
                tkModel.curTask = tkModel.GetTaskDataById(taskId);

                dialog.showTalk(ldesc, null, dialog.m_npc);

                //OnCompleteTalk();
            }
            else
            {
                string    opName = go.name;
                ArrayList lst    = new ArrayList();
                if (opName == "a3_npc_shop")
                {
                    lst.Add(npc_id);
                    // List<SXML> listNPCShop= XMLMgr.instance.GetSXMLList("npc_shop.npc_shop", "npc_id==" + npc_id);
                    //A3_NPCShopModel.getInstance().listNPCShop.Clear();
                    //A3_NPCShopModel.getInstance().listNPCShop = listNPCShop;
                    //A3_NPCShopProxy.getInstance().sendShowFloat((uint)listNPCShop[0].getInt("shop_id"));
                }
                if (opName == "a3_legi  on_dart")
                {
                    if (A3_LegionModel.getInstance().myLegion.id == 0)
                    {
                        flytxt.instance.fly(ContMgr.getCont("npctasktalk10"));
                        return;
                    }
                }
                if (opName == "a3_npc_shop")
                {
                    InterfaceMgr.getInstance().ui_async_open(opName, lst);
                }
                else
                {
                    InterfaceMgr.getInstance().ui_async_open(opName);
                }
                //List<string> ldesc = new List<string>() { "1:让我准备准备" };
                //dialog.showTalk(ldesc,
                //    () => InterfaceMgr.getInstance().open(opName),
                //    dialog.m_npc);
            }
        }
 public DragonInfo GetCurDragonLvInfo()
 {
     if (A3_LegionModel.getInstance().myLegion.id != 0)
     {
         List <int> idx = new List <int>(dicDragonInfo.Keys);
         for (int i = idx.Count - 1; i >= 0; i--)
         {
             if (dicDragonInfo[idx[i]].clan_lv <= A3_LegionModel.getInstance().myLegion.lvl)
             {
                 return(dicDragonInfo[idx[i]]);
             }
         }
     }
     return(null);
 }
 public int GetUnlockedDiffLv()
 {
     if (A3_LegionModel.getInstance().myLegion.id != 0)
     {
         List <int> idx = new List <int>(dicDragonInfo.Keys);
         for (int i = idx.Count - 1; i >= 0; i--)
         {
             if (dicDragonInfo[idx[i]].clan_lv <= A3_LegionModel.getInstance().myLegion.lvl)
             {
                 return(dicDragonInfo[idx[i]].diff_lvl);
             }
         }
     }
     return(0);
 }
 public uint GetDragonKeyId()
 {
     if (A3_LegionModel.getInstance().myLegion.id != 0)
     {
         List <int> idx = new List <int>(dicDragonInfo.Keys);
         for (int i = idx.Count - 1; i >= 0; i--)
         {
             if (dicDragonInfo[idx[i]].clan_lv <= A3_LegionModel.getInstance().myLegion.lvl)
             {
                 return(dicDragonInfo[idx[i]].item_id);
             }
         }
     }
     return(0);
 }
Exemple #11
0
        private void OnSearchMember(GameEvent e)
        {
            Variant data = e.data;
            bool    flag = data.ContainsKey("res");

            if (flag)
            {
                bool flag2 = data["res"] < 0;
                if (flag2)
                {
                    return;
                }
            }
            uint num = data["cid"];

            this.inviteNum = num;
            int    num2  = data["combpt"];
            int    i     = data["carr"];
            int    num3  = data["zhuan"];
            int    num4  = data["lvl"];
            string text  = data["name"];
            int    num5  = data["clid"];
            bool   flag3 = data["online"];

            this.s6.FindChild("sa").gameObject.SetActive(true);
            this.s6.FindChild("sa/Text").GetComponent <Text>().text = string.Concat(new object[]
            {
                "ID:",
                num,
                "       昵称:",
                text,
                "     职业:",
                A3_LegionModel.GetCarr(i),
                "      等级:",
                num3,
                "转",
                num4,
                "级"
            });
            bool flag4 = num5 != 0;

            if (flag4)
            {
                flytxt.instance.fly("玩家已有军团", 0, default(Color), null);
            }
        }
 private void OnGoToSlayDragon(GameObject go)
 {
     if (A3_LegionModel.getInstance().myLegion.clanc < 3 && !A3_SlayDragonModel.getInstance().GetUnlockedDragonData().isOpened)
     {
         flytxt.instance.fly(ContMgr.getCont("A3_SlayDragon_noopen"));
         return;
     }
     if (0 != A3_SlayDragonModel.getInstance().GetUnlockedDragonId())
     {
         isOnMoveOpt = true;
         A3_SlayDragonProxy.getInstance().SendGo();
     }
     else
     {
         flytxt.instance.fly(ContMgr.getCont("A3_SlayDragon_jf"));
     }
 }
        private void OnGive(GameObject go)
        {
            uint       unlockedDragonId = 0;
            DragonData curDrgnData      = A3_SlayDragonModel.getInstance().dicDragonData[currentSelectedDragonName];

            if (0 != (unlockedDragonId = A3_SlayDragonModel.getInstance().GetUnlockedDragonId()) && unlockedDragonId == curDrgnData.dragonId)
            {
                uint itemId = A3_SlayDragonModel.getInstance().GetDragonKeyId();
                if (0 != itemId)
                {
                    if (0 < a3_BagModel.getInstance().getItemNumByTpid(itemId))
                    {
                        if (curDrgnData.proc < A3_SlayDragonModel.getInstance().GetCost())
                        {
                            A3_SlayDragonProxy.getInstance().SendGive();
                        }
                        else
                        {
                            flytxt.instance.fly(ContMgr.getCont("A3_SlayDragon_can"));
                        }
                    }
                    else
                    {
                        ArrayList data = new ArrayList();
                        data.Add(a3_BagModel.getInstance().getItemDataById(itemId));
                        InterfaceMgr.getInstance().ui_async_open(InterfaceMgr.A3_ITEMLACK, data);
                    }
                }
            }
            else
            {
                if (A3_LegionModel.getInstance().myLegion.clanc < 3)
                {
                    flytxt.instance.fly(ContMgr.getCont("A3_SlayDragon_jf"));
                }
                else
                {
                    flytxt.instance.fly(ContMgr.getCont("A3_SlayDragon_please"));
                }
            }
        }
 public bool CanInFB()
 {
     if (A3_LegionModel.getInstance().myLegion != null)
     {
         if (checkTime() == TimeType.WarStart)
         {
             if (A3_LegionModel.getInstance().myLegion.id == def_clanid)
             {
                 return(true);
             }
             foreach (Apply_Info info in apply_list)
             {
                 if (info.clan_id == A3_LegionModel.getInstance().myLegion.id)
                 {
                     return(true);
                 }
             }
         }
     }
     return(false);
 }
        void SetWinBtn(TimeType type)
        {
            switch (type)
            {
            case TimeType.ApplyTime:
                this.transform.FindChild("letters/apply/local").gameObject.SetActive(false);
                this.transform.FindChild("letters/Prepare/local").gameObject.SetActive(true);
                if (A3_LegionModel.getInstance().myLegion.id != A3_cityOfWarModel.getInstance().def_clanid)
                {
                    this.transform.FindChild("viewbg/applyview/apply_btn").gameObject.SetActive(true);
                }
                else
                {
                    this.transform.FindChild("viewbg/applyview/apply_btn").gameObject.SetActive(false);
                }
                this.transform.FindChild("viewbg/applyview/infb_btn").gameObject.SetActive(false);
                break;

            case TimeType.PrepareTime:
                this.transform.FindChild("letters/apply/local").gameObject.SetActive(false);
                this.transform.FindChild("letters/Prepare/local").gameObject.SetActive(false);
                this.transform.FindChild("viewbg/applyview/apply_btn").gameObject.SetActive(false);
                this.transform.FindChild("viewbg/applyview/infb_btn").gameObject.SetActive(false);
                break;

            case TimeType.WarStart:
                this.transform.FindChild("letters/apply/local").gameObject.SetActive(false);
                this.transform.FindChild("letters/Prepare/local").gameObject.SetActive(true);
                this.transform.FindChild("viewbg/applyview/apply_btn").gameObject.SetActive(false);
                this.transform.FindChild("viewbg/applyview/infb_btn").gameObject.SetActive(true);
                break;

            case TimeType.WarOver:
                this.transform.FindChild("letters/apply/local").gameObject.SetActive(false);
                this.transform.FindChild("letters/Prepare/local").gameObject.SetActive(true);
                this.transform.FindChild("viewbg/applyview/apply_btn").gameObject.SetActive(false);
                this.transform.FindChild("viewbg/applyview/infb_btn").gameObject.SetActive(false);
                break;
            }
        }
 private void OnUnlockDragon(GameObject go)
 {
     if (A3_LegionModel.getInstance().myLegion.clanc >= 3)
     {
         if (currentSelectedDragonName != null)
         {
             DragonData dragonData = A3_SlayDragonModel.getInstance().dicDragonData[currentSelectedDragonName];
             if (!dragonData.isUnlcoked && 0 == A3_SlayDragonModel.getInstance().GetUnlockedDragonId())
             {
                 A3_SlayDragonProxy.getInstance().SendUnlock(dragonData.dragonId);
             }
             else
             {
                 flytxt.instance.fly(ContMgr.getCont("A3_SlayDragon_nomany"));
             }
         }
     }
     else
     {
         flytxt.instance.fly(ContMgr.getCont("A3_SlayDragon_kustllx"));
     }
 }
Exemple #17
0
        //请求日志信息
        public void SendGetDiary()
        {
            Variant msg = new Variant();

            msg["clan_cmd"] = EVENT_GETDIARY;
            if (A3_LegionModel.getInstance().logdata != null &&
                A3_LegionModel.getInstance().logdata.ContainsKey("clanlog_list") &&
                A3_LegionModel.getInstance().logdata["clanlog_list"]._arr.Count > 0)
            {
                Variant list = A3_LegionModel.getInstance().logdata["clanlog_list"];
                int     id   = 0;
                foreach (var v in list._arr)
                {
                    int x = v["id"];
                    if (x > id)
                    {
                        id = x;
                    }
                }
                msg["id"] = id;
            }
            sendRPC(PKG_NAME.C2S_CREATE_CLAN_RES, msg);
        }
Exemple #18
0
        void OnLegion(Variant data)
        {
            int res = data["res"];

            debug.Log("军团消息" + data.dump());
            //if (res < 0)
            //{
            //    Globle.err_output(res);
            //    return;
            //}
            Variant vd = new Variant();

            switch (res)
            {
            case EVENT_GETINFO:
                //if (data.ContainsKey("direct_join_clan"))
                //{

                //}
                if (data.ContainsKey("id"))
                {
                    A3_LegionData d = new A3_LegionData();
                    d.id     = data["id"];
                    d.lvl    = data["lvl"];
                    d.clname = data["clname"];
                    d.name   = data["name"];
                    d.notice = data["notice"];
                    d.gold   = data["money"];
                    d.plycnt = data["plycnt"];
                    d.exp    = data["clan_pt"];
                    if (data.ContainsKey("ol_cnt"))
                    {
                        d.ol_cnt = data["ol_cnt"];
                    }
                    if (data.ContainsKey("combpt"))
                    {
                        d.combpt = data["combpt"];
                    }
                    if (data.ContainsKey("rankidx"))
                    {
                        d.rankidx = data["rankidx"];
                    }
                    if (data.ContainsKey("clanc"))
                    {
                        d.clanc = data["clanc"];
                    }
                    d.anabasis_tm = data["anabasis_tm"];
                    A3_LegionModel.getInstance().myLegion = d;
                    int b = data["direct_join"];
                    A3_LegionModel.getInstance().CanAutoApply = b == 1 ? true : false;
                    A3_LegionModel.getInstance().SetMyLegion(d.lvl);
                    A3_LegionModel.getInstance().donate = data["donate"];
                    // a3_legion_info.mInstance.jx_up(d.gold,d.lvl);
                    gold = d.gold;
                    lvl  = d.lvl;
                }
                else
                {
                    A3_LegionModel.getInstance().myLegion = new A3_LegionData();
                }
                dispatchEvent(GameEvent.Create(EVENT_GETINFO, this, data));
                break;

            case EVENT_CREATE:
                dispatchEvent(GameEvent.Create(EVENT_CREATE, this, data));
                removeEventListener(A3_LegionProxy.EVENT_CHECKNAME, a3_legion.mInstance.SetCheckName);
                //a3_herohead.instance.legion_bf = true;
                //a3_herohead.instance.isclear = true;
                //if (a3_herohead.instance != null)
                //    a3_herohead.instance.refresBuff();
                break;

            case EVENT_APPLYFOR:
                int clid = data["clid"];
                dispatchEvent(GameEvent.Create(EVENT_APPLYFOR, this, data));
                flytxt.instance.fly(ContMgr.getCont("Legion_ok"));
                break;

            case EVENT_LVUP:
                A3_LegionModel.getInstance().myLegion.gold = data["money"];
                A3_LegionModel.getInstance().myLegion.lvl = data["lvl"];
                A3_LegionModel.getInstance().myLegion.exp = 0;
                A3_LegionModel.getInstance().SetMyLegion(A3_LegionModel.getInstance().myLegion.lvl);
                dispatchEvent(GameEvent.Create(EVENT_GETINFO, this, data));
                flytxt.instance.fly(ContMgr.getCont("Legionup_ok"));
                break;

            case EVENT_GETMEMBER:    //14
                vd = data["pls"];
                A3_LegionModel.getInstance().members.Clear();
                foreach (var v in vd._arr)
                {
                    A3_LegionModel.getInstance().AddMember(v);
                }
                dispatchEvent(GameEvent.Create(EVENT_GETMEMBER, this, data));
                //if (a3_legion.mInstance == null)
                //    cacheProxyData = data;
                break;

            case EVENT_APPROVEORREJECT:
                dispatchEvent(GameEvent.Create(EVENT_APPROVEORREJECT, this, data));
                break;

            case EVENT_QUIT:
                A3_LegionModel.getInstance().myLegion = new A3_LegionData();
                dispatchEvent(GameEvent.Create(EVENT_QUIT, this, data));
                if (a3_task_auto.instance.executeTask?.taskT == TaskType.CLAN)
                {
                    SelfRole.fsm.Stop();
                    flytxt.instance.fly(ContMgr.getCont("Legion_out"));
                }
                else
                {
                    flytxt.instance.fly(ContMgr.getCont("Legionout_ok"));
                }
                //a3_herohead.instance.legion_bf = false;
                //a3_herohead.instance.isclear =true;
                //if (a3_herohead.instance != null)
                //    a3_herohead.instance.refresBuff();


                break;

            case EVENT_UPBUFF:

                flytxt.instance.fly(ContMgr.getCont("Legionbuff_up"));
                break;



            case EVENT_DONATE:
                int money = data["money"];
                //flytxt.instance.fly("获得了" + money / 1000 + "点贡献度");
                flytxt.instance.fly(ContMgr.getCont("Legiondonate_add", new List <string> {
                    (money / 1000).ToString()
                }));
                SendGetInfo();
                break;

            case EVENT_GETAPPLICANT:
                A3_LegionModel.getInstance().RefreshApplicant(data);
                dispatchEvent(GameEvent.Create(EVENT_GETAPPLICANT, this, data));
                break;

            case EVENT_CHANGENOTICE:
                dispatchEvent(GameEvent.Create(EVENT_CHANGENOTICE, this, data));
                break;

            case EVENT_INVITE:

                dispatchEvent(GameEvent.Create(EVENT_INVITE, this, data));
                break;

            case EVENT_BELEADER:
                SendGetMember();
                break;

            case EVENT_GETDIARY:
                if (data != null && data.ContainsKey("clanlog_list") && data["clanlog_list"]._arr.Count > 0)
                {
                    A3_LegionModel.getInstance().AddLog(data);
                }
                dispatchEvent(GameEvent.Create(EVENT_GETDIARY, this, data));
                break;

            case EVENT_APPLYMODE:
                int c = data["direct_join"];
                A3_LegionModel.getInstance().CanAutoApply = c == 1 ? true : false;
                dispatchEvent(GameEvent.Create(EVENT_APPLYMODE, this, data));
                break;

            case EVENT_CHECKNAME:
                dispatchEvent(GameEvent.Create(EVENT_CHECKNAME, this, data));
                break;

            case EVENT_DELETECLAN:
                SendGetInfo();
                dispatchEvent(GameEvent.Create(EVENT_DELETECLAN, this, data));
                flytxt.instance.fly(ContMgr.getCont("Legion_bye"));
                //a3_herohead.instance.legion_bf = false;
                //a3_herohead.instance.isclear = true;
                //if (a3_herohead.instance != null)
                //    a3_herohead.instance.refresBuff();
                break;

            case EVENT_LOADLIST:
                A3_LegionModel.getInstance().list.Clear();
                A3_LegionModel.getInstance().list2.Clear();
                vd = data["info"];
                foreach (var v in vd._arr)
                {
                    A3_LegionData d = new A3_LegionData();
                    d.id          = v["id"];
                    d.clname      = v["clname"];
                    d.combpt      = v["combpt"];
                    d.lvl         = v["lvl"];
                    d.name        = v["name"];
                    d.plycnt      = v["plycnt"];
                    d.direct_join = v["direct_join"];
                    d.huoyue      = v["last_active"];
                    A3_LegionModel.getInstance().list.Add(d);
                    A3_LegionModel.getInstance().list2.Add(d);
                }

                //for (int i = 0; i < A3_LegionModel.getInstance().list.Count; i++)
                //{
                //    for (int j = 0; j < A3_LegionModel.getInstance().list.Count; j++)
                //    {
                //        if (A3_LegionModel.getInstance().list[i].id > A3_LegionModel.getInstance().list[j].id)
                //        {
                //            A3_LegionData temp = A3_LegionModel.getInstance().list[i];
                //            A3_LegionModel.getInstance().list[i] = A3_LegionModel.getInstance().list[j];
                //            A3_LegionModel.getInstance().list[j] = temp;

                //        }
                //    }
                //}



                dispatchEvent(GameEvent.Create(EVENT_LOADLIST, this, data));
                break;

            case EVENT_REMOVE:
                int ci = data["cid"];
                if (A3_LegionModel.getInstance().members.ContainsKey(ci))
                {
                    A3_LegionModel.getInstance().members.Remove(ci);
                }
                dispatchEvent(GameEvent.Create(EVENT_GETMEMBER, this, data));
                break;

            case EVENT_REPAIR:

                dispatchEvent(GameEvent.Create(EVENT_REPAIR, this, data));

                break;

            case EVENT_TASKREWARD:
                if (A3_LegionModel.getInstance().myLegion.id != 0)
                {
                    int taskCount;
                    if (A3_TaskModel.getInstance() == null || A3_TaskModel.getInstance().GetClanTask() == null)
                    {
                        taskCount = 9;
                    }
                    else
                    {
                        taskCount = A3_TaskModel.getInstance().GetClanTask().taskCount;
                    }
                    Dictionary <uint, int> rewardDic = A3_TaskModel.getInstance().GetClanRewardDic(taskCount);
                    flytxt.instance.StopDelayFly();
                    if (data.ContainsKey("money"))
                    {
                        if (rewardDic.ContainsKey((uint)A3_TaskModel.REWARD_CLAN_MONEY))
                        {
                            flytxt.instance.AddDelayFlytxt(ContMgr.getCont("Legion_money", new List <string> {
                                (rewardDic[(uint)A3_TaskModel.REWARD_CLAN_MONEY]).ToString()
                            }));
                        }
                        //flytxt.instance.AddDelayFlytxt("军团资金+" + rewardDic[(uint)A3_TaskModel.REWARD_CLAN_MONEY]);
                        A3_LegionModel.getInstance().myLegion.gold = data["money"]._int;
                    }
                    if (data.ContainsKey("clan_pt"))
                    {
                        if (rewardDic.ContainsKey((uint)A3_TaskModel.REWARD_CLAN_EXP))
                        {
                            flytxt.instance.AddDelayFlytxt(ContMgr.getCont("Legion_exp", new List <string> {
                                (rewardDic[(uint)A3_TaskModel.REWARD_CLAN_EXP]).ToString()
                            }));
                        }
                        //flytxt.instance.AddDelayFlytxt("军团经验+" + rewardDic[(uint)A3_TaskModel.REWARD_CLAN_EXP]);
                        A3_LegionModel.getInstance().myLegion.clan_pt = data["clan_pt"]._int;
                    }
                    if (data.ContainsKey("donate"))
                    {
                        if (rewardDic.ContainsKey((uint)A3_TaskModel.REWARD_CLAN_DONATE))
                        {
                            flytxt.instance.AddDelayFlytxt(ContMgr.getCont("Legion_gongxian", new List <string> {
                                (rewardDic[(uint)A3_TaskModel.REWARD_CLAN_DONATE]).ToString()
                            }));
                        }
                        //flytxt.instance.AddDelayFlytxt("军团贡献+" + rewardDic[(uint)A3_TaskModel.REWARD_CLAN_DONATE]);
                        A3_LegionModel.getInstance().donate = data["donate"]._int;
                    }
                    if (data.ContainsKey("active"))
                    {
                        A3_LegionModel.getInstance().myLegion.huoyue = data["active"]._int;
                    }
                    flytxt.instance.StartDelayFly();
                }
                break;

            case EVENT_BEINVITE:
                uint   clanid    = data["clanid"];
                string name      = data["name"];
                string clan_name = data["clan_name"];
                int    clan_lvl  = data["clan_lvl"];
                if (a3_legion.mInstance.dic0.isOn)
                {
                    SendAcceptInvite(clanid, true);
                    flytxt.instance.fly(ContMgr.getCont("Legion_request"));
                    a3_dartproxy.getInstance().sendDartGo();    //查看军团镖车信息
                    dispatchEvent(GameEvent.Create(EVENT_ACCEPTAINVITE, this, data));
                }
                else
                {
                    MsgBoxMgr.getInstance().showConfirm(name + ContMgr.getCont("add_request") + clan_lvl + ContMgr.getCont("lvLegion") + clan_name, () =>
                    {
                        SendAcceptInvite(clanid, true);
                    }, () =>
                    {
                        SendAcceptInvite(clanid, false);
                    });
                }
                dispatchEvent(GameEvent.Create(EVENT_BEINVITE, this, data));
                break;

            case EVENT_APPLYSUCCESSFUL:
                bool approved = data["approved"];
                if (approved)
                {
                    A3_LegionProxy.getInstance().SendGetInfo();
                }
                a3_dartproxy.getInstance().sendDartGo();    //查看军团镖车信息
                dispatchEvent(GameEvent.Create(EVENT_APPLYSUCCESSFUL, this, data));
                break;

            case 35:
                A3_LegionProxy.getInstance().SendGetMember();
                int    cid      = data["cid"];
                int    clanc    = data["clanc"];
                int    oldclanc = data["oldclanc"];
                string name1    = data["name"];
                string dic      = string.Empty;
                if ((uint)cid == PlayerModel.getInstance().cid)
                {
                    name1 = ContMgr.getCont("u");
                }
                if (oldclanc > clanc)
                {
                    dic = ContMgr.getCont("up");
                }
                else
                {
                    dic = ContMgr.getCont("down");
                }

                flytxt.instance.fly(name1 + dic + A3_LegionModel.getInstance().GetClancToName(clanc));
                break;

            case 36:
                A3_LegionProxy.getInstance().SendGetInfo();
                if (a3_buff.instance != null)
                {
                    a3_buff.instance.Quited();
                }
                break;

            case EVENT_GETDIN:                           //37
                flytxt.instance.fly(ContMgr.getCont("Legionadd_ok"));
                a3_dartproxy.getInstance().sendDartGo(); //查看军团镖车信息
                dispatchEvent(GameEvent.Create(A3_LegionProxy.EVENT_CREATE, this, data));
                //a3_herohead.instance.isclear = true;
                //a3_herohead.instance.legion_bf = true;
                //if (a3_herohead.instance != null)
                //    a3_herohead.instance.refresBuff();
                break;

            case EVENT_FINDNAME:    //27模糊搜索
                if (data["info"].Count <= 0)
                {
                    flytxt.instance.fly(ContMgr.getCont("nofinname"));
                }
                else
                {
                    A3_LegionModel.getInstance().finfname.Clear();
                    A3_LegionModel.getInstance().finfname = new List <A3_LegionData>();
                    foreach (var v in data["info"]._arr)
                    {
                        A3_LegionData d = new A3_LegionData();
                        d.id          = v["id"];
                        d.clname      = v["clname"];
                        d.combpt      = v["combpt"];
                        d.lvl         = v["lvl"];
                        d.name        = v["name"];
                        d.plycnt      = v["plycnt"];
                        d.direct_join = v["direct_join"];
                        d.huoyue      = v["last_active"];
                        A3_LegionModel.getInstance().finfname.Add(d);
                    }
                    if (a3_legion.Instance != null)
                    {
                        a3_legion.Instance.addpanels.SetActive(false);
                        a3_legion.Instance.Findnames();
                    }
                }
                break;

            case EVENT_CHANGE_NAME:

                A3_LegionModel.getInstance().myLegion.clname = data["clname"];

                dispatchEvent(GameEvent.Create(EVENT_CHANGE_NAME, this, data));

                break;

            case EVENT_BUILD:
                A3_LegionModel.getInstance().build_awd[data["type"]] = data["type"];
                if (a3_legion_build.instance)
                {
                    a3_legion_build.instance.RefresAward();
                }
                break;

            default:

                if (res < 0)
                {
                    Globle.err_output(res);
                }
                break;
            }
        }
        private void RefreshDragonInfo(string dragonName)
        {
            DragonData dragonData = A3_SlayDragonModel.getInstance().dicDragonData[dragonName];
            int        cost       = A3_SlayDragonModel.getInstance().GetCost();
            uint       dragonId   = dragonData.dragonId;
            uint       proc       = dragonData.proc;
            bool       isUnlocked = dragonData.isUnlcoked,
                       isOpened   = dragonData.isOpened,
                       isDead     = dragonData.isDead,
                       isCreated  = dragonData.isCreated && !isDead;

            if (isCreated || isDead)
            {
                goTimer.SetActive(isCreated);
                rootDragonOpt.FindChild("proc_unlock").gameObject.SetActive(false);
            }
            else
            {
                goTimer.SetActive(false);
                rootDragonOpt.FindChild("proc_unlock").gameObject.SetActive(true);
                rootDragonOpt.FindChild("proc_unlock/proc_text").GetComponent <Text>().text = string.Format("{0}/{1}", proc, cost);
                rootDragonOpt.FindChild("proc_unlock/Slider").GetComponent <Slider>().value = proc / (float)cost;
            }

            string    strDragonId = dragonId.ToString();
            Transform tfDesc      = rootDragonOpt.FindChild("descBg/desc");

            for (int i = 0; i < tfDesc.childCount; i++)
            {
                GameObject goDesc = tfDesc.GetChild(i).gameObject;
                if (!goDesc.name.Equals(strDragonId))
                {
                    goDesc.SetActive(false);
                }
                else
                {
                    goDesc.SetActive(true);
                }
            }
            if (isDead)
            {
                rootDragonOpt.FindChild("btn_do/Create").gameObject.SetActive(false);
                rootDragonOpt.FindChild("btn_do/Unlock").gameObject.SetActive(false);
                rootDragonOpt.FindChild("btn_do/Go").GetComponent <Button>().interactable = false;
            }
            else
            {
                if (A3_LegionModel.getInstance().myLegion.clanc < 3)
                {
                    rootDragonOpt.FindChild("btn_do/Create").gameObject.SetActive(false);
                }
                rootDragonOpt.FindChild("btn_do/Go").GetComponent <Button>().interactable = true;
                if (isUnlocked)
                {
                    if (!isOpened)
                    {
                        rootDragonOpt.FindChild("btn_do/Unlock").gameObject.SetActive(false);
                        rootDragonOpt.FindChild("btn_do/Create").gameObject.SetActive(!isCreated);
                        rootDragonOpt.FindChild("btn_do/Create").GetComponent <Button>().interactable = proc >= cost;
                    }
                    else
                    {
                        rootDragonOpt.FindChild("btn_do/Create").gameObject.SetActive(false);
                        rootDragonOpt.FindChild("btn_do/Unlock").gameObject.SetActive(false);
                        rootDragonOpt.FindChild("btn_do/Go").gameObject.SetActive(isCreated);
                    }
                }
                else
                {
                    if (!isCreated)
                    {
                        rootDragonOpt.FindChild("btn_do/Unlock").gameObject.SetActive(true);
                        rootDragonOpt.FindChild("btn_do/Unlock").GetComponent <Button>().interactable = A3_SlayDragonModel.getInstance().IsAbleToUnlock();
                        rootDragonOpt.FindChild("btn_do/Go").gameObject.SetActive(false);
                    }
                }
            }
        }
Exemple #20
0
        void onInfo(Variant data)
        {
            int res = data["res"];

            debug.Log("City" + data.dump());
            if (res < 0)
            {
                Globle.err_output(res);
                return;
            }
            switch (res)
            {
            case 1:

                debug.Log("GGGG" + A3_LegionModel.getInstance().myLegion.id);
                //请求攻城战数据
                A3_cityOfWarModel.getInstance().last_type  = data["last_type"];
                A3_cityOfWarModel.getInstance().llid       = data["llid"];
                A3_cityOfWarModel.getInstance().def_clanid = data["def_clanid"];
                A3_cityOfWarModel.getInstance().start_tm   = data["start_tm"];
                A3_cityOfWarModel.getInstance().clan_pcid  = data["clan_pcid"];
                A3_cityOfWarModel.getInstance().clan_lvl   = data["clan_lvl"];

                A3_cityOfWarModel.getInstance().clan_name        = data["clan_name"];
                A3_cityOfWarModel.getInstance().Castellan_name   = data["name"];
                A3_cityOfWarModel.getInstance().Castellan_zhuan  = data["zhuan"];
                A3_cityOfWarModel.getInstance().Castellan_lvl    = data["lvl"];
                A3_cityOfWarModel.getInstance().Castellan_combpt = data["combpt"];
                A3_cityOfWarModel.getInstance().Castellan_carr   = data["carr"];

                if (data.ContainsKey("def_info"))
                {
                    A3_cityOfWarModel.getInstance().deflist.Clear();
                    List <Variant> l = data["def_info"]._arr;
                    foreach (var v in l)
                    {
                        defInfo temp = new defInfo();
                        temp._type = v["type"];
                        temp._lvl  = v["level"];
                        A3_cityOfWarModel.getInstance().deflist[v["type"]] = temp;
                    }
                }

                if (data.ContainsKey("apply_list"))
                {
                    A3_cityOfWarModel.getInstance().apply_list.Clear();
                    List <Variant>    l         = data["apply_list"]._arr;
                    List <Apply_Info> ApplyList = new List <Apply_Info>();
                    foreach (var v in l)
                    {
                        Apply_Info temp = new Apply_Info();
                        temp.clan_id   = v["clan_id"];
                        temp.clan_name = v["clan_name"];
                        temp.apply_num = v["apply_num"];
                        temp.apply_tm  = v["apply_tm"];
                        temp.clan_lvl  = v["clan_lvl"];
                        ApplyList.Add(temp);
                    }
                    ApplyList.Sort();
                    A3_cityOfWarModel.getInstance().apply_list = ApplyList;
                }
                dispatchEvent(GameEvent.Create(REFRESHINFO, this, data));
                // A3_cityOfWarModel.getInstance().gg();
                break;

            case 2:
                //进入攻城战
                break;

            case 3:
                //提升防御
                if (A3_cityOfWarModel.getInstance().deflist.ContainsKey(data["type"]))
                {
                    A3_cityOfWarModel.getInstance().deflist[data["type"]]._lvl = data["level"];
                }
                else
                {
                    defInfo temp = new defInfo();
                    temp._type = data["type"];
                    temp._lvl  = data["level"];
                    A3_cityOfWarModel.getInstance().deflist[data["type"]] = temp;
                }
                dispatchEvent(GameEvent.Create(REFRESHPREPARE, this, data));
                break;

            case 4:
                //投标出价
                if (data.ContainsKey("apply_list"))
                {
                    A3_cityOfWarModel.getInstance().apply_list.Clear();
                    List <Variant>    l         = data["apply_list"]._arr;
                    List <Apply_Info> ApplyList = new List <Apply_Info>();
                    foreach (var v in l)
                    {
                        Apply_Info temp = new Apply_Info();
                        temp.clan_id   = v["clan_id"];
                        temp.clan_name = v["clan_name"];
                        temp.apply_num = v["apply_num"];
                        temp.apply_tm  = v["apply_tm"];
                        temp.clan_lvl  = v["clan_lvl"];
                        ApplyList.Add(temp);
                    }
                    ApplyList.Sort();
                    A3_cityOfWarModel.getInstance().apply_list = ApplyList;
                    dispatchEvent(GameEvent.Create(REFRESHAPPLY, this, data));
                }
                break;

            case 5:
                //攻城战统计
                break;

            case 6:
                // 地图成员信息
                break;

            case 8:
                list_position.Clear();
                List <Variant> ll = data["data"]._arr;
                foreach (var v in ll)
                {
                    PlayerPos_cityWar temp = new PlayerPos_cityWar();
                    temp.lvlsideid          = v["lvlsideid"];
                    temp.iid                = v["iid"];
                    temp.x                  = (uint)((v["x"]) / GameConstant.PIXEL_TRANS_UNITYPOS);
                    temp.y                  = (uint)((v["y"]) / GameConstant.PIXEL_TRANS_UNITYPOS);
                    list_position[v["iid"]] = temp;
                }
                break;

            case 9:
                if (data["lvlsideid"] == PlayerModel.getInstance().lvlsideid)
                {
                    signalInfo info = new signalInfo();
                    info.signalType = data["type"];
                    info.x          = (int)(data["x"]);
                    info.y          = (int)(data["y"]);
                    info.cd         = 5;
                    A3_cityOfWarModel.getInstance().signalList.Add(info);
                    a3_insideui_fb.instance.changesignal(info.signalType);
                    if (a3_liteMiniBaseMap2.instance)
                    {
                        a3_liteMiniBaseMap2.instance.SetSignal();
                    }
                }
                break;

            case 20:
                //怪物血量和人数
                A3_cityOfWarModel.getInstance().atk_num = data["atk_num"];
                A3_cityOfWarModel.getInstance().def_num = data["def_num"];
                if (data["door_open"] == 1)
                {
                    A3_cityOfWarModel.getInstance().door_open = true;
                }
                else
                {
                    A3_cityOfWarModel.getInstance().door_open = false;
                }
                if (data.ContainsKey("mon_hpper"))
                {
                    List <Variant> l = data["mon_hpper"]._arr;
                    A3_cityOfWarModel.getInstance().SetMonInfo(l);
                }
                dispatchEvent(GameEvent.Create(REFRESHFBINFO, this, data));
                break;

            case 21:
                //击杀通知
                break;

            case 22:
                //助攻通知
                break;
            }
        }
        static public void RefreshShow(BaseRole LockRole, bool havepeopleLv = false, bool havpeoplerednam = false)
        {
            if (br == LockRole && PlayerModel.getInstance().now_pkState == pkstat && skin != null && havepeopleLv == false && havpeoplerednam == false)
            {
                return;
            }
            br   = LockRole;
            skin = SelfRole.s_LockFX.gameObject.GetComponent <MeshRenderer>();
            if (skin == null)
            {
                return;
            }

            if (LockRole is ProfessionRole)
            {
                if (OtherPlayerMgr._inst.m_mapOtherPlayer.ContainsKey(LockRole.m_unIID) && OtherPlayerMgr._inst.m_mapOtherPlayer[LockRole.m_unIID].zhuan < 1)
                {
                    skin.material.SetColor(EnumShader.SPI_TINT_COLOR, new Color(0f, 1f, 0f, 1f));
                    pkstat = PlayerModel.getInstance().now_pkState;
                    return;
                }
                if (!OtherPlayerMgr._inst.m_mapOtherPlayer.ContainsKey(LockRole.m_unIID))
                {//这里加下保护
                    SelfRole._inst.m_LockRole = null;
                }
            }
            else if (LockRole is MS0000)
            {
                if (((MS0000)LockRole).owner_cid == PlayerModel.getInstance().cid)
                {
                    skin.material.SetColor(EnumShader.SPI_TINT_COLOR, new Color(0f, 1f, 0f, 1f));
                }
                else
                {
                    skin.material.SetColor(EnumShader.SPI_TINT_COLOR, new Color(1f, 0f, 0f, 1f));
                }
                return;
            }
            else if (LockRole is MDC000)//镖车
            {
                if (((MDC000)LockRole).escort_name == A3_LegionModel.getInstance().myLegion.clname)
                {
                    skin.material.SetColor(EnumShader.SPI_TINT_COLOR, new Color(0f, 1f, 0f, 1f));
                }
                else
                {
                    if (((float)LockRole.curhp / (float)LockRole.maxHp * 100) <= 20)
                    {
                        skin.material.SetColor(EnumShader.SPI_TINT_COLOR, new Color(0f, 1f, 0f, 1f));
                        return;
                    }
                    skin.material.SetColor(EnumShader.SPI_TINT_COLOR, new Color(1f, 0f, 0f, 1f));
                }

                return;
            }
            else if (LockRole is MonsterRole)
            {
                skin.material.SetColor(EnumShader.SPI_TINT_COLOR, new Color(1f, 0f, 0f, 1f));
                pkstat = PlayerModel.getInstance().now_pkState;
                return;
            }
            pkstat = PlayerModel.getInstance().now_pkState;
            bool canattack = false;

            switch (PlayerModel.getInstance().now_pkState)
            {
            case 0:
                if (LockRole is ProfessionRole)
                {
                    if (!LockRole.havefanjibuff)
                    {
                        skin.material.SetColor(EnumShader.SPI_TINT_COLOR, new Color(0f, 1f, 0f, 1f));
                    }
                    else
                    {
                        skin.material.SetColor(EnumShader.SPI_TINT_COLOR, new Color(1f, 0f, 0f, 1f));
                    }
                }
                else if (LockRole == null)
                {
                    skin = null;
                }
                break;

            case 1:
                // cricle.startColor = new Color(1f, 0f, 0f, 1f);
                skin.material.SetColor(EnumShader.SPI_TINT_COLOR, new Color(1f, 0f, 0f, 1f));
                break;

            case 2:
                // debug.Log("我的军团id:" + PlayerModel.getInstance().clanid+"他的军团id:"+ LockRole.m_unLegionID);
                //debug.Log("是否同一队伍:" + TeamProxy.getInstance().MyTeamData.IsInMyTeam(LockRole.roleName)+"他的队伍id:"+ LockRole.m_unTeamID);
                if (LockRole == null)
                {
                    skin = null;
                    return;
                }
                else
                {
                    if (TeamProxy.getInstance().MyTeamData != null && TeamProxy.getInstance().MyTeamData.IsInMyTeam(LockRole.roleName))
                    {
                        canattack = false;
                    }
                    else
                    {
                        if (PlayerModel.getInstance().clanid == 0)
                        {
                            canattack = true;
                        }
                        else
                        {
                            canattack = PlayerModel.getInstance().clanid == LockRole.m_unLegionID ? false : true;
                        }
                    }
                }
                if (canattack)
                {
                    haveLockpeople = true;
                    skin.material.SetColor(EnumShader.SPI_TINT_COLOR, new Color(1f, 0f, 0f, 1f));
                }
                else
                {
                    haveLockpeople = false;
                    skin.material.SetColor(EnumShader.SPI_TINT_COLOR, new Color(0f, 1f, 0f, 1f));
                }

                break;

            case 3:

                break;

            case 4:
                if (LockRole == null)
                {
                    skin = null;
                }
                else
                {
                    if (LockRole.rednm > 0)
                    {
                        skin.material.SetColor(EnumShader.SPI_TINT_COLOR, new Color(1f, 0f, 0f, 1f));
                    }
                    else
                    {
                        skin.material.SetColor(EnumShader.SPI_TINT_COLOR, new Color(0f, 1f, 0f, 1f));
                    }
                }

                break;
            }
            ;
        }
Exemple #22
0
        public override void init()
        {
            inText();
            instance = this;
            #region ====主界面初始化====
            ss      = XMLMgr.instance.GetSXML("clan_escort");
            listXml = ss.GetNodeList("line");
            length  = listXml.Count;


            for (int i = 0; i < length; i++)
            {
                clans cla = new clans();
                cla.open_lv_clan  = listXml[i].getInt("clan_lvl");
                cla.pathid        = listXml[i].getUint("id");
                cla.target_map    = listXml[i].getUint("target_map");
                cla.add_money_num = listXml[i].getInt("clan_money");
                cla.item_id       = listXml[i].getUint("item_id");
                cla.item_num      = listXml[i].getInt("item_num");
                if (!dicClan.ContainsKey(listXml[i].getInt("id")))
                {
                    dicClan.Add(listXml[i].getInt("id"), cla);
                }
            }
            one   = dicClan[1].open_lv_clan;
            three = dicClan[2].open_lv_clan;
            five  = dicClan[3].open_lv_clan;
            //Variant list = SvrMapConfig.instance.getSingleMapConf(dicClan[1].target_map);
            //getTransformByPath("candodart/scroll_view_dart/contain/UndergroundCity/bg/title").GetComponent<Text>().text = list["map_name"];
            //list = SvrMapConfig.instance.getSingleMapConf(dicClan[2].target_map);
            //getTransformByPath("candodart/scroll_view_dart/contain/darkPalace/bg/title").GetComponent<Text>().text = list["map_name"];
            //list = SvrMapConfig.instance.getSingleMapConf(dicClan[3].target_map);
            //getTransformByPath("candodart/scroll_view_dart/contain/coldWind/bg/title").GetComponent<Text>().text = list["map_name"];
            string      stri = "candodart/scroll_view_dart/contain";
            List <SXML> lisx = XMLMgr.instance.GetSXMLList("item.item", "id==" + dicClan[1].item_id);
            item_id = dicClan[1].item_id;
            getTransformByPath(stri + "/UndergroundCity/award/2/icon").GetComponent <Image>().sprite = GAMEAPI.ABUI_LoadSprite("icon_item_" + lisx[0].getInt("icon_file"));
            getTransformByPath(stri + "/UndergroundCity/award/1/icon").GetComponent <Image>().sprite = GAMEAPI.ABUI_LoadSprite("icon_comm_1x1");
            getTransformByPath(stri + "/UndergroundCity/award/1/Text").GetComponent <Text>().text    = dicClan[1].add_money_num.ToString();
            getTransformByPath(stri + "/UndergroundCity/award/2/Text").GetComponent <Text>().text    = dicClan[1].item_num.ToString();
            new BaseButton(getTransformByPath(stri + "/UndergroundCity/award/2")).onClick            = (GameObject go) =>
            {
                ArrayList arr = new ArrayList();
                arr.Add(dicClan[1].item_id);
                arr.Add(1);
                InterfaceMgr.getInstance().ui_async_open(InterfaceMgr.A3_MINITIP, arr);
            };
            lisx    = XMLMgr.instance.GetSXMLList("item.item", "id==" + dicClan[2].item_id);
            item_id = dicClan[2].item_id;
            getTransformByPath(stri + "/darkPalace/award/2/icon").GetComponent <Image>().sprite = GAMEAPI.ABUI_LoadSprite("icon_item_" + lisx[0].getInt("icon_file"));
            getTransformByPath(stri + "/darkPalace/award/1/icon").GetComponent <Image>().sprite = GAMEAPI.ABUI_LoadSprite("icon_comm_1x1");
            getTransformByPath(stri + "/darkPalace/award/1/Text").GetComponent <Text>().text    = dicClan[2].add_money_num.ToString();
            getTransformByPath(stri + "/darkPalace/award/2/Text").GetComponent <Text>().text    = dicClan[2].item_num.ToString();
            new BaseButton(getTransformByPath(stri + "/darkPalace/award/2")).onClick            = (GameObject go) =>
            {
                ArrayList arr = new ArrayList();
                arr.Add(dicClan[2].item_id);
                arr.Add(1);
                InterfaceMgr.getInstance().ui_async_open(InterfaceMgr.A3_MINITIP, arr);
            };
            lisx    = XMLMgr.instance.GetSXMLList("item.item", "id==" + dicClan[3].item_id);
            item_id = dicClan[3].item_id;
            getTransformByPath(stri + "/coldWind/award/2/icon").GetComponent <Image>().sprite = GAMEAPI.ABUI_LoadSprite("icon_item_" + lisx[0].getInt("icon_file"));
            getTransformByPath(stri + "/coldWind/award/1/icon").GetComponent <Image>().sprite = GAMEAPI.ABUI_LoadSprite("icon_comm_1x1");
            getTransformByPath(stri + "/coldWind/award/1/Text").GetComponent <Text>().text    = dicClan[3].add_money_num.ToString();
            getTransformByPath(stri + "/coldWind/award/2/Text").GetComponent <Text>().text    = dicClan[3].item_num.ToString();
            new BaseButton(getTransformByPath(stri + "/coldWind/award/2")).onClick            = (GameObject go) =>
            {
                ArrayList arr = new ArrayList();
                arr.Add(dicClan[3].item_id);
                arr.Add(1);
                InterfaceMgr.getInstance().ui_async_open(InterfaceMgr.A3_MINITIP, arr);
            };
            #endregion

            #region  ====button====
            new BaseButton(getTransformByPath("candodart/btn_close")).onClick = (GameObject go) =>
            {
                InterfaceMgr.getInstance().close(InterfaceMgr.A3_LEGION_DART);
            };
            new BaseButton(getTransformByPath("bg")).onClick = (GameObject go) =>
            {
                InterfaceMgr.getInstance().close(InterfaceMgr.A3_LEGION_DART);
            };
            new BaseButton(getTransformByPath("cantdart/close")).onClick = (GameObject go) =>
            {
                InterfaceMgr.getInstance().close(InterfaceMgr.A3_LEGION_DART);
            };
            new BaseButton(getTransformByPath("cantdart/bg/back")).onClick = (GameObject go) =>
            {
                InterfaceMgr.getInstance().close(InterfaceMgr.A3_LEGION_DART);
            };

            new BaseButton(getTransformByPath("cantdart/bg/go")).onClick = (GameObject go) =>
            {
                if ((int)PlayerModel.getInstance().mapid == 10)
                {
                    //SelfRole.moveToNPc(10, 1003);
                }
                else
                {
                    SelfRole.Transmit(10 * 100 + 1);
                }
                ltes = true;
                InterfaceMgr.getInstance().close(InterfaceMgr.A3_LEGION_DART);
            };

            new BaseButton(getTransformByPath("candodart/scroll_view_dart/contain/UndergroundCity/enter")).onClick = (GameObject go) =>
            {
                if (!a3_dartproxy.getInstance().canOpenDart)
                {
                    flytxt.instance.fly(ContMgr.getCont("clan_12")); return;
                }
                else
                {
                    if (A3_LegionModel.getInstance().myLegion.clanc < 3)  //领袖为4,元老为3
                    {
                        flytxt.instance.fly(ContMgr.getCont("clan_10"));
                        InterfaceMgr.getInstance().close(InterfaceMgr.A3_LEGION_DART);
                    }
                    else
                    {
                        a3_dartproxy.getInstance().sendDartStart(dicClan[1].pathid);
                        a3_dartproxy.getInstance().isme = true; ltes = true;  //ltes要改成服务器发送
                        InterfaceMgr.getInstance().close(InterfaceMgr.A3_LEGION_DART);
                    }
                }
            };
            new BaseButton(getTransformByPath("candodart/scroll_view_dart/contain/darkPalace/enter")).onClick = (GameObject go) =>
            {
                if (!a3_dartproxy.getInstance().canOpenDart)
                {
                    flytxt.instance.fly(ContMgr.getCont("clan_12")); return;
                }
                else
                {
                    if (A3_LegionModel.getInstance().myLegion.clanc < 3 || A3_LegionModel.getInstance().myLegion.lvl < three)//领袖为4,元老为3
                    {
                        flytxt.instance.fly(ContMgr.getCont("clan_10"));
                        InterfaceMgr.getInstance().close(InterfaceMgr.A3_LEGION_DART);
                    }
                    else if (A3_LegionModel.getInstance().myLegion.clanc >= 3 && A3_LegionModel.getInstance().myLegion.lvl >= three)
                    {
                        a3_dartproxy.getInstance().sendDartStart(dicClan[2].pathid);
                        a3_dartproxy.getInstance().isme = true; ltes = true;
                        InterfaceMgr.getInstance().close(InterfaceMgr.A3_LEGION_DART);
                    }
                }
            };
            new BaseButton(getTransformByPath("candodart/scroll_view_dart/contain/coldWind/enter")).onClick = (GameObject go) =>
            {
                if (!a3_dartproxy.getInstance().canOpenDart)
                {
                    flytxt.instance.fly(ContMgr.getCont("clan_12")); return;
                }
                else
                {
                    if (A3_LegionModel.getInstance().myLegion.clanc < 3 || A3_LegionModel.getInstance().myLegion.lvl < five)//领袖为4,元老为3
                    {
                        flytxt.instance.fly(ContMgr.getCont("clan_10"));
                        InterfaceMgr.getInstance().close(InterfaceMgr.A3_LEGION_DART);
                    }
                    else if (A3_LegionModel.getInstance().myLegion.clanc >= 3 && A3_LegionModel.getInstance().myLegion.lvl >= five)
                    {
                        a3_dartproxy.getInstance().sendDartStart(dicClan[3].pathid);
                        a3_dartproxy.getInstance().isme = true; ltes = true;
                        InterfaceMgr.getInstance().close(InterfaceMgr.A3_LEGION_DART);
                    }
                }
            };
            #endregion
            if (a3_dartproxy.getInstance().show2)
            {
                getGameObjectByPath("candodart").SetActive(false);
                getGameObjectByPath("cantdart").SetActive(true);
            }
            #region ====事件监听====
            A3_LegionProxy.getInstance().addEventListener(A3_LegionProxy.EVENT_CREATE, creatLegion);
            A3_LegionProxy.getInstance().addEventListener(A3_LegionProxy.EVENT_LVUP, upLegion);
            a3_dartproxy.getInstance().addEventListener(a3_dartproxy.EVENT_GETINFO, info);
            #endregion
        }
Exemple #23
0
 private void upLegion(GameEvent e)
 {
     legionLvl = A3_LegionModel.getInstance().myLegion.lvl;
     initText(legionLvl);
 }
 public bool IsAbleToUnlock()
 {
     return(A3_LegionModel.getInstance().myLegion.clanc >= 3);
 }
Exemple #25
0
        private bool Execute(TaskData taskData, bool checkNextStep, bool checkItems, bool clickAuto)
        {
            if (taskData.taskT == TaskType.CLAN && A3_LegionModel.getInstance().myLegion.id == 0)
            {
                flytxt.instance.fly(ContMgr.getCont("a3_task_auto_nocy"));
                return(false);
            }
            //这里将任务的自动改成只读配置表(待测试)
            bool forceMove = taskData.next_step;

            if (forceMove || clickAuto)
            {
                if (SelfRole.fsm.Autofighting)
                {
                    SelfRole.fsm.Stop();
                    StateInit.Instance.Origin = Vector3.zero;
                }
            }
            else
            {
                return(false);
            }

            int npcId = 0;
            int mapId = 0;
            int posX  = 0;
            int posY  = 0;


            SXML taskXml = XMLMgr.instance.GetSXML("task.Task", "id==" + taskData.taskId);

            if (taskXml == null)
            {
                debug.Log("任务Id错误::" + taskData.taskId);
                return(false);
            }
            if (taskData.isComplete && taskData.taskT != TaskType.DAILY)
            {
                if (taskXml.getInt("complete_way") == 3)
                {
                    A3_TaskProxy.getInstance().SendGetAward();
                    return(true);
                }
                npcId = taskXml.getInt("complete_npc_id");
                SXML npcsXml = XMLMgr.instance.GetSXML("npcs.npc", "id==" + npcId);
                if (npcsXml != null)
                {
                    mapId = npcsXml.getInt("map_id");
                }
                List <string> listDialog = new List <string>();

                string strDialog = taskXml.getString("complete_dialog");
                strDialog = GameFramework.StringUtils.formatText(strDialog);
                string[] listTempDia = strDialog.Split(';');
                listDialog = listTempDia.ToList <string>();

                tarNpcId = npcId;
                //if(forceMove)
                //InterfaceMgr.getInstance().open(InterfaceMgr.TRANSMIT_PANEL, (ArrayList)new TransmitData
                //{
                //    mapId = mapId,
                //    check_beforeShow = true,
                //    handle_customized_afterTransmit = () => SelfRole.moveToNPc(mapId, npcId, listDialog, OnTalkWithNpc)
                //});
                if (!PlayerModel.getInstance().inFb&& mapId != GRMap.instance.m_nCurMapID && MapModel.getInstance().dicMappoint.ContainsKey(mapId) && MapModel.getInstance().dicMappoint[mapId] != GRMap.instance.m_nCurMapID)
                {
                    SelfRole.Transmit(toid: MapModel.getInstance().dicMappoint[mapId], after: () => SelfRole.moveToNPc(mapId, npcId, listDialog, OnTalkWithNpc, taskmove: true), taskTrans: true);
                }
                else
                {
                    SelfRole.moveToNPc(mapId, npcId, listDialog, OnTalkWithNpc, taskmove: true);
                }
            }
            else
            {
                mapId = taskXml.getInt("tasking_map_id");
                posX  = taskXml.getInt("target_coordinate_x");
                posY  = taskXml.getInt("target_coordinate_y");
                float mapY = taskXml.getFloat("map_y");
                mapY = (mapY == -1 ? 0 : mapY);
                Vector3 pos = new Vector3(posX, mapY, posY);
                switch (taskData.targetType)
                {
                case TaskTargetType.DODAILY:     /*页面切换到每日任务*/
                    ArrayList arr          = new ArrayList();
                    var       tasks        = A3_TaskModel.getInstance().GetDicTaskData();
                    bool      hasDailyTask = false;
                    int       i            = 0;
                    for (List <int> idx = new List <int>(tasks.Keys); i < tasks.Count; i++)
                    {
                        if (hasDailyTask = tasks[idx[i]].taskT == TaskType.DAILY)
                        {
                            break;
                        }
                    }
                    if (hasDailyTask /*tasks.Count(v => v.Value.taskT == TaskType.DAILY) > 0*/)
                    {
                        List <int> k = tasks.Keys.ToList();
                        for (i = 0; i < k.Count; i++)
                        {
                            if (tasks[k[i]].taskT == TaskType.DAILY)
                            {
                                arr.Add(tasks[k[i]].taskId);
                            }
                        }
                        InterfaceMgr.getInstance().ui_async_open(InterfaceMgr.A3_TASK, arr);
                        //MonsterMgr._inst.taskMonId = XMLMgr.instance.GetSXML("task.Task", "id==" + taskData.taskId)?.getInt("target_param2") ?? 0;
                    }
                    break;

                case TaskTargetType.FRIEND:     /*关闭当前页面,弹出好友页面*/
                    if (a3_liteMinimap.instance)
                    {
                        a3_liteMinimap.instance.ZidongTask = false;
                    }
                    arr = new ArrayList();
                    arr.Add(1 /* index of friend panel*/);
                    InterfaceMgr.getInstance().ui_async_open(InterfaceMgr.A3_SHEJIAO, arr);
                    break;

                case TaskTargetType.WING:     /*关闭当前页面,弹出飞翼页面*/
                    if (a3_liteMinimap.instance)
                    {
                        a3_liteMinimap.instance.ZidongTask = false;
                    }
                    InterfaceMgr.getInstance().ui_async_open(InterfaceMgr.A3_WIBG_SKIN);
                    break;

                case TaskTargetType.GETEXP:    /*卡级任务、转生任务*/

                    debug.Log("当前是转生等级任务");
                    StateAutoMoveToPos.Instance.stopdistance = 0.3f;
                    int zs           = int.Parse(taskXml.getString("target_param2").Split(',')[0]);
                    int ls           = int.Parse(taskXml.getString("target_param2").Split(',')[1]);
                    int trriger_type = int.Parse(taskXml.getString("trigger"));
                    if (trriger_type == 1)
                    {
                        if (a3_liteMinimap.instance)
                        {
                            a3_liteMinimap.instance.ZidongTask = false;
                        }
                        InterfaceMgr.getInstance().ui_async_open(InterfaceMgr.A3_WANTLVUP);
                    }
                    else
                    {
                        bool b       = true;
                        int  pp      = PlayerModel.getInstance().profession;
                        uint pl      = PlayerModel.getInstance().lvl;
                        uint pz      = PlayerModel.getInstance().up_lvl;
                        uint exp     = PlayerModel.getInstance().exp;
                        uint needExp = ResetLvLModel.getInstance().getNeedExpByCurrentZhuan(pp, pz);
                        uint needLvL = ResetLvLModel.getInstance().getNeedLvLByCurrentZhuan(pp, pz);
                        if (pz >= 10)
                        {
                            break;              //10转之后无法再次转生
                        }
                        if (needLvL > pl)
                        {
                            b = false;
                        }
                        if (b)
                        {
                            npcId = XMLMgr.instance.GetSXML("task.zhuan_npc").getInt("id");
                            SXML npcsXml = XMLMgr.instance.GetSXML("npcs.npc", "id==" + npcId);
                            if (npcsXml != null)
                            {
                                mapId = npcsXml.getInt("map_id");
                            }

                            List <string> listDialog = new List <string>();

                            string strDialog = taskXml.getString("target_dialog");
                            strDialog = GameFramework.StringUtils.formatText(strDialog);
                            string[] listTempDia = strDialog.Split(';');
                            listDialog = listTempDia.ToList <string>();

                            //if (GRMap.instance != null)
                            //{
                            //    InterfaceMgr.getInstance().open(InterfaceMgr.TRANSMIT_PANEL, (ArrayList)new TransmitData
                            //    {
                            //        mapId = mapId,
                            //        check_beforeShow = true,
                            //        handle_customized_afterTransmit = () => SelfRole.moveToNPc(mapId, npcId, listDialog, OnTalkWithNpc)
                            //    });
                            //}
                            if (!PlayerModel.getInstance().inFb&& mapId != GRMap.instance.m_nCurMapID && MapModel.getInstance().dicMappoint.ContainsKey(mapId) && MapModel.getInstance().dicMappoint[mapId] != GRMap.instance.m_nCurMapID)
                            {
                                SelfRole.Transmit(toid: MapModel.getInstance().dicMappoint[mapId], after: () => SelfRole.moveToNPc(mapId, npcId, listDialog, OnTalkWithNpc, taskmove: true), taskTrans: true);
                            }
                            else
                            {
                                SelfRole.moveToNPc(mapId, npcId, listDialog, OnTalkWithNpc, taskmove: true);
                            }
                            //InterfaceMgr.getInstance().open(InterfaceMgr.A3_RESETLVL);
                        }
                        else
                        {
                            if (a3_liteMinimap.instance)
                            {
                                a3_liteMinimap.instance.ZidongTask = false;
                            }
                            InterfaceMgr.getInstance().ui_async_open(InterfaceMgr.A3_WANTLVUP);
                        }
                    }
                    break;

                case TaskTargetType.VISIT:    /*访问(无条件)*/
                {
                    StateAutoMoveToPos.Instance.stopdistance = 2f;
                    npcId = taskXml.getInt("target_param2");
                    SXML npcsXml = XMLMgr.instance.GetSXML("npcs.npc", "id==" + npcId);
                    if (npcsXml != null)
                    {
                        mapId = npcsXml.getInt("map_id");
                    }

                    List <string> listDialog = new List <string>();
                    string        strDialog  = taskXml.getString("target_dialog");
                    strDialog = GameFramework.StringUtils.formatText(strDialog);
                    string[] listTempDia = strDialog.Split(';');
                    listDialog = listTempDia.ToList <string>();

                    tarNpcId = npcId;
                    if (GRMap.instance != null)
                    {
                        //InterfaceMgr.getInstance().open(InterfaceMgr.TRANSMIT_PANEL, (ArrayList)new TransmitData
                        //{
                        //    mapId = mapId,
                        //    check_beforeShow = true,
                        //    handle_customized_afterTransmit = () => SelfRole.moveToNPc(mapId, npcId, listDialog, OnTalkWithNpc)
                        //});
                        if (!PlayerModel.getInstance().inFb&& mapId != GRMap.instance.m_nCurMapID && MapModel.getInstance().dicMappoint.ContainsKey(mapId) && MapModel.getInstance().dicMappoint[mapId] != GRMap.instance.m_nCurMapID)
                        {
                            SelfRole.Transmit(toid: MapModel.getInstance().dicMappoint[mapId], after: () => SelfRole.moveToNPc(mapId, npcId, listDialog, OnTalkWithNpc, taskmove: true), taskTrans: true);
                        }
                        else
                        {
                            SelfRole.moveToNPc(mapId, npcId, listDialog, OnTalkWithNpc, taskmove: true);
                        }
                    }
                }
                break;

                case TaskTargetType.KILL:    /*杀怪类*/
                    //StateAutoMoveToPos.Instance.stopdistance = 2.0f;
                    SelfRole.UnderTaskAutoMove = true;
                    onTaskSearchMon            = taskData.taskT == TaskType.MAIN;
                    int _taskId;
                    if (PlayerModel.getInstance().task_monsterId.ContainsKey(taskData.taskId))
                    {
                        if (!PlayerModel.getInstance().task_monsterIdOnAttack.ContainsKey(taskData.taskId))
                        {
                            PlayerModel.getInstance().task_monsterIdOnAttack.Add(
                                key: taskData.taskId,
                                value: PlayerModel.getInstance().task_monsterId[taskData.taskId]
                                );
                        }
                        PlayerModel.getInstance().task_monsterId.Remove(taskData.taskId);
                        _taskId = taskData.taskId;
                    }
                    else
                    {
                        _taskId = A3_TaskModel.getInstance().GetTaskXML().GetNode("Task", "id==" + taskData.taskId).getInt("target_param2");
                        PlayerModel.getInstance().task_monsterIdOnAttack.Add(
                            key: taskData.taskId,
                            value: _taskId
                            );
                    }
                    SXML _taskXml = XMLMgr.instance.GetSXML("task.Task", "id==" + taskData.taskId);
                    //InterfaceMgr.getInstance().open(InterfaceMgr.TRANSMIT_PANEL, (ArrayList)new TransmitData
                    //{
                    //    mapId = mapId,
                    //    check_beforeShow = true,
                    //    handle_customized_afterTransmit = () =>
                    //    {
                    //        Vector3 fightOrigin = pos;
                    //        StateInit.Instance.Origin = fightOrigin;
                    //        SelfRole.moveto(mapId, pos, () =>
                    //        {
                    //            SelfRole.fsm.StartAutofight();
                    //            MonsterMgr._inst.taskMonId = _taskXml.getInt("target_param2");
                    //        }, stopDis: 2.0f);
                    //    }
                    //});
                    Action afterTransmit = () => {
                        Vector3 fightOrigin = pos;
                        StateInit.Instance.Origin = fightOrigin;
                        SelfRole.moveto(mapId, pos, () =>
                        {
                            SelfRole.fsm.StartAutofight();
                            MonsterMgr._inst.taskMonId = _taskXml.getInt("target_param2");
                        }, stopDis: 2.0f, taskmove: true);
                    };
                    if (!PlayerModel.getInstance().inFb&& mapId != GRMap.instance.m_nCurMapID && MapModel.getInstance().dicMappoint.ContainsKey(mapId) && MapModel.getInstance().dicMappoint[mapId] != GRMap.instance.m_nCurMapID)
                    {
                        SelfRole.Transmit(toid: MapModel.getInstance().dicMappoint[mapId], after: afterTransmit, taskTrans: true);
                    }
                    else
                    {
                        SelfRole.WalkToMap(mapId, pos, afterTransmit, taskmove: true);
                    }
                    break;

                case TaskTargetType.COLLECT:

                    //Action afterTransmit_collect = () =>
                    //{
                    //    StateAutoMoveToPos.Instance.stopdistance = 0.3f;
                    //    SelfRole.moveto(mapId, pos, () => SelfRole.fsm.StartAutoCollect());
                    //};
                    Action afterTransmit_collect = () => SelfRole.WalkToMap(mapId, pos, SelfRole.fsm.StartAutoCollect, taskmove: true);
                    if (!PlayerModel.getInstance().inFb&& mapId != GRMap.instance.m_nCurMapID && MapModel.getInstance().dicMappoint.ContainsKey(mapId) && MapModel.getInstance().dicMappoint[mapId] != GRMap.instance.m_nCurMapID)
                    {
                        SelfRole.Transmit(toid: MapModel.getInstance().dicMappoint[mapId], after: afterTransmit_collect, taskTrans: true);
                    }
                    else
                    {
                        afterTransmit_collect();
                    }
                    break;

                case TaskTargetType.FB:
                    if (a3_liteMinimap.instance)
                    {
                        a3_liteMinimap.instance.ZidongTask = false;
                    }
                    int fbid = taskXml.getInt("target_param2");
                    //StateAutoMoveToPos.Instance.stopdistance = 0.3f;
                    if (GRMap.instance.m_nCurMapID == mapId || GameRoomMgr.getInstance().curRoom is PlotRoom)
                    {
                        SelfRole.moveto(mapId, pos, () => SelfRole.fsm.StartAutofight(), stopDis: 2.0f, taskmove: true /* 副本中开始战斗的停止距离 */);
                    }
                    else
                    {
                        Variant sendData = new Variant();
                        sendData["npcid"]    = 0;
                        sendData["ltpid"]    = fbid;
                        sendData["diff_lvl"] = 1;
                        int  levelinfoid = taskXml.getInt("level_info");
                        var  tainf       = XMLMgr.instance.GetSXML("task.level_info", "id==" + levelinfoid);
                        bool guide       = (taskXml.getInt("guide") == 1);
                        int  type        = taskXml.getInt("level_yw");
                        if (type == 1)
                        {
                            MsgBoxMgr.getInstance().showTask_fb_confirm(tainf.getString("title"), tainf.getString("desc"),
                                                                        guide, a3_ygyiwuModel.getInstance().GetYiWu_God(a3_ygyiwuModel.getInstance().nowGod_id).need_zdl, () => LevelProxy.getInstance().sendCreate_lvl(sendData));
                        }
                        else
                        {
                            MsgBoxMgr.getInstance().showTask_fb_confirm(tainf.getString("title"), tainf.getString("desc"),
                                                                        guide, () => LevelProxy.getInstance().sendCreate_lvl(sendData));
                        }
                    }
                    break;

                case TaskTargetType.WAIT_POINT_GIVEN:   /*在指定区域读条*/
                case TaskTargetType.GET_ITEM_GIVEN:     /*收集指定道具*/
                case TaskTargetType.KILL_MONSTER_GIVEN: /*打指定怪物*/
                    DealByType(taskData, checkItems);
                    break;
                }
                SXML _taskXML = XMLMgr.instance.GetSXML("task.Task", "id==" + taskData.taskId);
                if (SelfRole.UnderTaskAutoMove = taskData.targetType == TaskTargetType.KILL)
                {
                    StateAutoMoveToPos.Instance.stopdistance = 2.0f;
                    Vector3 fightOrigin = new Vector3(
                        x: _taskXML.getInt("target_coordinate_x"),
                        y: 0,
                        z: _taskXML.getInt("target_coordinate_y")
                        );
                    StateInit.Instance.Origin = fightOrigin;
                }
                if (taskData.targetType == TaskTargetType.KILL || taskData.targetType == TaskTargetType.DODAILY)
                {
                    int monId = _taskXML.getInt("target_param2");
                    if (monId != -1)
                    {
                        MonsterMgr._inst.taskMonId = monId;
                    }
                }
            }
            return(true);
        }
Exemple #26
0
 private IEnumerator RunCD()
 {
     while (!SelfRole._inst.m_curAni.GetBool(EnumAni.ANI_RUN) /*移动*/ && !SelfRole.s_bInTransmit /*传送*/)
     {
         long timeCurrent = NetClient.instance.CurServerTimeStampMS;
         if (timeWaitTerminal < timeCurrent)
         {
             tfParentWait.gameObject.SetActive(false);
             //IsOnTaskWait = false;
             StopCD(true);
             if (A3_TaskModel.getInstance().curTask.showMessage)
             {
                 string msg = string.Format(A3_TaskModel.getInstance().curTask.completionStr, A3_LegionModel.getInstance().myLegion.clname);
                 a3_chatroom._instance.SendMsg(msg);
             }
             yield break;
         }
         imgProcess.fillAmount = (timeCD * 1000 - (timeWaitTerminal - timeCurrent)) / (timeCD * 1000);
         yield return(null);
     }
     imgProcess.fillAmount = 0;
 }
        public override void init()
        {
            Con_view        = this.transform.FindChild("citylist/scroll/content");
            stageCon        = this.transform.FindChild("cityinfo/citystage");
            inputTip        = transform.FindChild("tip").gameObject;
            apply_clan_item = this.transform.FindChild("viewbg/applyview/scroll/item").gameObject;
            helpCon         = this.transform.FindChild("helpCon").gameObject;
            apply_clan_Con  = this.transform.FindChild("viewbg/applyview/scroll/content");
            inputCost       = inputTip.transform.FindChild("bug/InputField/Text").GetComponent <Text>();
            new BaseButton(transform.FindChild("close")).onClick = (GameObject go) => {
                InterfaceMgr.getInstance().close(this.uiName);
            };

            applyview   = this.transform.FindChild("viewbg/applyview");
            Prepareview = this.transform.FindChild("viewbg/Prepareview");

            for (int i = 0; i < Con_view.childCount; i++)
            {
                new BaseButton(Con_view.GetChild(i)).onClick = (GameObject go) =>
                {
                    onTab(go.name);
                };
            }

            new BaseButton(this.transform.FindChild("letters/apply")).onClick = (GameObject go) => {
                SetLetter_btn(1);
            };

            new BaseButton(this.transform.FindChild("letters/Prepare")).onClick = (GameObject go) => {
                SetLetter_btn(2);
                change_Id(1);
            };

            new BaseButton(this.transform.FindChild("letters/Prepare/local")).onClick = (GameObject go) => {
                flytxt.instance.fly(ContMgr.getCont("uilayer_A3_cityOfWar_nllopen"));//"备战阶段才可以此操作"
            };

            new BaseButton(this.transform.FindChild("viewbg/applyview/apply_btn")).onClick = (GameObject go) => {
                if (A3_LegionModel.getInstance().myLegion.clanc < 3)
                {
                    flytxt.flyUseContId("clan_8");
                    return;
                }
                inputTip.SetActive(true);
                SetApply_Info_Tip();
            };
            new BaseButton(this.transform.FindChild("viewbg/applyview/infb_btn")).onClick = (GameObject go) => {
                //进入副本
                A3_cityOfWarProxy.getInstance().sendInfb();
            };

            new BaseButton(inputTip.transform.FindChild("btn_add")).onClick = (GameObject go) => {
                mineCost = mineCost + A3_cityOfWarModel.getInstance().one_change_cost;
                if (mineCost > A3_LegionModel.getInstance().myLegion.gold)
                {
                    mineCost = mineCost - A3_cityOfWarModel.getInstance().one_change_cost;
                    flytxt.instance.fly(ContMgr.getCont("A3_cityOfWar_nullMoney"));
                    return;
                }
                if (mineCost >= Minimum + A3_cityOfWarModel.getInstance().max_cost)
                {
                    mineCost = Minimum + A3_cityOfWarModel.getInstance().max_cost;
                }
                inputCost.text = mineCost.ToString();
            };

            new BaseButton(inputTip.transform.FindChild("btn_reduce")).onClick = (GameObject go) => {
                mineCost = mineCost - A3_cityOfWarModel.getInstance().one_change_cost;
                if (mineCost <= Minimum + A3_cityOfWarModel.getInstance().min_cost)
                {
                    if (mineCost <= 0)
                    {
                        mineCost = 0;
                        flytxt.instance.fly(ContMgr.getCont("A3_cityOfWar_nullMoney"));
                    }
                    else
                    {
                        mineCost = Minimum + A3_cityOfWarModel.getInstance().min_cost;
                    }
                }
                inputCost.text = mineCost.ToString();
            };

            new BaseButton(inputTip.transform.FindChild("toup")).onClick = (GameObject go) => {
                A3_cityOfWarProxy.getInstance().sendApply((uint)mineCost);
                inputTip.SetActive(false);
            };

            new BaseButton(inputTip.transform.FindChild("close")).onClick = (GameObject go) => {
                inputTip.SetActive(false);
            };

            new BaseButton(this.transform.FindChild("viewbg/applyview/Refresh")).onClick = (GameObject go) => {
                A3_cityOfWarProxy.getInstance().sendProxy(1);
            };


            new BaseButton(this.transform.FindChild("help")).onClick = (GameObject go) => {
                helpCon.SetActive(true);
            };

            new BaseButton(this.transform.FindChild("helpCon/close")).onClick = (GameObject go) => {
                helpCon.SetActive(false);
            };

            new BaseButton(this.transform.FindChild("viewbg/Prepareview/apply_btn")).onClick = (GameObject go) =>
            {
                if (A3_LegionModel.getInstance().myLegion.clanc < 3)
                {
                    flytxt.flyUseContId("clan_8");
                    return;
                }
                if (curSelectId != 0)
                {
                    A3_cityOfWarProxy.getInstance().sendPrepare((uint)curSelectId);
                }
            };
            inText();
        }
Exemple #28
0
        private void RefreshDiary(GameEvent e)
        {
            GameObject gameObjectByPath = base.getGameObjectByPath("cells/scroll/0");
            Transform  transformByPath  = base.getTransformByPath("cells/scroll/content");

            Transform[] componentsInChildren = transformByPath.GetComponentsInChildren <Transform>(true);
            for (int i = 0; i < componentsInChildren.Length; i++)
            {
                Transform transform = componentsInChildren[i];
                bool      flag      = transform.parent == transformByPath;
                if (flag)
                {
                    UnityEngine.Object.Destroy(transform.gameObject);
                }
            }
            Variant logdata = ModelBase <A3_LegionModel> .getInstance().logdata;

            bool flag2 = logdata == null || !logdata.ContainsKey("clanlog_list");

            if (!flag2)
            {
                Variant        variant = logdata["clanlog_list"];
                List <Variant> list    = new List <Variant>(variant._arr);
                list.Reverse();
                foreach (Variant current in list)
                {
                    GameObject gameObject = UnityEngine.Object.Instantiate <GameObject>(gameObjectByPath);
                    gameObject.SetActive(true);
                    gameObject.transform.SetParent(transformByPath);
                    gameObject.transform.localPosition = Vector3.zero;
                    gameObject.transform.localScale    = Vector3.one;
                    Text    component = gameObject.transform.FindChild("text").GetComponent <Text>();
                    int     num       = current["logtp"];
                    Variant variant2  = current["log"];
                    string  item      = string.Empty;
                    string  item2     = string.Empty;
                    string  item3     = string.Empty;
                    int     num2      = 0;
                    int     num3      = 0;
                    int     num4      = 0;
                    int     num5      = 0;
                    int     num6      = 0;
                    int     num7      = 0;
                    bool    flag3     = variant2.ContainsKey("name");
                    if (flag3)
                    {
                        item = variant2["name"];
                    }
                    bool flag4 = variant2.ContainsKey("tar_name");
                    if (flag4)
                    {
                        item3 = variant2["tar_name"];
                    }
                    bool flag5 = variant2.ContainsKey("clanc");
                    if (flag5)
                    {
                        num4 = variant2["clanc"];
                    }
                    bool flag6 = variant2.ContainsKey("oldclanc");
                    if (flag6)
                    {
                        num3 = variant2["oldclanc"];
                    }
                    bool flag7 = variant2.ContainsKey("money");
                    if (flag7)
                    {
                        num5 = variant2["money"];
                    }
                    bool flag8 = variant2.ContainsKey("name");
                    if (flag8)
                    {
                        item2 = variant2["name"];
                    }
                    bool flag9 = variant2.ContainsKey("guard_time");
                    if (flag9)
                    {
                        num2 = variant2["guard_time"];
                    }
                    bool flag10 = variant2.ContainsKey("repair_cost");
                    if (flag10)
                    {
                        num7 = variant2["repair_cost"];
                    }
                    bool flag11 = variant2.ContainsKey("clan_lvl");
                    if (flag11)
                    {
                        num6 = variant2["clan_lvl"];
                    }
                    switch (num)
                    {
                    case 1:
                    {
                        string item4  = string.Empty;
                        bool   flag12 = num4 < num3;
                        if (flag12)
                        {
                            item4 = "降级";
                        }
                        else
                        {
                            item4 = "升级";
                        }
                        component.text = ContMgr.getCont("clan_log_" + num, new List <string>
                            {
                                item3,
                                item,
                                item4,
                                ModelBase <A3_LegionModel> .getInstance().GetClancToName(num4)
                            });
                        break;
                    }

                    case 2:
                        component.text = ContMgr.getCont("clan_log_" + num, new List <string>
                        {
                            item,
                            ModelBase <A3_LegionModel> .getInstance().myLegion.lvl.ToString()
                        });
                        break;

                    case 3:
                        component.text = ContMgr.getCont("clan_log_" + num, new List <string>
                        {
                            A3_LegionModel.GetCarr(ModelBase <PlayerModel> .getInstance().profession),
                            item,
                            num5.ToString()
                        });
                        break;

                    case 4:
                        component.text = ContMgr.getCont("clan_log_" + num, new List <string>
                        {
                            item2
                        });
                        break;

                    case 5:
                        component.text = ContMgr.getCont("clan_log_" + num, new List <string>
                        {
                            item2
                        });
                        break;

                    case 6:
                        component.text = ContMgr.getCont("clan_log_" + num, new List <string>
                        {
                            item3,
                            item
                        });
                        break;

                    case 7:
                        component.text = ContMgr.getCont("clan_log_" + num, new List <string>
                        {
                            item
                        });
                        break;

                    case 8:
                        component.text = ContMgr.getCont("clan_log_" + num, new List <string>
                        {
                            item
                        });
                        break;

                    case 9:
                        component.text = ContMgr.getCont("clan_log_" + num, new List <string>
                        {
                            item3,
                            item
                        });
                        break;

                    case 10:
                        component.text = ContMgr.getCont("clan_log_" + num, new List <string>
                        {
                            item,
                            item3
                        });
                        break;

                    case 11:
                    {
                        bool flag13 = num6 <= 1;
                        if (flag13)
                        {
                            component.text = ContMgr.getCont("clan_log_" + num, new List <string>
                                {
                                    (4 - num2).ToString()
                                });
                        }
                        else
                        {
                            component.text = ContMgr.getCont("clan_log_12", new List <string>
                                {
                                    (4 - num2).ToString(),
                                    (num6 - 1).ToString()
                                });
                        }
                        break;
                    }

                    case 12:
                        component.text = ContMgr.getCont("clan_log_14", new List <string>
                        {
                            num6.ToString()
                        });
                        break;

                    case 13:
                        component.text = ContMgr.getCont("clan_log_" + num, new List <string>
                        {
                            num7.ToString()
                        });
                        break;
                    }
                }
                transformByPath.GetComponent <RectTransform>().sizeDelta = new Vector2(0f, transformByPath.GetComponent <GridLayoutGroup>().cellSize.y *(float)variant._arr.Count);
            }
        }
Exemple #29
0
        public override void onShowed()
        {
            if (room is MLZDRoom)
            {
                //打开活动界面
                ismlzd = true;
            }

            InterfaceMgr.getInstance().closeAllWin();
            a3_insideui_fb.instance?.enter_pic2.SetActive(false);
            jjc.SetActive(false);
            jdzc.SetActive(false);
            cityWAr.SetActive(false);
            ar_result.SetActive(false);
            getGameObjectByPath("win/success").SetActive(false);
            getGameObjectByPath("state_successed").SetActive(false);
            transform.FindChild("state_successed/bg/goldNum").gameObject.SetActive(false);
            transform.FindChild("state_successed/bg/getNum").gameObject.SetActive(false);
            tip_text.SetActive(true);
            bgdefet.SetActive(false);
            bgwin.SetActive(false);
            yiwufb_defet.SetActive(false);
            //  closefb_way = false;
            transform.FindChild("btn_close/closeTime").gameObject.SetActive(false);
            //createAvatar();
            closetime  = 0;
            close_time = 0;
            Variant data = (Variant)uiData[0];

            if (data.ContainsKey("ltpid"))
            {
                ltpid = data["ltpid"];
            }
            if (data.ContainsKey("score"))
            {
                score = data["score"];
            }
            else
            {
                score = 0;
            }

            if (data.ContainsKey("close_tm"))
            {
                double ct = data["close_tm"];
                closetime = ct;
            }
            if (data.ContainsKey("win"))
            {
                int ct = data["win"];

                Transform wint = getTransformByPath("win");
                wint.gameObject.SetActive(true);
                if (ct > 0 && wint != null)
                {
                    wint.FindChild("success").gameObject.SetActive(true);
                    wint.FindChild("fail").gameObject.SetActive(false);
                }
                else if (wint != null)
                {
                    closeWindow();
                    // InterfaceMgr.getInstance().floatUI.localScale = Vector3.zero;
                    if (GameObject.Find("GAME_CAMERA/myCamera"))
                    {
                        GameObject cameraOBJ = GameObject.Find("GAME_CAMERA/myCamera");
                        if (!cameraOBJ.GetComponent <DeathShader>())
                        {
                            cameraOBJ.AddComponent <DeathShader>();
                        }
                        else
                        {
                            cameraOBJ.GetComponent <DeathShader>().enabled = true;
                        }
                    }
                    wint.FindChild("success").gameObject.SetActive(false);
                    wint.FindChild("fail").gameObject.SetActive(true);


                    getGameObjectByPath("state_successed").SetActive(false);
                }
                if (data.ContainsKey("item_drop"))
                {
                    ct = data["item_drop"]._arr.Count;
                }
                else
                {
                    ct = 0;
                }
                if (ct >= 0)
                {
                    getGameObjectByPath("state_successed").SetActive(true);
                    //getGameObjectByPath("state_failed").SetActive(false);

                    finishTiem = getComponentByPath <Text>("state_successed/bg/fnTime/time");
                    kmNum      = getComponentByPath <Text>("state_successed/bg/kmNum/num");
                    getNum     = getComponentByPath <Text>("state_successed/bg/getNum/num");
                    goldNum    = getComponentByPath <Text>("state_successed/bg/goldNum/num");
                }
                else
                {
                    getGameObjectByPath("state_successed").SetActive(false);
                    //getGameObjectByPath("state_failed").SetActive(true);
                    //finishTiem = getComponentByPath<Text>("state_failed/bg/fnTime/time");
                    //kmNum = getComponentByPath<Text>("state_failed/bg/kmNum/num");
                    //getNum = getComponentByPath<Text>("state_failed/bg/getNum/num");
                    //goldNum = getComponentByPath<Text>("state_failed/bg/goldNum/num");
                }
            }

            finishtime = 0;
            if (uiData.Count > 1)
            {
                finishtime = (double)uiData[1];
            }
            //TimeSpan ts = new TimeSpan(0, 0, (int)finishtime);

            float tss = 0;
            uint  tkn = 0, ten = 0, tgn = 0;
            int   ach = 0, mon = 0;

            DOTween.To(() => tss, (float s) =>
            {
                TimeSpan ts     = new TimeSpan(0, 0, (int)s);
                finishTiem.text = (int)ts.TotalHours + ":" + (int)ts.Minutes + ":" + (int)ts.Seconds;
            }, (float)finishtime, 1f);

            evaluation(score);

            kmnum = 0;
            if (uiData.Count > 2)
            {
                kmnum = (int)uiData[2];
            }
            DOTween.To(() => (int)tkn, (int s) =>
            {
                tkn        = (uint)s;
                kmNum.text = tkn.ToString();
            }, kmnum, 1f);


            if (room is MoneyRoom)
            {
                if (room != null)
                {
                    transform.FindChild("state_successed/bg/goldNum").gameObject.SetActive(true);
                }
            }


            if (room is ExpRoom)
            {
                if (room != null)
                {
                    transform.FindChild("state_successed/bg/getNum").gameObject.SetActive(true);
                }
            }
            //if (room != null)
            //{
            //    goldnum = room.goldnum;
            //}
            //DOTween.To(() => tgn, (uint s) =>
            //{
            //    tgn = s;
            //    goldNum.text = tgn.ToString();
            //}, goldnum, 1f);

            //}


            if (room is PVPRoom)
            {
                if (room != null)
                {
                    getach = room.getach;
                }
                DOTween.To(() => ach, (int s) =>
                {
                    ach         = s;
                    getNum.text = ach.ToString();
                }, getach, 1f);

                if (room != null)
                {
                    getmoney = room.getExp;
                }
                DOTween.To(() => mon, (int s) =>
                {
                    mon          = s;
                    goldNum.text = mon.ToString();
                }, getmoney, 1f);

                MapProxy.getInstance().Win_uiData = "sports_jjc";
                MapProxy.getInstance().openWin    = InterfaceMgr.A3_SPORTS;
            }
            else
            {
                if (room != null)
                {
                    getnum = room.expnum;
                }
                DOTween.To(() => ten, (uint s) =>
                {
                    ten         = s;
                    getNum.text = ten.ToString();
                }, getnum, 1f);
                if (room != null)
                {
                    //goldnum = room.goldnum;
                    goldnum = a3_insideui_fb.AllMoneynum;
                }
                DOTween.To(() => tgn, (uint s) =>
                {
                    tgn          = s;
                    goldNum.text = tgn.ToString();
                }, goldnum, 1f);
            }
            //if (data.ContainsKey("ltpid")) {
            //    int tid = data["ltpid"];
            //    if (tid == 101) {
            //        getNum.text = "获得经验量:" + getnum;
            //    }
            //    else if (tid == 102) {
            //        getNum.text = "获得金币量:" + getnum;
            //    }
            //}
            _NewOne     = true;
            instance    = this;
            room.getExp = 0;
            room.getach = 0;

            Variant d = SvrLevelConfig.instacne.get_level_data(ltpid);

            if (data["win"] == 0 || room is PVPRoom || d.ContainsKey("shengwu") || room is PlotRoom || room is ExpRoom || room is MoneyRoom || room is FSWZRoom || room is MLZDRoom || room is JDZCRoom || room is CityWarRoom)
            {
                a3_liteMinimap.instance?.taskinfo?.SetActive(true);
                a3_insideui_fb.instance?.enter_pic2?.SetActive(false);

                LevelProxy.getInstance().open_pic = false;
                closefb_way = true;
                //InterfaceMgr.getInstance().close(InterfaceMgr.TARGET_HEAD);
            }
            else
            {
                closefb_way = false;
            }


            if (closefb_way == true)
            {
                close_time = 0;
                transform.FindChild("btn_close/closeTime").gameObject.SetActive(true);
            }
            if (closefb_way == false)
            {
                close_time = (double)closetime - (double)muNetCleint.instance.CurServerTimeStamp - 3;
                transform.FindChild("btn_close/closeTime").gameObject.SetActive(false);
            }

            if (d.ContainsKey("shengwu") && d.ContainsKey("icon"))
            {
                shengwu = d["shengwu"];
                icon    = d["icon"];
                if (data["win"] == 0)
                {
                    jjc.SetActive(false);
                    jdzc.SetActive(false);
                    cityWAr.SetActive(false);
                    ar_result.SetActive(false);
                    getGameObjectByPath("win").SetActive(false);
                    getGameObjectByPath("win/success").SetActive(false);
                    getGameObjectByPath("state_successed").SetActive(false);
                    transform.FindChild("state_successed/bg/goldNum").gameObject.SetActive(false);
                    bgdefet.SetActive(false);
                    bgwin.SetActive(false);
                    yiwufb_defet.SetActive(true);
                    return;
                }
            }
            else
            {
                shengwu = 0;
            }
            if (data["win"] == 1 && d.ContainsKey("shengwu") && d.ContainsKey("des"))
            {
                icon1 = d["des"];
                string[] codess = icon1.Split(',');
                // SXML xml = XMLMgr.instance.GetSXML("accent_relic.relic", "type=="+codess[0].ToString());
                //mid = xml.getUint("obj");
                List <SXML> listSxml = null;
                if (listSxml == null)
                {
                    listSxml = XMLMgr.instance.GetSXMLList("accent_relic.relic");
                    //List<SXML> xml2 = XMLMgr.instance.GetSXMLList("accent_relic.relic", "carr=="+ PlayerModel.getInstance().profession);     , "carr==" + PlayerModel.getInstance().profession
                    for (int i = 0; i < listSxml.Count; i++)
                    {
                        if (listSxml[i].getInt("carr") == PlayerModel.getInstance().profession&& listSxml[i].getString("type") == codess[0].ToString())
                        {
                            List <SXML> god_id = listSxml[i].GetNodeList("relic_god", "id==" + codess[1].ToString());
                            {
                                foreach (SXML x in god_id)
                                {
                                    text1.text = x.getString("des1");
                                    text2.text = x.getString("des2");
                                }
                            }
                        }
                    }
                }



                //foreach (SXML x in xml)
                //{
                //    if (x.getString("id") == codess[1])
                //    {
                //        text1.text = x.getString("des1");
                //        text2.text = x.getString("des2");
                //    }
                // }


                //    if (xml.getInt("carr") == PlayerModel.getInstance().profession)
                //{

                //    text1.text = xml.getString("des1");
                //    text2.text = xml.getString("des2");

                //}
            }



            if (shengwu == 1)
            {
                ar_result.SetActive(true);
                string[] codes = icon.Split(',');
                if (PlayerModel.getInstance().profession == 2)
                {
                    pic_icon.transform.GetComponent <Image>().sprite = GAMEAPI.ABUI_LoadSprite("icon_ar_" + codes[0]);
                }
                if (PlayerModel.getInstance().profession == 3)
                {
                    pic_icon.transform.GetComponent <Image>().sprite = GAMEAPI.ABUI_LoadSprite("icon_ar_" + codes[1]);
                }
                if (PlayerModel.getInstance().profession == 5)
                {
                    pic_icon.transform.GetComponent <Image>().sprite = GAMEAPI.ABUI_LoadSprite("icon_ar_" + codes[2]);
                }

                bgwin.SetActive(false);
                getGameObjectByPath("win").SetActive(false);
                getGameObjectByPath("win/success").SetActive(false);
                transform.FindChild("state_successed").gameObject.SetActive(false);
                jjc.SetActive(false);
                jdzc.SetActive(false);
                cityWAr.SetActive(false);
            }
            jjc.SetActive(false);
            jdzc.SetActive(false);
            cityWAr.SetActive(false);
            if (room is PVPRoom)
            {
                jjc.SetActive(false);
                ar_result.SetActive(false);
                getGameObjectByPath("win").SetActive(false);
                getGameObjectByPath("state_successed").SetActive(false);
                bgdefet.SetActive(false);
                bgwin.SetActive(false);
                if (data.ContainsKey("win"))
                {
                    int cct = data["win"];
                    if (cct == 0)
                    {
                        jjc.SetActive(true);
                        jjc.transform.FindChild("vector").gameObject.SetActive(false);
                        jjc.transform.FindChild("defet").gameObject.SetActive(true);
                    }
                    else
                    {
                        jjc.SetActive(true);
                        jjc.transform.FindChild("vector").gameObject.SetActive(true);
                        jjc.transform.FindChild("defet").gameObject.SetActive(false);
                    }
                    int aa = a3_sportsModel.getInstance().grade;
                    if (aa < 10)
                    {
                        icon_star.GetComponent <Image>().sprite = GAMEAPI.ABUI_LoadSprite("icon_rank_00" + aa);
                    }
                    else
                    {
                        icon_star.GetComponent <Image>().sprite = GAMEAPI.ABUI_LoadSprite("icon_rank_0" + aa);
                    }
                    if (a3_sportsModel.getInstance().grade <= 0)
                    {
                        return;
                    }
                    SXML Xml        = XMLMgr.instance.GetSXML("jjc.reward", "grade==" + a3_sportsModel.getInstance().grade);
                    int  pointCount = Xml.getInt("star");
                    if (pointCount <= 0)
                    {
                        return;
                    }
                    Transform star = this.transform.FindChild("jjc/star");
                    for (int i = 0; i < star.childCount; i++)
                    {
                        star.GetChild(i).FindChild("this").gameObject.SetActive(false);
                        star.GetChild(i).gameObject.SetActive(false);
                    }
                    for (int m = pointCount; m > 0; m--)
                    {
                        star.GetChild(m - 1).gameObject.SetActive(true);
                    }
                    for (int j = 0; j < a3_sportsModel.getInstance().score; j++)
                    {
                        star.GetChild(j).FindChild("this").gameObject.SetActive(true);
                    }
                }
            }

            if (room is JDZCRoom)
            {
                jjc.SetActive(false);
                ar_result.SetActive(false);
                jdzc.SetActive(false);
                cityWAr.SetActive(false);
                tip_text.SetActive(false);
                getGameObjectByPath("win").SetActive(false);
                getGameObjectByPath("state_successed").SetActive(false);
                bgdefet.SetActive(false);
                bgwin.SetActive(false);
                if (data.ContainsKey("win"))
                {
                    int cct = data["win"];
                    jdzc.SetActive(true);

                    if (cct == 0)
                    {
                        GameObject item = jdzc.transform.FindChild("fail/gift/reward").gameObject;
                        Transform  con  = jdzc.transform.FindChild("fail/gift/contain");
                        jdzc.transform.FindChild("win").gameObject.SetActive(false);
                        jdzc.transform.FindChild("fail").gameObject.SetActive(true);
                        SXML        Xml_lose = XMLMgr.instance.GetSXML("pointarena.lose_reward");
                        List <SXML> rew      = Xml_lose.GetNodeList("RewardItem");
                        foreach (SXML one in rew)
                        {
                            GameObject clon = Instantiate(item) as GameObject;
                            clon.SetActive(true);
                            clon.transform.SetParent(con, false);
                            uint       id   = (uint)one.getInt("item_id");
                            int        num  = one.getInt("value");
                            GameObject icon = IconImageMgr.getInstance().createA3ItemIcon(id);
                            icon.transform.SetParent(clon.transform.FindChild("pic/icon"), false);
                            clon.transform.FindChild("pic/num").GetComponent <Text>().text = num.ToString();
                        }
                    }
                    else
                    {
                        GameObject item = jdzc.transform.FindChild("win/gift/reward").gameObject;
                        Transform  con  = jdzc.transform.FindChild("win/gift/contain");
                        jdzc.transform.FindChild("win").gameObject.SetActive(true);
                        jdzc.transform.FindChild("fail").gameObject.SetActive(false);
                        SXML        Xml_win = XMLMgr.instance.GetSXML("pointarena.win_reward");
                        List <SXML> rew     = Xml_win.GetNodeList("RewardItem");
                        foreach (SXML one in rew)
                        {
                            GameObject clon = Instantiate(item) as GameObject;
                            clon.SetActive(true);
                            clon.transform.SetParent(con, false);
                            uint       id   = (uint)one.getInt("item_id");
                            int        num  = one.getInt("value");
                            GameObject icon = IconImageMgr.getInstance().createA3ItemIcon(id);
                            icon.transform.SetParent(clon.transform.FindChild("pic/icon"), false);
                            clon.transform.FindChild("pic/num").GetComponent <Text>().text = num.ToString();
                        }
                    }
                }
            }

            if (room is CityWarRoom)
            {
                jjc.SetActive(false);
                ar_result.SetActive(false);
                jdzc.SetActive(false);
                tip_text.SetActive(false);
                cityWAr.SetActive(false);
                getGameObjectByPath("win").SetActive(false);
                getGameObjectByPath("state_successed").SetActive(false);
                bgdefet.SetActive(false);
                bgwin.SetActive(false);
                cityWAr.transform.FindChild("win/warinfo").gameObject.SetActive(false);
                if (data.ContainsKey("win"))
                {
                    int cct = data["win"];

                    cityWAr.SetActive(true);
                    if (cct == 0)
                    {
                        GameObject item = cityWAr.transform.FindChild("fail/gift/reward").gameObject;
                        Transform  con  = cityWAr.transform.FindChild("fail/gift/contain");
                        cityWAr.transform.FindChild("win").gameObject.SetActive(false);
                        cityWAr.transform.FindChild("fail").gameObject.SetActive(true);
                        if (PlayerModel.getInstance().lvlsideid == 1)
                        {//攻城
                            SXML        Xml_win   = XMLMgr.instance.GetSXML("clanwar.atk_awd", "min==" + 0);
                            List <SXML> rew       = Xml_win.GetNodeList("RewardItem");
                            List <SXML> awds_coin = Xml_win.GetNodeList("RewardValue");
                            setAwd(con, item, rew, awds_coin);
                        }
                        else
                        {
                            //守城
                            SXML        Xml_win   = XMLMgr.instance.GetSXML("clanwar.def_awd", "min==" + 0);
                            List <SXML> rew       = Xml_win.GetNodeList("RewardItem");
                            List <SXML> awds_coin = Xml_win.GetNodeList("RewardValue");
                            setAwd(con, item, rew, awds_coin);
                        }
                    }

                    else
                    {
                        GameObject item = cityWAr.transform.FindChild("win/gift/reward").gameObject;
                        Transform  con  = cityWAr.transform.FindChild("win/gift/contain");
                        cityWAr.transform.FindChild("win").gameObject.SetActive(true);
                        cityWAr.transform.FindChild("fail").gameObject.SetActive(false);
                        if (PlayerModel.getInstance().lvlsideid == 1)
                        {//攻城
                            int i = data["rank"];
                            if (data["win_clanid"])
                            {
                                cityWAr.transform.FindChild("win/warinfo").gameObject.SetActive(true);
                                if (A3_LegionModel.getInstance().myLegion != null && A3_LegionModel.getInstance().myLegion.id == data["win_clanid"])
                                {
                                    cityWAr.transform.FindChild("win/warinfo").GetComponent <Text>().text = ContMgr.getCont("uilayer_a3_fb_finish_11");
                                }
                                else
                                {
                                    cityWAr.transform.FindChild("win/warinfo").GetComponent <Text>().text = ContMgr.getCont("uilayer_a3_fb_finish_12");
                                }
                            }
                            cityWAr.transform.FindChild("win/info").GetComponent <Text>().text = ContMgr.getCont("uilayer_a3_fb_finish_9", new List <string> {
                                i.ToString()
                            });
                            SXML        Xml_win = XMLMgr.instance.GetSXML("clanwar");
                            List <SXML> awd     = Xml_win.GetNodeList("atk_awd");
                            foreach (SXML s in awd)
                            {
                                if (s.getInt("min") <= i && s.getInt("max") >= i)
                                {
                                    List <SXML> rew       = Xml_win.GetNodeList("RewardItem");
                                    List <SXML> awds_coin = Xml_win.GetNodeList("RewardValue");
                                    setAwd(con, item, rew, awds_coin);
                                    break;
                                }
                            }
                        }
                        else
                        {
                            //守城
                            int i = data["hpper"];
                            cityWAr.transform.FindChild("win/info").GetComponent <Text>().text = ContMgr.getCont("uilayer_a3_fb_finish_10", new List <string> {
                                i.ToString()
                            });
                            SXML        Xml_win = XMLMgr.instance.GetSXML("clanwar");
                            List <SXML> awd     = Xml_win.GetNodeList("def_awd");
                            foreach (SXML s in awd)
                            {
                                if (s.getInt("min") <= i && s.getInt("max") >= i)
                                {
                                    List <SXML> rew       = s.GetNodeList("RewardItem");
                                    List <SXML> awds_coin = s.GetNodeList("RewardValue");
                                    setAwd(con, item, rew, awds_coin);
                                    break;
                                }
                            }
                        }
                    }
                }
            }
        }
Exemple #30
0
        void getPublish(Variant data)
        {
            if (data.ContainsKey("tp") && data["tp"] != 10)
            {
                UnityEngine.Debug.Log("聊天所有信息" + data.dump());
            }
            if (data.ContainsKey("cid"))
            {
                uint cid = data["cid"]._uint;
                if (FriendProxy.getInstance().BlackDataList.ContainsKey(cid))
                {
                    return;
                }
            }
            if (data.ContainsKey("res"))
            {
                int res = data["res"];
                if (res < 0)//-158
                {
                    Globle.err_output(res);
                    return;
                }
                if (res == 1)//私聊玩家存在情况下
                {
                    a3_chatroom._instance.meSays(false);
                }
            }
            else
            {
                switch ((ChatToType)data["tp"]._int)
                {
                case ChatToType.Nearby:
                    if (!data.ContainsKey("url"))
                    {
                        uint   cid = data["cid"]._uint;
                        string msg = data["msg"]._str;
                        foreach (KeyValuePair <uint, ProfessionRole> item in OtherPlayerMgr._inst.m_mapOtherPlayerSee)
                        {
                            if (item.Value.m_unCID == cid)
                            {
                                PlayerChatUIMgr.getInstance().show(item.Value, analysisStrName(msg));
                            }
                        }
                    }

                    break;

                case ChatToType.PrivateSecretlanguage:
                    if (GlobleSetting.IGNORE_PRIVATE_INFO)
                    {
                        return;                                       //客户端开启屏蔽私聊信息
                    }
                    break;
                }
                // UIClient.instance.dispatchEvent(GameEvent.Create(UI_EVENT.GET_PUBLISH, this, data));

                if (data["tp"] == 10)
                {//系统消息特殊处理,走马灯的同时,聊天框也要显示
                    if (broadcasting.instance != null)
                    {
                        broadcasting.instance.addGonggaoMsg(data["msg"]);
                    }

                    data["tp"] = (int)ChatToType.SystemMsg;
                    if (a3_chatroom._instance != null)
                    {
                        a3_chatroom._instance.otherSays(data);
                    }
                }
                else if (data["tp"] == 11)
                {
                    data["tp"] = (int)ChatToType.LegionSystemMsg;
                    if (data.ContainsKey("guard_time"))
                    {
                        if (A3_LegionModel.getInstance().myLegion.lvl > 1)
                        {
                            data["msg"] = ContMgr.getCont(("clan_log_12"), new List <string>()
                            {
                                (3 - data["guard_time"]).ToString(), (A3_LegionModel.getInstance().myLegion.lvl - 1).ToString()
                            });
                        }
                        else
                        {
                            data["msg"] = ContMgr.getCont(("clan_log_11"), new List <string>()
                            {
                                (3 - data["guard_time"]).ToString()
                            });
                        }

                        if (a3_chatroom._instance != null)
                        {
                            a3_chatroom._instance.otherSays(data);
                        }
                    }
                }
                else if (data["tp"] == 12)
                {
                    InterfaceMgr.getInstance().ui_async_open(InterfaceMgr.A3_CITYWARTIP);
                }
                else
                {
                    if (a3_chatroom._instance != null)
                    {
                        List <Variant> lp = null;
                        if (data.ContainsKey("xtp"))
                        {
                            int xtp = data["xtp"]._int;
                            switch (xtp)
                            {
                            case 1:
                                data = AnalysisData(data, out lp, xtp);
                                if (lp.Count == 6 &&
                                    lp[5].ContainsKey("tid") &&
                                    TeamProxy.getInstance()?.MyTeamData != null &&
                                    lp[5]["tid"] == TeamProxy.getInstance().MyTeamData.teamId&&
                                    PlayerModel.getInstance().IsCaptain)     //反馈仅对队长可见
                                {
                                    flytxt.instance.fly(ContMgr.getCont("a3_currentTeamPanel_in_fb2"));
                                }
                                break;

                            default: break;
                            }
                        }
                        a3_chatroom._instance.otherSays(data, lp);
                    }
                }
            }
        }