From 157a8787e84d14d3907aadb13f639964b6bd95d4 Mon Sep 17 00:00:00 2001
From: xdh <xiefantasy@qq.com>
Date: 星期二, 11 十二月 2018 10:53:03 +0800
Subject: [PATCH] 5390  【后端】【1.3】【1.3.100】神兵特效展示界面新增战力与属性展示

---
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Item/UseItem/ItemCommon.py |   18 ++++++++++++++++--
 1 files changed, 16 insertions(+), 2 deletions(-)

diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Item/UseItem/ItemCommon.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Item/UseItem/ItemCommon.py
index fb44051..5c450f6 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Item/UseItem/ItemCommon.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Item/UseItem/ItemCommon.py
@@ -1337,8 +1337,9 @@
     return hasEnough, itemIndexList, findItemIsBind, needCnt
 
 
-def GetPackItemBindStateIndexInfo(curPlayer, itemID):
+def GetPackItemBindStateIndexInfo(curPlayer, itemID, needCount=0):
     ''' 获取背包消耗道具绑定及未绑定索引情况
+    @param needCount: 所需个数, 默认绑定优先,当找到已经足够的个数后不再遍历,减少无用遍历
     @return: 可消耗物品列表[[绑定物品索引], [不绑定物品索引]], 绑定个数, 未绑定个数
     '''
     consumeItemIndexList = [[], []] # 可消耗物品列表[[绑定物品索引], [不绑定物品索引]]
@@ -1359,6 +1360,8 @@
         if curItem.GetIsBind():
             consumeItemIndexList[0].append(i)
             bindCnt += itemCount
+            if needCount > 0 and bindCnt >= needCount:
+                break
         else:
             consumeItemIndexList[1].append(i)
             unBindCnt += itemCount
@@ -1513,7 +1516,18 @@
 
 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()

--
Gitblit v1.8.0