示例#1
0
        public void do_expCD()
        {
            endCD_exp--;
            if (endCD_exp <= 0)
            {
                endCD_exp = 0;
                dou_exp   = false;
                if (a3_insideui_fb.instance)
                {
                    a3_insideui_fb.instance.Using_jc();
                }
                A3_BuffModel.getInstance().RemoveBuff(10001);
                CancelInvoke("do_expCD");
                return;
            }
            string cd;

            if (endCD_exp > 3600)
            {
                cd = string.Format("{0:D2}:{1:D2}:{2:D2}", endCD_exp / 3600, endCD_exp % 3600 / 60, endCD_exp % 60);
            }
            else
            {
                cd = string.Format("{0:D2}:{1:D2}", /* endCD_exp / 3600,*/ endCD_exp % 3600 / 60, endCD_exp % 60);
            }
            if (exp_pos)
            {
                exp_pos.GetComponent <Text>().text = name_exp + "(" + cd + ")";
            }
        }
        //--------------------------------------------buff问题暂时注掉
        void on_rmv_state(Variant msgData)
        {
            debug.Log("移除buff" + msgData.dump());
            //uint iid = msgData["iid"];
            uint     iid    = msgData["iid"]._uint;
            BaseRole toRole = RoleMgr._instance.getRole(iid);

            if ((toRole != null && toRole.m_isMain) || iid == PlayerModel.getInstance().iid)
            {
                foreach (uint id in msgData["ids"]._arr)
                {
                    A3_BuffModel.getInstance().RemoveBuff(id);
                }
            }
            else
            {
                foreach (uint id in msgData["ids"]._arr)
                {
                    A3_BuffModel.getInstance().removeOtherBuff(toRole, id);
                }
            }
            //-------------------------------------------------------------
            //LGAvatarGameInst av = RoleMgr._instance.getRoleByIID(iid);
            //if (av == null)
            //    return;
            //List<Variant> ids = msgData["ids"]._arr;
            //foreach (Variant id in ids)
            //{
            //    av.removeBuffer(id);
            //}
        }
示例#3
0
 private void Set_cancel()
 {
     for (int i = 0; i < 10; i++)
     {
         if (!A3_BuffModel.getInstance().BuffCd.ContainsKey(skill_id[i]))
         {
             if (IsInvoking("do_skillCD_" + i))
             {
                 CancelInvoke("do_skillCD_" + i);
             }
         }
     }
 }
示例#4
0
        public void do_skillCD_10()
        {
            endCD_skill[10]--;
            if (endCD_skill[10] <= 0)
            {
                endCD_skill[10] = 0;
                CancelInvoke("do_skillCD_10");
                A3_BuffModel.getInstance().RemoveBuff(skill_id[10]);
                return;
            }
            string cd = string.Format("{0:D2}:{1:D2}", /*endCD_skill[8] / 3600,*/ endCD_skill[10] % 3600 / 60, endCD_skill[10] % 60);

            if (skill_pos[10])
            {
                skill_pos[10].GetComponent <Text>().text = name_skill[10] + "(" + cd + ")";
            }
        }
        void on_add_state(Variant msgData)
        {
            debug.Log("添加buff" + msgData.dump());
            if (msgData != null && msgData["iid"] != null)
            {
                uint to_iid = msgData["iid"]._uint;

                BaseRole toRole = RoleMgr._instance.getRole(to_iid);
                if (toRole != null || to_iid == PlayerModel.getInstance().iid)
                {
                    if ((toRole != null && toRole.m_isMain) || to_iid == PlayerModel.getInstance().iid)
                    {
                        if (!msgData.ContainsKey("states"))
                        {
                            return;
                        }
                        foreach (Variant one in msgData["states"]._arr)
                        {
                            Variant data = one;
                            if (data["id"] == 10001 && a3_herohead.instance != null)
                            {
                                end_tm  = data["end_tm"];
                                star_tm = data["start_tm"];
                                //a3_herohead.instance.doubleexp_bf = true;
                                a3_herohead.instance.exp_time = end_tm - muNetCleint.instance.CurServerTimeStamp;
                            }

                            A3_BuffModel.getInstance().addBuffList(data);
                        }
                    }
                }
                else
                {
                    foreach (Variant one in msgData["states"]._arr)
                    {
                        A3_BuffModel.getInstance().addOtherBuff(toRole, one["id"]);
                    }
                }
            }
        }
示例#6
0
        public void do_blessCD()
        {
            endCD_bless--;
            if (endCD_bless <= 0)
            {
                bless_ad = false;
                if (a3_insideui_fb.instance)
                {
                    a3_insideui_fb.instance.Using_jc();
                }
                endCD_bless = 0;
                CancelInvoke("do_blessCD");
                A3_BuffModel.getInstance().RemoveBuff(10000);
                return;
            }
            string cd = string.Format("{0:D2}:{1:D2}", /*endCD_bless / 3600,*/ endCD_bless % 3600 / 60, endCD_bless % 60);

            if (bless_pos)
            {
                bless_pos.GetComponent <Text>().text = name_bless + "(" + cd + ")";
            }
        }
示例#7
0
        private void onMapChange(Variant msgData)
        {
            bool flag = a3_expbar.instance != null;

            if (flag)
            {
                a3_expbar.instance.CloseAgainst();
            }
            debug.Log(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>onMapChange>" + msgData.dump());
            A3_BuffModel expr_38 = ModelBase <A3_BuffModel> .getInstance();

            bool flag2 = ((expr_38 != null) ? expr_38.BuffCd : null) != null;

            if (flag2)
            {
                ModelBase <A3_BuffModel> .getInstance().BuffCd.Clear();

                a3_buff expr_61 = a3_buff.instance;
                if (expr_61 != null)
                {
                    expr_61.resh_buff();
                }
            }
            bool flag3 = msgData.ContainsKey("states");

            if (flag3)
            {
                Variant variant = msgData["states"];
                foreach (Variant current in variant["state_par"]._arr)
                {
                    Variant data = current;
                    ModelBase <A3_BuffModel> .getInstance().addBuffList(data);
                }
            }
            bool flag4 = msgData.ContainsKey("pk_state");

            if (flag4)
            {
                ModelBase <PlayerModel> .getInstance().now_pkState = msgData["pk_state"];

                switch (ModelBase <PlayerModel> .getInstance().now_pkState)
                {
                case 0:
                    ModelBase <PlayerModel> .getInstance().pk_state = PK_TYPE.PK_PEACE;

                    break;

                case 1:
                    ModelBase <PlayerModel> .getInstance().pk_state = PK_TYPE.PK_PKALL;

                    ModelBase <PlayerModel> .getInstance().m_unPK_Param = ModelBase <PlayerModel> .getInstance().cid;

                    ModelBase <PlayerModel> .getInstance().m_unPK_Param2 = ModelBase <PlayerModel> .getInstance().cid;

                    break;

                case 2:
                    ModelBase <PlayerModel> .getInstance().pk_state = PK_TYPE.PK_TEAM;

                    ModelBase <PlayerModel> .getInstance().m_unPK_Param = ModelBase <PlayerModel> .getInstance().teamid;

                    ModelBase <PlayerModel> .getInstance().m_unPK_Param2 = ModelBase <PlayerModel> .getInstance().clanid;

                    break;
                }
                bool flag5 = a3_pkmodel._instance;
                if (flag5)
                {
                    a3_pkmodel._instance.ShowThisImage(msgData["pk_state"]);
                }
                InterfaceMgr.doCommandByLua("PlayerModel:getInstance().modPkState", "model/PlayerModel", new object[]
                {
                    ModelBase <PlayerModel> .getInstance().now_pkState,
                    true
                });
            }
            GRMap.loading = true;
            bool flag6 = a3_liteMinimap.instance;

            if (flag6)
            {
                a3_liteMinimap.instance.clear();
            }
            ModelBase <PlayerModel> .getInstance().refreshByChangeMap(msgData);

            GRMap.curSvrMsg = msgData;
            NetClient.instance.dispatchEvent(GameEvent.Create(58u, this, msgData, false));
            bool autofighting = SelfRole.fsm.Autofighting;

            if (autofighting)
            {
                SelfRole.fsm.Stop();
            }
            bool flag7 = msgData["hp"] <= 0;

            if (flag7)
            {
                SelfRole._inst.onDead(true, null);
                InterfaceMgr.getInstance().open(InterfaceMgr.A3_RELIVE, null, false);
            }
        }
        void on_single_skill_res(Variant msgData)
        {
            debug.Log("UUUUUUU" + msgData.dump());
            uint     to_iid  = msgData["to_iid"]._uint;
            uint     frm_iid = msgData["frm_iid"]._uint;
            BaseRole toRole  = RoleMgr._instance.getRole(to_iid);
            BaseRole frmRole = RoleMgr._instance.getRole(frm_iid);

            //toRole.m_unTeamID = 0;

            if (!msgData.ContainsKey("states"))
            {
                return;
            }

            if (toRole != null && toRole.m_isMain)
            {
                Variant data = msgData["states"];
                if (msgData["sid"])
                {
                    int runeid = msgData["sid"];
                    //skill_id = runeid;
                    FightText.play(FightText.BUFF_TEXT, toRole.getHeadPos(), 0, false, runeid, null, toRole);
                }
                //if (data["id"] != 10000)
                A3_BuffModel.getInstance().addBuffList(data);

                ////副本祝福
                //if (data["id"] == 10000)
                //{
                //    A3_ActiveProxy.getInstance().dispatchEvent(GameEvent.Create(A3_ActiveProxy.EVENT_ONBLESS, this, data));
                //}
            }
            else
            {
                A3_BuffModel.getInstance().addOtherBuff(toRole, msgData["states"]["id"]);
            }

            if (msgData.ContainsKey("states"))
            {//技能的配置表特效播放
                SXML   xml      = XMLMgr.instance.GetSXML("skill.state", "id==" + msgData["states"]["id"]);
                string eff_file = xml.getString("effect");
                if (frmRole is MonsterRole && (frmRole as MonsterRole).issummon && to_iid == frm_iid)
                {
                    frmRole.PlaySkill(msgData["sid"]);
                }
                if (eff_file != "null")
                {
                    if (SceneCamera.m_nSkillEff_Level == 1 || toRole.m_isMain ||
                        (frmRole is MonsterRole && (frmRole as MonsterRole).masterid == PlayerModel.getInstance().cid))
                    {//屏蔽隐藏其他玩家时的buff特效
                        float      time      = xml.getFloat("last");
                        GameObject fx_prefab = GAMEAPI.ABFight_LoadPrefab(eff_file);
                        GameObject fx_inst   = GameObject.Instantiate(fx_prefab) as GameObject;

                        fx_inst.transform.SetParent(toRole.m_curModel, false);
                        GameObject.Destroy(fx_inst, time);

                        if (xml.getFloat("head") > 0)
                        {//头顶显示
                            fx_inst.transform.localPosition = new Vector3(0, toRole.headOffset_half.y / 2 + xml.getFloat("head"), 0);
                        }
                    }
                }
            }
        }
示例#9
0
        public void resh_buff()
        {
            if (SelfRole._inst?.isDead ?? false)
            {
                return;
            }
            Clear_con();
            var buff = A3_BuffModel.getInstance().BuffCd;

            Set_cancel();
            if (num < 0)
            {
                num = 0;
            }
            if (buff.Count == 0 && num == 0)
            {
                buff_tp.SetActive(false);
                buff_info.SetActive(false);
                getGameObjectByPath("close").SetActive(false);
                return;
            }
            else
            {
                buff_tp.SetActive(true);
                // buff_info.SetActive(false);
            }

            //if(A3_BuffModel.getInstance().BuffCd.Count>1)


            buff_num.GetComponent <Text>().text = "buff * " + (buff.Count + num);
            contain.GetComponent <RectTransform>().sizeDelta = new Vector2(pre.GetComponent <RectTransform>().sizeDelta.x, pre.GetComponent <RectTransform>().sizeDelta.y *(buff.Count + num));
            foreach (uint buffId in A3_BuffModel.getInstance().BuffCd.Keys)
            {
                var go = GameObject.Instantiate(pre) as GameObject;
                go.transform.SetParent(contain);
                go.transform.localScale = Vector3.one;
                go.SetActive(true);

                Set_Line(go.transform, buff[buffId]);
            }
            //宠物和军团的buff重新加
            if (num != 0)
            {
                if (legion_bf == true && PlayerModel.getInstance().clan_buff_lvl > 0)
                {
                    var go = GameObject.Instantiate(pre) as GameObject;
                    go.transform.SetParent(contain);
                    go.transform.localScale = Vector3.one;
                    go.SetActive(true);
                    go.transform.FindChild("item_text").GetComponent <Text>().text = ContMgr.getCont("a3_buff");
                    // Debug.LogError(PlayerModel.getInstance().clan_buff_lvl);
                    // if (PlayerModel.getInstance().clan_buff_lvl == 0 ) PlayerModel.getInstance().clan_buff_lvl = 1;
                    var dv_self = XMLMgr.instance.GetSXML("clan.clan_buff", "lvl==" + PlayerModel.getInstance().clan_buff_lvl);

                    go.transform.FindChild("Text").GetComponent <Text>().text = dv_self.getString("buff_dc");
                }
                if (pet_bf == true)
                {
                    var go = GameObject.Instantiate(pre) as GameObject;
                    go.transform.SetParent(contain);
                    go.transform.localScale = Vector3.one;
                    go.SetActive(true);
                    go.transform.FindChild("item_text").GetComponent <Text>().text = ContMgr.getCont("a3_buff_pet");
                    if (A3_PetModel.curPetid == 0)
                    {
                        A3_PetModel.curPetid = 2;
                    }
                    var petXML = XMLMgr.instance.GetSXML("newpet.pet", "id==" + A3_PetModel.curPetid);
                    go.transform.FindChild("Text").GetComponent <Text>().text = petXML.getString("buff_dc");
                }
            }
        }
示例#10
0
        // private void on_begin_change_map_res (Variant msgData)
        //{
        //    NetClient.instance.dispatchEvent(
        //            GameEvent.Create(PKG_NAME.S2C_BEGIN_CHANGE_MAP_RES, this, msgData)
        //        );
        //}

        private void onMapChange(Variant msgData)
        {
            if (a3_expbar.instance != null)
            {
                a3_expbar.instance.CloseAgainst();
            }

            debug.Log(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>onMapChange>" + msgData.dump());

            if (A3_BuffModel.getInstance()?.BuffCd != null)
            {
                A3_BuffModel.getInstance().BuffCd.Clear();
                a3_buff.instance?.resh_buff();
            }
            if (msgData.ContainsKey("states"))
            {
                Variant buff = msgData["states"];
                foreach (Variant one in buff["state_par"]._arr)
                {
                    Variant data = one;
                    A3_BuffModel.getInstance().addBuffList(data);
                }
            }



            if (msgData.ContainsKey("pk_state"))
            {
                PlayerModel.getInstance().now_pkState = msgData["pk_state"];
                switch (PlayerModel.getInstance().now_pkState)
                {
                case 0:
                    PlayerModel.getInstance().pk_state = PK_TYPE.PK_PEACE;
                    break;

                case 1:
                    PlayerModel.getInstance().pk_state      = PK_TYPE.PK_PKALL;
                    PlayerModel.getInstance().m_unPK_Param  = PlayerModel.getInstance().cid;
                    PlayerModel.getInstance().m_unPK_Param2 = PlayerModel.getInstance().cid;
                    break;

                case 2:
                    PlayerModel.getInstance().pk_state      = PK_TYPE.PK_TEAM;
                    PlayerModel.getInstance().m_unPK_Param  = PlayerModel.getInstance().teamid;
                    PlayerModel.getInstance().m_unPK_Param2 = PlayerModel.getInstance().clanid;
                    break;
                //case 3:
                //    PlayerModel.getInstance().pk_state = PK_TYPE.PK_LEGION;
                //    PlayerModel.getInstance().m_unPK_Param = PlayerModel.getInstance().clanid;
                //    break;
                //case 4:
                //    PlayerModel.getInstance().pk_state = PK_TYPE.PK_HERO;
                //    //???
                //    break;

                case 5:
                    PlayerModel.getInstance().pk_state = PK_TYPE.Pk_SPOET;

                    break;
                }
                if (a3_pkmodel._instance)
                {
                    a3_pkmodel._instance.ShowThisImage(msgData["pk_state"]);
                }

                InterfaceMgr.doCommandByLua("PlayerModel:getInstance().modPkState", "model/PlayerModel", PlayerModel.getInstance().now_pkState, true);
            }
            GRMap.grmap_loading = true;
            if (a3_liteMiniBaseMap.instance)
            {
                a3_liteMiniBaseMap.instance.clear();
            }
            PlayerModel.getInstance().refreshByChangeMap(msgData);
            GRMap.curSvrMsg = msgData;
            NetClient.instance.dispatchEvent(
                GameEvent.Create(PKG_NAME.S2C_MAP_CHANGE, this, msgData)
                );

            if (SelfRole.fsm.Autofighting)
            {
                SelfRole.fsm.Stop();
            }

            if (msgData["hp"] <= 0)
            {
                SelfRole._inst.onDead(true);
                InterfaceMgr.getInstance().ui_async_open(InterfaceMgr.A3_RELIVE);
            }

            change_map = false;
        }