From 033a680f4c973fbac074a95152c6d313d4a71091 Mon Sep 17 00:00:00 2001 From: hxp <ale99527@vip.qq.com> Date: 星期三, 12 六月 2019 17:12:39 +0800 Subject: [PATCH] 7220 【后端】【2.0】灵器开发1.0版(增加灵器属性表,灵器战力由评分计算,评分由基础属性+灵器属性组成,原翅膀模块改为灵器模块) --- ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerActivity.py | 60 ++++++++++++++++++++++++++++++++++++++++++++---------------- 1 files changed, 44 insertions(+), 16 deletions(-) diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerActivity.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerActivity.py index 8148b50..85a2f01 100644 --- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerActivity.py +++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerActivity.py @@ -236,23 +236,35 @@ __SetPDictValue(curPlayer, key, addPbCnt) # - multiple = 1 - if addValue: - multiple, extraPointLimit = __GetActionAddPer(curPlayer) - curExtraPoint = __GetPDictValue(curPlayer, ChConfig.Def_PDict_Activity_ExtraRealmPoint) - addExtraPoint = max(0, min(addValue * (multiple - 1), extraPointLimit - curExtraPoint)) if extraPointLimit else addValue * (multiple - 1) - __SetPDictValue(curPlayer, ChConfig.Def_PDict_Activity_ExtraRealmPoint, curExtraPoint + addExtraPoint) - addValue = addValue + addExtraPoint - curTotalPoint = __GetPDictValue(curPlayer, ChConfig.Def_PDict_Activity_TotalPoint) - __SetPDictValue(curPlayer, ChConfig.Def_PDict_Activity_TotalPoint, curTotalPoint + addValue) - #realmPoint = __GetPDictValue(curPlayer, ChConfig.Def_PDict_Activity_RealmPoint) - #__SetPDictValue(curPlayer, ChConfig.Def_PDict_Activity_RealmPoint, realmPoint+addValue) - SyncDailyActivityInfo(curPlayer) - - GameWorld.DebugLog("增加活跃度任务次数,activityNum=%s,addPbCnt=%s,addValue=%s, multiple=%s, addExtraPoint=%s,curExtraPoint=%s" - % (activityNum, addPbCnt, addValue, multiple, addExtraPoint, curExtraPoint), curPlayer.GetPlayerID()) + DoAddActivity(curPlayer, addValue, True) return +def DoAddActivity(curPlayer, addValue, isMultiple=False): + if not addValue: + return + multiple = 1 + addExtraPoint = 0 + if isMultiple: + multiple, extraPointLimit = __GetActionAddPer(curPlayer) + curExtraPoint = __GetPDictValue(curPlayer, ChConfig.Def_PDict_Activity_ExtraRealmPoint) + addExtraPoint = max(0, min(addValue * (multiple - 1), + extraPointLimit - curExtraPoint)) if extraPointLimit else addValue * (multiple - 1) + __SetPDictValue(curPlayer, ChConfig.Def_PDict_Activity_ExtraRealmPoint, curExtraPoint + addExtraPoint) + addValue = addValue + addExtraPoint + curTotalPoint = __GetPDictValue(curPlayer, ChConfig.Def_PDict_Activity_TotalPoint) + __SetPDictValue(curPlayer, ChConfig.Def_PDict_Activity_TotalPoint, curTotalPoint + addValue) + AddCanCostActivityPoint(curPlayer, addValue) + historyPoint = __GetPDictValue(curPlayer, ChConfig.Def_PDict_ActivityHistoryPoint) + __SetPDictValue(curPlayer, ChConfig.Def_PDict_ActivityHistoryPoint, + min(ChConfig.Def_UpperLimit_DWord, historyPoint + addValue)) + + SyncDailyActivityInfo(curPlayer) + EventShell.EventRespons_AddActivityValue(curPlayer) + GameWorld.DebugLog( + "增加活跃度,addValue=%s, multiple=%s, addExtraPoint=%s" + % (addValue, multiple, addExtraPoint), curPlayer.GetPlayerID()) + + return def __GetActionAddPer(curPlayer): multiple, extraPointLimit = 1, 0 #倍数、额外可获得修行点上限 @@ -268,6 +280,22 @@ return multiple, extraPointLimit return actRealmPointIpyData.GetMultiple(), actRealmPointIpyData.GetPointLimit() +def AddCanCostActivityPoint(curPlayer, addValue): + # 增加可消耗的活跃点 + curPoint = __GetPDictValue(curPlayer, ChConfig.Def_PDict_ActivityCanCostTotalPoint) + __SetPDictValue(curPlayer, ChConfig.Def_PDict_ActivityCanCostTotalPoint, min(IpyGameDataPY.GetFuncCfg('ImmortalDomainActivePoint'), curPoint + addValue)) + return + +def CostActivityPoint(curPlayer, costPoint, isOnlyCheck=False): + # 消耗活跃点 + curPoint = __GetPDictValue(curPlayer, ChConfig.Def_PDict_ActivityCanCostTotalPoint) + if curPoint < costPoint: + return + if not isOnlyCheck: + __SetPDictValue(curPlayer, ChConfig.Def_PDict_ActivityCanCostTotalPoint, + curPoint - costPoint) + SyncDailyActivityInfo(curPlayer) + return True ## 同步活跃度信息 # @param curPlayer @@ -279,7 +307,7 @@ sendPack.CurValue = __GetPDictValue(curPlayer, ChConfig.Def_PDict_Activity_TotalPoint) sendPack.StageIndex = __GetPDictValue(curPlayer, ChConfig.Def_PDict_Activity_AwardStage) sendPack.AwardRecord = __GetPDictValue(curPlayer, ChConfig.Def_PDict_ActivityAwardRecord) - sendPack.RealmPoint = __GetPDictValue(curPlayer, ChConfig.Def_PDict_Activity_RealmPoint) + sendPack.RealmPoint = __GetPDictValue(curPlayer, ChConfig.Def_PDict_ActivityCanCostTotalPoint) sendPack.ExtraPoint = __GetPDictValue(curPlayer, ChConfig.Def_PDict_Activity_ExtraRealmPoint) NetPackCommon.SendFakePack(curPlayer, sendPack) return -- Gitblit v1.8.0