| | |
| | | import Operate_EquipStone
|
| | | import Operate_EquipSuitCompose
|
| | | import IpyGameDataPY
|
| | | import DataRecordPack
|
| | | import EventShell
|
| | |
|
| | | import math
|
| | |
| | | return -1
|
| | |
|
| | | curPlayer = self.__Player
|
| | | #equipPack = self.__PlayerEquip
|
| | | #equipItem = equipPack.GetAt(packEquipIndex)
|
| | | |
| | | equipPack = self.__PlayerEquip
|
| | | equipItem = equipPack.GetAt(packEquipIndex)
|
| | | desItemID, desUserData = [0, ''] if equipItem.IsEmpty() else [equipItem.GetItemTypeID(), equipItem.GetUserData()]
|
| | | srcItemID, srcUserData = curItem.GetItemTypeID(), curItem.GetUserData()
|
| | | # 装备绑定处理 在 DoLogic_ItemBindType函数有处理,此处注释掉
|
| | | # if not curItem.GetIsBind():
|
| | | # SetItemIsBind(curItem, True)
|
| | |
| | | #套装降级处理
|
| | | Operate_EquipSuitCompose.CheckEquipSuitReduce(curPlayer, packEquipIndex)
|
| | | EventShell.EventRespons_EquipStar(curPlayer)
|
| | | dataDict = {'dotype':'EquipItem', 'desItemID':desItemID, 'desUserData':desUserData,'srcItemID':srcItemID,'srcUserData':srcUserData}
|
| | | DataRecordPack.Cache_FightPowerChangeInfo(curPlayer, ChConfig.PowerDownType_EquipChange, dataDict)
|
| | | |
| | | self.RefreshStartEquipCount()
|
| | | return packEquipIndex if result else -1
|
| | |
|
| | |
| | | return
|
| | |
|
| | | equipID = curEquip.GetItemTypeID()
|
| | |
|
| | | userData = curEquip.GetUserData()
|
| | | #该物品锁定不执行==============================================
|
| | | if curEquip.GetIsLocked():
|
| | | PlayerControl.NotifyCode(curPlayer, "RescannotEquip")
|
| | |
| | | #套装降级处理
|
| | | Operate_EquipSuitCompose.CheckEquipSuitReduce(curPlayer, equipIndex)
|
| | | EventShell.EventRespons_EquipStar(curPlayer)
|
| | | dataDict = {'dotype':'UnEquipItem', 'equipID':equipID, 'userData':userData}
|
| | | DataRecordPack.Cache_FightPowerChangeInfo(curPlayer, ChConfig.PowerDownType_EquipChange, dataDict)
|
| | | #===============================================================================
|
| | | # #destItemPlace = 卸下物品的位置
|
| | | # destItemPlace = curPack.GetAt(packIndex)
|
| | |
| | | if packIndex == ShareDefine.rptRune:
|
| | | runeSource = tagItem.GetUserAttr(ShareDefine.Def_IudetRuneSource) or 1
|
| | | setItemKeyData = GetRuneItemKeyData(tagItem.GetItemTypeID(), tagItem.GetUserAttr(ShareDefine.Def_IudetRuneLV), source=runeSource)
|
| | | elif packIndex == ShareDefine.rptGatherSoul:
|
| | | setItemKeyData = GetGatherSoulItemKeyData(tagItem.GetItemTypeID(), tagItem.GetUserAttr(ShareDefine.Def_IudetGatherSoulLV))
|
| | |
|
| | | refreshPlaceList = []
|
| | | for place in xrange(ItemCommon.GetVPackCnt(packIndex)):
|
| | |
| | | GameWorld.GetPlayerManager().GameServer_QueryPlayerResult(0, 0, 0, 'AddBossRebornPoint', msgStr, len(msgStr))
|
| | | elif itemID == ChConfig.Def_ItemID_Ysog:
|
| | | PlayerControl.GiveMoney(curPlayer, ShareDefine.TYPE_Price_Ysog, itemCount)
|
| | | |
| | | elif itemID == ChConfig.Def_ItemID_SoulDust:
|
| | | PlayerControl.GiveMoney(curPlayer, ShareDefine.TYPE_Price_SoulDust, itemCount)
|
| | | elif itemID == ChConfig.Def_ItemID_SoulSplinters:
|
| | | PlayerControl.GiveMoney(curPlayer, ShareDefine.TYPE_Price_SoulSplinters, itemCount)
|
| | | elif itemID == ChConfig.Def_ItemID_SoulCore:
|
| | | PlayerControl.GiveMoney(curPlayer, ShareDefine.TYPE_Price_SoulCore, itemCount)
|
| | | return True
|
| | |
|
| | | ## 放入物品
|
| | |
| | | isBind = tagItem.GetIsBind()
|
| | | isNeedRecord = False
|
| | | # 目前暂只记录放入背包的
|
| | | if packIndex in [IPY_GameWorld.rptItem, ShareDefine.rptTreasure, ShareDefine.rptRune]:
|
| | | if packIndex in [IPY_GameWorld.rptItem, ShareDefine.rptTreasure, ShareDefine.rptRune, ShareDefine.rptGatherSoul]:
|
| | | isNeedRecord = ItemNeedRecord(tagItem) or isForceEvent
|
| | | putResult = False
|
| | |
|
| | |
| | | #可以摆放
|
| | | if curItemCount > canPutinCount:
|
| | | #需要创建新物品放入
|
| | | curCreateItem = ItemCommon.CreateSingleItem(tagItem.GetItemTypeID())
|
| | | curCreateItem = GetOutPutItemObj(tagItem.GetItemTypeID(), canPutinCount, isBind)
|
| | | #注意: 不能在这里AssignItem, 否则会有2个物品指针指向同一个物品实例 . 巨大的错误在这一句 : curCreateItem.Assign(tagItem)
|
| | | SetItemCount(curCreateItem, canPutinCount)
|
| | | SetItemIsBind(curCreateItem, isBind)
|
| | | #此处不做装备拆解,如有需求外传for处理
|
| | | #如果是装备,那么 maxPackCount 为1 这里会循环自动创建新物品,所以直接 GetOutPutItemObj 即可, 暂不支持定制装备拆解
|
| | |
|
| | | item.AssignItem(curCreateItem)
|
| | | SetItemCount(tagItem, curItemCount - canPutinCount)
|
| | |
| | | def GetRuneItemIsLock(keyData): return keyData / 1000000000
|
| | | def GetRuneItemSource(keyData): return keyData % 1000000000 / 100000000
|
| | | def IsRuneItemNeedRecord(curItem, plusLV):
|
| | | return plusLV > 0 or curItem.GetItemColor() >= ChConfig.Def_Quality_Orange
|
| | |
|
| | | # 聚魂物品存储字典数值数据结构: 前5位为物品ID, 6~8位为强化等级
|
| | | def GetGatherSoulItemKeyData(itemID, GatherSoulLV):
|
| | | return min(GatherSoulLV, 999) * 100000 + itemID
|
| | | def GetGatherSoulItemID(keyData): return keyData % 100000
|
| | | def GetGatherSoulItemPlusLV(keyData): return keyData % 100000000 / 100000
|
| | | def IsGatherSoulItemNeedRecord(curItem, plusLV):
|
| | | return plusLV > 0 or curItem.GetItemColor() >= ChConfig.Def_Quality_Orange
|
| | |
|
| | | def SetVPackItemKeyData(curPlayer, packIndex, place, keyData, isSync=True):
|
| | |
| | |
|
| | | def __CmpRolePack(item1, item2):
|
| | | # 装备评分高 评分0 评分低,外层分列表
|
| | | # 颜色-星数 - 装备类型 - ID,内层比较 暂时不做时间判断
|
| | | |
| | | if item1.GetItemColor() == item2.GetItemColor():
|
| | | if item1.GetItemQuality() == item2.GetItemQuality():
|
| | | itemType1 = item1.GetType()
|
| | | itemType2 = item2.GetType()
|
| | | if itemType1 == itemType2:
|
| | | #===========================================================================
|
| | | # # 颜色-星数 - 装备类型 - ID,内层比较 暂时不做时间判断
|
| | | # |
| | | # if item1.GetItemColor() == item2.GetItemColor():
|
| | | # if item1.GetItemQuality() == item2.GetItemQuality():
|
| | | # itemType1 = item1.GetType()
|
| | | # itemType2 = item2.GetType()
|
| | | # if itemType1 == itemType2:
|
| | | # return cmp(item1.GetItemTypeID(), item2.GetItemTypeID())
|
| | | # else:
|
| | | # #类型有定义配置顺序
|
| | | # typeList = IpyGameDataPY.GetFuncEvalCfg("PackageSortPriority", 1)
|
| | | # if itemType1 in typeList and itemType2 in typeList:
|
| | | # return cmp(typeList.index(item1.GetType()), typeList.index(item2.GetType()))
|
| | | # elif itemType1 in typeList:
|
| | | # #排在前面
|
| | | # return -1
|
| | | # elif itemType2 in typeList:
|
| | | # return 1
|
| | | # else:
|
| | | # return cmp(itemType1, itemType2)
|
| | | # else:
|
| | | # return cmp(0-item1.GetItemQuality(), 0-item2.GetItemQuality())
|
| | | # else:
|
| | | # return cmp(0-item1.GetItemColor(), 0-item2.GetItemColor())
|
| | | #===========================================================================
|
| | |
|
| | | # 装备类型-颜色-星数 - ID,内层比较 暂时不做时间判断
|
| | | itemType1 = item1.GetType()
|
| | | itemType2 = item2.GetType()
|
| | | if itemType1 == itemType2:
|
| | | if item1.GetItemColor() == item2.GetItemColor():
|
| | | if item1.GetItemQuality() == item2.GetItemQuality():
|
| | | return cmp(item1.GetItemTypeID(), item2.GetItemTypeID())
|
| | | else:
|
| | | #类型有定义配置顺序
|
| | | typeList = IpyGameDataPY.GetFuncEvalCfg("PackageSortPriority", 1)
|
| | | if itemType1 in typeList and itemType2 in typeList:
|
| | | return cmp(typeList.index(item1.GetType()), typeList.index(item2.GetType()))
|
| | | elif itemType1 in typeList:
|
| | | #排在前面
|
| | | return -1
|
| | | elif itemType2 in typeList:
|
| | | return 1
|
| | | else:
|
| | | return cmp(itemType1, itemType2)
|
| | | return cmp(0-item1.GetItemQuality(), 0-item2.GetItemQuality())
|
| | | else:
|
| | | return cmp(0-item1.GetItemQuality(), 0-item2.GetItemQuality())
|
| | | return cmp(0-item1.GetItemColor(), 0-item2.GetItemColor())
|
| | | else:
|
| | | return cmp(0-item1.GetItemColor(), 0-item2.GetItemColor())
|
| | |
|
| | | #类型有定义配置顺序
|
| | | typeList = IpyGameDataPY.GetFuncEvalCfg("PackageSortPriority", 1)
|
| | | if itemType1 in typeList and itemType2 in typeList:
|
| | | return cmp(typeList.index(item1.GetType()), typeList.index(item2.GetType()))
|
| | | elif itemType1 in typeList:
|
| | | #排在前面
|
| | | return -1
|
| | | elif itemType2 in typeList:
|
| | | return 1
|
| | | else:
|
| | | return cmp(itemType1, itemType2)
|
| | | |
| | | |
| | |
|
| | | def __ResetItem_AddItemInList(curList, addItem):
|
| | | #把物品放到列表中, 要判断叠加
|