4697 【主干】活跃修炼修为收益显示错误(修复活跃修炼经验计算错误bug)
1个文件已修改
23 ■■■■■ 已修改文件
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerActivity.py 23 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerActivity.py
@@ -760,11 +760,19 @@
    expSeconds = IpyGameDataPY.GetFuncCfg("ActivityPlaceExp", 1) # 活跃放置获得经验多少秒一次
    passTime = curTime - startTime
    
    endCount = passTime / needSeconds
    endCount = min(endCount, remainCount)
    expCount = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_ActivityPlaceExpCount)
    canGetExpCount = passTime / expSeconds
    maxExpCount = needSeconds / expSeconds
    addExpCount = min(maxExpCount, canGetExpCount - expCount)
    maxExpCount = needSeconds / expSeconds # 单次放置最多可获得经验次数
    # 由于结算时重置了开启下次的时间及经验次数,所以如果有需要结算,则溢出时间不计,放置多算经验次数
    if endCount >= 1:
        maxExpCount *= endCount
    canGetExpCount = min(maxExpCount, passTime / expSeconds)
    addExpCount = canGetExpCount - expCount
    if addExpCount > 0:
        #GameWorld.DebugLog("活跃放置定时处理 : curTime=%s,startTime=%s,passTime=%s,endCount=%s,expCount=%s,canGetExpCount=%s,maxExpCount=%s,addExpCount=%s"
        #                   % (curTime, startTime, passTime, endCount, expCount, canGetExpCount, maxExpCount, addExpCount))
        PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_ActivityPlaceExpCount, expCount + addExpCount)
        lv = curPlayer.GetLV()
        reExp = PlayerControl.GetPlayerReExp(curPlayer)
@@ -776,7 +784,7 @@
                break
        if not expLV:
            expLV, expFormat = lvFormatList[-1]
        addExp = eval(FormulaControl.GetCompileFormula("ActivityPlaceExp_%s" % expLV, expFormat)) * expSeconds
        addExp = eval(FormulaControl.GetCompileFormula("ActivityPlaceExp_%s" % expLV, expFormat)) * expSeconds * addExpCount
        playerControl = PlayerControl.PlayerControl(curPlayer)
        addExp = playerControl.AddExp(addExp, ShareDefine.Def_ViewExpType_Activity)
        
@@ -789,11 +797,8 @@
        #GameWorld.DebugLog("passTime=%s,canGetExpCount=%s,expCount=%s,addExpCount=%s,addExp=%s,todayTotalExp=%s" 
        #                   % (passTime, canGetExpCount, expCount, addExpCount, addExp, todayTotalExp))
        
    if passTime < needSeconds:
        #GameWorld.DebugLog("探索时间未到,不结算! curTime=%s,startTime=%s,passTime=%s < %s" % (curTime, startTime, passTime, needSeconds))
        return
    endCount = passTime / needSeconds
    __DoActivityPlaceRewardEnd(curPlayer, endCount)
    if endCount > 0:
        __DoActivityPlaceRewardEnd(curPlayer, endCount)
    return
def __DoActivityPlaceRewardEnd(curPlayer, endCount, isQuick=False):