| | |
| | |
|
| | | return
|
| | |
|
| | | def GivePlayerItem(curPlayer, itemID, itemCount, auctionGroup, packIndexList, showEff=False, defaultPile=True,
|
| | | returnItemObj=False, showSysInfo=False, event=["", False, {}]):
|
| | | def GivePlayerItem(curPlayer, itemID, itemCount, auctionGroup, packIndexList, event=["", False, {}]):
|
| | | '''给玩家物品
|
| | | @param auctionGroup: 拍品组数,0为非拍品,大于0为总给的物品数拆成的拍品组数;注意这个不一定按叠加拆分,策划自行决定非几组拍
|
| | | '''
|
| | |
| | | itemControl = PlayerItemControler(curPlayer)
|
| | | for packIndex in packIndexList:
|
| | | #可以放入背包
|
| | | if itemControl.CanPutInItem(packIndex, itemID, itemCount, auctionGroup, defaultPile):
|
| | | if itemControl.CanPutInItem(packIndex, itemID, itemCount, auctionGroup):
|
| | | canPutIn = True
|
| | | break
|
| | | if not canPutIn:
|
| | |
| | | outPutEquip = GetOutPutItemObj(itemID, 1, isAuctionItem, curPlayer=curPlayer)
|
| | | if not outPutEquip:
|
| | | return isOK
|
| | | if DoLogic_PutItemInPack(curPlayer, outPutEquip, event, packIndexList, defaultPile):
|
| | | if DoLogic_PutItemInPack(curPlayer, outPutEquip, event, packIndexList):
|
| | | isOK = True # 只要有成功的就返回成功,防止异常情况失败可能导致被刷
|
| | | return isOK
|
| | |
|
| | |
| | | giveItem = GetOutPutItemObj(itemID, giveCount, isAuctionItem, curPlayer=curPlayer)
|
| | | if not giveItem:
|
| | | return isOK
|
| | | if DoLogic_PutItemInPack(curPlayer, giveItem, event, packIndexList, defaultPile):
|
| | | if DoLogic_PutItemInPack(curPlayer, giveItem, event, packIndexList):
|
| | | isOK = True # 只要有成功的就返回成功,防止异常情况失败可能导致被刷
|
| | |
|
| | | return isOK
|
| | |
| | | ## 根据物品data字典给玩家装备/翅膀
|
| | | # @param curPlayer:玩家实例
|
| | | # @param itemData:物品数据
|
| | | # @param showEff:是否显示放入背包特效
|
| | | # @param packType:背包类型
|
| | | # @param defaultPile 默认先判断是否能进行物品堆叠
|
| | | # @param showSysInfo 是否显示系统提示
|
| | | # @return None
|
| | | def GivePlayerEquip(curPlayer, itemData, event=["", False, {}], packType=[IPY_GameWorld.rptItem, IPY_GameWorld.rptAnyWhere],
|
| | | defaultPile=True):
|
| | |
| | | # @param packIndexList 背包索引列表
|
| | | # @param showEff 放入背包特效
|
| | | # @param defaultPile 默认先判断是否能进行物品堆叠
|
| | | # @param returnItemObj 是否返回物品对象
|
| | | # @param showSysInfo 是否显示系统提示
|
| | | # @return 布尔值
|
| | | def DoLogic_PutItemInPack(curPlayer, curGiveItem, event=["", False, {}], packIndexList=[IPY_GameWorld.rptItem, IPY_GameWorld.rptAnyWhere], defaultPile=True):
|
| | |
| | | # PlayerControl.NotifyCode(curPlayer, "ObtainRes01", [itemID, count])
|
| | | #===================================================================
|
| | |
|
| | | #if returnItemObj:
|
| | | # return curGiveItem
|
| | | return True
|
| | |
|
| | | #玩家背包已满, 清空物品,否则创建物品不删除,将导致内存溢出
|
| | |
| | | ## 临时背包放入物品
|
| | | # 临时交换背包目前只开放1个格子,每次放入前先清空再放入
|
| | | ClearPack(curPlayer, ShareDefine.rptTempSwap)
|
| | | return GivePlayerItem(curPlayer, itemID, 1, isBind, [ShareDefine.rptTempSwap])
|
| | | auctionGroup = 1 if not isBind else 0
|
| | | return GivePlayerItem(curPlayer, itemID, 1, auctionGroup, [ShareDefine.rptTempSwap])
|
| | |
|
| | | def OpenPickupItemPutInTemp(curPlayer, isClearItem):
|
| | | ''' 开启拾取的物品放入临时存放背包
|