| | |
| | | __CalcAwardStage(curPlayer)
|
| | |
|
| | | SyncDailyActivityInfo(curPlayer)
|
| | | |
| | | # 记录昨日活跃吸纳经验
|
| | | todayExp = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_ActivityPlaceTodayExp)
|
| | | todayExpPoint = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_ActivityPlaceTodayExpPoint)
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_ActivityPlaceTodayExp, 0)
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_ActivityPlaceTodayExpPoint, 0)
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_ActivityPlaceYestorDayExp, todayExp)
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_ActivityPlaceYestorDayExpPoint, todayExpPoint)
|
| | | #活跃放置
|
| | | Sync_ActivityPlaceInfo(curPlayer)
|
| | | |
| | | else:
|
| | | SendDayActionMail(curPlayer)
|
| | |
|
| | |
| | | curTotalPoint = __GetPDictValue(curPlayer, ChConfig.Def_PDict_Activity_TotalPoint)
|
| | | __SetPDictValue(curPlayer, ChConfig.Def_PDict_Activity_TotalPoint, curTotalPoint + addValue)
|
| | | __AddCanCostActivityPoint(curPlayer, addValue, isLVUp)
|
| | | |
| | | PlayerControl.NotifyCode(curPlayer, "GetActivity", [addValue])
|
| | | SyncDailyActivityInfo(curPlayer)
|
| | | EventShell.EventRespons_AddActivityValue(curPlayer)
|
| | | GameWorld.DebugLog("增加活跃度,addValue=%s,multiple=%s,addExtraPoint=%s,isLVUp=%s"
|
| | |
| | |
|
| | | ################################## 活跃放置 ##############################################
|
| | |
|
| | | #// B0 29 活跃放置明细查询 #tagCMActivityPlaceQuery
|
| | | #
|
| | | #struct tagCMActivityPlaceQuery
|
| | | #{
|
| | | # tagHead Head;
|
| | | #};
|
| | | def OnActivityPlaceQuery(index, clientData, tick):
|
| | | curPlayer = GameWorld.GetPlayerManager().GetPlayerByIndex(index)
|
| | | Sync_ActivityPlaceInfo(curPlayer)
|
| | | return
|
| | |
|
| | | #// B0 27 活跃放置启动 #tagCMActivityPlaceStart
|
| | | #
|
| | | #struct tagCMActivityPlaceStart
|
| | |
| | | if not remainCount:
|
| | | curTime = int(time.time())
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_ActivityPlaceStartTime, curTime)
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_ActivityPlaceExpCount, 0)
|
| | | GameWorld.DebugLog(" 没有剩余次数,更新启动时间: %s" % curTime)
|
| | |
|
| | | Sync_ActivityPlaceInfo(curPlayer)
|
| | |
| | | # BYTE FinishCount; //完成次数
|
| | | #};
|
| | | def OnActivityPlaceQuickFinish(index, clientData, tick):
|
| | | ## 经验改为实时获取,暂屏蔽快速完成
|
| | | return
|
| | | curPlayer = GameWorld.GetPlayerManager().GetPlayerByIndex(index)
|
| | | finishCount = clientData.FinishCount
|
| | | remainCount = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_ActivityPlaceRemainCount)
|
| | |
| | | if not startTime:
|
| | | startTime = curTime
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_ActivityPlaceStartTime, curTime)
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_ActivityPlaceExpCount, 0)
|
| | |
|
| | | needSeconds = IpyGameDataPY.GetFuncCfg("ActivityPlace", 3) # 单次放置奖励持续时间,秒
|
| | | expSeconds = IpyGameDataPY.GetFuncCfg("ActivityPlaceExp", 1) # 活跃放置获得经验多少秒一次
|
| | | passTime = curTime - startTime
|
| | | |
| | | expCount = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_ActivityPlaceExpCount)
|
| | | canGetExpCount = passTime / expSeconds
|
| | | maxExpCount = needSeconds / expSeconds
|
| | | addExpCount = min(maxExpCount, canGetExpCount - expCount)
|
| | | if addExpCount > 0:
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_ActivityPlaceExpCount, expCount + addExpCount)
|
| | | lv = curPlayer.GetLV()
|
| | | reExp = PlayerControl.GetPlayerReExp(curPlayer)
|
| | | addExp = eval(IpyGameDataPY.GetFuncCompileCfg("ActivityPlaceExp", 2)) * addExpCount # 获得经验公式,参数 lv, reExp
|
| | | playerControl = PlayerControl.PlayerControl(curPlayer)
|
| | | addExp = playerControl.AddExp(addExp, ShareDefine.Def_ViewExpType_Activity)
|
| | | |
| | | todayExp = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_ActivityPlaceTodayExp)
|
| | | todayExpPoint = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_ActivityPlaceTodayExpPoint)
|
| | | todayTotalExp = todayExpPoint * ChConfig.Def_PerPointValue + todayExp + addExp
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_ActivityPlaceTodayExp, todayTotalExp % ChConfig.Def_PerPointValue)
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_ActivityPlaceTodayExpPoint, todayTotalExp / ChConfig.Def_PerPointValue)
|
| | | |
| | | #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
|
| | | nextStartReduceSeconds = passTime % needSeconds
|
| | | __DoActivityPlaceRewardEnd(curPlayer, endCount, nextStartReduceSeconds)
|
| | | __DoActivityPlaceRewardEnd(curPlayer, endCount)
|
| | | return
|
| | |
|
| | | def __DoActivityPlaceRewardEnd(curPlayer, endCount, nextStartReduceSeconds=0, isQuick=False):
|
| | | def __DoActivityPlaceRewardEnd(curPlayer, endCount, isQuick=False):
|
| | | ## 放置活跃奖励结算
|
| | |
|
| | | remainCount = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_ActivityPlaceRemainCount)
|
| | | endCount = min(endCount, remainCount)
|
| | | if endCount <= 0:
|
| | | return
|
| | | |
| | | if PlayerTJG.GetIsTJG(curPlayer):
|
| | | return
|
| | |
|
| | | countDataDict = {}
|
| | |
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_ActivityPlaceRewardTotalCount, rewardTotalCount)
|
| | |
|
| | | if remainCount > 0:
|
| | | nextStartTime = int(time.time()) - nextStartReduceSeconds
|
| | | nextStartTime = int(time.time())
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_ActivityPlaceStartTime, nextStartTime)
|
| | | GameWorld.DebugLog(" 还有剩余次数,更新启动时间: %s, nextStartReduceSeconds=%s" % (nextStartTime, nextStartReduceSeconds))
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_ActivityPlaceExpCount, 0)
|
| | | GameWorld.DebugLog(" 还有剩余次数,更新启动时间: %s" % (nextStartTime))
|
| | |
|
| | | # 存储奖励
|
| | | rewardItemCount = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_ActivityPlaceRewardItem)
|
| | |
| | | placeInfo.RewardCount = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_ActivityPlaceRewardCount)
|
| | | placeInfo.RewardInfo = str(rewardItemInfo)
|
| | | placeInfo.RewardLen = len(placeInfo.RewardInfo)
|
| | | placeInfo.TodayExp = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_ActivityPlaceTodayExp)
|
| | | placeInfo.TodayExpPoint = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_ActivityPlaceTodayExpPoint)
|
| | | placeInfo.YestordayExp = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_ActivityPlaceYestorDayExp)
|
| | | placeInfo.YestordayExpPoint = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_ActivityPlaceYestorDayExpPoint)
|
| | | NetPackCommon.SendFakePack(curPlayer, placeInfo)
|
| | | return
|
| | |
|