| | |
| | | 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)
|
| | |
| | | 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)
|
| | |
|
| | |
| | | #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):
|