| | |
| | | return
|
| | |
|
| | | showType = chestsIpyData.GetShowType() # 规定有开箱表现的默认只能开启1个
|
| | | if showType:
|
| | | useCnt = 1
|
| | | |
| | | #if showType:
|
| | | # useCnt = 1
|
| | | useCnt = min(curRoleItem.GetCount(), useCnt)
|
| | | |
| | | isBind = int(chestsIpyData.GetIsBind()) # 奖励物品是否绑定
|
| | | costItemID = chestsIpyData.GetCostItemID()
|
| | | costItemCountTotal = chestsIpyData.GetCostItemCount() * useCnt
|
| | |
| | | if not itemData:
|
| | | GameWorld.ErrLog("宝箱奖励物品不存在! chestsItemID=%s,itemID=%s,jobItemID=%s" % (chestsItemID, itemID, jobItemID))
|
| | | return
|
| | | packType = ChConfig.GetItemPackType(itemData.GetType())
|
| | | packType = ChConfig.GetItemPackType(itemData)
|
| | | needSpace = int(math.ceil(itemCount / float(itemData.GetPackCount())))
|
| | | needSpaceDict[packType] = needSpaceDict.get(packType, 0) + needSpace
|
| | |
|
| | |
| | | # 多条产出记录的,按等级来
|
| | | lvIpyDataList = []
|
| | | for ipyData in awardIpyDataList:
|
| | | lvIpyDataList.append([ipyData.GetAwardLV(), ipyData])
|
| | | lvIpyDataList.append([ipyData.GetRealmLV(), ipyData.GetAwardLV(), ipyData])
|
| | | lvIpyDataList.sort() # 升序排序
|
| | |
|
| | | curLV = curPlayer.GetLV()
|
| | | minLV = lvIpyDataList[0][0]
|
| | | curRealmLV = curPlayer.GetOfficialRank()
|
| | | minRealmLV, minLV = lvIpyDataList[0][0], lvIpyDataList[0][1]
|
| | | if curLV < minLV:
|
| | | GameWorld.ErrLog("当前等级无法开启该宝箱!curLV=%s,minLV=%s,chestsItemID=%s" % (curLV, minLV, chestsItemID), curPlayer.GetPlayerID())
|
| | | GameWorld.ErrLog("当前等级无法开启该宝箱!curLV=%s < minLV=%s,chestsItemID=%s" % (curLV, minLV, chestsItemID), curPlayer.GetPlayerID())
|
| | | return
|
| | | if curRealmLV < minRealmLV:
|
| | | GameWorld.ErrLog("当前境界无法开启该宝箱!curRealmLV=%s < minRealmLV=%s,chestsItemID=%s" % (curRealmLV, minRealmLV, chestsItemID), curPlayer.GetPlayerID())
|
| | | return
|
| | |
|
| | | for i, lvIpyInfo in enumerate(lvIpyDataList[1:], 1):
|
| | | awardLV, ipyData = lvIpyInfo
|
| | | if curLV < awardLV:
|
| | | awardLV, ipyData = lvIpyDataList[i - 1]
|
| | | return ipyData
|
| | | realmLV, awardLV, ipyData = lvIpyInfo
|
| | | if realmLV: # 境界优先,二选一
|
| | | if curRealmLV < realmLV:
|
| | | return lvIpyDataList[i - 1][-1]
|
| | | else:
|
| | | if curLV < awardLV:
|
| | | return lvIpyDataList[i - 1][-1]
|
| | | return awardIpyDataList[-1]
|
| | |
|