| | |
| | | actID = actInfo.get(ShareDefine.ActKey_ID, 0)
|
| | | state = actInfo.get(ShareDefine.ActKey_State, 0)
|
| | |
|
| | | templateID = __GetWishTemplateID()
|
| | | playerActID = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_FeastWishID) # 玩家身上的活动ID
|
| | | playerTemplateID = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_FeastWishTemplateID) # 玩家身上的模板ID
|
| | | # 活动ID 相同的话不处理
|
| | | if actID == playerActID:
|
| | | GameWorld.DebugLog("节日祝福活动ID不变,不处理!", curPlayer.GetPlayerID())
|
| | | if state:
|
| | | if templateID and templateID != playerTemplateID:
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_FeastWishTemplateID, templateID)
|
| | | return
|
| | | GameWorld.DebugLog("节日祝福活动重置! actID=%s,playerActID=%s,state=%s" % (actID, playerActID, state), playerID)
|
| | | GameWorld.DebugLog("节日祝福活动重置! actID=%s,playerActID=%s,state=%s,templateID=%s,playerTemplateID=%s" |
| | | % (actID, playerActID, state, templateID, playerTemplateID), playerID)
|
| | |
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_FeastWishID, actID)
|
| | | if not state:
|
| | | return
|
| | | |
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_FeastWishTemplateID, templateID)
|
| | | if playerTemplateID:
|
| | | __SendWishBottleItemMail(curPlayer, playerTemplateID)
|
| | | |
| | | bottleNumList = GetWishBottleNumList()
|
| | | for bottleNum in bottleNumList:
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_FeastWishBottleValue % bottleNum, 0)
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_FeastWishBottleGetState % bottleNum, 0)
|
| | |
|
| | | Sync_FeastWishActionInfo(curPlayer)
|
| | | Sync_FeastWishPlayerInfo(curPlayer)
|
| | | if state:
|
| | | Sync_FeastWishActionInfo(curPlayer)
|
| | | Sync_FeastWishPlayerInfo(curPlayer)
|
| | | return True
|
| | |
|
| | | def __SendWishBottleItemMail(curPlayer, playerTemplateID):
|
| | | # 未领取的奖励邮件发放
|
| | | |
| | | if not playerTemplateID:
|
| | | return
|
| | | |
| | | bottleIpyDataList = IpyGameDataPY.GetIpyGameDataList("ActFeastWishBottle", playerTemplateID)
|
| | | if not bottleIpyDataList:
|
| | | return
|
| | | |
| | | playerID = curPlayer.GetPlayerID()
|
| | | batchPlayerIDList, batchAddItemList, batchParamList = [], [], []
|
| | | for ipyData in bottleIpyDataList:
|
| | | bottleNum = ipyData.GetWishBottleNum()
|
| | | choosePrizeItemDict = ipyData.GetChoosePrizeItem()
|
| | | |
| | | curWishValue = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_FeastWishBottleValue % bottleNum)
|
| | | getState = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_FeastWishBottleGetState % bottleNum)
|
| | | |
| | | getIndexList = []
|
| | | for recordIndex in choosePrizeItemDict.keys():
|
| | | if getState & pow(2, recordIndex):
|
| | | getIndexList.append(recordIndex)
|
| | | |
| | | getTimes = len(getIndexList)
|
| | | maxTimes = ipyData.GetChooseTimeMax()
|
| | | if getTimes >= maxTimes:
|
| | | continue
|
| | | |
| | | needGiveTimes = min(maxTimes - getTimes, curWishValue / ipyData.GetNeedWishValue())
|
| | | if not needGiveTimes:
|
| | | continue
|
| | | |
| | | awardItemList = []
|
| | | for recordIndex, itemInfo in choosePrizeItemDict.items():
|
| | | if recordIndex in getIndexList:
|
| | | continue
|
| | | awardItemList.append(itemInfo)
|
| | | |
| | | curWishValue = curWishValue - ipyData.GetNeedWishValue()
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_FeastWishBottleValue % bottleNum, curWishValue)
|
| | | |
| | | getState = getState | pow(2, recordIndex)
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_FeastWishBottleGetState % bottleNum, getState)
|
| | | |
| | | if not awardItemList:
|
| | | continue
|
| | | |
| | | batchPlayerIDList.append([playerID])
|
| | | batchAddItemList.append(awardItemList)
|
| | | batchParamList.append([bottleNum])
|
| | | |
| | | if batchPlayerIDList:
|
| | | PlayerControl.SendMailBatch("FeastWishBottleAwardMail", batchPlayerIDList, batchAddItemList, batchParamList)
|
| | | |
| | | return
|
| | |
|
| | | #// AA 10 节日祝福瓶选择奖励物品 #tagCMFeastWishBottleChooseItem
|
| | | #
|
| | |
| | | def __GetWishTemplateID():
|
| | | actInfo = PyGameData.g_operationActionDict.get(ShareDefine.OperationActionName_FeastWish, {})
|
| | | if not actInfo:
|
| | | return
|
| | | return 0
|
| | |
|
| | | if not actInfo.get(ShareDefine.ActKey_State):
|
| | | return
|
| | | return 0
|
| | |
|
| | | cfgID = actInfo.get(ShareDefine.ActKey_CfgID)
|
| | | ipyData = IpyGameDataPY.GetIpyGameData("ActFeastWish", cfgID)
|
| | | if not ipyData:
|
| | | return
|
| | | return 0
|
| | |
|
| | | worldLV = actInfo.get(ShareDefine.ActKey_WorldLV)
|
| | | templateID = GameWorld.GetDictValueByRangeKey(ipyData.GetTemplateIDInfo(), worldLV, 0)
|