| | |
| | | return
|
| | |
|
| | | #===============================================================================
|
| | | # //B4 14 根据类型来决定移动的方式 #tagMCMoveByType
|
| | | # |
| | | # struct tagMCMoveByType
|
| | | # {
|
| | | # tagHead Head;
|
| | | # DWORD ID; //玩家ID
|
| | | # WORD PosX; // 目标X
|
| | | # WORD PosY; // 目标Y
|
| | | # BYTE MoveType; //移动方式
|
| | | # };
|
| | | #===============================================================================
|
| | | def OnMoveByType(index, clientData, tick):
|
| | | curPlayer = GameWorld.GetPlayerManager().GetPlayerByIndex(index)
|
| | | |
| | | #玩家移动通用检查
|
| | | if not __CheckPlayerCanMove(curPlayer):
|
| | | return
|
| | | |
| | | #先验证目标点是否合法
|
| | | if not GameWorld.GetMap().CanMove(clientData.PosX, clientData.PosY):
|
| | | return
|
| | | |
| | | curPlayer.StopMove()
|
| | | curPlayer.ChangePos(clientData.PosX, clientData.PosY)
|
| | | sendPack = ChPyNetSendPack.tagMCMoveByType()
|
| | | sendPack.Clear()
|
| | | sendPack.ID = curPlayer.GetID()
|
| | | sendPack.ObjType = curPlayer.GetGameObjType()
|
| | | sendPack.PosX = clientData.PosX
|
| | | sendPack.PosY = clientData.PosY
|
| | | sendPack.MoveType = clientData.MoveType
|
| | | |
| | | PlayerControl.PyNotifyAll(curPlayer, sendPack, False, -1)
|
| | | return
|
| | |
|
| | | #===============================================================================
|
| | | # //B4 04 战前冲锋 #tagCMRush
|
| | | #
|
| | | # struct tagCMRush
|
| | |
| | | if GameWorld.GetDist(curPlayer.GetPosX(), curPlayer.GetPosY(), clientData.PosX, clientData.PosY) > curPlayer.GetSight():
|
| | | return
|
| | |
|
| | | #玩家移动通用检查
|
| | | if not __CheckPlayerCanMove(curPlayer):
|
| | | return
|
| | | |
| | | #先验证目标点是否合法
|
| | | if not GameWorld.GetMap().CanMove(clientData.PosX, clientData.PosY):
|
| | | return
|
| | | |
| | | curPlayer.StopMove()
|
| | | #GameWorld.DebugLog("战前冲锋 %s %s"%([curPlayer.GetPosX(), curPlayer.GetPosY()], [clientData.PosX, clientData.PosY]))
|
| | | curPlayer.ChangePos(clientData.PosX, clientData.PosY)
|