| | |
| | | || _hero.SkillMgr.CurCastSkill.SkillCompelete))
|
| | | {
|
| | | _hero.Run();
|
| | |
|
| | | _hero.State = E_ActorState.CtrlRun;
|
| | | }
|
| | | }
|
| | | }
|
| | |
| | | //Send_TagCPlayerStopMove(_hero.Position);
|
| | | }
|
| | |
|
| | | private static byte s_LastStatus = 0;
|
| | | //private static byte s_LastStatus = 0;
|
| | |
|
| | | public static void Send_CB409_tagCMPyMove(byte moveOrStop = 1)
|
| | | {
|
| | |
| | |
|
| | | float _distSqrt = MathUtility.DistanceSqrtXZ(_targetPos, _heroPos);
|
| | |
|
| | | if (_distSqrt > Mathf.Pow(reFindSelectTargetDist, 2))
|
| | | var _chkDis = reFindSelectTargetDist;
|
| | |
|
| | | if (_hero.SelectTarget is GA_NpcCollect && PlayerDatas.Instance.baseData.MapID == 31340)
|
| | | {
|
| | | _chkDis = reFindSelectTargetDist * 2;
|
| | | }
|
| | |
|
| | | if (_distSqrt > Mathf.Pow(reFindSelectTargetDist, _chkDis))
|
| | | {
|
| | | _hero.SelectTarget = GAMgr.Instance.FindAtkTarget(_hero.Pos, reSetLockTargetDist);
|
| | | }
|
| | |
| | | {
|
| | | return;
|
| | | }
|
| | |
|
| | | IOtherSelectable _selectable = base.SelectTarget as IOtherSelectable;
|
| | | if (_selectable != null)
|
| | | {
|
| | |
| | | StopRush();
|
| | | }
|
| | | }
|
| | |
|
| | | if (PlayerDatas.Instance.baseData.MapID == 31340)
|
| | | {
|
| | | if (State == E_ActorState.AutoRun
|
| | | || State == E_ActorState.CtrlRun)
|
| | | {
|
| | | var _list = GAMgr.Instance.GetTypeList(E_ActorClassType.NpcCollect);
|
| | |
|
| | | if (_list != null && _list.Count > 0)
|
| | | {
|
| | | _list.Sort((a1, a2) =>
|
| | | {
|
| | | float _d1 = MathUtility.DistanceSqrtXZ(a1.Pos, Pos);
|
| | | float _d2 = MathUtility.DistanceSqrtXZ(a2.Pos, Pos);
|
| | | return _d2 > _d1 ? -1 : 1;
|
| | | });
|
| | |
|
| | | var _collect = _list[0] as GA_NpcCollect;
|
| | | if (_collect != null)
|
| | | {
|
| | | if ((SelectTarget == null || SelectTarget is GA_NpcCollect) && SelectTarget != _collect)
|
| | | {
|
| | | SelectTarget = _collect;
|
| | | _collect.Arrive();
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | protected sealed override void OnLateUpdate()
|
| | |
| | | if (obj is MainInterfaceWin)
|
| | | {
|
| | | m_IsMainWinOpen = true;
|
| | |
|
| | | if (NpcConfig.NPCID != GeneralDefine.GatherSoulDZ)
|
| | | {
|
| | | GA_Hero _hero = PlayerDatas.Instance.hero;
|
| | |
|
| | | if (_hero != null)
|
| | |
| | | if (_distSqrt < Mathf.Pow(NpcConfig.ModelRadius + 0.4f + GeneralDefine.CloseNpcDist, 2))
|
| | | {
|
| | | Arrive();
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | |
| | | return;
|
| | | }
|
| | |
|
| | | if (NpcConfig.NPCID != GeneralDefine.GatherSoulDZ)
|
| | | {
|
| | | GA_Hero _hero = PlayerDatas.Instance.hero;
|
| | |
|
| | | if (_hero != null)
|
| | |
| | | OnLeave(ServerInstID, NpcConfig.NPCID);
|
| | | }
|
| | | m_ArrivedList.Remove(ServerInstID);
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | protected override void HandleOnClick()
|
| | | {
|
| | | if (NpcConfig.NPCID != GeneralDefine.GatherSoulDZ)
|
| | | {
|
| | | base.HandleOnClick();
|
| | | }
|
| | | else
|
| | | {
|
| | | var _hero = PlayerDatas.Instance.hero;
|
| | |
|
| | | if (_hero != null)
|
| | | {
|
| | | float _distSqrt = MathUtility.DistanceSqrtXZ(_hero.Pos, Pos);
|
| | |
|
| | | if (_distSqrt < Mathf.Pow(NpcConfig.ModelRadius + 0.4f + GeneralDefine.CloseNpcDist, 2))
|
| | | {
|
| | | Arrive();
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | protected override void OnUnit()
|
| | | {
|
| | | if (m_ReplaceNpcID != -1)
|
| | |
| | | public override void OnClick()
|
| | | {
|
| | | GA_Hero _hero = PlayerDatas.Instance.hero;
|
| | | _hero.LockTarget = this;
|
| | | _hero.SelectTarget = this;
|
| | |
|
| | | // 这里判断是否要走向此对象
|
| | | float _distSqrt = MathUtility.DistanceSqrtXZ(_hero.Pos, Pos);
|
| | |
|
| | | if (PlayerDatas.Instance.baseData.MapID != 31340)
|
| | | {
|
| | | _hero.LockTarget = this;
|
| | | _hero.SelectTarget = this;
|
| | | }
|
| | | else
|
| | | {
|
| | | if (_distSqrt < Mathf.Pow(GeneralDefine.CloseNpcDist + NpcConfig.ModelRadius + 0.4f, 2))
|
| | | {
|
| | | _hero.LockTarget = this;
|
| | | _hero.SelectTarget = this;
|
| | | }
|
| | | }
|
| | |
|
| | | if (_distSqrt > Mathf.Pow(GeneralDefine.CloseNpcDist + NpcConfig.ModelRadius + 0.4f, 2))
|
| | | {
|
| | | MapTransferUtility.Instance.MoveToNPC(NpcConfig.NPCID, (int)ServerInstID);
|
| | |
| | | Vector3 _forward = MathUtility.ForwardXZ(_hero.Pos, Pos);
|
| | | Forward = _forward;
|
| | | }
|
| | | if (NpcConfig.NPCID != GeneralDefine.GatherSoulDZ)
|
| | |
|
| | | HandleOnClick();
|
| | | }
|
| | | }
|
| | |
|
| | | protected virtual void HandleOnClick()
|
| | | {
|
| | | NPCInteractProcessor.InvokeEvent(E_NpcType.Func, NpcConfig.NPCID, ServerInstID);
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | protected override void OnLateUpdate() { }
|