| | |
| | | delCostItemCount = costItemNeedCount - lackCount
|
| | | lackCountCostMoney = 0
|
| | | if lackCount > 0:
|
| | | lackCountCostMoney = ItemCommon.GetAutoBuyItemNeedGold({costItemID:lackCount})
|
| | | costGoldList = setIpyData.GetCostMoneyList() # 消耗货币列表
|
| | | costGoldType = setIpyData.GetCostMoneyType() # 消耗货币类型
|
| | | if not costGoldType or not costGoldList or treasureIndex >= len(costGoldList) or not costGoldList[treasureIndex]:
|
| | | GameWorld.ErrLog("寻宝道具不足,该寻宝类型不支持消耗货币寻宝! treasureType=%s,treasureIndex=%s" % (treasureType, treasureIndex), playerID)
|
| | | return
|
| | | costGold = costGoldList[treasureIndex]
|
| | | perItemGold = int(costGold / costItemNeedCount) # 道具单价
|
| | | lackCountCostMoney = perItemGold * lackCount
|
| | | GameWorld.DebugLog("寻宝道具不足,使用对应货币扣除: costItemID=%s,perItemGold=%s,lackCount=%s,lackCountCostMoney=%s,costGoldType=%s" |
| | | % (costItemID, perItemGold, lackCount, lackCountCostMoney, costGoldType), playerID)
|
| | | if lackCountCostMoney:
|
| | | moneyType = IPY_GameWorld.TYPE_Price_Gold_Paper
|
| | | moneyType = costGoldType
|
| | | infoDict = {ChConfig.Def_Cost_Reason_SonKey:costItemID}
|
| | | if not PlayerControl.HaveMoney(curPlayer, moneyType, lackCountCostMoney):
|
| | | return
|