| | |
| | | return hasEnough, itemIndexList, findItemIsBind, needCnt
|
| | |
|
| | |
|
| | | def GetPackItemBindStateIndexInfo(curPlayer, itemID):
|
| | | def GetPackItemBindStateIndexInfo(curPlayer, itemID, needCount=0):
|
| | | ''' 获取背包消耗道具绑定及未绑定索引情况
|
| | | @param needCount: 所需个数, 默认绑定优先,当找到已经足够的个数后不再遍历,减少无用遍历
|
| | | @return: 可消耗物品列表[[绑定物品索引], [不绑定物品索引]], 绑定个数, 未绑定个数
|
| | | '''
|
| | | consumeItemIndexList = [[], []] # 可消耗物品列表[[绑定物品索引], [不绑定物品索引]]
|
| | |
| | | if curItem.GetIsBind():
|
| | | consumeItemIndexList[0].append(i)
|
| | | bindCnt += itemCount
|
| | | if needCount > 0 and bindCnt >= needCount:
|
| | | break
|
| | | else:
|
| | | consumeItemIndexList[1].append(i)
|
| | | unBindCnt += itemCount
|
| | |
| | |
|
| | | def GetShopItemPrice(itemID, priceType):
|
| | | ''' 获取商城物品对应价格 '''
|
| | | ipyData = IpyGameDataPY.GetIpyGameDataByCondition("Store", {"ItemID":itemID, "MoneyType":priceType}, isLogNone=False)
|
| | | # 系统固定商店类型: 仙玉(2-常用道具,3-成长变强),绑玉(4-绑玉商城)
|
| | | priceTypeShopTypeDict = {IPY_GameWorld.TYPE_Price_Gold_Money:[2, 3],
|
| | | IPY_GameWorld.TYPE_Price_Gold_Paper:[4],
|
| | | }
|
| | | ipyData = None
|
| | | if priceType in priceTypeShopTypeDict:
|
| | | for shopType in priceTypeShopTypeDict[priceType]:
|
| | | ipyData = IpyGameDataPY.GetIpyGameDataByCondition("Store", {"ShopType":shopType, "ItemID":itemID, "MoneyType":priceType}, isLogNone=False)
|
| | | if ipyData:
|
| | | break
|
| | | else:
|
| | | ipyData = IpyGameDataPY.GetIpyGameDataByCondition("Store", {"ItemID":itemID, "MoneyType":priceType}, isLogNone=False)
|
| | | if not ipyData:
|
| | | return 0
|
| | | return ipyData.GetMoneyNum()
|