| | |
| | | import PyGameData
|
| | | import GameFuncComm
|
| | |
|
| | |
|
| | | #关联类型
|
| | | (
|
| | | RelatedType_1, # 1关联日常活动表
|
| | | RelatedType_2, # 2关联副本总表
|
| | | RelatedType_1, # 1关联日常活动表
|
| | | RelatedType_2, # 2关联副本总表
|
| | | ) = range(1, 3)
|
| | |
|
| | |
|
| | |
|
| | | def OnWeek(curPlayer, onWeekType):
|
| | |
| | | # 重置类型不同的不处理
|
| | | if ipyData.GetWeekResetType() != onWeekType:
|
| | | continue
|
| | | key = ChConfig.Def_PDict_DailyActionWeekTimes%ipyData.GetDailyID()
|
| | | key = ChConfig.Def_PDict_DailyActionWeekTimes % ipyData.GetDailyID()
|
| | | __SetPDictValue(curPlayer, key, 0)
|
| | |
|
| | | actionIDInfo.append(ipyData.GetDailyID())
|
| | |
| | | if onEventType == ShareDefine.Def_OnEventTypeEx:
|
| | | # 重置完成次数
|
| | | for i in xrange(ipyDataMgr.GetDailyQuestCount()):
|
| | | key = ChConfig.Def_PDict_Activity_FinishCnt % (i+1)
|
| | | curPBCnt = __GetPDictValue(curPlayer, key) #单次进度值
|
| | | ipyData = ipyDataMgr.GetDailyQuestByIndex(i)
|
| | | |
| | | key = ChConfig.Def_PDict_Activity_FinishCnt % ipyData.GetID()
|
| | | curPBCnt = __GetPDictValue(curPlayer, key) #单次进度值
|
| | | if curPBCnt:
|
| | | __SetPDictValue(curPlayer, key, 0)
|
| | | #总活跃度重置
|
| | | __SetPDictValue(curPlayer, ChConfig.Def_PDict_Activity_TotalPoint, 0)
|
| | | # 重置领奖记录
|
| | | __SetPDictValue(curPlayer, ChConfig.Def_PDict_ActivityAwardRecord, 0)
|
| | | #重置额外获得修行点数
|
| | | __SetPDictValue(curPlayer, ChConfig.Def_PDict_Activity_ExtraRealmPoint, 0)
|
| | | #重新计算奖励阶段
|
| | | __CalcAwardStage(curPlayer)
|
| | | #重置可领取修行点,未领取的发邮件
|
| | | realmPoint = __GetPDictValue(curPlayer, ChConfig.Def_PDict_Activity_RealmPoint)
|
| | | if realmPoint and GameFuncComm.GetFuncCanUse(curPlayer, ShareDefine.GameFuncID_Official):
|
| | | if GameFuncComm.GetFuncCanUse(curPlayer, ShareDefine.GameFuncID_DailyQuest):
|
| | | PlayerControl.SendMailByKey('XXDForgetToPick', [curPlayer.GetID()], [(ChConfig.Def_ItemID_RealmPoint, realmPoint, 1)], [realmPoint])
|
| | | __SetPDictValue(curPlayer, ChConfig.Def_PDict_Activity_RealmPoint, 0)
|
| | | # realmPoint = __GetPDictValue(curPlayer, ChConfig.Def_PDict_Activity_RealmPoint)
|
| | | # if realmPoint and GameFuncComm.GetFuncCanUse(curPlayer, ShareDefine.GameFuncID_Official):
|
| | | # if GameFuncComm.GetFuncCanUse(curPlayer, ShareDefine.GameFuncID_DailyQuest):
|
| | | # PlayerControl.SendMailByKey('XXDForgetToPick', [curPlayer.GetID()], [(ChConfig.Def_ItemID_RealmPoint, realmPoint, 1)], [realmPoint])
|
| | | # __SetPDictValue(curPlayer, ChConfig.Def_PDict_Activity_RealmPoint, 0)
|
| | |
|
| | | SyncDailyActivityInfo(curPlayer)
|
| | | else:
|
| | |
| | | actionIDInfo = []
|
| | | for i in xrange(ipyDataMgr.GetDailyActionCount()):
|
| | | ipyData = ipyDataMgr.GetDailyActionByIndex(i)
|
| | | dayTimesLimit = GetMaxDayTimes(ipyData)#ipyData.GetDayTimes()
|
| | | dayTimesLimit = GetMaxDayTimes(ipyData) #ipyData.GetDayTimes()
|
| | | if not dayTimesLimit:
|
| | | continue
|
| | | # 重置类型不同的不处理
|
| | | if ipyData.GetDayResetType() != onEventType:
|
| | | continue
|
| | | key = ChConfig.Def_PDict_DailyActionDayTimes%ipyData.GetDailyID()
|
| | | __SetPDictValue(curPlayer, key, 0)
|
| | | dailyID = ipyData.GetDailyID()
|
| | | __SetPDictValue(curPlayer, ChConfig.Def_PDict_DailyActionDayTimes % dailyID, 0)
|
| | | __SetPDictValue(curPlayer, ChConfig.Def_PDict_DailyActionDayBuyTimes % dailyID, 0)
|
| | | __SetPDictValue(curPlayer, ChConfig.Def_PDict_DailyActionDayItemTimes % dailyID, 0)
|
| | | |
| | | actionIDInfo.append(ipyData.GetDailyID())
|
| | | if actionIDInfo:
|
| | | SyncDailyActionInfo(curPlayer, actionIDInfo)
|
| | | return
|
| | |
|
| | |
|
| | | def SendDayActionMail(curPlayer):
|
| | | ##发送每日活动邮件
|
| | | if curPlayer.GetLV()>= IpyGameDataPY.GetFuncCfg('DailyQuestMailLvLimit'):
|
| | | if curPlayer.GetLV() >= IpyGameDataPY.GetFuncCfg('DailyQuestMailLvLimit'):
|
| | | PlayerControl.SendMailByKey('TodayDailyTask', [curPlayer.GetID()], [])
|
| | | return
|
| | |
|
| | |
|
| | | #重新计算奖励阶段
|
| | | def __CalcAwardStage(curPlayer):
|
| | | realmLV= curPlayer.GetOfficialRank()
|
| | | realmLV = curPlayer.GetOfficialRank()
|
| | | ipyData = IpyGameDataPY.IPY_Data().GetDailyLivenessRewardByIndex(0)
|
| | | if not ipyData:
|
| | | return
|
| | | stageLVList = ipyData.GetStageLV()
|
| | | curStage = 0
|
| | | for i, lv in enumerate(stageLVList):
|
| | | if realmLV <lv:
|
| | | if realmLV < lv:
|
| | | break
|
| | | if realmLV >= lv:
|
| | | curStage = i
|
| | | __SetPDictValue(curPlayer, ChConfig.Def_PDict_Activity_AwardStage, curStage)
|
| | | GameWorld.DebugLog(' 重新计算活跃奖励阶段 curStage=%s,realmLV=%s'%(curStage, realmLV))
|
| | | GameWorld.DebugLog(' 重新计算活跃奖励阶段 curStage=%s,realmLV=%s' % (curStage, realmLV))
|
| | | return
|
| | |
|
| | |
|
| | | ## OnLogin
|
| | | # @param curPlayer 玩家实例
|
| | |
| | | # @return
|
| | | def __GetPDictValue(curPlayer, key, defaultValue=0):
|
| | | return curPlayer.NomalDictGetProperty(key, defaultValue)
|
| | |
|
| | |
|
| | | ## 设置活跃度玩家数据库字典信息值
|
| | | # @param curPlayer 玩家实例
|
| | |
| | | return
|
| | |
|
| | |
|
| | |
|
| | | ## 摸NPC获得活跃度
|
| | | # @param atkObj
|
| | | # @param curNPC
|
| | |
| | |
|
| | | return
|
| | |
|
| | |
|
| | | ## 增加完成活跃度次数
|
| | | # @param curPlayer 玩家实例
|
| | | # @param activityNum 活跃度编号
|
| | |
| | | onceActivityTime = dailyQuestData.GetOnceActivityTime()
|
| | | if not onceActivity:
|
| | | return
|
| | | if maxActiveValue and finishCnt > maxActiveValue/onceActivity*onceActivityTime:
|
| | | if maxActiveValue and finishCnt > maxActiveValue / onceActivity * onceActivityTime:
|
| | | #GameWorld.DebugLog("活跃度可完成次数已达到上限,activityNum=%s" % (activityNum))
|
| | | return
|
| | |
|
| | | key = ChConfig.Def_PDict_Activity_FinishCnt % activityNum
|
| | | curPBCnt = __GetPDictValue(curPlayer, key) #单次进度值
|
| | | curPBCnt = __GetPDictValue(curPlayer, key) #单次进度值
|
| | |
|
| | | addValue = (addCnt+curPBCnt)/onceActivityTime * onceActivity #增加的活跃度
|
| | | addPbCnt = (addCnt+curPBCnt) % onceActivityTime
|
| | | addValue = (addCnt + curPBCnt) / onceActivityTime * onceActivity #增加的活跃度
|
| | | addPbCnt = (addCnt + curPBCnt) % onceActivityTime
|
| | |
|
| | | __SetPDictValue(curPlayer, key, addPbCnt)
|
| | |
|
| | | #curTotalPoint = __GetPDictValue(curPlayer, ChConfig.Def_PDict_Activity_TotalPoint)
|
| | | #
|
| | | multiple = 1
|
| | | if addValue:
|
| | | #__SetPDictValue(curPlayer, ChConfig.Def_PDict_Activity_TotalPoint, nuwTotalPoint)
|
| | | actRealmPointInfo = PyGameData.g_operationActionDict.get(ShareDefine.OperationActionName_RealmPoint, {})# 多倍修行点活动
|
| | | if actRealmPointInfo.get(ShareDefine.ActKey_State) \
|
| | | and curPlayer.GetLV() >= actRealmPointInfo.get(ShareDefine.ActKey_LVLimit, 0):
|
| | | multiple = actRealmPointInfo.get(ShareDefine.ActKey_RealmPointMulti, 1)
|
| | | addValue *= multiple
|
| | | |
| | | realmPoint = __GetPDictValue(curPlayer, ChConfig.Def_PDict_Activity_RealmPoint)
|
| | | __SetPDictValue(curPlayer, ChConfig.Def_PDict_Activity_RealmPoint, realmPoint+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" |
| | | % (activityNum, addPbCnt, addValue, multiple), curPlayer.GetPlayerID())
|
| | | GameWorld.DebugLog("增加活跃度任务次数,activityNum=%s,addPbCnt=%s,addValue=%s, multiple=%s, addExtraPoint=%s,curExtraPoint=%s" |
| | | % (activityNum, addPbCnt, addValue, multiple, addExtraPoint, curExtraPoint), curPlayer.GetPlayerID())
|
| | | return
|
| | |
|
| | |
|
| | | def __GetActionAddPer(curPlayer):
|
| | | multiple, extraPointLimit = 1, 0 #倍数、额外可获得修行点上限
|
| | | actRealmPointInfo = PyGameData.g_operationActionDict.get(ShareDefine.OperationActionName_RealmPoint, {}) # 多倍修行点活动
|
| | | if not actRealmPointInfo:
|
| | | return multiple, extraPointLimit
|
| | | if not actRealmPointInfo.get(ShareDefine.ActKey_State):
|
| | | return multiple, extraPointLimit
|
| | | actRealmPointIpyData = IpyGameDataPY.GetIpyGameData("ActRealmPoint", actRealmPointInfo.get(ShareDefine.ActKey_CfgID, 0))
|
| | | if not actRealmPointIpyData:
|
| | | return multiple, extraPointLimit
|
| | | if curPlayer.GetLV() < actRealmPointIpyData.GetLVLimit():
|
| | | return multiple, extraPointLimit
|
| | | return actRealmPointIpyData.GetMultiple(), actRealmPointIpyData.GetPointLimit()
|
| | |
|
| | |
|
| | | ## 同步活跃度信息
|
| | |
| | | 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.ExtraPoint = __GetPDictValue(curPlayer, ChConfig.Def_PDict_Activity_ExtraRealmPoint)
|
| | | NetPackCommon.SendFakePack(curPlayer, sendPack)
|
| | | return
|
| | |
|
| | |
|
| | |
|
| | | ## 领取活跃度奖励
|
| | |
| | | itemIDList = ipyData.GetItemID()
|
| | | itemCntList = ipyData.GetItemCount()
|
| | | itemIsBindList = ipyData.GetItemBind()
|
| | | if awardStage >=len(itemIDList) or awardStage >= len(itemCntList) or awardStage >= len(itemIsBindList):
|
| | | if awardStage >= len(itemIDList) or awardStage >= len(itemCntList) or awardStage >= len(itemIsBindList):
|
| | | return
|
| | |
|
| | | itemID = itemIDList[awardStage]
|
| | |
| | | return
|
| | |
|
| | | # 给物品
|
| | | ItemControler.GivePlayerItem(curPlayer, itemID, itemCnt, isBind, [IPY_GameWorld.rptItem], True)
|
| | | ItemControler.GivePlayerItem(curPlayer, itemID, itemCnt, 0, [IPY_GameWorld.rptItem])
|
| | |
|
| | | # 更新已领取成功标记
|
| | | updAwardRecord = getAwardRecord | (1 << awardIndex)
|
| | |
| | | SyncDailyActivityInfo(curPlayer)
|
| | | GameWorld.DebugLog("领取活跃度奖励OK!awardStage=%s, index=%s,needActivity=%s,totalActivity=%s,awardRecord=%s"
|
| | | % (awardStage, awardIndex, needActivity, totalActivity, updAwardRecord))
|
| | |
|
| | | |
| | |
|
| | | return
|
| | |
|
| | |
|
| | | def GetRealmPointAward(curPlayer):
|
| | | #领取活跃修行点
|
| | |
| | | SyncDailyActivityInfo(curPlayer)
|
| | | return
|
| | |
|
| | |
|
| | | def GetActivityNum(relatedType, relatedID):
|
| | | ## 获取日常任务ID(活跃ID)
|
| | | ipyData = IpyGameDataPY.GetIpyGameDataByCondition('DailyQuest', {"RelatedID":relatedID,"RelatedType":relatedType}, False, False)
|
| | | ipyData = IpyGameDataPY.GetIpyGameDataByCondition('DailyQuest', {"RelatedID":relatedID, "RelatedType":relatedType}, False, False)
|
| | | if not ipyData:
|
| | | return 0
|
| | | return ipyData.GetID()
|
| | |
|
| | | #########################################日常活动###########################################
|
| | |
|
| | |
|
| | | def AddDailyActionFinishCnt(curPlayer, dailyID, addCnt=1):
|
| | | ##增加日常活动完成次数
|
| | |
| | | # return
|
| | |
|
| | | # 由GameServer决定
|
| | | if not GameWorld.GetGameWorld().GetGameWorldDictByKey(ShareDefine.Def_Notify_WorldKey_DailyActionState % dailyID):
|
| | | GameWorld.DebugLog("日常活动未开启!dailyID=%s" % dailyID)
|
| | | return
|
| | | # 目前跨服PK暂不需要判断,因为跨服PK次数结算在本服,玩家可能上次未结算离线,等非匹配期间上线,也需要加上,所以暂不判断
|
| | | if dailyID not in [ShareDefine.DailyActionID_CrossReamPK]:
|
| | | if not GameWorld.GetGameWorld().GetGameWorldDictByKey(ShareDefine.Def_Notify_WorldKey_DailyActionState % dailyID):
|
| | | GameWorld.DebugLog("日常活动未开启!dailyID=%s" % dailyID)
|
| | | return
|
| | |
|
| | | dayTimesLimit = GetMaxDayTimes(ipyData)#ipyData.GetDayTimes()
|
| | | dayTimesLimit = GetMaxDayTimes(ipyData) #ipyData.GetDayTimes()
|
| | | weekTimesLimit = ipyData.GetWeekTimes()
|
| | | if not dayTimesLimit and not weekTimesLimit:
|
| | | return
|
| | |
| | | activityNum = GetActivityNum(RelatedType_1, dailyID)
|
| | | 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):
|
| | | return
|
| | |
|
| | | updDayTimes = 0
|
| | | if dayTimesLimit:
|
| | | key = ChConfig.Def_PDict_DailyActionDayTimes%dailyID
|
| | | key = ChConfig.Def_PDict_DailyActionDayTimes % dailyID
|
| | | curDayTimes = curPlayer.NomalDictGetProperty(key)
|
| | | if not unLimitCnt and curDayTimes >= dayTimesLimit:
|
| | | curDayBuyTimes = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_DailyActionDayBuyTimes % dailyID)
|
| | | curDayItemTimes = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_DailyActionDayItemTimes % dailyID)
|
| | | if not unLimitCnt and curDayTimes >= dayTimesLimit + curDayBuyTimes + curDayItemTimes:
|
| | | return
|
| | | updDayTimes = curDayTimes+addCnt if unLimitCnt else min(dayTimesLimit, curDayTimes+addCnt)
|
| | | updDayTimes = curDayTimes + addCnt if unLimitCnt else min(dayTimesLimit + curDayBuyTimes + curDayItemTimes, curDayTimes + addCnt)
|
| | | addCnt = updDayTimes - curDayTimes
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, key, updDayTimes)
|
| | | GameWorld.DebugLog('增加日常活动完成次数 dailyID=%s, curDayTimes=%s, updDayTimes=%s'%(dailyID, curDayTimes, updDayTimes))
|
| | | |
| | | GameWorld.DebugLog('增加日常活动完成次数 dailyID=%s, curDayTimes=%s, updDayTimes=%s' % (dailyID, curDayTimes, updDayTimes))
|
| | | updWeekTimes = 0
|
| | | if weekTimesLimit:
|
| | | key = ChConfig.Def_PDict_DailyActionWeekTimes%dailyID
|
| | | key = ChConfig.Def_PDict_DailyActionWeekTimes % dailyID
|
| | | curWeekTimes = curPlayer.NomalDictGetProperty(key)
|
| | | if not unLimitCnt and curWeekTimes >= weekTimesLimit:
|
| | | return
|
| | | updWeekTimes = curWeekTimes+addCnt if unLimitCnt else min(weekTimesLimit, curWeekTimes+addCnt)
|
| | | updWeekTimes = curWeekTimes + addCnt if unLimitCnt else min(weekTimesLimit, curWeekTimes + addCnt)
|
| | | addCnt = updWeekTimes - curWeekTimes
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, key, updWeekTimes)
|
| | | GameWorld.DebugLog('增加日常活动完成次数 dailyID=%s, curWeekTimes=%s, updWeekTimes=%s'%(dailyID, curWeekTimes, updWeekTimes))
|
| | | GameWorld.DebugLog('增加日常活动完成次数 dailyID=%s, curWeekTimes=%s, updWeekTimes=%s' % (dailyID, curWeekTimes, updWeekTimes))
|
| | |
|
| | | SyncDailyActionInfo(curPlayer, [dailyID])
|
| | |
|
| | | #对应的日常任务表ID
|
| | | updTimes = updDayTimes or updWeekTimes
|
| | | if updTimes and dailyQuestData:
|
| | | if addCnt and updTimes and dailyQuestData:
|
| | | AddActivityFinishCnt(curPlayer, activityNum, updTimes, addCnt)
|
| | | return True
|
| | |
|
| | |
|
| | | def GetDailyActionFinishCnt(curPlayer, dailyID):
|
| | | key = ChConfig.Def_PDict_DailyActionDayTimes%dailyID
|
| | | key = ChConfig.Def_PDict_DailyActionDayTimes % dailyID
|
| | | curDayTimes = __GetPDictValue(curPlayer, key)
|
| | | ipyData = IpyGameDataPY.GetIpyGameData('DailyAction', dailyID)
|
| | | if not ipyData:
|
| | | return 0, 0
|
| | | dayTimesLimit = GetMaxDayTimes(ipyData)#ipyData.GetDayTimes()
|
| | | dayTimesLimit = GetMaxDayTimes(ipyData) #ipyData.GetDayTimes()
|
| | | return curDayTimes, dayTimesLimit
|
| | |
|
| | | def GetDailyActionrRemainCnt(curPlayer, dailyID):
|
| | | ##获取活动剩余次数
|
| | | curDayTimes = __GetPDictValue(curPlayer, ChConfig.Def_PDict_DailyActionDayTimes % dailyID)
|
| | | curDayBuyTimes = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_DailyActionDayBuyTimes % dailyID)
|
| | | curDayItemTimes = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_DailyActionDayItemTimes % dailyID)
|
| | | ipyData = IpyGameDataPY.GetIpyGameData('DailyAction', dailyID)
|
| | | dayTimesLimit = GetMaxDayTimes(ipyData)
|
| | | return max(0, dayTimesLimit+curDayBuyTimes+curDayItemTimes-curDayTimes)
|
| | |
|
| | | def GetMaxDayTimes(ipyData):
|
| | | dayTimesLimit = ipyData.GetDayTimes()
|
| | |
| | | dayTimesLimit += IpyGameDataPY.GetFuncCfg('RuneTowerSweepBuy')
|
| | | return dayTimesLimit
|
| | |
|
| | |
|
| | | #// A5 25 购买日常活动次数 #tagCMBuyDailyActionCnt
|
| | | #
|
| | | #struct tagCMBuyDailyActionCnt
|
| | | #{
|
| | | # tagHead Head;
|
| | | # DWORD ActionID; // ID
|
| | | # BYTE AddType; // 0-花仙玉 1-用物品
|
| | | #};
|
| | | def OnDailyActionBuyCnt(index, clientData, tick):
|
| | | curPlayer = GameWorld.GetPlayerManager().GetPlayerByIndex(index)
|
| | | dailyID = clientData.ActionID
|
| | | addType = clientData.AddType #0花仙玉 1使用物品
|
| | | ipyData = IpyGameDataPY.GetIpyGameData('DailyAction', dailyID)
|
| | | if not ipyData:
|
| | | return
|
| | | curDayTimes = __GetPDictValue(curPlayer, ChConfig.Def_PDict_DailyActionDayTimes % dailyID)
|
| | | curDayBuyTimes = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_DailyActionDayBuyTimes % dailyID)
|
| | | curDayItemTimes = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_DailyActionDayItemTimes % dailyID)
|
| | | if curDayBuyTimes + curDayItemTimes - curDayTimes >= 0:
|
| | | GameWorld.DebugLog('剩余次数已达上限,不可增加!')
|
| | | return
|
| | | |
| | | if addType == 0:
|
| | | dayBuyTimesLimit = ipyData.GetDayBuyTimes()
|
| | | buyNeedMoney = ipyData.GetBuyNeedMoney()
|
| | | if not dayBuyTimesLimit or not buyNeedMoney:
|
| | | return
|
| | | if curDayBuyTimes >= dayBuyTimesLimit:
|
| | | GameWorld.DebugLog('今日购买次数已达上限,不可增加!')
|
| | | return
|
| | | if not PlayerControl.PayMoney(curPlayer, IPY_GameWorld.TYPE_Price_Gold_Money, buyNeedMoney, ChConfig.Def_Cost_BuyDailyActionCnt, {'dailyID':dailyID, 'curDayBuyTimes':curDayBuyTimes}):
|
| | | return
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_DailyActionDayBuyTimes % dailyID, curDayBuyTimes + 1)
|
| | | |
| | | elif addType == 1:
|
| | | dayItemAddTimesLimit = ipyData.GetDayItemAddTimes()
|
| | | dayItemID = ipyData.GetDayItemID()
|
| | | if not dayItemAddTimesLimit or not dayItemID:
|
| | | return
|
| | | if curDayItemTimes >= dayItemAddTimesLimit:
|
| | | GameWorld.DebugLog('今日使用物品增加次数已达上限,不可增加!')
|
| | | return
|
| | | itemPack = curPlayer.GetItemManager().GetPack(IPY_GameWorld.rptItem)
|
| | | enough, indexList, hasBind, lackCnt = ItemCommon.GetItem_FromPack_ByID_ExEx(dayItemID, itemPack, 1)
|
| | | if not enough:
|
| | | return
|
| | | ItemCommon.ReduceItem(curPlayer, itemPack, indexList, 1, False, "DailyActionCnt")
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_DailyActionDayItemTimes % dailyID, curDayItemTimes + 1)
|
| | |
|
| | | else:
|
| | | return
|
| | | SyncDailyActionInfo(curPlayer, [dailyID])
|
| | | return
|
| | |
|
| | |
|
| | | ## 同步活跃度信息
|
| | | # @param curPlayer
|
| | | # @param syncNum 默认-1时全部同步
|
| | | # @return None
|
| | | def SyncDailyActionInfo(curPlayer, syncNumList= []):
|
| | | def SyncDailyActionInfo(curPlayer, syncNumList=[]):
|
| | | sendPack = ChPyNetSendPack.tagMCDailyActionCnt()
|
| | | sendPack.Clear()
|
| | | sendPack.ActionInfo = []
|
| | |
| | | activityInfo.Clear()
|
| | | activityInfo.ActionID = activityNum
|
| | | activityInfo.DayFinishCnt = __GetPDictValue(curPlayer, ChConfig.Def_PDict_DailyActionDayTimes % activityNum)
|
| | | activityInfo.DayBuyTimes = __GetPDictValue(curPlayer, ChConfig.Def_PDict_DailyActionDayBuyTimes % activityNum)
|
| | | activityInfo.DayItemTimes = __GetPDictValue(curPlayer, ChConfig.Def_PDict_DailyActionDayItemTimes % activityNum)
|
| | | activityInfo.WeekFinishCnt = __GetPDictValue(curPlayer, ChConfig.Def_PDict_DailyActionWeekTimes % activityNum)
|
| | | sendPack.ActionInfo.append(activityInfo)
|
| | |
|
| | | sendPack.Count = len(sendPack.ActionInfo)
|
| | | NetPackCommon.SendFakePack(curPlayer, sendPack)
|
| | | return
|
| | |
|
| | |
|
| | | ##################################副本类增加活跃##########################################
|
| | | ## 参加副本获得活跃度
|
| | |
| | | activityNum = GetActivityNum(RelatedType_2, mapID)
|
| | | if activityNum:
|
| | | AddActivityFinishCnt(curPlayer, activityNum, curDayTimes, addCount)
|
| | | return |
| | | return
|