コード例 #1
0
        public void onLoadInfo(Variant data)
        {
            debug.Log("pk模式的信息:" + data.dump());
            bool flag = data.ContainsKey("pk_state");

            if (flag)
            {
                ModelBase <PlayerModel> .getInstance().now_pkState = data["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 flag2 = a3_pkmodel._instance;
                if (flag2)
                {
                    a3_pkmodel._instance.ShowThisImage(data["pk_state"]);
                }
                bool flag3 = SelfRole.s_LockFX.gameObject != null;
                if (flag3)
                {
                    PkmodelAdmin.RefreshShow(SelfRole._inst.m_LockRole, false, false);
                }
                InterfaceMgr.doCommandByLua("PlayerModel:getInstance().modPkState", "model/PlayerModel", new object[]
                {
                    ModelBase <PlayerModel> .getInstance().now_pkState,
                    true
                });
                InterfaceMgr.getInstance().close(InterfaceMgr.A3_PKMODEL);
                NewbieModel.getInstance().hide();
            }
        }
コード例 #2
0
        public void onLoadInfo(Variant data)
        {
            debug.Log("pk模式的信息:" + data.dump());
            if (data.ContainsKey("pk_state"))
            {
                PlayerModel.getInstance().now_pkState = data["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;
                }
                if (a3_pkmodel._instance)
                {
                    a3_pkmodel._instance.ShowThisImage(data["pk_state"]);
                }
                if (SelfRole.s_LockFX.gameObject != null)
                {
                    PkmodelAdmin.RefreshShow(SelfRole._inst.m_LockRole);
                }

                InterfaceMgr.doCommandByLua("PlayerModel:getInstance().modPkState", "model/PlayerModel", PlayerModel.getInstance().now_pkState, true);

                InterfaceMgr.getInstance().close(InterfaceMgr.A3_PKMODEL);
                NewbieModel.getInstance().hide();
            }
        }
コード例 #3
0
        private void onLvlUp(Variant msgData)
        {
            bool flag = a3_liteMinimap.instance != null;

            if (flag)
            {
                a3_liteMinimap.instance.function_open(a3_liteMinimap.instance.fun_i);
            }
            debug.Log("收到升级或者转生的协议........." + msgData.dump());
            bool flag2 = msgData.ContainsKey("cid");

            if (flag2)
            {
                bool flag3 = msgData["cid"] != ModelBase <PlayerModel> .getInstance().cid;

                if (flag3)
                {
                    bool flag4 = OtherPlayerMgr._inst != null && OtherPlayerMgr._inst.m_mapOtherPlayer.Count > 0;
                    if (flag4)
                    {
                        bool flag5 = OtherPlayerMgr._inst.m_mapOtherPlayer.ContainsKey(msgData["iid"]);
                        if (flag5)
                        {
                            OtherPlayerMgr._inst.m_mapOtherPlayer[msgData["iid"]].zhuan = msgData["zhuan"];
                        }
                    }
                    bool flag6 = SelfRole._inst != null && SelfRole._inst.m_LockRole != null && SelfRole._inst.m_LockRole.m_unIID == msgData["iid"];
                    if (flag6)
                    {
                        PkmodelAdmin.RefreshShow(SelfRole._inst.m_LockRole, true, false);
                    }
                }
                else
                {
                    ModelBase <PlayerModel> .getInstance().lvUp(msgData);

                    base.dispatchEvent(GameEvent.Create(PlayerInfoProxy.EVENT_SELF_ON_LV_CHANGE, this, msgData, false));
                    bool flag7 = msgData.ContainsKey("pinfo");
                    if (flag7)
                    {
                        InterfaceMgr.doCommandByLua("PlayerModel:getInstance().modExp", "model/PlayerModel", new object[]
                        {
                            msgData["pinfo"]["exp"]
                        });
                    }
                    bool flag8 = msgData.ContainsKey("mod_exp");
                    if (flag8)
                    {
                        flytxt.instance.fly("EXP+" + msgData["mod_exp"], 3, default(Color), null);
                    }
                }
            }
            bool flag9 = a3_QHmaster.instance != null;

            if (flag9)
            {
                a3_QHmaster.instance.refreshDashi();
            }
            base.dispatchEvent(GameEvent.Create(PlayerInfoProxy.EVENT_ON_LV_CHANGE, this, msgData, false));
            BaseProxy <ResetLvLProxy> .getInstance().resetLvL();
        }
コード例 #4
0
        void onLvlUp(Variant msgData)
        {
            if (a3_liteMinimap.instance != null)
            {
                a3_liteMinimap.instance.function_open(a3_liteMinimap.instance.fun_i);
            }
            //NetClient.instance.dispatchEvent(
            //    GameEvent.Create(GAME_EVENT.ON_LVL_UP, this, msgData)
            //);
            //if (msgData.ContainsKey("pinfo"))
            //{
            //    NetClient.instance.dispatchEvent(
            //        GameEvent.Create(GAME_EVENT.R_PLAYER_INFO_CHANGED, this, null)
            //    );
            //    NetClient.instance.dispatchEvent(
            //        GameEvent.Create(GAME_EVENT.PLAYER_INFO_CHANGED, this, null)
            //    );
            //}

            //Variant plyInfo = new Variant();

            //NetClient.instance.dispatchEvent(
            //        GameEvent.Create(GAME_EVENT.MODIFY_TEAMMATE_DATA, this, msgData["lvlshare"])
            //    );
            debug.Log("收到升级或者转生的协议........." + msgData.dump());
            if (msgData.ContainsKey("cid"))
            {
                if (msgData["cid"] != PlayerModel.getInstance().cid)
                {
                    if (OtherPlayerMgr._inst != null && OtherPlayerMgr._inst.m_mapOtherPlayer.Count > 0)
                    {
                        if (OtherPlayerMgr._inst.m_mapOtherPlayer.ContainsKey(msgData["iid"]))
                        {
                            OtherPlayerMgr._inst.m_mapOtherPlayer[msgData["iid"]].zhuan = msgData["zhuan"];
                        }
                    }
                    //点击的角色在你身边升到1转以上了
                    if (SelfRole._inst != null && SelfRole._inst.m_LockRole != null && SelfRole._inst.m_LockRole.m_unIID == msgData["iid"])
                    {
                        PkmodelAdmin.RefreshShow(SelfRole._inst.m_LockRole, true);
                    }
                    //   // (SelfRole._inst.m_LockRole as ProfessionRole).lvl = msgData["lvl"];
                    //    //(SelfRole._inst.m_LockRole as ProfessionRole).zhuan= msgData["zhuan"];
                }
                else
                {
                    PlayerModel.getInstance().lvUp(msgData);
                    dispatchEvent(GameEvent.Create(EVENT_SELF_ON_LV_CHANGE, this, msgData));
                    if (msgData.ContainsKey("pinfo"))
                    {
                        InterfaceMgr.doCommandByLua("PlayerModel:getInstance().modExp", "model/PlayerModel", (uint)msgData["pinfo"]["exp"]);
                    }
                    if (msgData.ContainsKey("mod_exp"))
                    {
                        flytxt.instance.fly("EXP+" + msgData["mod_exp"], 3);
                    }
                }
            }
            if (a3_QHmaster.instance != null)
            {
                a3_QHmaster.instance.refreshDashi();
            }
            dispatchEvent(GameEvent.Create(EVENT_ON_LV_CHANGE, this, msgData));
            ResetLvLProxy.getInstance().resetLvL();
        }
コード例 #5
0
ファイル: SKillCdBt.cs プロジェクト: atom-chen/rongyaojt
        public void onDrag(GameObject go)
        {
            this.recTransform.DOScale(this.endScale, 0.15f);
            base.transform.FindChild("click").gameObject.SetActive(true);
            base.transform.FindChild("click").GetComponent <Animator>().Play("skill_click", -1, 0f);
            base.transform.FindChild("click").GetComponent <Animator>().SetBool("isLoop", true);
            bool flag = SelfRole.fsm.Autofighting;

            if (flag)
            {
                StateInit.Instance.PlaySkillInAutoPlay(this._data.skill_id);
            }
            else
            {
                bool flag2 = this.data == null;
                if (!flag2)
                {
                    bool flag3 = !this.canUse();
                    if (!flag3)
                    {
                        bool flag4 = SelfRole._inst.isPlayingSkill && this.data.skill_id != skillbar.NORNAL_SKILL_ID;
                        if (!flag4)
                        {
                            this.m_nCurDownID = this._data.skill_id;
                            this.setSelf_LockRole();
                            bool flag5 = SelfRole._inst.m_LockRole == null;
                            if (flag5)
                            {
                                bool flag6 = this.data.skill_id == 3006 || this.data.skill_id == 5004 || this.data.skill_id == 5009 || this.data.skill_id == 3004;
                                if (flag6)
                                {
                                    bool flag7 = flytxt.instance != null;
                                    if (flag7)
                                    {
                                        flytxt.instance.fly("无锁定的目标!", 0, default(Color), null);
                                    }
                                    return;
                                }
                            }
                            else
                            {
                                bool flag8 = this.data.skill_id == 3006 || this.data.skill_id == 5004 || this.data.skill_id == 5009 || this.data.skill_id == 3004;
                                if (flag8)
                                {
                                    bool flag9 = !PkmodelAdmin.RefreshLockSkill(SelfRole._inst.m_LockRole);
                                    if (flag9)
                                    {
                                        bool flag10 = flytxt.instance != null;
                                        if (flag10)
                                        {
                                            flytxt.instance.fly("无锁定的目标!", 0, default(Color), null);
                                        }
                                        return;
                                    }
                                }
                            }
                            bool flag11 = SelfRole._inst.m_LockRole != null;
                            if (flag11)
                            {
                                SelfRole._inst.LeaveHide();
                                bool flag12 = this.data.skill_id != 3010;
                                if (flag12)
                                {
                                    SelfRole._inst.TurnToRole(SelfRole._inst.m_LockRole, true);
                                }
                                SelfRole._inst.PlaySkill(this._data.skill_id);
                                bool flag13 = !SelfRole._inst.m_LockRole.isfake;
                                if (flag13)
                                {
                                    BaseProxy <BattleProxy> .getInstance().send_cast_self_skill(SelfRole._inst.m_LockRole.m_unIID, this._data.skill_id);
                                }
                            }
                            else
                            {
                                SelfRole._inst.LeaveHide();
                                SelfRole._inst.PlaySkill(this._data.skill_id);
                                BaseProxy <BattleProxy> .getInstance().send_cast_self_skill(0u, this._data.skill_id);
                            }
                            bool flag14 = this._data.skillType == 0;
                            if (flag14)
                            {
                                BaseProxy <BattleProxy> .getInstance().sendUseSelfSkill((uint)this._data.skill_id);
                            }
                            this.doCD();
                        }
                    }
                }
            }
        }
コード例 #6
0
ファイル: SKillCdBt.cs プロジェクト: atom-chen/rongyaojt
        public void setSelf_LockRole()
        {
            bool flag = SelfRole._inst.m_LockRole != null && SelfRole._inst.m_LockRole.isDead;

            if (flag)
            {
                SelfRole._inst.m_LockRole = null;
            }
            bool flag2 = ModelBase <PlayerModel> .getInstance().now_pkState == 0;

            if (flag2)
            {
                bool flag3 = SelfRole._inst.m_LockRole is ProfessionRole || SelfRole._inst.m_LockRole is MS0000 || SelfRole._inst.m_LockRole is MDC000;
                if (flag3)
                {
                    SelfRole._inst.m_LockRole = null;
                }
                bool flag4 = SelfRole._inst.m_LockRole is MDC000 && ((MDC000)SelfRole._inst.m_LockRole).escort_name == ModelBase <A3_LegionModel> .getInstance().myLegion.clname;

                if (flag4)
                {
                    SelfRole._inst.m_LockRole = null;
                }
                bool flag5 = SelfRole._inst.m_LockRole is MDC000;
                if (flag5)
                {
                    float num   = (float)((MDC000)SelfRole._inst.m_LockRole).curhp / (float)((MDC000)SelfRole._inst.m_LockRole).maxHp * 100f;
                    bool  flag6 = num <= 20f;
                    if (flag6)
                    {
                        SelfRole._inst.m_LockRole = null;
                    }
                }
            }
            else
            {
                bool flag7 = ModelBase <PlayerModel> .getInstance().now_pkState == 1;

                if (flag7)
                {
                    bool flag8 = SelfRole._inst.m_LockRole is MS0000 && (SelfRole._inst.m_LockRole as MS0000).masterid == ModelBase <PlayerModel> .getInstance().cid;

                    if (flag8)
                    {
                        SelfRole._inst.m_LockRole = null;
                    }
                    bool flag9 = SelfRole._inst.m_LockRole is MDC000 && ((MDC000)SelfRole._inst.m_LockRole).escort_name == ModelBase <A3_LegionModel> .getInstance().myLegion.clname;

                    if (flag9)
                    {
                        SelfRole._inst.m_LockRole = null;
                    }
                    bool flag10 = SelfRole._inst.m_LockRole is MDC000;
                    if (flag10)
                    {
                        float num2   = (float)((MDC000)SelfRole._inst.m_LockRole).curhp / (float)((MDC000)SelfRole._inst.m_LockRole).maxHp * 100f;
                        bool  flag11 = num2 <= 20f;
                        if (flag11)
                        {
                            SelfRole._inst.m_LockRole = null;
                        }
                    }
                }
                else
                {
                    bool flag12 = ModelBase <PlayerModel> .getInstance().now_pkState == 2;

                    if (flag12)
                    {
                        bool flag13 = SelfRole._inst.m_LockRole is MS0000;
                        if (flag13)
                        {
                            bool flag14 = false;
                            bool flag15 = BaseProxy <TeamProxy> .getInstance().MyTeamData != null;

                            if (flag15)
                            {
                                foreach (ItemTeamData current in BaseProxy <TeamProxy> .getInstance().MyTeamData.itemTeamDataList)
                                {
                                    bool flag16 = current.cid == (SelfRole._inst.m_LockRole as MS0000).masterid;
                                    if (flag16)
                                    {
                                        flag14 = true;
                                        break;
                                    }
                                }
                            }
                            bool flag17 = !flag14 && ModelBase <A3_LegionModel> .getInstance().members != null;

                            if (flag17)
                            {
                                foreach (A3_LegionMember current2 in ModelBase <A3_LegionModel> .getInstance().members.Values)
                                {
                                    bool flag18 = (long)current2.cid == (long)((ulong)(SelfRole._inst.m_LockRole as MS0000).masterid);
                                    if (flag18)
                                    {
                                        flag14 = true;
                                        break;
                                    }
                                }
                            }
                            bool flag19 = flag14 || (SelfRole._inst.m_LockRole as MS0000).masterid == ModelBase <PlayerModel> .getInstance().cid;

                            if (flag19)
                            {
                                SelfRole._inst.m_LockRole = null;
                            }
                        }
                        else
                        {
                            bool flag20 = SelfRole._inst.m_LockRole is MDC000;
                            if (flag20)
                            {
                                float num3   = (float)((MDC000)SelfRole._inst.m_LockRole).curhp / (float)((MDC000)SelfRole._inst.m_LockRole).maxHp * 100f;
                                bool  flag21 = ((MDC000)SelfRole._inst.m_LockRole).escort_name == ModelBase <A3_LegionModel> .getInstance().myLegion.clname;

                                if (flag21)
                                {
                                    SelfRole._inst.m_LockRole = null;
                                }
                                bool flag22 = num3 <= 20f;
                                if (flag22)
                                {
                                    SelfRole._inst.m_LockRole = null;
                                }
                            }
                            else
                            {
                                bool flag23 = SelfRole._inst.m_LockRole is ProfessionRole;
                                if (flag23)
                                {
                                    bool flag24 = false;
                                    bool flag25 = BaseProxy <TeamProxy> .getInstance().MyTeamData != null;

                                    if (flag25)
                                    {
                                        foreach (A3_LegionMember current3 in ModelBase <A3_LegionModel> .getInstance().members.Values)
                                        {
                                            bool flag26 = (long)current3.cid == (long)((ulong)SelfRole._inst.m_LockRole.m_unCID);
                                            if (flag26)
                                            {
                                                flag24 = true;
                                                break;
                                            }
                                        }
                                    }
                                    bool flag27 = !flag24 && ModelBase <A3_LegionModel> .getInstance().members != null;

                                    if (flag27)
                                    {
                                        foreach (A3_LegionMember current4 in ModelBase <A3_LegionModel> .getInstance().members.Values)
                                        {
                                            bool flag28 = (long)current4.cid == (long)((ulong)SelfRole._inst.m_LockRole.m_unCID);
                                            if (flag28)
                                            {
                                                flag24 = true;
                                                break;
                                            }
                                        }
                                    }
                                    bool flag29 = flag24;
                                    if (flag29)
                                    {
                                        SelfRole._inst.m_LockRole = null;
                                    }
                                }
                            }
                        }
                    }
                }
            }
            bool flag30 = SelfRole._inst.m_LockRole == null;

            if (flag30)
            {
                SelfRole._inst.m_LockRole = PkmodelAdmin.RefreshLockRole();
            }
            bool flag31 = SelfRole._inst.m_LockRole == null;

            if (flag31)
            {
                SelfRole._inst.m_LockRole = MonsterMgr._inst.FindNearestMonster(SelfRole._inst.m_curModel.position, null, false, PK_TYPE.PK_PEACE, false);
            }
            bool flag32 = SelfRole._inst.m_LockRole == null;

            if (flag32)
            {
                SelfRole._inst.m_LockRole = MonsterMgr._inst.FindNearestFakeMonster(SelfRole._inst.m_curModel.position);
            }
        }