| | |
| | | return
|
| | | totalPoint = gameWorld.GetDictByKey(ChConfig.Def_WorldKey_BossRebornNeedPoint)
|
| | | if not totalPoint:
|
| | | totalPoint = __SetBossRebornNeedPoint()
|
| | | totalPoint = SetBossRebornNeedPoint()
|
| | | if not totalPoint:
|
| | | GameWorld.Log(' 增加boss复活点 没有总点数!!!!')
|
| | | return
|
| | |
| | | def ResetBossRebornPoint():
|
| | | ## 重置boss复活点
|
| | | PlayerDBGSEvent.SetDBGSTrig_ByKey(PlayerDBGSEvent.Def_BossRebornPoint, 0)
|
| | | Sync_BossRebornPoint()
|
| | | |
| | | # 活动开启时设置参数 服务器人数
|
| | | lvLimit = IpyGameDataPY.GetFuncCfg('ServerActivePlayerCnt')
|
| | | yesterdayPlayerCnt = len([1 for lv in PyGameData.g_yesterdayPlayerLVDict.values() if lv >= lvLimit]) #参数昨日活跃人数
|
| | | serverActivePlayerCnt = eval(IpyGameDataPY.GetFuncCompileCfg('ServerActivePlayerCnt', 2))
|
| | | PlayerDBGSEvent.SetDBGSTrig_ByKey(PlayerDBGSEvent.Def_BRServerPlayerCnt, serverActivePlayerCnt)
|
| | | GameWorld.Log(' boss复活活动开启时设置昨日活跃人数yesterdayPlayerCnt=%s'%yesterdayPlayerCnt)
|
| | | #重新计算需要总点数
|
| | | __SetBossRebornNeedPoint()
|
| | | SetBossRebornNeedPoint()
|
| | | |
| | | Sync_BossRebornPoint()
|
| | | return
|
| | |
|
| | | def __SetBossRebornNeedPoint():
|
| | | def SetBossRebornNeedPoint(isSync=False):
|
| | | totalPointList = IpyGameDataPY.GetFuncEvalCfg('BossRebornTotalPoint')
|
| | | worldLVList = IpyGameDataPY.GetFuncEvalCfg('BossRebornTotalPoint', 2)
|
| | | playerCntList = IpyGameDataPY.GetFuncEvalCfg('BossRebornTotalPoint', 2)
|
| | |
|
| | | actWorldLV = PlayerDBGSEvent.GetDBGSTrig_ByKey(PlayerDBGSEvent.Def_OActWorldLV % ShareDefine.OperationActionName_BossReborn)
|
| | | BRServerPlayerCnt = PlayerDBGSEvent.GetDBGSTrig_ByKey(PlayerDBGSEvent.Def_BRServerPlayerCnt)
|
| | |
|
| | | index = len(worldLVList)-1
|
| | | for i, lv in enumerate(worldLVList):
|
| | | prelv = 0 if i ==0 else worldLVList[i-1]
|
| | | if prelv <=actWorldLV < lv:
|
| | | index = len(playerCntList)-1
|
| | | for i, cnt in enumerate(playerCntList):
|
| | | preCnt = 0 if i ==0 else playerCntList[i-1]
|
| | | if preCnt <=BRServerPlayerCnt < cnt:
|
| | | index = i
|
| | | break
|
| | |
|
| | | totalPoint = totalPointList[-1] if index >= len(totalPointList) else totalPointList[index]
|
| | | GameWorld.GetGameWorld().SetDict(ChConfig.Def_WorldKey_BossRebornNeedPoint, totalPoint)
|
| | | if isSync:
|
| | | Sync_BossRebornPoint()
|
| | | return totalPoint
|
| | |
|
| | | def BossRebornWorldNotify(curTime):
|
| | |
| | | ##通知BOSS复活点数
|
| | | packData = ChPyNetSendPack.tagGCBossRebornPoint()
|
| | | packData.Point = PlayerDBGSEvent.GetDBGSTrig_ByKey(PlayerDBGSEvent.Def_BossRebornPoint)
|
| | | totalPoint = GameWorld.GetGameWorld().GetDictByKey(ChConfig.Def_WorldKey_BossRebornNeedPoint)
|
| | | if not totalPoint:
|
| | | totalPoint = SetBossRebornNeedPoint()
|
| | | packData.TotalPoint = totalPoint
|
| | | playerManager = GameWorld.GetPlayerManager()
|
| | | if not curPlayer:
|
| | | for i in xrange(playerManager.GetActivePlayerCount()):
|
| | |
| | | NetPackCommon.SendFakePack(curPlayer, packData)
|
| | | return
|
| | |
|
| | |
|
| | | def Sync_OperationAction_BossReborn(ipyData, curPlayer=None):
|
| | | ## 通知boss复活活动信息
|
| | | if not ipyData:
|
| | | return
|
| | | |
| | | bossRebornInfo = ChPyNetSendPack.tagGCBossRebornInfo()
|
| | | bossRebornInfo.Clear()
|
| | | bossRebornInfo.StartDate = ipyData.GetStartDate()
|
| | | bossRebornInfo.EndtDate = ipyData.GetEndDate()
|
| | | bossRebornInfo.WorldLV = PlayerDBGSEvent.GetDBGSTrig_ByKey(PlayerDBGSEvent.Def_OActWorldLV % ShareDefine.OperationActionName_BossReborn)
|
| | | bossRebornInfo.LimitLV = ipyData.GetLVLimit()
|
| | | if not curPlayer:
|
| | | # 全服广播在线玩家
|
| | | playerManager = GameWorld.GetPlayerManager()
|
| | | for i in xrange(playerManager.GetActivePlayerCount()):
|
| | | curPlayer = playerManager.GetActivePlayerAt(i)
|
| | | if curPlayer == None or not curPlayer.GetInitOK():
|
| | | continue
|
| | | if PlayerControl.GetIsTJG(curPlayer):
|
| | | continue
|
| | | NetPackCommon.SendFakePack(curPlayer, bossRebornInfo)
|
| | | else:
|
| | | if PlayerControl.GetIsTJG(curPlayer):
|
| | | return
|
| | | NetPackCommon.SendFakePack(curPlayer, bossRebornInfo)
|
| | | return
|