hch
2018-10-10 5e3e992c98a7cd2d63abef53146cfb037f9a6b4e
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_Dogz.py
@@ -106,7 +106,6 @@
    
    return
## 收集中
def OnCollecting(curPlayer, tick):
    tagObj = curPlayer.GetActionObj()
@@ -123,13 +122,13 @@
    lostCD = IpyGameDataPY.GetFuncEvalCfg('DogzFBCollect', 1, {}).get(npcID, 1)
    lostTime = (tick - collectLostHPTick) / 1000/lostCD # 掉血次数
    if lostTime >3:
    if lostTime >2:
        gameFB.SetPlayerGameFBDict(playerID, Map_Dogzfb_CollectLostHPTick, tick)
        return
    
    if not lostTime:
        return
    gameFB.SetGameFBDict(Map_Dogzfb_CollectLostHPTick, tick)
    gameFB.SetPlayerGameFBDict(playerID, Map_Dogzfb_CollectLostHPTick, tick)
        
   
    lostHPPer = IpyGameDataPY.GetFuncEvalCfg('DogzFBCollect', 2, {}).get(npcID, 1)
@@ -137,7 +136,7 @@
    lostValue = min(int(GameObj.GetMaxHP(curPlayer) * lostHPPer / 100.0) * lostTime, GameObj.GetHP(curPlayer)-1)
    if lostValue <=0:
        return
    #GameWorld.DebugLog("OnCollecting npcID=%s, lostHPPer=%s,lostTime=%s,lostValue=%s" % (npcID, lostHPPer, lostTime, lostValue))
    GameWorld.DebugLog("OnCollecting npcID=%s, lostHPPer=%s,lostTime=%s,lostValue=%s" % (npcID, lostHPPer, lostTime, lostValue))
    SkillCommon.SkillLostHP(curPlayer, skillTypeID, buffOwner, lostValue, tick)
    return
@@ -185,7 +184,7 @@
            continue
        rmark = npcRefresh.GetRefreshMark()
        npcCntDict[rmark] = npcCntDict.get(rmark, 0) + npcRefresh.GetCount()
    isNeedSync = False #是否需要通知
    for markInfo, refreshInfo in refreshDict.items():
        npcID = refreshInfo[Def_NPCID]
        refreshCnt = refreshInfo[Def_FirstRefreshCnt] if isFirst else refreshInfo[Def_RefreshCnt]
@@ -210,9 +209,11 @@
        
        #计算下次多久刷新
        __UpdateBossTime(npcID, refreshInfo[Def_TimeFormula])
        if npcID in IpyGameDataPY.GetFuncEvalCfg('DogzFBRefreshCfg', 3):
            isNeedSync = True
    #通知时间
    SyncNPCRefreshTime()
    if isNeedSync:
        SyncNPCRefreshTime()
    
    return
@@ -247,14 +248,15 @@
    nextNeedTime = gameWorldMgr.GetGameWorldDictByKey(Map_Dogzfb_NextNeedTime % npcID)
    return max(0, nextNeedTime - curTime + lastRefreshTime)
def SyncNPCRefreshTime(playerid=0):
    curTime = int(time.time())
def SyncNPCRefreshTime():
    syncNPCIDList = IpyGameDataPY.GetFuncEvalCfg('DogzFBRefreshCfg', 3)
    syncDict = {}
    for npcID in syncNPCIDList:
        refreshTime = GetDogzNPCRefreshTime(curTime, npcID)
        syncDict[npcID] = refreshTime
    msgStr = str([playerid, syncDict])
        gameWorldMgr = GameWorld.GetGameWorld()
        lastRefreshTime = gameWorldMgr.GetGameWorldDictByKey(Map_Dogzfb_LastRefreshTime % npcID)
        nextNeedTime = gameWorldMgr.GetGameWorldDictByKey(Map_Dogzfb_NextNeedTime % npcID)
        syncDict[npcID] = [lastRefreshTime, nextNeedTime]
    msgStr = str(syncDict)
    GameWorld.GetPlayerManager().GameServer_QueryPlayerResult(0, 0, 0, 'DogzNPCTime', msgStr, len(msgStr))
    return