local ChangeAvatarSystem = require "Battle/Logic/Entity/System/ChangeAvatarSystem" local EventSystem = require 'Event/EventSystem' -- 战斗外部可以用,战斗视图设置器 -- 给非Battle文件夹内的代码提供控制战斗的接口 -- 只允许在非同步场景内使用,否则可能导致战斗不一致 local NotSyncBattleSetter = {} local ZeroV1 = FP.newV1(0) --跨场景寻路传送点 local _targetConveyList = {} local _targetNode = nil local _tempTargetData = nil --根据位置寻路的目标位置,避免重复创建 local _targetCallback = nil local _radiusV1 = FP.newV1(1) local EFindPathType = { BY_POS = 1, BY_LEVELITEM = 2, BY_NPCID_AND_RIDE = 3, } local AccessWatcher = { __index = function(t,k) if LevelManager.ShouldKeepSyncLevel() and not LevelManager.IsMonsterTest() then logging.error(LTAG.ERROR, "HYW : (程序临时调试日志,可忽略)尝试在同步关卡/需要校验的单机关卡访问NotSyncBattleSetter,禁止这样做,需要修改!! LevelType : ", LevelManager.GetCurLevelType()) end return t[1][k]; end } --ugly 因为有引导假副本的需求,服务器又不走常规流程, 所以这里只能让客户端写这样的代码了 function NotSyncBattleSetter.OnWorldBossSeekHelp() LevelManager.CurLevelFunc:OnWorldBossSeekHelp() end --↑↑↑↑↑↑↑ --for debug deleteme now↓ 这里纯为了米欧展示做的,展示完毕需要删掉 function NotSyncBattleSetter.SetHitFlyDistance(aliveHitFlyDist, deadHitFlyDist, randomDist) LogicUpdateManager.CheatAliveHitFlyDistance = aliveHitFlyDist LogicUpdateManager.CheatDeadHitFlyDistance = deadHitFlyDist LogicUpdateManager.CheatRandomDistance = randomDist end function NotSyncBattleSetter.SwitchHitFlyCountRecordState() LogicUpdateManager.isRecordHitFlyCount = not LogicUpdateManager.isRecordHitFlyCount if LogicUpdateManager.isRecordHitFlyCount then if LogicUpdateManager.CheatAliveHitFlyDistance == nil then LogicUpdateManager.CheatAliveHitFlyDistance = 1 LogicUpdateManager.CheatDeadHitFlyDistance = 1 LogicUpdateManager.CheatRandomDistance = 0 end LogicUpdateManager.aliveHitFlyCount = 0 LogicUpdateManager.deadHitFlyCount = 0 LogicUpdateManager.hitFlyRecordStartFrame = LogicUpdateManager._clientHandleFrame logging.error(LTAG.ERROR, "HYW : 开始记录")--for debug deleteme now else logging.error(LTAG.ERROR, "HYW : 停止记录,一共持续", (LogicUpdateManager._clientHandleFrame - LogicUpdateManager.hitFlyRecordStartFrame) / 20, "秒。 活人击飞", LogicUpdateManager.aliveHitFlyCount, "次; 死人击飞", LogicUpdateManager.deadHitFlyCount, "次")--for debug deleteme now end end --for debug deleteme now↑ function NotSyncBattleSetter.SetPlayerInfo(accid,name) PlayerInfoManager.SetPlayerInfo(accid,name) end function NotSyncBattleSetter.SetAcid(acid) PlayerInfoManager.SetAcid(acid) logging.crit(LTAG.CRIT, " acid ", acid) end function NotSyncBattleSetter.StopCurLevel(isClickExitBtn) LevelManager.CurLevelFunc:StopLevel(isClickExitBtn) end function NotSyncBattleSetter.HandleEndLevel(isWin, withShow) LevelItemManager.Global:HandleEndLevel(isWin, withShow) end function NotSyncBattleSetter.ChangeAI(aiid) if LogicUpdateManager._curEntity then LogicUpdateManager._curEntity.components.aiBase:ChangeAiByAIID(aiid) end end function NotSyncBattleSetter.SetCanShowVictoryPose(show) LevelManager.CurLevelFunc:SetShowVictoryPoseFlag(show) end function NotSyncBattleSetter.SetTownHeroTable(basicHeroInfo, extraHeroInfo) LevelPlayerManager.SetTownHeroTable(basicHeroInfo, extraHeroInfo) end function NotSyncBattleSetter.SetMainPlayerExpVisible(isVisible) if LogicUpdateManager._curEntity then LogicUpdateManager._curEntity.ExpEntity:SetVisible(isVisible, false) end end function NotSyncBattleSetter.SwitchDummyLevel(scenePath, isPlotReview) LevelManager.SwitchDummyLevel(scenePath, isPlotReview) end function NotSyncBattleSetter.RecoverLevel() LevelManager.RecoverLevel() end --传送门发送一遍Check function NotSyncBattleSetter.ForceC2SRoleCheck() if BattleDataGetter.IsTownLevel() then SyncMoveManager.ForceC2SRoleCheck() end end function NotSyncBattleSetter.SendGetSceneLineRequest() SyncMoveManager.GetSceneLineRequest() end function NotSyncBattleSetter.SendChangeSceneLineRequest(lineNum, mapId) SyncMoveManager.ChangeSceneLineRequest(lineNum, mapId) end function NotSyncBattleSetter.SetCanChangeLine(value) SyncMoveManager.CanChangeLine = value end function NotSyncBattleSetter.AddBuffToMainEntity(buffID) if LogicUpdateManager._curEntity then SystemManager.AddBuff(LogicUpdateManager._curEntity, buffID, LogicUpdateManager._curEntity, nil, nil) end end function NotSyncBattleSetter.AddBuffToEntity(entity, buffID) SystemManager.AddBuff(entity, buffID) end function NotSyncBattleSetter.DeleteBuffOfEntity(entity, buffID) SystemManager.DeleteBuff(entity, buffID) end function NotSyncBattleSetter.TryClearRetinue(entity) if entity.retinueList then for i,retinue in ipairs(entity.retinueList) do if retinue:IsAlive() and retinue:IsActive() then SystemManager.DeadQuit(retinue) end end entity.retinueList = {} end end function NotSyncBattleSetter.RequestAddSeverPlayerBuff(buffInfo) if not LevelManager.IsSyncLevel() then LevelPlayerManager.EnqueuePlayerBuff(buffInfo) else logging.error(LTAG.ERROR, "HYW : 警告!只有单机玩法才能用RequestAddSeverPlayerBuff方法给玩家添加buff!!") end end function NotSyncBattleSetter.PauseAutoFindPathInTown() if LogicUpdateManager._curEntity then LogicUpdateManager._curEntity.components.autoFight.IsAutoFindPath = false end end function NotSyncBattleSetter.ResumeAutoFindPathInTown() if LogicUpdateManager._curEntity then LogicUpdateManager._curEntity.components.autoFight.IsAutoFindPath = true end end function NotSyncBattleSetter.StartAutoFindPathInTown() if LogicUpdateManager._curEntity then SystemManager.StartAutoFindPathInTown(LogicUpdateManager._curEntity) end end function NotSyncBattleSetter.SetGuideLevelState(state) LevelManager.InGuideLevel = state end function NotSyncBattleSetter.StartFollowTeamLeader() NotSyncBattleSetter.ChangeAI(LuaConst.TeamFollowAIID) NotSyncBattleSetter.StartAutoFindPathInTown() end function NotSyncBattleSetter.DisableFollowIndexCacheByAcid(acid) SyncMoveManager.DisableFollowIndexCacheByAcid(acid) end function NotSyncBattleSetter.StopAutoFightPathInTown(townFindPathType) if LogicUpdateManager._curEntity then SystemManager.StopAutoFightPathInTown(LogicUpdateManager._curEntity, townFindPathType) logging.log(LTAG.LOG," StopAutoFightPathInTown ", townFindPathType ) end end function NotSyncBattleSetter.SwitchPveAutoFightState() if LogicUpdateManager._curEntity then SystemManager.SwitchAutoFight(LogicUpdateManager._curEntity) end end function NotSyncBattleSetter.SetPveAutoFightState(isEnable) if LogicUpdateManager._curEntity then if isEnable then SystemManager.StartAutoFight(LogicUpdateManager._curEntity) else SystemManager.StopAutoFight(LogicUpdateManager._curEntity) end end end --自动寻路到NPC function NotSyncBattleSetter.FindPathByNPCIDAndRide(npcId) NotSyncBattleSetter._lastFindPathType = EFindPathType.BY_NPCID_AND_RIDE NotSyncBattleSetter.SetIsChangeSceneFinding(false) local npcData = DataSheetManager.NpcData:GetDataByID(npcId) local mapId = npcData.MapID local item = LevelItemManager.GetLevelItemByNpcID(mapId, npcId) local levelItemID = item.LevelItemID local function callback() local entity = BattleDataGetter.GetEntityByLevelItemID(levelItemID) if entity then EventSystem.Dispatch(entity.Event_EntityVisited, entity, nil) --else --有的时候会找不到NPC,但是不影响功能,切场景的时候极其偶发出现,目前出现原因不明,暂时去掉报错 --logging.error(LTAG.ERROR, "HYW : 找不到单位 , levelItemID :", levelItemID) end end NotSyncBattleSetter.FindPathByLevelItemIDAndRide(mapId, levelItemID, callback) end local function ChangeSceneFindTarget(conveList, targetNode, callback) NotSyncBattleSetter.SetIsChangeSceneFinding(#conveList > 0) local nextNode = table.remove(conveList, #conveList) local radius = ZeroV1 local node = nextNode or targetNode local position = node.ItemPos if node.LevelItemType == LuaConst.LevelItemType.Npc then radius = LuaConst.NpcAutoFindDistance local npcItem = LevelItemManager.GetItemByID(node.LevelItemID) if npcItem then local npcEntity = npcItem:GetNPCEntity() if npcEntity then position = npcEntity.components.move.LogicPos end else --logging.error(LTAG.ERROR, "HYW : 找不到npcItem : ", node.LevelItemID) --正常情况,如果是跨场景寻找NPC,则就找不到npcItem return end end if LogicUpdateManager._curEntity then if nextNode then SystemManager.AutoFindPathInTown(LogicUpdateManager._curEntity, position, radius, nil) else SystemManager.AutoFindPathInTown(LogicUpdateManager._curEntity, position, radius, callback) end end end local function sortFunc(nodeA, nodeB) return nodeA.level < nodeB.level end local function SearchTargetPath(beginId, targetId, conveyItemList) for i = 1, #_targetConveyList do _targetConveyList[i] = nil end local firstNode = { id = beginId, parent = nil, level = 0, linkList = conveyItemList,--邻近节点 } local openList = { firstNode } local closeSet = {} local nextNode = table.remove(openList, 1) while (nextNode) do if nextNode.id == targetId then --找到目标节点,依次将其parent存到_targetConveyList while (nextNode) do table.insert(_targetConveyList, nextNode.itemData) nextNode = nextNode.parent end break else --将节点从openList中挪至closeSet去 closeSet[nextNode.id] = nextNode.level if nextNode.linkList then for _, item in ipairs(nextNode.linkList) do local itemData = item.ItemData == nil and item or item.ItemData if closeSet[itemData.TargetMapID] == nil then --不在closeSet中 local childNode = { id = itemData.TargetMapID, parent = nextNode, level = nextNode.level + 1, linkList = LevelItemManager.GetConveyData(itemData.TargetMapID), itemData = itemData, } table.insert(openList, childNode) end end --else -- do nothing 存在一些地图,策划会配成没有任何传送点的 end end --对openList排序,将level最小的置顶 table.sort(openList, sortFunc) nextNode = table.remove(openList, 1) end end local _rideHorseTimerHandle = nil --寻路上马 定时器句柄 --寻路上坐骑 local function RideHorseInTown() if _rideHorseTimerHandle then TimerUtil.Remove(_rideHorseTimerHandle) _rideHorseTimerHandle = nil end if not LevelManager.CurLevelCanRideHorse() then return end local fun = function ( ) if MDL.Unlock.IsUnlock(MDL.Unlock.FunctionType.WarHorse) then if LogicUpdateManager._curEntity and LogicUpdateManager._curEntity.components.autoFight.IsAutoFindPath and not LogicUpdateManager._curEntity.components.buff:CheckHasBuffState(LuaConst.SpecialBuffs.InRiding) then if LogicUpdateManager._curEntity.components.buff:CheckHasBuffState(LuaConst.SpecialBuffs.CanRide) then --LuaInputManager.SpecialCommand = LuaConst.SpecialCommandType.Ride LuaInputManager.SetSpecialCommand(LuaConst.SpecialCommandType.Ride) --print("上马命令发出:", LogicUpdateManager._clientHandleFrame) end end end TimerUtil.Remove(_rideHorseTimerHandle) _rideHorseTimerHandle = nil end local ridetime = math.floor( FP.tonumberV1(DataSheetManager.ConstData:GetDataByID("HorseAutoRideTime_Town").FloatValue ) ) _rideHorseTimerHandle = TimerUtil.Interval(fun,ridetime,1) end function NotSyncBattleSetter.IsChangeSceneFinding() return NotSyncBattleSetter.isChangeSceneFinding end function NotSyncBattleSetter.SetIsChangeSceneFinding(value) NotSyncBattleSetter.isChangeSceneFinding = value end function NotSyncBattleSetter.FindPathByPos(levelID,posX,posY,isConvey,callback,townFindPathType, isRide) NotSyncBattleSetter._lastFindPathType = EFindPathType.BY_POS NotSyncBattleSetter.SetIsChangeSceneFinding(false) local callbackFunc = function() if callback then callback() end NotSyncBattleSetter.StopAutoFightPathInTown(townFindPathType) end if _tempTargetData == nil then _tempTargetData = {} _tempTargetData.ItemPos = FP.newV2(0,0):Rawset(posX,posY) _tempTargetData.LevelItemID = levelID else _tempTargetData.ItemPos:Rawset(posX,posY) _tempTargetData.LevelItemID = levelID end if levelID == LevelManager.GetCurInfoData().LevelID then --同场景直接寻路 if LogicUpdateManager._curEntity then SystemManager.AutoFindPathInTown(LogicUpdateManager._curEntity, _tempTargetData.ItemPos, ZeroV1, callbackFunc) EventSystem.Dispatch(EventID.UI_Auto_Tips, LuaConst.AutoType.AutoFindPath) -- 显隐自动寻路提示 end else _targetNode = _tempTargetData _targetCallback = callbackFunc if isConvey then --直接传送到地图,往目标点寻路过去 NotSyncBattleSetter.SetMainPlayerNextState(LuaConst.StateType.Idle,-1, "idle_loop", nil ,-1) CTL.Level.StartConveyProgress(levelID) else local conveyItemList = LevelItemManager.GetItemListByType(LuaConst.LevelItemType.Convey) --将到达目的地前要经过的传送门存进_targetConveyList中 SearchTargetPath(LevelManager.GetCurInfoData().LevelID, levelID, conveyItemList) --开始寻路 if #_targetConveyList == 1 then --#_targetConveyList == 1 代表是相邻的地图,策划要求相邻的地图通过传送点走着去 ChangeSceneFindTarget(_targetConveyList, _tempTargetData, callbackFunc) --通过传送点移动到目标场景 else --不相邻的地图,通过读条传送过去 -- 通过读条 + 传送 移动到目标场景 NotSyncBattleSetter.SetMainPlayerNextState(LuaConst.StateType.Idle,-1, "idle_loop", nil ,-1) CTL.Level.StartConveyProgress(levelID) end --new↑ end end if isRide then RideHorseInTown() end --new ↑↑↑↑↑↑↑↑↑↑ end function NotSyncBattleSetter.ChangeSceneFindPath() if _targetNode then if not NotSyncBattleSetter.TryLastFindPathByLevelItem() then ChangeSceneFindTarget(_targetConveyList, _targetNode, _targetCallback) end end end function NotSyncBattleSetter.TryLastFindPathByLevelItem() if NotSyncBattleSetter._lastFindPathType == EFindPathType.BY_LEVELITEM then NotSyncBattleSetter.FindPathByLevelItem( NotSyncBattleSetter._lastFindPathByLevelItem_levelID, NotSyncBattleSetter._lastFindPathByLevelItem_levelItemData, NotSyncBattleSetter._lastFindPathByLevelItem_callback, NotSyncBattleSetter._lastFindPathByLevelItem_townFindPathType, NotSyncBattleSetter._lastFindPathByLevelItem_isRide) return true end end function NotSyncBattleSetter.FindPathByLevelItem(levelID, levelItemData, callback, townFindPathType, isRide) NotSyncBattleSetter._lastFindPathType = EFindPathType.BY_LEVELITEM NotSyncBattleSetter._lastFindPathByLevelItem_levelID = levelID NotSyncBattleSetter._lastFindPathByLevelItem_levelItemData = levelItemData NotSyncBattleSetter._lastFindPathByLevelItem_callback = callback NotSyncBattleSetter._lastFindPathByLevelItem_townFindPathType = townFindPathType NotSyncBattleSetter._lastFindPathByLevelItem_isRide = isRide if not LevelManager.GetCurInfoData() then return end NotSyncBattleSetter.SetIsChangeSceneFinding(false) if LevelManager.GetCurInfoData() == nil then --正常情况 return end local callbackFunc = function() if callback then callback() end NotSyncBattleSetter.StopAutoFightPathInTown(townFindPathType) end if levelItemData == nil then if levelID == LevelManager.GetCurInfoData().LevelID then callbackFunc() else _targetNode = levelItemData _targetCallback = callbackFunc --不同场景先找传送门 local conveyItemList = LevelItemManager.GetItemListByType(LuaConst.LevelItemType.Convey) --将到达目的地前要经过的传送门存进_targetConveyList中 SearchTargetPath(LevelManager.GetCurInfoData().LevelID, levelID, conveyItemList) --开始寻路 if #_targetConveyList == 1 then --#_targetConveyList == 1 代表是相邻的地图,策划要求相邻的地图通过传送点走着去 ChangeSceneFindTarget(_targetConveyList, levelItemData, callbackFunc) -- 通过传送点移动到目标场景 else --不相邻的地图,通过读条传送过去 -- 通过读条 + 传送 移动到目标场景 NotSyncBattleSetter.SetMainPlayerNextState(LuaConst.StateType.Idle,-1, "idle_loop", nil ,-1) CTL.Level.StartConveyProgress(levelID) end end else if levelID == LevelManager.GetCurInfoData().LevelID then if LogicUpdateManager._curEntity then local radius = ZeroV1 local position = levelItemData.ItemPos if levelItemData.LevelItemType == LuaConst.LevelItemType.Npc then radius = LuaConst.NpcAutoFindDistance local npcItem = LevelItemManager.GetItemByID(levelItemData.LevelItemID) local npcEntity = npcItem:GetNPCEntity() if npcEntity then position = npcEntity.components.move.LogicPos end elseif levelItemData.LevelItemType == LuaConst.LevelItemType.SpawnNpcPoint then --半径随机 local offset = UnityEngine.Random.Range(0, LuaConst.RebelStrike_MaxArriveDistance) _radiusV1:Reset(offset) radius = _radiusV1 position = levelItemData.BornPos elseif levelItemData.LevelItemType == LuaConst.LevelItemType.Collection then radius = LuaConst.CollectionAutoFindDistance local item = LevelItemManager.GetItemByID(levelItemData.LevelItemID) position = item:GetFindPathCollectItemPos() end --同场景直接寻路 SystemManager.AutoFindPathInTown(LogicUpdateManager._curEntity, position, radius, callbackFunc, townFindPathType) end else _targetNode = levelItemData _targetCallback = callbackFunc --不同场景先找传送门 local conveyItemList = LevelItemManager.GetItemListByType(LuaConst.LevelItemType.Convey) --将到达目的地前要经过的传送门存进_targetConveyList中 SearchTargetPath(LevelManager.GetCurInfoData().LevelID, levelID, conveyItemList) --开始寻路 if #_targetConveyList == 1 then --#_targetConveyList == 1 代表是相邻的地图,策划要求相邻的地图通过传送点走着去 ChangeSceneFindTarget(_targetConveyList, levelItemData, callbackFunc) -- 通过传送点移动到目标场景 else --不相邻的地图,通过读条传送过去 -- 通过读条 + 传送 移动到目标场景 NotSyncBattleSetter.SetMainPlayerNextState(LuaConst.StateType.Idle,-1, "idle_loop", nil ,-1) CTL.Level.StartConveyProgress(levelID) end end end if isRide then RideHorseInTown() end end function NotSyncBattleSetter.FindPathByLevelItemIDAndRide(levelID, levelItemID, callback, townFindPathType) if LevelManager.GetCurInfoData() == nil then return end if MDL.Team.IsFollowing() then CTL.Tips.AddTipsMsg(Const_IDS["IDS_Team_FollowCanNotDoThis"]) return end --SystemManager.FindPathByLevelItemIDAndRide(mapId,mapItemId,callback) --old --new↓ local levelItem = LevelItemManager.GetLevelItem(levelID, levelItemID) NotSyncBattleSetter.FindPathByLevelItem(levelID, levelItem, callback, townFindPathType) RideHorseInTown() end function NotSyncBattleSetter.OnStopAutoFindPath(townFindPathType) if _targetNode then _targetNode = nil _targetCallback = nil end --停止任务寻路 CTL.Task.OnStopAutoTask(townFindPathType) CTL.TeamDungeon.OnStopFindPath(townFindPathType) CTL.ChannelChat.OnStopFindPath(townFindPathType) CTL.GuildEscort.OnStopFindPath(townFindPathType) CTL.OfficialPosition.OnStopFindPath(townFindPathType) CTL.Nobility.OnStopFindPath(townFindPathType) -- 停止进爵寻路 EventSystem.Dispatch(EventID.UI_Auto_Tips, LuaConst.AutoType.AutoFindPath) -- 显隐自动寻路提示 end function NotSyncBattleSetter.SetMainPlayerMoveInTown(pos,dir) if LogicUpdateManager._curEntity then if pos then LogicUpdateManager._curEntity:SetLogicPos(pos) end if dir then LogicUpdateManager._curEntity:SetLogicRotateDir(dir) end end end function NotSyncBattleSetter.SetMainPlayerNextState(stateType , skillID , animName , command , commonCircle) if LogicUpdateManager._curEntity then SystemManager.SetNextState(stateType, LogicUpdateManager._curEntity, skillID, animName, command , commonCircle) end end function NotSyncBattleSetter.SetNextState(stateType, entity, skillID, animName, command, buffId, sourceEntity, hitFlyRate,hitFlyRandom) SystemManager.SetNextState(stateType, entity, skillID, animName, command, buffId, sourceEntity, hitFlyRate,hitFlyRandom) end function NotSyncBattleSetter.MainPlayerPlayEffectByType(effectType) if LogicUpdateManager._curEntity then LogicUpdateManager._curEntity.ExpEntity:PlayEffectByType(effectType) end end function NotSyncBattleSetter.MainPlayerPlayPsEffect(effectPath) if LogicUpdateManager._curEntity then return ExpSystemManager.PlayPsEffect(effectPath, LogicUpdateManager._curEntity) end end function NotSyncBattleSetter.EntityPlayPsEffect(entity,effectPath) if entity then return SystemManager.ShowPSEffect(entity, effectPath) end end function NotSyncBattleSetter.EntityStopPsEffect(entity, effectPath) if entity then return SystemManager.StopPSEffect(entity, effectPath) end end function NotSyncBattleSetter.ChangeCameraTargetPattern() ExpSystemManager.ChangeCameraTargetPattern() end function NotSyncBattleSetter.SwitchTargetCameraAim() ExpSystemManager.SwitchTargetCameraAim() end --获取相机目标:仅在非同步玩法使用 function NotSyncBattleSetter.SetMySkillHighestPriorityTarget(entity, target, isAllEntity) if entity == LogicUpdateManager._curEntity then if isAllEntity then local entityList = BattleDataGetter.GetMyHeroEntityTable() for i,entity in ipairs(entityList) do local targetComp = entity.components.target targetComp:SetSkillHighestPriorityTarget(target) end else local targetComp = entity.components.target targetComp:SetSkillHighestPriorityTarget(target) end end end function NotSyncBattleSetter.OffHorse(entity) --目前只有寻路到目标点后停止用 ;这个地方本身就是用来做不同步的 ,如果想同步 ;必须传入一个entity --LuaInputManager.SpecialCommand = LuaConst.SpecialCommandType.Ride local opEntity = entity if opEntity == nil then opEntity = LogicUpdateManager._curEntity end if opEntity then SystemManager.OffHorse(opEntity) end end --非帧同步的上下马 function NotSyncBattleSetter.RideHorse(entity) SystemManager.ExecuteRideHorse(entity) end function NotSyncBattleSetter.CloseMusouShow() LevelManager.CurLevelFunc:CloseMusouShow() end function NotSyncBattleSetter.CloseMusouShowOfHero(heroId) LevelManager.CurLevelFunc:CloseMusouShowOfHero(heroId) end function NotSyncBattleSetter.OpenMusouShow() LevelManager.CurLevelFunc:OpenMusouShow() end function NotSyncBattleSetter.MainPlayerCreateModelUI(element,collection) if LogicUpdateManager._curEntity then LogicUpdateManager._curEntity._logicInitData.Name = BattleDataGetter.GetPlayerName() if string.isNilOrEmpty(LogicUpdateManager._curEntity._logicInitData.Name) then LogicUpdateManager._curEntity._logicInitData.Name = "" end end end function NotSyncBattleSetter.DeadQuitEntity(entity) SystemManager.DeadQuit(entity) end -- 直接进入dead 注意:npc不要用这个接口 function NotSyncBattleSetter.DeadEntity(entity) SystemManager.OnDead(entity) end -- 让npc处于死亡状态 function NotSyncBattleSetter.SetNpcEntityState(entity, stateType) if stateType == 0 then -- common_pb.Dead = 0 SystemManager.SetNextState(LuaConst.StateType.Dead, entity, -1, "dead_loop", nil) SystemManager.DisableInteract(entity) elseif stateType == 1 then -- common_pb.Alive = 1 SystemManager.SetNextState(LuaConst.StateType.Idle, entity) SystemManager.ResetInteractColliderState(entity) end end -- 复活 function NotSyncBattleSetter.ReviveEntity(entity, isInBornPoint) SystemManager.OnRevive(entity,isInBornPoint) SystemManager.SetNextState(LuaConst.StateType.Idle, entity) end --为entity身上播一个气泡 bubbleID:气泡ID function NotSyncBattleSetter.ShowBubbleDialogue(entity, bubbleID) SystemManager.ShowBubbleDialogue(entity, bubbleID) end function NotSyncBattleSetter.ChangeEntityName(entity, name) entity._logicInitData.Name = name end function NotSyncBattleSetter.RefreshEntityUIName(entity, name) SystemManager.ChangeEntityName(entity, name or entity.ExpEntity:GetPlayerModelName()) end function NotSyncBattleSetter.ChangeEntityGuildEscort(entity, quality) SystemManager.ChangeEntityGuildEscort(entity, quality) end function NotSyncBattleSetter.ChangeEntityTitle(entity, titleID) SystemManager.ChangeEntityTitle(entity, titleID) end function NotSyncBattleSetter.RefreshEntityHeadGuildShow(entity) SystemManager.UpdateEntityHeadGuildShow(entity) end function NotSyncBattleSetter.ChangeHorse(entity,horseId, horseAppearanceID) SystemManager.ChangeHorse(entity,horseId, horseAppearanceID) end function NotSyncBattleSetter.ChangePetInfo(entity,petInfo) SystemManager.ChangePet(entity,petInfo.petId, petInfo.stage, petInfo.petName, petInfo.petSkill, petInfo.isLineUp, petInfo.aptitudeSum, petInfo.runeSkillLevelSum) end function NotSyncBattleSetter.ChangeDyeCurPart(entity, dyeCurPartList) local newDyeList = {} for i,v in ipairs(dyeCurPartList) do table.insert(newDyeList, v) end entity._logicInitData.DyeList = newDyeList entity.ExpEntity:CreateDyeAppearance() end function NotSyncBattleSetter.SetClimbTowerId(id) LevelManager.SetClimbTowerId(id) end function NotSyncBattleSetter.ChangeMagicWeaponID(entity, magicWeaponID) entity._logicInitData.MagicWeaponID = magicWeaponID SystemManager.OnChangeMagicWeaponID(entity) end function NotSyncBattleSetter.ChangeMagicWeaponBreak(entity, weaponBreak, isActiveMagicWeapon) entity._logicInitData.WeaponBreak = weaponBreak > 0 and weaponBreak or 0 --神兵突破等级 entity._logicInitData.IsActiveMagicWeapon = weaponBreak > 0 or isActiveMagicWeapon --神兵激活 if entity._logicInitData.IsActiveMagicWeapon and (entity._logicInitData.MagicWeaponID == nil or entity._logicInitData.MagicWeaponID == 0 ) then entity._logicInitData.MagicWeaponID = entity:GetCharacterID() end ExpSystemManager.OnChangeMagicWeaponEffect(entity.ExpEntity) end -- 换外显(做某任务时变和尚) function NotSyncBattleSetter.ChangeAppearanceId(entity,appearanceId) entity.ExpEntity.components.model:SetAppearanceId(appearanceId) SystemManager.OnChangeModel(entity, false, appearanceId == 0, appearanceId == 0) end --主城换武将 function NotSyncBattleSetter.TownChangeHero(entity,roleShowInfo) --主视角调用 local newLightEffectIDs = {} for i=1,#roleShowInfo.lightEffectIds do table.insert(newLightEffectIDs, roleShowInfo.lightEffectIds[i]) end local newDyeList = {} for i,v in ipairs(roleShowInfo.dyeCurPartList) do table.insert(newDyeList, v) end entity.ExpEntity:PlayHeroLightEffect(entity._logicInitData.LightEffectIDs, false) entity._logicInitData:NotSyncResetInfo(roleShowInfo.HeroId,roleShowInfo.heroBreakNums,roleShowInfo.isActiveMagicWeapon,roleShowInfo.weaponBreak, roleShowInfo.weaponAppearanceId,roleShowInfo.heroAppearanceId, newLightEffectIDs,roleShowInfo.weaponSoulInfo, newDyeList) SystemManager.ReplaceModel_ByHeroAppearance(entity, roleShowInfo.heroAppearanceId) ChangeAvatarSystem.ChangeAvatar(entity, roleShowInfo.HeroId, nil, nil ,nil, true) -- ChangeAvatarSystem.ChangeAvatar 方法中大变身 会取消AI,这个时候会停掉寻路,为了UI展示一致。界面上也取消寻路提示 NotSyncBattleSetter.StopAutoFightPathInTown() --停止现在的寻路 entity.ExpEntity:PlayHeroLightEffect(newLightEffectIDs, true) entity.ExpEntity:UpdateExpWeaponSoulInfo() entity.ExpEntity:DisposeWeaponHalo() entity.ExpEntity:CreateWeaponHalo() end --主城武将神兵铸魂(天命)光轮 function NotSyncBattleSetter.TownChangeWeaponSoulInfo(entity, weaponSoulInfo) entity._logicInitData.WeaponSoulInfo = weaponSoulInfo entity.ExpEntity:UpdateExpWeaponSoulInfo() entity.ExpEntity:DisposeWeaponHalo() entity.ExpEntity:CreateWeaponHalo() end --主城换武将时装模型 function NotSyncBattleSetter.ReplaceModelSkin(entity,modelID) local needHorse = false -- 为解决有光效bug:在马上换hero皮肤,有脚底光效,从马上移到了马背上。为了不改C#这才做了这个临时方案 if entity.components.buff:CheckHasBuffState(LuaConst.SpecialBuffs.InRiding) then -- 只有在上马的时候才换 NotSyncBattleSetter.OffHorse(entity) needHorse = true end SystemManager.ReplaceModelSkin(entity,modelID) if needHorse then NotSyncBattleSetter.RideHorse(entity) end end --主将突破数 变化(主将的特效) function NotSyncBattleSetter.ChangeHeroBreakNum(entity,heroBreakNums) entity._logicInitData.HeroBreakNums = heroBreakNums local opModelData = entity.components.replace:GetCurExpModelData() if entity.ExpEntity.components.model.CurModelID ~= opModelData.ID then logging.log(LTAG.LOG, "gws:当前处于特显状态,不能换神兵特效") return end entity.ExpEntity:PlayHeroBreakEffect(entity._logicInitData.CharacterID, heroBreakNums) end -- 主城光效变化 lightEffectIds[1] = -1 表示卸载所有特效 function NotSyncBattleSetter.ChangeHeroLightEffect(entity,lightEffectIds) local oldList = entity._logicInitData.LightEffectIDs local addList = {} local removeList = {} for i=1,#lightEffectIds do local id = lightEffectIds[i] if id > 0 then -- -1 表示卸载光效 local isContent = table.containValue(oldList,id) if not isContent then table.insert(addList,id) end end end for i=1,#oldList do local id = oldList[i] if id > 0 then local isContent = table.containValue(lightEffectIds,id) if not isContent then table.insert(removeList,id) end end end entity._logicInitData.LightEffectIDs = lightEffectIds for k, id in ipairs(removeList) do -- 删除特效 SystemManager.ShowOrHideLightEffect(entity, id, false) end for k, id in ipairs(addList) do --穿带光效 SystemManager.ShowOrHideLightEffect(entity, id, true) end end ---------------战斗数据设置(仅限副本、联机战斗开始前使用(离开主城前),用作战斗初始化)------------------------------------------------- function NotSyncBattleSetter.SetPlayerArmyTable(playerID,heroLineUpInfos,playerInfo,isFairLevel,stratagemDevelopEffects, robotEnemyRecommendGS,levelType) LevelPlayerManager.SetNotSyncArmyTable(playerID,heroLineUpInfos ,playerInfo,isFairLevel,stratagemDevelopEffects, robotEnemyRecommendGS,levelType) end -- 设置预备军(3次teamPk时用到) function NotSyncBattleSetter.SetPlayerReserveArmyInfo(playerID, heroLineUpInfos,heroLineUpInfos2, heroLineUpInfos3, extraInfo) LevelPlayerManager.SetPlayerReserveArmyInfo(playerID, heroLineUpInfos, heroLineUpInfos2, heroLineUpInfos3, extraInfo) end function NotSyncBattleSetter.SetLevelBuffIdList(buffIdList) LevelPlayerManager.SetLevelBuffIdList(buffIdList) end function NotSyncBattleSetter.SetPlayerBuffInfoList(playerbuffInfoList) LevelPlayerManager.SetPlayerBuffInfoList(LevelPlayerManager.MyPlayerIDInRoom, playerbuffInfoList) end function NotSyncBattleSetter.SetCutsceneAutoPass(isAutoPass) LevelManager.SetCutsceneAutoPass(isAutoPass) end function NotSyncBattleSetter.SetLevelData(cutSceneAutoPassTime) LevelManager.SetLevelData(cutSceneAutoPassTime) end function NotSyncBattleSetter.ResetLevelData() LevelManager.SetLevelData(-1) end function NotSyncBattleSetter.PauseLevel(isPause) if not LevelManager.IsSyncLevel() then --走校验的单机也可以调用这个 LevelManager.PauseLevel(isPause) else logging.error(LTAG.ERROR, "HYW : 试图在联机玩法调用 NotSyncBattleSetter.PauseLevel,这是不允许的!") end end function NotSyncBattleSetter.SetLevelSaveRecordBytes(bytes) LevelManager.SetServerSaveRecordBytes(bytes) end function NotSyncBattleSetter.Set_IsUseSelfAI(value) GlobalBattleData.IsUseSelfAI = value end function NotSyncBattleSetter.Set_IsSkillNoCD(value) GlobalBattleData.IsSkillNoCD = value end function NotSyncBattleSetter.Set_CheatHeroIndex(value) GlobalBattleData.CheatHeroIndex = value end function NotSyncBattleSetter.SetTestEntitySkillPos(value) GlobalBattleData.TestEntitySkillIndex = value end function NotSyncBattleSetter.SetClientIntermediateParamsBytes(bytes) LevelManager.SetServerClientIntermediateParamsBytes(bytes) end function NotSyncBattleSetter.SetTimeScaleBatchNotSync(isSlow, contantType, caster, slowTarget, id, scale, time, breakType,timeScaleChannel) if caster ~= LogicUpdateManager._curEntity then --防止机器人和副将 触发 return end if contantType == 0 then -- 全部 for entityID ,entity in pairs(LogicUpdateManager._entityDic) do if isSlow then SystemManager.OnAddTimeScale(entity, id, scale, time, breakType,timeScaleChannel) else SystemManager.OnDeleteTimeScale(entity, id, scale) end end elseif contantType == 1 then -- 除自己外的所有 for entityID ,entity in pairs(LogicUpdateManager._entityDic) do if entity ~= LogicUpdateManager._curEntity then if isSlow then SystemManager.OnAddTimeScale(entity, id, scale, time, breakType,timeScaleChannel) else SystemManager.OnDeleteTimeScale(entity, id, scale) end end end elseif contantType == 2 then -- 仅自己和指定的entity if isSlow then SystemManager.OnAddTimeScale(caster, id, scale, time, breakType, timeScaleChannel) SystemManager.OnAddTimeScale(slowTarget, id, scale, time, breakType, timeScaleChannel) else SystemManager.OnDeleteTimeScale(caster, id, scale) SystemManager.OnDeleteTimeScale(slowTarget, id, scale) end end end function NotSyncBattleSetter.PauseEntity(entity) SystemManager.OnAddTimeScale(entity,"level",FP.newV1(0),-1,LuaConst.TimeScaleBreakType.NeverBreak) end function NotSyncBattleSetter.AddTimeScale(entity, id, scale, time, breakType,timeScaleChannel) SystemManager.OnAddTimeScale(entity, id, scale, time, breakType,timeScaleChannel) end function NotSyncBattleSetter.IsGuildPartyCanGetBox() return CTL.GuildParty.IsGuildPartyCanGetBox() end function NotSyncBattleSetter.SwitchWatchPlayer(useLast) local oldEntity = LogicUpdateManager._curEntity local curPlayerID = LogicUpdateManager._curEntity and LogicUpdateManager._curEntity:GetPlayerID() or 0 local watchPlayerID = nil -- 被观看的玩家id local curCampID = LogicUpdateManager._curEntity:GetCampID() local lastPlayerID = MDL.Replay.GetLastWatchID() MDL.Replay.SetLastWatchID(curPlayerID) if useLast and lastPlayerID then watchPlayerID = lastPlayerID else for i, pID in ipairs(LevelPlayerManager.SyncPlayerIDList) do -- 先找同阵容的观看 local pCamp = LevelPlayerManager.GetCampIDByPlayerIDInRoom(pID) if pCamp == curCampID and pID > curPlayerID then watchPlayerID = pID break end end if watchPlayerID == nil then -- 同阵容全部看完后,再找敌阵容的观看(先确定同哪个阵营camp,再找其中最小的playerID) local toWatchCampID = 1 for i, pID in ipairs(LevelPlayerManager.SyncPlayerIDList) do -- 再找敌阵容的观看 local pCamp = LevelPlayerManager.GetCampIDByPlayerIDInRoom(pID) if pCamp > curCampID then toWatchCampID = pCamp break end end for i, pID in ipairs(LevelPlayerManager.SyncPlayerIDList) do local pCamp = LevelPlayerManager.GetCampIDByPlayerIDInRoom(pID) if pCamp == toWatchCampID then -- 如果找到了新的敌对阵营则要从这个阵营的最小playerID开始看 watchPlayerID = pID break end end end end if watchPlayerID == nil then watchPlayerID = 1 -- (保底代码,实在找不到默认为1号玩家) logging.error(LTAG.ERROR, "gws: 观战切换将时,找不到合适的玩家,将默认切换到1号玩家!") end --LevelPlayerManager.MainEntityCampID = 不要设置这个值,否则 3v3的界面判断和光圈颜色等会错乱。 local watchEntity = LevelPlayerManager.GetPlayerActiveEntity(watchPlayerID) local searchCount = 0 while(watchEntity == nil) do --有可能这个玩家没进来或者卡掉了,比如龙脉回放里 searchCount = searchCount + 1 if searchCount > #LevelPlayerManager.SyncPlayerIDList then watchPlayerID = 1 break end watchPlayerID = watchPlayerID + 1 watchEntity = LevelPlayerManager.GetPlayerActiveEntity(watchPlayerID) if watchPlayerID > #LevelPlayerManager.SyncPlayerIDList then watchPlayerID = 1 end end LevelPlayerManager.MyPlayerIDInRoom = watchPlayerID LogicUpdateManager.SetCurEntity(watchEntity) ExpSystemManager.SetCurEntity(watchEntity.ExpEntity) EventSystem.Dispatch(EventID.Player_SetSkillList) -- 刷新技能icon oldEntity.ExpEntity:SetSoundListener(false) watchEntity.ExpEntity:SetSoundListener(true) if BattleDataGetter.IsDragonArteryLevel() then NotSyncBattleSetter.RefreshUINameColor() end return watchPlayerID end --市场cheat : 龙脉回放,换被观察人时,需要换所有人的头顶颜色 --entity要求传入一个主玩家的entity function NotSyncBattleSetter.RefreshUINameColor() local myCamp = LogicUpdateManager._curEntity:GetCampID() for i, entity in ipairs(LogicUpdateManager.EntityList_Sync) do local isEnemy = CampManager.IsEnemyCamp(entity:GetCampID(), myCamp) local playerSelf = entity == LogicUpdateManager._curEntity local colorType, nameColor if playerSelf then colorType = LuaConst.BloodBarColorType.Green nameColor = UTL.Color.ModelNameColor.Green else if isEnemy then colorType = LuaConst.BloodBarColorType.Red nameColor = UTL.Color.ModelNameColor.Red else colorType = LuaConst.BloodBarColorType.Blue nameColor = UTL.Color.ModelNameColor.Blue end end entity.ExpEntity:SetModelUIImageColor(colorType) -- 血条颜色 entity.ExpEntity:SetModelUINameColor(colorType) -- 名字颜色 entity.ExpEntity:ChangeModelUI_NameColor(nameColor) -- 名字颜色 end end function NotSyncBattleSetter.OnConvertRenderVisual(renderEntity, isVisible) ExpSystemManager.OnConvertRenderVisual(renderEntity, isVisible) end -- 给entity添加一个交互功能 function NotSyncBattleSetter.AddInteract(entity, interactID, pos) SystemManager.AddInteract(entity, interactID, pos) end -- 删除entity的交互功能 function NotSyncBattleSetter.DeleteInteract(entity, interactID) SystemManager.DeleteInteract(entity, interactID) end -- 切换整容。等于 阉割版本的 ActionFunc[ActionType.Global_SwitchArmy] function NotSyncBattleSetter.SwitchArmy(heroList) local pos,dir,itemData --主视角调用 if LogicUpdateManager._curEntity then local component = LogicUpdateManager._curEntity.components pos = component.move.LogicPos dir = component.move.LogicRotateDir local bornItemID = LogicUpdateManager._curEntity._logicInitData.OriginBornItemID itemData = LevelItemManager.GetItemDataByID(bornItemID) end -- 修改数据 local army = LevelPlayerManager.GetPlayerArmyByPlayerIDInRoom(LuaConst.STANDALONE_PLAYER_PlayID) for i,heroArmyData in ipairs(army) do local index = i * 2 - 1 local heroID, isAwaken = CTL.HeroAwaken.DecodeHeroId(heroList[index]) if heroID then heroArmyData.HeroID = heroID if isAwaken then local awakenData = DataSheetManager.AwakenHeroNum:GetDataByID(heroID) heroArmyData.heroAppearanceId = awakenData.HeroAppearance heroArmyData.mainHeroDevelopEffectsIds = { awakenData.WeaponRebirthBuff } heroArmyData.weaponAppearanceId = awakenData.WeaponAppearance else heroArmyData.heroAppearanceId = 0 heroArmyData.weaponAppearanceId = heroID end heroArmyData.mainHeroAwaken = isAwaken end local adjutantID, isAwaken = CTL.HeroAwaken.DecodeHeroId(heroList[index + 1]) if adjutantID then heroArmyData.AdjutantID = adjutantID if isAwaken then local awakenData = DataSheetManager.AwakenHeroNum:GetDataByID(adjutantID) heroArmyData.viceHeroAppearanceId = awakenData .HeroAppearance heroArmyData.viceHeroDevelopEffectsIds = { awakenData.WeaponRebirthBuff } heroArmyData.viceWeaponAppearanceId = awakenData.WeaponAppearance else heroArmyData.viceHeroAppearanceId = 0 heroArmyData.viceWeaponAppearanceId = adjutantID end heroArmyData.viceHeroAwaken = isAwaken end end LevelPlayerManager.NotSyncCollectDevelopEffects(LuaConst.STANDALONE_PLAYER_PlayID) LevelPlayerManager.ClearPlayerEntity(LuaConst.STANDALONE_PLAYER_PlayID) LevelPlayerManager.CreatePlayers(pos,dir) --主视角调用 EventSystem.Dispatch(EventID.Level_SwitchHero,LuaConst.SwitchHeroType.LevelAction,LogicUpdateManager._curEntity) CameraController.Instance:ReactiveCamera() end --region 主播PC包相关 --让怪物元素开始 function NotSyncBattleSetter.StartMonsterLevelItem(levelItemID) local levelItem = LevelItemManager.GetItemByID(levelItemID, LuaConst.LevelItemType.Monster) if levelItem then levelItem:DoAction(LuaConst.LevelActionType.Monster_Active) end end --让怪物元素暂不启用 function NotSyncBattleSetter.DeactiveMonsterLevelItem(levelItemID) local levelItem = LevelItemManager.GetItemByID(levelItemID, LuaConst.LevelItemType.Monster) if levelItem then levelItem:OnDeactive() levelItem:DeleteAll(false, true) end end --替换要出生的怪物 function NotSyncBattleSetter.SetMonsterItemOverrideMonsterID(levelItemID, monsterID) local monsterItem = LevelItemManager.GetItemByID(levelItemID, LuaConst.LevelItemType.Monster) if monsterItem then monsterItem:DeleteAll() monsterItem:OnDeactive() monsterItem:SetOverrideMonsterID(monsterID) monsterItem:DoAction(LuaConst.LevelActionType.Monster_Active) end end --让boss暂停 function NotSyncBattleSetter.SetBossIdleAI(levelItemID) local entity = BattleDataGetter.GetEntityByLevelItemID(levelItemID) entity.components.aiBase:ChangeAiByAIID(2) end --endregion 主播PC包相关 ---------------end region------------------------------------------------------------------- --增加访问监控 local proxy = {} proxy[1] = NotSyncBattleSetter --忽略监控的方法(如果要被c#调用,则一定要加入到proxy里) proxy.SetTownHeroTable = NotSyncBattleSetter.SetTownHeroTable proxy.Set_IsUseSelfAI = NotSyncBattleSetter.Set_IsUseSelfAI --因为要给C#访问,必须加到proxy里 proxy.Set_IsSkillNoCD = NotSyncBattleSetter.Set_IsSkillNoCD --因为要给C#访问,必须加到proxy里 proxy.Set_CheatHeroIndex = NotSyncBattleSetter.Set_CheatHeroIndex --因为要给C#访问,必须加到proxy里 proxy.SetTestEntitySkillPos = NotSyncBattleSetter.SetTestEntitySkillPos proxy.SetPlayerArmyTable = NotSyncBattleSetter.SetPlayerArmyTable proxy.SetPlayerReserveArmyInfo = NotSyncBattleSetter.SetPlayerReserveArmyInfo proxy.DisableFollowIndexCacheByAcid = NotSyncBattleSetter.DisableFollowIndexCacheByAcid proxy.SetAcid = NotSyncBattleSetter.SetAcid proxy.SetPlayerInfo = NotSyncBattleSetter.SetPlayerInfo proxy.SetCanChangeLine = NotSyncBattleSetter.SetCanChangeLine proxy.SetGuideLevelState = NotSyncBattleSetter.SetGuideLevelState proxy.SetClientIntermediateParamsBytes = NotSyncBattleSetter.SetClientIntermediateParamsBytes proxy.StopCurLevel = NotSyncBattleSetter.StopCurLevel proxy.MainPlayerPlayEffectByType = NotSyncBattleSetter.MainPlayerPlayEffectByType --纯视图操作开放给外面,不做访问限制 proxy.MainPlayerPlayPsEffect = NotSyncBattleSetter.MainPlayerPlayPsEffect --纯视图操作开放给外面,不做访问限制 proxy.OnWorldBossSeekHelp = NotSyncBattleSetter.OnWorldBossSeekHelp --因为有引导假副本的需求,服务器又不走常规流程, 所以这里只能让客户端写这样的代码了 proxy.SetClimbTowerId = NotSyncBattleSetter.SetClimbTowerId proxy.PauseLevel = NotSyncBattleSetter.PauseLevel --走校验的单机玩法可以调这个,所以要忽略一下,在PauseLevel方法里会有IsSyncLevel的过滤 proxy.RequestAddSeverPlayerBuff = NotSyncBattleSetter.RequestAddSeverPlayerBuff --这个方法可以在需要检验的单机玩法调用,这个方法是一个数据同步,类似随进随出的NewFighter,服务器会保证这个数据同步在校验程序中也能及时收到。这个数据会由command来激活 proxy.ChangeCameraTargetPattern = NotSyncBattleSetter.ChangeCameraTargetPattern proxy.EntityPlayPsEffect = NotSyncBattleSetter.EntityPlayPsEffect proxy.EntityStopPsEffect = NotSyncBattleSetter.EntityStopPsEffect proxy.SetLevelData = NotSyncBattleSetter.SetLevelData proxy.SetPlayerBuffInfoList = NotSyncBattleSetter.SetPlayerBuffInfoList --爬塔这种单机校验的玩法也需要SetPlayerBuffInfoList,所以排除监控 proxy.SwitchWatchPlayer = NotSyncBattleSetter.SwitchWatchPlayer proxy.OnConvertRenderVisual = NotSyncBattleSetter.OnConvertRenderVisual --纯视图代码,排除监控 proxy.SwitchTargetCameraAim = NotSyncBattleSetter.SwitchTargetCameraAim proxy.SetLevelBuffIdList = NotSyncBattleSetter.SetLevelBuffIdList --↑↑↑ setmetatable(proxy,AccessWatcher) return proxy