From 7aea6ad0d560ee2533024c910b956fdfcdb59583 Mon Sep 17 00:00:00 2001 From: hxp <ale99527@vip.qq.com> Date: 星期五, 24 五月 2019 15:40:36 +0800 Subject: [PATCH] 6805 【后端】【2.0】副本前端化(优化前端本状态逻辑,召唤木桩增加可指定血量,增加可设置玩家血量) --- ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/FBCommon.py | 37 +++++++------------------------------ 1 files changed, 7 insertions(+), 30 deletions(-) diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/FBCommon.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/FBCommon.py index 1116739..4ff972f 100644 --- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/FBCommon.py +++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/FBCommon.py @@ -473,36 +473,13 @@ GameWorld.GetGameFB().SetPlayerGameFBDict(curPlayer.GetID(), ChConfig.FBPlayerDict_IsDelTicket, delSign) return -def SetCustomSceneStart(curPlayer, mapID, lineID): - ''' 设置前端自定义场景副本开始时间 - 某些自定义场景进入可能需要处理某些逻辑,比如扣门票、设置某些状态、完成成就等,这些逻辑在单次进入只能触发一次 - 需要记录一个开始状态,只在设置成功的时候进行处理这些逻辑,防止断线重连或重登重新进入自定义场景时,重复执行逻辑 - 该状态设置了一个有效期,暂时设定为15分钟,未完成场景有效期内重复进入不会重复触发 - 做超时是为了防止玩家没有正常结束场景导致未来的某个时间再次进入场景时无法正常触发进入需要额外处理的逻辑 - 需根据副本结束时机配置函数 SetCustomSceneOver 设置结束状态 - @return: 设置成功返回True - ''' - if GetCustomSceneState(curPlayer, mapID, lineID) == ChConfig.CustomSceneState_Fight: - return - PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_Player_Dict_CustomSceneStartTime % (mapID, lineID), int(time.time())) - return True - -def GetCustomSceneState(curPlayer, mapID, lineID): - '''获取前端自定义场景状态 - @return: 0-无,1-进行中,2-已结束 - ''' - startTime = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_CustomSceneStartTime % (mapID, lineID)) - if not startTime: - return ChConfig.CustomSceneState_None - if startTime == ChConfig.CustomSceneState_Over: - return ChConfig.CustomSceneState_Over - # 保留15分钟 - curTime = int(time.time()) - return ChConfig.CustomSceneState_Fight if curTime - startTime < 15 * 60 else ChConfig.CustomSceneState_None - -def SetCustomSceneOver(curPlayer, mapID, lineID): - ## 设置前端自定义场景副本结束 - PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_Player_Dict_CustomSceneStartTime % (mapID, lineID), ChConfig.CustomSceneState_Over) +## 自定义场景阶段 +def GetCustomMapStep(curPlayer, mapID, lineID): + return curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_CustomMapStep % (mapID, lineID)) +def SetCustomMapStep(curPlayer, mapID, lineID, step): + PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_Player_Dict_CustomMapStep % (mapID, lineID), step) + if step == ChConfig.CustomMapStep_Over: + PlayerControl.SetCustomMap(curPlayer, 0, 0) return def GetCurSingleFBPlayer(): -- Gitblit v1.8.0