Exemplo n.º 1
0
        //public   List<uint> skillList = new List<uint>();
        public override void init()
        {
            instance = this;
            getGameObjectByPath("close").SetActive(false);
            buff_tp   = transform.FindChild("view_buff").gameObject;
            buff_info = transform.FindChild("buff_info").gameObject;
            buff_num  = buff_tp.transform.FindChild("con/text");
            contain   = buff_info.transform.FindChild("view/con");

            pre = buff_info.transform.FindChild("view/temp").gameObject;
            buff_info.SetActive(false);
            buff_tp.SetActive(false);
            new BaseButton(buff_tp.transform).onClick = (GameObject go) =>
            {
                if (buff_info.activeInHierarchy == false)
                {
                    getGameObjectByPath("close").SetActive(true);
                    buff_info.SetActive(true);
                }
                else
                {
                    getGameObjectByPath("close").SetActive(false);
                    buff_info.SetActive(false);
                }
            };
            new BaseButton(getTransformByPath("close")).onClick = (GameObject go) =>
            {
                if (buff_info.activeInHierarchy)
                {
                    getGameObjectByPath("close").SetActive(false);
                    buff_info.SetActive(false);
                }
            };
            legion_pet_buff();
        }
Exemplo n.º 2
0
        public override void init()
        {
            a3_buff.instance = this;
            this.buff_tp     = base.transform.FindChild("view_buff").gameObject;
            this.buff_info   = base.transform.FindChild("buff_info").gameObject;
            this.buff_num    = this.buff_tp.transform.FindChild("con/text");
            this.contain     = this.buff_info.transform.FindChild("view/con");
            this.pre         = this.buff_info.transform.FindChild("view/temp").gameObject;
            this.buff_info.SetActive(false);
            this.buff_tp.SetActive(false);
            new BaseButton(this.buff_tp.transform, 1, 1).onClick = delegate(GameObject go)
            {
                bool flag = !this.buff_info.activeInHierarchy;
                if (flag)
                {
                    this.buff_info.SetActive(true);
                }
                else
                {
                    this.buff_info.SetActive(false);
                }
            };
            this.legion_pet_buff();
            BaseProxy <A3_LegionProxy> .getInstance().addEventListener(9u, new Action <GameEvent>(this.Quit));

            BaseProxy <A3_LegionProxy> .getInstance().addEventListener(2u, new Action <GameEvent>(this.Join));

            BaseProxy <A3_LegionProxy> .getInstance().addEventListener(22u, new Action <GameEvent>(this.Deleteclan));

            BaseProxy <A3_PetProxy> .getInstance().addEventListener(A3_PetProxy.EVENT_HAVE_PET, new Action <GameEvent>(this.closePet));

            BaseProxy <A3_PetProxy> .getInstance().addEventListener(A3_PetProxy.EVENT_GET_LAST_TIME, new Action <GameEvent>(this.get_pettime));

            BaseProxy <BattleProxy> .getInstance().addEventListener(A3_PetProxy.EVENT_GET_LAST_TIME, new Action <GameEvent>(this.reshbuff));
        }
Exemplo n.º 3
0
        public void RemoveBuff(uint id)
        {
            bool flag = !this.BuffCd.ContainsKey(id);

            if (!flag)
            {
                BUFF_TYPE buff_type = this.BuffCd[id].buff_type;
                BUFF_TYPE bUFF_TYPE = buff_type;
                if (bUFF_TYPE != BUFF_TYPE.CANT_MOVE)
                {
                    if (bUFF_TYPE != BUFF_TYPE.CANT_SKILL)
                    {
                        if (bUFF_TYPE == BUFF_TYPE.CANT_MOVE_SKILL)
                        {
                            SelfRole._inst.can_buff_move    = true;
                            SelfRole._inst.can_buff_skill   = true;
                            SelfRole._inst.can_buff_ani     = true;
                            SelfRole._inst.m_curAni.enabled = true;
                        }
                    }
                    else
                    {
                        SelfRole._inst.can_buff_skill = true;
                    }
                }
                else
                {
                    SelfRole._inst.can_buff_move = true;
                }
                bool flag2 = SelfRole._inst is P3Mage;
                if (flag2)
                {
                    XMLMgr expr_A4 = XMLMgr.instance;
                    SXML   sXML    = (expr_A4 != null) ? expr_A4.GetSXML("skill.state", "id==" + id) : null;
                    bool   flag3   = sXML.getInt("skill_id") == 3008;
                    if (flag3)
                    {
                        SelfRole._inst.PlaySkill(30081);
                    }
                }
                bool flag4 = buff_type != BUFF_TYPE.NULL && this.Buff_type_list.Contains(buff_type);
                if (flag4)
                {
                    this.Buff_type_list.Remove(this.BuffCd[id].buff_type);
                }
                this.BuffCd.Remove(id);
                a3_buff expr_138 = a3_buff.instance;
                if (expr_138 != null)
                {
                    expr_138.resh_buff();
                }
            }
        }
Exemplo n.º 4
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);
            }
        }
Exemplo n.º 5
0
        public void addBuffList(Variant data)
        {
            BuffInfo buffInfo = new BuffInfo();

            buffInfo.id         = data["id"];
            buffInfo.par        = data["par"];
            buffInfo.start_time = data["start_tm"];
            buffInfo.end_time   = data["end_tm"];
            XMLMgr expr_64 = XMLMgr.instance;
            SXML   sXML    = (expr_64 != null) ? expr_64.GetSXML("skill.state", "id==" + buffInfo.id) : null;
            SXML   sXML2   = (sXML != null) ? sXML.GetNode("s", null) : null;
            bool   flag    = sXML2 != null;

            if (flag)
            {
                int @int = sXML2.getInt("tp");
                if (@int != 1)
                {
                    if (@int != 6)
                    {
                        if (@int != 7)
                        {
                            buffInfo.buff_type = BUFF_TYPE.NULL;
                        }
                        else
                        {
                            SelfRole._inst.can_buff_move    = false;
                            SelfRole._inst.can_buff_skill   = false;
                            SelfRole._inst.can_buff_ani     = false;
                            SelfRole._inst.m_curAni.enabled = false;
                            buffInfo.buff_type = BUFF_TYPE.CANT_MOVE_SKILL;
                        }
                    }
                    else
                    {
                        SelfRole._inst.can_buff_skill = false;
                        buffInfo.buff_type            = BUFF_TYPE.CANT_SKILL;
                    }
                }
                else
                {
                    buffInfo.buff_type           = BUFF_TYPE.CANT_MOVE;
                    SelfRole._inst.can_buff_move = false;
                }
                bool flag2 = buffInfo.buff_type != BUFF_TYPE.NULL && !this.Buff_type_list.Contains(buffInfo.buff_type);
                if (flag2)
                {
                    this.Buff_type_list.Add(buffInfo.buff_type);
                }
            }
            buffInfo.icon = ((sXML != null) ? sXML.getString("icon") : null);
            buffInfo.name = ((sXML != null) ? sXML.getString("name") : null);
            this.dele_buff(data);
            this.BuffCd[buffInfo.id] = buffInfo;
            buffInfo.doCD();
            a3_buff expr_1C7 = a3_buff.instance;

            if (expr_1C7 != null)
            {
                expr_1C7.resh_buff();
            }
        }