| | |
| | | if wishPubFreeCntDict:
|
| | | outTotal = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_TreasureWishLibOut % (treasureType, libID))
|
| | | freeCnt = wishPubFreeCntDict.get(libIDStr, 0)
|
| | | canFreeOut = freeCnt - outTotal
|
| | | if canFreeOut > 0:
|
| | | canFreeOutWishLibDict[libID] = canFreeOut
|
| | | canFreeOutPub = freeCnt - outTotal
|
| | | if canFreeOutPub > 0:
|
| | | canFreeOutWishLibDict[libID] = canFreeOutPub
|
| | |
|
| | | for wishIndex in range(selectCnt):
|
| | | wishID = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_TreasureWishSelect % (treasureType, libIDStr, wishIndex))
|
| | |
| | | # 非心愿物品
|
| | | continue
|
| | |
|
| | | # 公共次数
|
| | | if wishPubFreeCntDict:
|
| | | useWishItemState = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_TreasureWishUseItem % (treasureType, libID))
|
| | | if not useWishItemState:
|
| | | # 未启用该库心愿视为未选择
|
| | | continue
|
| | | if libID not in selectWishIDDict:
|
| | | selectWishIDDict[libID] = []
|
| | | selectWishIDList = selectWishIDDict[libID]
|
| | | selectWishIDList.append(wishID)
|
| | | |
| | | # 公共次数
|
| | | if wishPubFreeCntDict:
|
| | | pass
|
| | |
|
| | | # 独立次数
|
| | | else:
|
| | | if libID not in selectWishIDDict:
|
| | | selectWishIDDict[libID] = []
|
| | | selectWishIDList = selectWishIDDict[libID]
|
| | | selectWishIDList.append(wishID)
|
| | | |
| | | outCntLimit = libItemIpyData.GetWishOutCnt()
|
| | | outCnt = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_TreasureWishOut % (treasureType, wishID))
|
| | | canFreeOut = outCntLimit - outCnt
|
| | |
| | | canFreeOutWishIDict[wishID] = canFreeOut
|
| | |
|
| | | if wishLibSelect:
|
| | | GameWorld.DebugLog("本次可优先产出的心愿库物品: %s, 免费次数:%s" % (selectWishIDDict, canFreeOutWishLibDict), playerID)
|
| | | GameWorld.DebugLog("当前心愿库选择的心愿ID列表: %s" % selectWishIDDict, playerID)
|
| | | GameWorld.DebugLog("还可优先产出的心愿免费次数:%s" % canFreeOutWishLibDict, playerID)
|
| | |
|
| | | # 单抽产出优先级: 幸运物品 > 必出 > 保底 > 普通
|
| | | # 连抽没有优先级限制,只要满足条件即可产出
|
| | |
| | |
|
| | | gridNum = GameWorld.GetResultByRandomList(curRateList)
|
| | | if gridNum in luckyGridNumList and gridNum in getGridResult:
|
| | | GameWorld.DebugLog(" 幸运物品已经出过,不再重复产出! gridNum=%s in %s" % (gridNum, getGridResult))
|
| | | GameWorld.DebugLog(" 幸运物品已经出过,不再重复产出重新随机! gridNum=%s in %s" % (gridNum, getGridResult), playerID)
|
| | | continue
|
| | |
|
| | | # 心愿库物品,检查心愿预产出
|
| | |
| | | wishLibID = gridLibInfoDict[gridNumStr]
|
| | | if wishPubFreeCntDict:
|
| | | # 公共心愿默认均可正常产出,只是处理是否优先产出心愿
|
| | | __prePubWishOut(curPlayer, treasureType, gridNum, wishLibID, selectWishIDDict, wishPubFreeCntDict, |
| | | __prePubWishOut(curPlayer, treasureType, gridNum, wishLibID, selectWishIDDict, |
| | | preOutWishDict, canFreeOutWishLibDict, wishPubCardDict, wishCardItemLibDict)
|
| | | #else:
|
| | | # # 非公共的暂不支持,后续有需要再处理
|
| | |
| | | Sync_TreasureInfo(curPlayer, [treasureType])
|
| | | return
|
| | |
|
| | | def __prePubWishOut(curPlayer, treasureType, gridNum, wishLibID, selectWishIDDict, wishPubFreeCntDict, preOutWishDict, |
| | | def __prePubWishOut(curPlayer, treasureType, gridNum, wishLibID, selectWishIDDict, preOutWishDict, |
| | | canFreeOutWishLibDict, wishPubCardDict, wishCardItemLibDict):
|
| | | ## 公共心愿产出预处理
|
| | |
|