| | |
| | | ItemControler.RecycleItem(curPlayer, costItemID, recycleItemMail)
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_TreasureFreeCount % (treasureType), 0)
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_TreasureCount % (treasureType), 0)
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_TreasureCountEx % (treasureType), 0)
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_TreasureCountToday % (treasureType), 0)
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_TreasureLuck % (treasureType), 0)
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_TreasureCntAward % (treasureType), 0)
|
| | |
| | | gridNumCountInfo[int(gridNumStr)] = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_TreasureGridCnt % (treasureType, gridNumStr))
|
| | | GameWorld.DebugLog("gridNumMaxLimitInfo=%s,gridNumCountInfo=%s" % (gridNumMaxLimitInfo, gridNumCountInfo), playerID)
|
| | |
|
| | | treasureCountEx = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_TreasureCountEx % (treasureType)) # 当前第x次单抽、x抽
|
| | | curIndexCount, maxIndexCount = 0, 0
|
| | | beSureCountByIndexDict = {}
|
| | | beSureCountByIndexList = ipyData.GetGridItemRateList4() # 第x次x抽必出,最多支持定制到9次
|
| | | if beSureCountByIndexList and treasureIndex < len(beSureCountByIndexList):
|
| | | beSureCountByIndexDict = beSureCountByIndexList[treasureIndex]
|
| | | maxIndexCount = min(9, max(beSureCountByIndexDict))
|
| | | curIndexCount = GameWorld.GetDataByDigitPlace(treasureCountEx, treasureIndex) + 1
|
| | | rateByIndexCount = 0 # 第x次x抽必出可产出个数
|
| | | rateByIndexCountList = []
|
| | | if curIndexCount <= maxIndexCount and curIndexCount in beSureCountByIndexDict:
|
| | | rateByIndexCountList = [[10000, beSureCountByIndexDict[curIndexCount]]]
|
| | | rateByIndexCount = 1 # 可扩展支持产出多个,暂定单次抽奖仅定制产出1个
|
| | | |
| | | # 单抽产出优先级: 幸运物品 > 必出 > 保底 > 普通
|
| | | # 连抽没有优先级限制,只要满足条件即可产出
|
| | | getGridResult = []
|
| | |
| | | if not curRateList and ensureCount and updTreasureCount % ensureCount == 0 and ensureRateList:
|
| | | curRateList = GetRemoveLimitGridRateList(ensureRateList, gridNumCountInfo, gridNumMaxLimitInfo)
|
| | | GameWorld.DebugLog(" 【满%s次数必出饼图】: %s" % (ensureCount, curRateList), playerID)
|
| | | |
| | | # 第x次x抽必出,优先级较低
|
| | | if not curRateList and rateByIndexCountList and rateByIndexCount > 0:
|
| | | rateByIndexCount -= 1
|
| | | curRateList = rateByIndexCountList
|
| | | GameWorld.DebugLog(" 【第x次x抽必出】: treasureIndex=%s,curIndexCount=%s,rateByIndexCount=%s,%s" |
| | | % (treasureIndex, curIndexCount, rateByIndexCount, rateByIndexCountList), playerID)
|
| | |
|
| | | doCount = 0
|
| | | while doCount <= 50: # 限制最大次数
|
| | |
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_TreasureLuck % (treasureType), updLuck)
|
| | | for gridNum, updCount in gridNumCountInfo.items():
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_TreasureGridCnt % (treasureType, gridNum), updCount)
|
| | | if curIndexCount <= maxIndexCount:
|
| | | treasureCountEx = GameWorld.ChangeDataByDigitPlace(treasureCountEx, treasureIndex, curIndexCount)
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_TreasureCountEx % (treasureType), treasureCountEx)
|
| | | GameWorld.DebugLog("更新第x次x抽次数: treasureIndex=%s,curIndexCount=%s,maxIndexCount=%s,treasureCountEx=%s" % (treasureIndex, curIndexCount, maxIndexCount, treasureCountEx))
|
| | |
|
| | | addScoreType = setIpyData.GetAwardMoneyType() # 额外奖励货币类型
|
| | | addScore = setIpyData.GetAwardMoneyValue() # 单次奖励货币数
|
| | |
| | | if mailItemList:
|
| | | PlayerControl.SendMailByKey("HappyXBUnEnough", [playerID], mailItemList)
|
| | |
|
| | | GameWorld.DebugLog("寻宝成功: treasureType=%s,updTreasureCount=%s(%s),updLuck=%s,addScoreType=%s,addScore=%s,gridNumCountInfo=%s" |
| | | % (treasureType, updTreasureCount, updTreasureCountToday, updLuck, addScoreType, addScore, gridNumCountInfo), playerID)
|
| | | GameWorld.DebugLog("寻宝成功: treasureType=%s,updTreasureCount=%s(%s),updLuck=%s,addScoreType=%s,addScore=%s,gridNumCountInfo=%s,treasureCountEx=%s" |
| | | % (treasureType, updTreasureCount, updTreasureCountToday, updLuck, addScoreType, addScore, gridNumCountInfo, treasureCountEx), playerID)
|
| | | GameWorld.DebugLog(" treasureResult=%s" % (treasureResult), playerID)
|
| | | GameWorld.DebugLog(" mailItemList=%s" % (mailItemList), playerID)
|
| | |
|