| | |
| | | if itemEff.GetEffectID() == ChConfig.Def_Effect_GubaoPiece:
|
| | | gubaoID = itemEff.GetEffectValue(0)
|
| | | if gubaoID:
|
| | | PlayerGubao.AddGubaoPiece(curPlayer, gubaoID, tagItem.GetCount(), itemID)
|
| | | PlayerGubao.AddGubaoPiece(curPlayer, gubaoID, tagItemCount, itemID)
|
| | | tagItem.Clear()
|
| | | return True
|
| | | #直升VIP
|
| | |
| | | GameWorld.Log("找不到ItemID = %d" % curItemID)
|
| | | return False, 0
|
| | |
|
| | | if curItemID in ChConfig.Def_TransformItemIDList or curItemData.GetType() == ChConfig.Def_ItemType_AutoUseMoney:
|
| | | if IsPutinAutoTransformItem(curItemData):
|
| | | # 货币直接转换的物品如果是放入背包的则直接转化,无需暂用格子
|
| | | if packIndex == IPY_GameWorld.rptItem:
|
| | | return True, 0
|
| | |
| | | # @return None
|
| | | def SetItemCount(item, cnt, playerID=0, accID=0, playerName=""):
|
| | | if not item.IsEmpty():
|
| | | itemID = item.GetItemTypeID()
|
| | | if cnt > 0 and itemID in ChConfig.Def_TransformItemIDList:
|
| | | if cnt > 0 and IsPutinAutoTransformItem(item):
|
| | | item.SetUserAttr(ShareDefine.Def_IudetItemCount, min(cnt, ChConfig.Def_UpperLimit_DWord))
|
| | | else:
|
| | | item.SetCount(min(cnt, 65535))
|
| | |
| | | raise
|
| | |
|
| | | def GetItemCount(item):
|
| | | if item.GetItemTypeID() in ChConfig.Def_TransformItemIDList:
|
| | | if IsPutinAutoTransformItem(item):
|
| | | return item.GetUserAttr(ShareDefine.Def_IudetItemCount)
|
| | | return item.GetCount()
|
| | |
|
| | |
| | | # if isAuctionItem:
|
| | | # if IpyGameDataPY.GetIpyGameDataNotLog("AuctionItem", itemData.GetItemTypeID()):
|
| | | # return 1
|
| | | if itemData.GetItemTypeID() in ChConfig.Def_TransformItemIDList or itemData.GetType() == ChConfig.Def_ItemType_AutoUseMoney:
|
| | | if IsPutinAutoTransformItem(itemData):
|
| | | # 货币直接转换的物品如果是放入背包的则不需要暂用格子,放入其他的背包的则按物品叠加上限算
|
| | | if packType == IPY_GameWorld.rptItem:
|
| | | return 0
|
| | |
| | | packCount = itemData.GetPackCount()
|
| | | return int(math.ceil(itemCount / float(packCount)))
|
| | |
|
| | | def IsPutinAutoTransformItem(itemData):
|
| | | ## 放入背包时是否直接转化为对应数值的物品
|
| | | if itemData.GetItemTypeID() in ChConfig.Def_TransformItemIDList or itemData.GetType() == ChConfig.Def_ItemType_AutoUseMoney:
|
| | | return True
|
| | | itemEff = itemData.GetEffectByIndex(0)
|
| | | if itemEff.GetEffectID() == ChConfig.Def_Effect_GubaoPiece:
|
| | | gubaoID = itemEff.GetEffectValue(0)
|
| | | if gubaoID:
|
| | | return True
|
| | | return False
|
| | |
|
| | | ## 双手武器,需要两只手才拿得动
|
| | | # @param curEquip
|
| | | # @return bool
|