| | |
| | | return
|
| | | GameWorld.DebugLog("轮回殿活动重置! actNum=%s,cfgID=%s,actID=%s,playerActID=%s,state=%s"
|
| | | % (actNum, cfgID, actID, playerActID, state), playerID)
|
| | | |
| | | OnGiveUngetAward(curPlayer, actNum)
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_ActLunhuidianID % actNum, actID)
|
| | |
|
| | | if state:
|
| | |
| | | ctgIDDict = ipyData.GetRoundCTGIDInfo()
|
| | | shopTypeDict = ipyData.GetRoundShopTypeInfo()
|
| | | resetCTGIDList, resetShopTypeList = [], []
|
| | | for roundType in roundSetDict.keys():
|
| | | for roundType, roundSet in roundSetDict.items():
|
| | | SaveActRoundSet(curPlayer, actNum, roundType, roundSet)
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_ActLunhuidianValue % (actNum, roundType), 0)
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_ActLunhuidianRound % (actNum, roundType), 1) # 从第1轮开始
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_ActLunhuidianAward % (actNum, roundType), 0)
|
| | |
| | |
|
| | | return True
|
| | |
|
| | | def SaveActRoundSet(curPlayer, actNum, roundType, roundSet):
|
| | | ## 保存参与的活动轮回设定,用于活动结束邮件补发奖励
|
| | | # 单次actNum活动最多支持同时开x个轮回类型,一般同个时间的轮回活动最多同时开2个或3个最多了
|
| | | for num in range(20):
|
| | | if curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_ActLunhuidianSet % (actNum, num)):
|
| | | continue
|
| | | roundMax = GetRoundSetValue(roundSet, RoundSetIndex_RoundMax)
|
| | | setValue = roundType * 100 + roundMax
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_ActLunhuidianSet % (actNum, num), setValue)
|
| | | GameWorld.DebugLog(" 保存轮回殿参与值! actNum=%s,roundType=%s,roundMax=%s,setValue=%s" |
| | | % (actNum, roundType, roundMax, setValue), curPlayer.GetPlayerID())
|
| | | break
|
| | | return
|
| | |
|
| | | def OnGiveUngetAward(curPlayer, actNum):
|
| | | ## 补发未领取奖励
|
| | | for num in range(20):
|
| | | setValue = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_ActLunhuidianSet % (actNum, num))
|
| | | if not setValue:
|
| | | continue
|
| | | __DoGiveUngetAwardByMail(curPlayer, actNum, setValue)
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_ActLunhuidianSet % (actNum, num), 0) |
| | | return
|
| | |
|
| | | def __DoGiveUngetAwardByMail(curPlayer, actNum, setValue):
|
| | | playerID = curPlayer.GetPlayerID()
|
| | | roundType = setValue / 100
|
| | | roundMax = setValue % 100
|
| | | curRound = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_ActLunhuidianRound % (actNum, roundType))
|
| | | curValue = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_ActLunhuidianValue % (actNum, roundType))
|
| | | awardState = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_ActLunhuidianAward % (actNum, roundType))
|
| | | awardIpyDataList = IpyGameDataPY.GetIpyGameDataList("ActLunhuidianAward", roundType)
|
| | | if not awardIpyDataList:
|
| | | return
|
| | | |
| | | mailItemList = []
|
| | | doRound = curRound
|
| | | doValue = curValue
|
| | | doAwardState = awardState
|
| | | while doValue > 0 and doRound <= roundMax:
|
| | | GameWorld.DebugLog("处理补发轮回奖励: doRound=%s,doValue=%s,doAwardState=%s" % (doRound, doValue, doAwardState), playerID)
|
| | | roundValueMax = 0
|
| | | for awardIpyData in awardIpyDataList:
|
| | | needV = awardIpyData.GetNeedValue()
|
| | | aIndex = awardIpyData.GetAwardIndex()
|
| | | awardItemList = awardIpyData.GetAwardItemList()
|
| | | roundValueMax = max(roundValueMax, needV)
|
| | | if doAwardState&pow(2, aIndex):
|
| | | GameWorld.DebugLog(" 已领取该奖励: doRound=%s,aIndex=%s,needV=%s" % (doRound, aIndex, needV), playerID)
|
| | | continue
|
| | | if doValue < needV:
|
| | | GameWorld.DebugLog(" 所需值不达标: doRound=%s,aIndex=%s,needV=%s > %s" % (doRound, aIndex, needV, doValue), playerID)
|
| | | continue
|
| | | mailItemList += awardItemList
|
| | | GameWorld.DebugLog(" 未领取补发奖: doRound=%s,aIndex=%s,needV=%s,%s" % (doRound, aIndex, needV, awardItemList), playerID)
|
| | | |
| | | doRound += 1
|
| | | doValue -= roundValueMax
|
| | | doAwardState = 0
|
| | | |
| | | if not mailItemList:
|
| | | return
|
| | | GameWorld.Log("处理补发轮回奖励完毕: actNum=%s,roundType=%s,roundMax=%s,curRound=%s,curValue=%s,awardState=%s,mailItemList=%s" |
| | | % (actNum, roundType, roundMax, curRound, curValue, awardState, mailItemList), playerID)
|
| | | PlayerControl.SendMailByKey("LunhuidianUnget", [playerID], mailItemList)
|
| | | return
|
| | |
|
| | | def GetRoundSetValue(roundSet, setIndex): return roundSet[setIndex] if len(roundSet) > setIndex else 0
|
| | |
|
| | | def AddLunhuidianValue(curPlayer, awardType, awardTypeValue, addValue):
|