| | |
| | | import PyGameData
|
| | | import GameFuncComm
|
| | | import EventShell
|
| | | import PlayerPet
|
| | |
|
| | | #关联类型
|
| | | (
|
| | |
| | | __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 DoAddActivityByLV(curPlayer, befLV, aftLV):
|
| | | ##升级增加活跃点
|
| | | perLVAddPoint = IpyGameDataPY.GetFuncCfg('ImmortalDomainActivePoint', 3)
|
| | | skillTypeID, perAddLV, addPoint, maxPoint = IpyGameDataPY.GetFuncEvalCfg('ImmortalDomainActivePoint', 4)
|
| | | learnSkillList, passiveSkillList = PlayerPet.GetPetLearnSkill(curPlayer)
|
| | | addValue = (aftLV-befLV)*perLVAddPoint
|
| | | if skillTypeID in passiveSkillList:
|
| | | for lv in xrange(befLV+1, aftLV+1):
|
| | | addValue += min(((lv-1)/perAddLV+1) * addPoint, maxPoint)
|
| | | DoAddActivity(curPlayer, addValue, False, True)
|
| | | return
|
| | |
|
| | | def AddActivityByLVOnLearnSkill(curPlayer, skillID):
|
| | | ## 获得技能时,处理增加升级获得活跃点效果
|
| | | skillTypeID, perAddLV, addPoint, maxPoint = IpyGameDataPY.GetFuncEvalCfg('ImmortalDomainActivePoint', 4)
|
| | | if skillID != skillTypeID:
|
| | | return
|
| | | curLV = curPlayer.GetLV()
|
| | | addValue = 0
|
| | | for lv in xrange(2, curLV+1):
|
| | | addValue += min(((lv-1)/perAddLV+1) * addPoint, maxPoint)
|
| | | DoAddActivity(curPlayer, addValue, False, True)
|
| | | return
|
| | |
|
| | | def DoAddActivity(curPlayer, addValue, isMultiple=False, isLVUp=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, isLVUp)
|
| | | 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 #倍数、额外可获得修行点上限
|
| | |
| | | return multiple, extraPointLimit
|
| | | return actRealmPointIpyData.GetMultiple(), actRealmPointIpyData.GetPointLimit()
|
| | |
|
| | | def AddCanCostActivityPoint(curPlayer, addValue, isLVUp):
|
| | | # 增加可消耗的活跃点
|
| | | curPoint = __GetPDictValue(curPlayer, ChConfig.Def_PDict_ActivityCanCostTotalPoint)
|
| | | if isLVUp:
|
| | | updPoint = min(ChConfig.Def_UpperLimit_DWord, curPoint + addValue)
|
| | | else:
|
| | | updPoint = min(IpyGameDataPY.GetFuncCfg('ImmortalDomainActivePoint'), curPoint + addValue)
|
| | | __SetPDictValue(curPlayer, ChConfig.Def_PDict_ActivityCanCostTotalPoint, updPoint)
|
| | | 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
|
| | |
| | | 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
|
| | |
| | | dailyQuestData = IpyGameDataPY.GetIpyGameDataNotLog('DailyQuest', activityNum)
|
| | | unLimitCnt = dailyQuestData and not dailyQuestData.GetTotalActiveValue()
|
| | | funcID = dailyQuestData.GetUnLockFuncID() if dailyQuestData else 0
|
| | | if funcID and not GameFuncComm.GetFuncCanUse(curPlayer, funcID):
|
| | | #封魔坛活跃不判断功能开启 特殊处理
|
| | | if funcID and dailyID != ShareDefine.DailyActionID_SealDemon and not GameFuncComm.GetFuncCanUse(curPlayer, funcID) :
|
| | | return
|
| | |
|
| | | updDayTimes = 0
|