From be35331b8931d2829f014749a827a1c37c78feff Mon Sep 17 00:00:00 2001 From: hxp <ale99527@vip.qq.com> Date: 星期三, 29 五月 2019 17:11:18 +0800 Subject: [PATCH] 6997 【后端】【2.0】战力计算整理 --- ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/FBCommon.py | 63 ++++++++++--------------------- 1 files changed, 20 insertions(+), 43 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 0afee8e..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 @@ -446,18 +446,18 @@ # @return def SetFBPropertyMark(propertyMark, setPlayer=None): GameWorld.GetGameFB().SetGameFBDict(ChConfig.Map_FBDict_PropertyMark, propertyMark + 1) # 存储时+1才能判断是否存储过 - if setPlayer != None: - PlayerControl.SetFBFuncLineID(setPlayer, propertyMark) - GameWorld.DebugLog("SetFBPropertyMark 设置玩家副本功能线路ID: %s" % propertyMark, setPlayer.GetPlayerID()) - return - - playerManager = GameWorld.GetMapCopyPlayerManager() - for index in xrange(playerManager.GetPlayerCount()): - curPlayer = playerManager.GetPlayerByIndex(index) - if not curPlayer.GetPlayerID(): - continue - PlayerControl.SetFBFuncLineID(curPlayer, propertyMark) - GameWorld.DebugLog("SetFBPropertyMark 广播玩家副本功能线路ID: %s" % propertyMark, curPlayer.GetPlayerID()) +# if setPlayer != None: +# PlayerControl.SetFBFuncLineID(setPlayer, propertyMark) +# GameWorld.DebugLog("SetFBPropertyMark 设置玩家副本功能线路ID: %s" % propertyMark, setPlayer.GetPlayerID()) +# return +# +# playerManager = GameWorld.GetMapCopyPlayerManager() +# for index in xrange(playerManager.GetPlayerCount()): +# curPlayer = playerManager.GetPlayerByIndex(index) +# if not curPlayer.GetPlayerID(): +# continue +# PlayerControl.SetFBFuncLineID(curPlayer, propertyMark) +# GameWorld.DebugLog("SetFBPropertyMark 广播玩家副本功能线路ID: %s" % propertyMark, curPlayer.GetPlayerID()) return ## 是否已经扣除入场券/进入次数等 @@ -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(): @@ -2059,7 +2036,7 @@ def AddFbEncourageBuff(curPlayer, key, tick, ownerID=0): curPlayerID = curPlayer.GetID() GameWorld.Log("AddFbEncourageBuff() curPlayerID=%s" % curPlayerID) - + ownerID = ownerID or curPlayer.GetID() gameFB = GameWorld.GetGameFB() encourageLV = gameFB.GetPlayerGameFBDictByKey(ownerID, key) if not encourageLV: -- Gitblit v1.8.0