Exemple #1
0
    void Update()
    {
        if (m_unListRoleHitted != null)
        {
            print("攻击到的人的个数:" + m_unListRoleHitted.Count);
            PkmodelAdmin.RefreshList(m_unListRoleHitted, HittedisProfession);/*, HittedisProfessionByRedname*/
            if (m_unListRoleHitted != null)
            {
                int lockId = -1;
                if (SelfRole._inst.m_LockRole != null && m_unListRoleHitted.Contains(SelfRole._inst.m_LockRole.m_unIID))
                {
                    lockId = (int)SelfRole._inst.m_LockRole.m_unIID;
                }
                //if(m_unListRoleHitted.Count<=0)
                //{
                //    print("空的");
                //}
                //else
                //{
                //    for (int i = 0; i < m_unListRoleHitted.Count; i++)
                //    {
                //        print("发送的iid是多少:" + m_unListRoleHitted[i]);
                //    }
                //}

                BattleProxy.getInstance().sendcast_target_skill(m_unSkillID, m_unListRoleHitted, m_nLastHit, lockId);
                m_unListRoleHitted = null;
                HittedisProfession = null;
                //HittedisProfessionByRedname = null;
            }
        }
    }
    //bool值判断一下攻击的人是不是我,
    public void TurnToRole(BaseRole r, bool ismyself)
    {
        if (ismyself)
        {
            if (PkmodelAdmin.RefreshLockRoleTransform(r) == null)
            {
                return;
            }
            else
            if (r == null)
            {
                return;
            }
        }


        if (r.m_curModel != null)
        {
            Vector3 pos = r.m_curModel.position;
            TurnToPos(pos);
        }
    }
Exemple #3
0
    public void TurnToRole(BaseRole r, bool ismyself)
    {
        if (ismyself)
        {
            bool flag = PkmodelAdmin.RefreshLockRoleTransform(r) == null;
            if (flag)
            {
                return;
            }
            bool flag2 = r == null;
            if (flag2)
            {
                return;
            }
        }
        bool flag3 = r.m_curModel != null;

        if (flag3)
        {
            Vector3 position = r.m_curModel.position;
            this.TurnToPos(position);
        }
    }
Exemple #4
0
    private void Update()
    {
        bool flag = this.m_unListRoleHitted != null;

        if (flag)
        {
            PkmodelAdmin.RefreshList(this.m_unListRoleHitted, this.HittedisProfession);
            bool flag2 = this.m_unListRoleHitted != null;
            if (flag2)
            {
                int  lockid = -1;
                bool flag3  = SelfRole._inst.m_LockRole != null && this.m_unListRoleHitted.Contains(SelfRole._inst.m_LockRole.m_unIID);
                if (flag3)
                {
                    lockid = (int)SelfRole._inst.m_LockRole.m_unIID;
                }
                BaseProxy <BattleProxy> .getInstance().sendcast_target_skill(this.m_unSkillID, this.m_unListRoleHitted, this.m_nLastHit, lockid);

                this.m_unListRoleHitted = null;
                this.HittedisProfession = null;
            }
        }
    }
Exemple #5
0
    public override void refreshViewData(Variant v)
    {
        bool flag = !this.m_isMain && this.m_moveAgent != null && this.m_moveAgent.enabled;

        if (flag)
        {
            this.m_moveAgent.avoidancePriority = 48;
        }
        this.detailInfo = v;
        int  num   = v["carr"];
        bool flag2 = v.ContainsKey("activate_count");

        if (flag2)
        {
            this.m_roleDta.add_eff = false;
            bool flag3 = v["activate_count"] >= 10;
            if (flag3)
            {
                this.m_roleDta.add_eff = true;
            }
        }
        bool flag4 = v.ContainsKey("show_eqp");

        if (flag4)
        {
            this.m_roleDta.m_BodyID       = 0;
            this.m_roleDta.m_BodyFXID     = 0;
            this.m_roleDta.m_EquipColorID = 0u;
            this.m_roleDta.m_Weapon_LID   = 0;
            this.m_roleDta.m_Weapon_LFXID = 0;
            this.m_roleDta.m_Weapon_RID   = 0;
            this.m_roleDta.m_Weapon_RFXID = 0;
            foreach (Variant current in v["show_eqp"]._arr)
            {
                a3_ItemData itemDataById = ModelBase <a3_BagModel> .getInstance().getItemDataById(current["tpid"]);

                bool flag5 = itemDataById.equip_type == 3;
                if (flag5)
                {
                    int tpid     = (int)itemDataById.tpid;
                    int bodyFXID = current["stage"];
                    this.m_roleDta.m_BodyID   = tpid;
                    this.m_roleDta.m_BodyFXID = bodyFXID;
                    uint equipColorID = 0u;
                    bool flag6        = current.ContainsKey("colour");
                    if (flag6)
                    {
                        equipColorID = current["colour"];
                    }
                    this.m_roleDta.m_EquipColorID = equipColorID;
                }
                bool flag7 = itemDataById.equip_type == 6;
                if (flag7)
                {
                    int tpid2 = (int)itemDataById.tpid;
                    int num2  = current["stage"];
                    switch (num)
                    {
                    case 2:
                        this.m_roleDta.m_Weapon_RID   = tpid2;
                        this.m_roleDta.m_Weapon_RFXID = num2;
                        break;

                    case 3:
                        this.m_roleDta.m_Weapon_LID   = tpid2;
                        this.m_roleDta.m_Weapon_LFXID = num2;
                        break;

                    case 5:
                        this.m_roleDta.m_Weapon_LID   = tpid2;
                        this.m_roleDta.m_Weapon_LFXID = num2;
                        this.m_roleDta.m_Weapon_RID   = tpid2;
                        this.m_roleDta.m_Weapon_RFXID = num2;
                        break;
                    }
                }
            }
        }
        bool flag8 = v.ContainsKey("wing");

        if (flag8)
        {
            this.m_roleDta.m_WindID = v["wing"]["show_stage"];
        }
        bool flag9 = v.ContainsKey("ach_title");

        if (flag9)
        {
            base.title_id = v["ach_title"];
            base.isactive = v["title_display"]._bool;
            PlayerNameUIMgr.getInstance().refreshTitlelv(this, base.title_id);
        }
        bool flag10 = v.ContainsKey("serial_kp");

        if (flag10)
        {
            PlayerNameUIMgr.getInstance().refreserialCount(this, v["serial_kp"]);
        }
        bool flag11 = v.ContainsKey("rednm");

        if (flag11)
        {
            base.rednm = v["rednm"];
            PlayerNameUIMgr.getInstance().refreshNameColor(this, base.rednm);
            bool flag12 = SelfRole._inst != null && SelfRole._inst.m_LockRole != null && SelfRole._inst.m_LockRole.m_unIID == v["iid"];
            if (flag12)
            {
                PkmodelAdmin.RefreshShow(SelfRole._inst.m_LockRole, false, true);
            }
        }
        bool flag13 = v.ContainsKey("strike_back_tm");

        if (flag13)
        {
            base.hidbacktime = v["strike_back_tm"];
            PlayerNameUIMgr.getInstance().refresHitback(this, (int)(base.hidbacktime - (uint)NetClient.instance.CurServerTimeStamp), false);
        }
        bool flag14 = v.ContainsKey("lvl");

        if (flag14)
        {
            this.lvl = v["lvl"];
        }
        bool flag15 = v.ContainsKey("combpt");

        if (flag15)
        {
            this.combpt = v["combpt"];
        }
        bool flag16 = v.ContainsKey("clname");

        if (flag16)
        {
            this.clanName = v["clname"];
        }
        ArrayList arrayList = new ArrayList();

        arrayList.Add(this.m_unCID);
        arrayList.Add(this.combpt);
        bool flag17 = BaseProxy <FriendProxy> .getInstance() != null;

        if (flag17)
        {
            BaseProxy <FriendProxy> .getInstance().reFreshProfessionInfo(arrayList);
        }
        bool flag18 = OtherPlayerMgr._inst.VIEW_PLAYER_TYPE == 1 || this.m_isMain;

        if (flag18)
        {
            base.refreshViewType(BaseRole.VIEW_TYPE_ALL);
        }
    }
    static public void FrameMove(float delta_time)
    {
        //切地图时加个保护
        if (GRMap.instance != null && GRMap.grmap_loading == true)
        {
            return;
        }

        //需要不停的发位置变化的消息给服务器
        if (_inst != null)
        {
            bool haveTarget = false;
            try { haveTarget = _inst.m_LockRole?.m_curModel ?? false; } catch (Exception e) { _inst.m_LockRole = null; haveTarget = false; }
            if (haveTarget)
            {
                if (s_LockFX != null && _inst.m_LockRole.m_circle_type == -1)
                {                                                             //通用类型光圈
                    PkmodelAdmin.RefreshShow(_inst.m_LockRole);
                    s_LockFX.position = _inst.m_LockRole.m_curModel.position; //m_curPhy
                    if (_inst.m_LockRole.isDead)
                    {
                        s_LockFX.position = Vector3.zero;
                    }
                }
                if (s_LockFX_boss != null && _inst.m_LockRole.m_circle_type == 1)
                {//boss类型光圈
                    s_LockFX_boss.position = _inst.m_LockRole.m_curPhy.position;
                    if (_inst.m_LockRole.isDead)
                    {
                        s_LockFX_boss.position = Vector3.zero;
                    }
                    float scale_value = _inst.m_LockRole.m_circle_scale;
                    s_LockFX_boss.localScale = new Vector3(scale_value, scale_value, scale_value);
                }
            }
            else
            {
                if (s_LockFX != null)
                {
                    s_LockFX.position = Vector3.zero;
                }
                if (s_LockFX_boss != null)
                {
                    s_LockFX_boss.position = Vector3.zero;
                }
            }

            _inst.FrameMove(delta_time);
            MoveProxy.getInstance().TrySyncPos(delta_time);
            try
            {
                long    tm  = muNetCleint.instance.g_netM.CurServerTimeStampMS;
                Vector3 pos = _inst.m_curModel.position;


                //Vector3 vec3 = new Vector3(x, pGameobject.transform.position.y, y);
                //LGCamera.instance.updateMainPlayerPos();
                //  MoveProxy.getInstance().sendstop((uint)x, (uint)y, 1, tm, false);

                if (_inst.moving)
                {
                    float angle = Mathf.Atan2(a1_gamejoy.inst_joystick.MovePosiNorm.z, a1_gamejoy.inst_joystick.MovePosiNorm.x) * Mathf.Rad2Deg;
                    angle = SceneCamera.m_curCamGo.transform.eulerAngles.y - angle;
                    pos   = Quaternion.Euler(0, angle, 0) * new Vector3(1f, 0f, 0f) + pos;

                    NavMeshHit hit;
                    NavMesh.SamplePosition(pos, out hit, 3f, NavmeshUtils.allARE);
                    pos = hit.position;
                }

                float x = (float)(pos.x) * GameConstant.PIXEL_TRANS_UNITYPOS;
                float y = (float)(pos.z) * GameConstant.PIXEL_TRANS_UNITYPOS;
                MoveProxy.getInstance().sendstop((uint)x, (uint)y, 1, tm, false);
            }
            catch (System.Exception ex)
            {
                debug.Log(ex.ToString());
            }

            fsm.Update(delta_time);

            if (_inst.m_LockRole != null)
            {//添加怪物离开锁定范围的判定
                try
                {
                    Vector3 off_pos = _inst.m_LockRole.m_curPhy.position - _inst.m_curModel.position;
                    float   off_dis = off_pos.magnitude;
                    if (off_dis > _inst.m_LockDis)
                    {
                        _inst.m_LockRole = null;
                    }
                }
                catch (Exception) { _inst.m_LockRole = null; }
            }
        }
    }