| | |
| | | _pullPosition = _hit.position;
|
| | | }
|
| | |
|
| | | // 只认主角导致的推逻辑. 如果是其他人的退不认
|
| | | if (target is GActorNpcFight)
|
| | | {
|
| | | if (attacker is GA_Player)
|
| | | {
|
| | | return;
|
| | | }
|
| | | }
|
| | |
|
| | | if (GActor.TryGetValidPos(_pullPosition, ref _checkPos))
|
| | | {
|
| | | if (target.ActorType == GameObjType.gotPlayer)
|
| | | {
|
| | | GActorPlayerBase _player = target as GActorPlayerBase;
|
| | | //Debug.Log("--------------------------- 8");
|
| | | if (_player.MovingState != E_MovingState.Ride)
|
| | | if (target is GA_Hero)
|
| | | {
|
| | | // Debug.LogFormat("{0} attack {1} ==================== 9", attacker.GetType().ToString(), target.GetType().ToString());
|
| | | CB402_tagCMNPCBeatBack _beatBack = new CB402_tagCMNPCBeatBack();
|
| | | _beatBack.ObjType = (byte)GameObjType.gotPlayer;
|
| | | _beatBack.Count = 1;
|
| | | _beatBack.NPCPosList = new CB402_tagCMNPCBeatBack.tagCMNPCPos[1];
|
| | | _beatBack.NPCPosList[0] = new CB402_tagCMNPCBeatBack.tagCMNPCPos();
|
| | | _beatBack.NPCPosList[0].ObjID = (uint)target.ServerInstID;
|
| | | _beatBack.NPCPosList[0].PosX = (ushort)(_checkPos.x * 2f + GA_Hero.MapOffset.x);
|
| | | _beatBack.NPCPosList[0].PosY = (ushort)(_checkPos.z * 2f + GA_Hero.MapOffset.x);
|
| | | GameNetSystem.Instance.SendInfo(_beatBack);
|
| | | GActorPlayerBase _player = target as GActorPlayerBase;
|
| | | //Debug.Log("--------------------------- 8");
|
| | | if (_player.MovingState != E_MovingState.Ride)
|
| | | {
|
| | | // Debug.LogFormat("{0} attack {1} ==================== 9", attacker.GetType().ToString(), target.GetType().ToString());
|
| | | CB402_tagCMNPCBeatBack _beatBack = new CB402_tagCMNPCBeatBack();
|
| | | _beatBack.ObjType = (byte)GameObjType.gotPlayer;
|
| | | _beatBack.Count = 1;
|
| | | _beatBack.NPCPosList = new CB402_tagCMNPCBeatBack.tagCMNPCPos[1];
|
| | | _beatBack.NPCPosList[0] = new CB402_tagCMNPCBeatBack.tagCMNPCPos();
|
| | | _beatBack.NPCPosList[0].ObjID = (uint)target.ServerInstID;
|
| | | _beatBack.NPCPosList[0].PosX = (ushort)(_checkPos.x * 2f + GA_Hero.MapOffset.x);
|
| | | _beatBack.NPCPosList[0].PosY = (ushort)(_checkPos.z * 2f + GA_Hero.MapOffset.z);
|
| | | GameNetSystem.Instance.SendInfo(_beatBack);
|
| | | }
|
| | | }
|
| | | //else
|
| | | //{
|
| | |
| | | NPCPos _npcPos = new NPCPos
|
| | | {
|
| | | objId = (int)target.ServerInstID,
|
| | | posX = (int)(_checkPos.x * 2f),
|
| | | posY = (int)(_checkPos.z * 2f)
|
| | | posX = (int)(_checkPos.x * 2f + GA_Hero.MapOffset.x),
|
| | | posY = (int)(_checkPos.z * 2f + GA_Hero.MapOffset.z)
|
| | | };
|
| | | npcPosList.Add(_npcPos);
|
| | | }
|