hxp
2025-08-25 ab6c66e52962aa5d62244a6e7d8515a784861e99
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/FBCommon.py
@@ -33,7 +33,6 @@
import PlayerSuccess
import GameFuncComm
import PyGameData
import PlayerVip
import GameObj
import FBLogic
import ChConfig
@@ -169,20 +168,14 @@
    passLineID = 0
    if mapID == ChConfig.Def_FBMapID_Main:
        return PlayerControl.IsMainLevelPass(curPlayer, lineID)
    if mapID == ChConfig.Def_FBMapID_RealmTower:
        passLineID = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_RealmTowerFloor)
    elif mapID == ChConfig.Def_FBMapID_SkyTower:
        passLineID = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_SkyTowerFloor)
    elif mapID == ChConfig.Def_FBMapID_TrialTower:
        passLineID = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_TrialTower_PassLV)
    ipyData = IpyGameDataPY.GetIpyGameDataNotLog('FBGeneralTrain', mapID, lineID)
    if ipyData:
        passLineID = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_FBPassLineID % mapID)
    else:
        ipyData = IpyGameDataPY.GetIpyGameDataNotLog('FBGeneralTrain', mapID, lineID)
        if ipyData:
            passLineID = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_FBPassLineID % mapID)
        else:
            grade = GameWorld.GetDictValueByBit(curPlayer, ChConfig.Def_Player_Dict_PlayerFBStar_MapId, lineID, False, [mapID])
            if grade:
                return True
        grade = GameWorld.GetDictValueByBit(curPlayer, ChConfig.Def_Player_Dict_PlayerFBStar_MapId, lineID, False, [mapID])
        if grade:
            return True
            
    if passLineID >= lineID:
        return True
@@ -250,13 +243,6 @@
    if not maxTimes:
        return True, ""
    
    # 首次进入免费
    if mapID in [ChConfig.Def_FBMapID_PersonalBoss]:
        curfbStar = GameWorld.GetDictValueByBit(curPlayer, ChConfig.Def_Player_Dict_PlayerFBStar_MapId, lineID, False, [mapID])
        if not curfbStar:
            GameWorld.DebugLog("OnEnterFBEvent 首次进入该副本线路免费!mapID=%s,lineID=%s" % (mapID, lineID))
            return True, ""
    #playerID = curPlayer.GetPlayerID()
    enterCnt = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_EnterFbCntDay % mapID)
    maxCnt = GetEnterFBMaxCnt(curPlayer, mapID)
@@ -408,17 +394,6 @@
    gameFB.SetGameFBDict(ChConfig.Def_FB_NPCStrengthenMaxLV, maxLV)
    GameWorld.Log("NPC成长动态等级变更: isLeave=%s,totalLV=%s,playerCnt=%s,averageLV=%s,maxLV=%s" 
                  % (isLeave, totalLV, playerCnt, averageLV, maxLV), playerID)
    # 上古战场特殊处理
    if mapID == ChConfig.Def_FBMapID_ElderBattlefield:
        lineID = GameWorld.GetGameWorld().GetPropertyID() - 1
        fbLineIpyData = GetFBLineIpyData(mapID, lineID)
        lvLimitMin = 0 if not fbLineIpyData else fbLineIpyData.GetLVLimitMin()
        robotLVDiff = IpyGameDataPY.GetFuncCfg("ElderBattlefieldCfg", 5)
        robotLVMin, robotLVMax = averageLV - robotLVDiff, averageLV
        robotLVMin = max(lvLimitMin, robotLVMin)
        gameFB.SetGameFBDict(ChConfig.Def_FB_NPCStrengthenMaxLV, robotLVMax)
        gameFB.SetGameFBDict(ChConfig.Def_FB_NPCStrengthenMinLV, robotLVMin)
        GameWorld.Log("    更新上古机器人等级范围: lineID=%s,robotLVDiff=%s,robotLV=(%s~%s)" % (lineID, robotLVDiff, robotLVMin, robotLVMax))
    return True
def UpdFBLineNPCStrengthenPlayerCnt(playerID, isLeave):
@@ -1608,7 +1583,7 @@
    
    mwAddCnt = 0#wmpIpyData.GetEffectValue() if wmpIpyData else 0
    extraTimesVIPPriID = fbIpyData.GetExtraTimesVIPPriID()
    extraCnt = PlayerVip.GetPrivilegeValue(curPlayer, extraTimesVIPPriID)
    extraCnt = 0
    buyCnt = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_BuyFbCntDay % mapID)
    recoverFbCnt = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_RecoverFbCnt % mapID)
    itemAddCnt = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_ItemAddFbCnt % mapID)
@@ -1632,7 +1607,7 @@
    mwAddCnt = 0#wmpIpyData.GetEffectValue() if wmpIpyData else 0
    maxTimes += mwAddCnt #法宝增加的次数加到基础次数里
    extraTimesVIPPriID = fbIpyData.GetExtraTimesVIPPriID()
    extraCnt = PlayerVip.GetPrivilegeValue(curPlayer, extraTimesVIPPriID)
    extraCnt = 0
    buyCnt = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_BuyFbCntDay % mapID)
    recoverFbCnt = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_RecoverFbCnt % mapID)
    itemAddCnt = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_ItemAddFbCnt % mapID)
@@ -1649,7 +1624,7 @@
    #未买次数
    buyTimesVIPPriID = fbIpyData.GetBuyTimesVIPPriID()
    canBuyCnt = PlayerVip.GetPrivilegeValue(curPlayer, buyTimesVIPPriID)
    canBuyCnt = 0
    noBuyCnt = max(0, canBuyCnt - buyCnt)
    return [[rCommonCnt, rRegainFbCnt, rExtraCnt, rBuyCnt, rItemAddCnt, noBuyCnt], [maxTimes, maxRegainFbCnt, extraCnt, canBuyCnt, 10000, canBuyCnt]]
@@ -1881,13 +1856,6 @@
        ipyData = ipyDataMgr.GetFBFuncByIndex(i)
        mapID = ipyData.GetDataMapID()
        
        # 有真实助战次数奖励限制的
        if ipyData.GetDayHelpCountMax():
            helpCount = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_FBRealHelpCount % mapID)
            if helpCount:
                PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_FBRealHelpCount % mapID, 0)
                GameWorld.DebugLog("重置日助战奖励次数限制!mapID=%s" % mapID)
        dayTimes = ipyData.GetDayTimes()
        # 没有日次数限制的不处理
        if not dayTimes and not ipyData.GetBuyTimesVIPPriID() and not ipyData.GetExtraTimesVIPPriID() and not ipyData.GetExtraTimesMWPriID():
@@ -1931,14 +1899,7 @@
        
        GameWorld.DebugLog("    重置:mapID=%s,dayTimes=%s,buyCnt=%s,recoverCnt=%s,itemAddCnt=%s,regainFBCnt=%s,maxCnt=%s,enterCnt=%s" 
                           % (mapID, dayTimes, buyCnt, recoverCnt, itemAddCnt, regainFBCnt, maxCnt, enterCnt))
        if mapID == ChConfig.Def_FBMapID_ZhuXianBoss:
            if GameFuncComm.GetFuncCanUse(curPlayer, ShareDefine.GameFuncID_ZhuXianBoss):
                curCnt = min(maxCnt - enterCnt + IpyGameDataPY.GetFuncCfg('ZhuXianBossCntCfg'), IpyGameDataPY.GetFuncCfg('ZhuXianBossCntCfg', 2))
                if curCnt > dayTimes:
                    PlayerControl.NomalDictSetProperty(curPlayer, itemAddCntKey, curCnt - dayTimes)
                elif curCnt < dayTimes:
                    PlayerControl.NomalDictSetProperty(curPlayer, enterCntKey, dayTimes - curCnt)
        mapIDInfo.append(mapID)
        
    if mapIDInfo:
@@ -1997,9 +1958,6 @@
    if not ipyData:
        return
    canBuyCnt = 0
    buyTimesVIPPriID = ipyData.GetBuyTimesVIPPriID()
    if buyTimesVIPPriID:
        canBuyCnt += PlayerVip.GetPrivilegeValue(curPlayer, buyTimesVIPPriID)
    canBuyCnt += PlayerGoldInvest.GetAddFBBuyCnt(curPlayer, mapID)
    GameWorld.DebugLog("购买副本进入次数: mapID=%s,canBuyCnt=%s" % (mapID, canBuyCnt))
    if canBuyCnt <= 0:
@@ -2013,11 +1971,9 @@
    if mapID == ChConfig.Def_FBMapID_SealDemon and maxDayTimes and maxCnt - enterCnt >= maxDayTimes:
        GameWorld.DebugLog('当前次数已满,无需购买。。')
        return
    if mapID == ChConfig.Def_FBMapID_ZhuXianBoss and maxCnt - enterCnt >= IpyGameDataPY.GetFuncCfg('ZhuXianBossCntCfg', 2):
        return
    
    if hasBuyCnt >= canBuyCnt:
        GameWorld.DebugLog("购买次数已经用完mapID=%s,buyTimesVIPPriID=%s,hasBuyCnt=%s >= canBuyCnt=%s" % (mapID, buyTimesVIPPriID, hasBuyCnt, canBuyCnt))
        GameWorld.DebugLog("购买次数已经用完mapID=%s,hasBuyCnt=%s >= canBuyCnt=%s" % (mapID, hasBuyCnt, canBuyCnt))
        return
    costGoldDict = IpyGameDataPY.GetFuncEvalCfg('BuyFBCntCost', 1, {})
    costGold = costGoldDict.get(str(mapID), '0')
@@ -2189,11 +2145,7 @@
        return
    
    encourageCost = eval(ipyData.GetMoneyCount())
    if curMapID == ChConfig.Def_FBMapID_SealDemon:
        isDouble = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_FMTDouble)
        if isDouble: #封魔坛双倍挑战则鼓舞双倍花费
            encourageCost *= 2
    costMoneyList = PlayerControl.HaveMoneyEx(curPlayer, encourageType, encourageCost)
    if not costMoneyList:
        return
@@ -2653,14 +2605,6 @@
            totalZhenQi = gameWorld.GetGameWorldDictByKey(ChConfig.Map_Player_AreaReward_GetZhenQiTotal%playerID)
            totalZhenQi += addZhenQi
            gameWorld.SetGameWorldDict(ChConfig.Map_Player_AreaReward_GetZhenQiTotal%playerID, totalZhenQi)
        if "TechPoint" in rewardFormatDict:
            addTechPoint = eval(rewardFormatDict["TechPoint"])
            PlayerFamily.AddPlayerFamilyActiveValue(curPlayer, addTechPoint, True, ShareDefine.Def_AddFAVReason_FamilyInvade, True)
            techPoint = gameWorld.GetGameWorldDictByKey(ChConfig.Map_Player_AreaReward_GetTechPoint%playerID)
            techPoint += addTechPoint
            gameWorld.SetGameWorldDict(ChConfig.Map_Player_AreaReward_GetTechPoint%playerID, techPoint)
            
        #GameWorld.DebugLog("    战场福利 倍区=%s,reLV=%s,reExp=%s,addExp=%s,addZQ=%s,totalExp=%s,totalZQ=%s" 
        #                   % (multiple, reLV, reExp, addExp, addZhenQi, totalExp, totalZhenQi), playerID)