10033 【后端】仙树升级系统及砍树产出规则(增加砍树内置CD300毫秒;砍树装备产出及分解规则调整;砍树装备操作支持批量;)
| | |
| | | list RangeAtkBackDefRate; // 抗反击范围
|
| | | list RangeSuckHPPer; // 吸血范围
|
| | | list RangeSuckHPDefPer; // 抗吸血范围
|
| | | DWORD MoneyBase; // 分解基础货币值
|
| | | };
|
| | |
|
| | | //装备品质部位表
|
| | |
| | | # B2 22 砍树装备操作 #tagCMCutTreeEquipOP
|
| | |
|
| | | class tagCMCutTreeEquipOP(Structure):
|
| | | _pack_ = 1
|
| | | _fields_ = [
|
| | | ("Cmd", c_ubyte),
|
| | | ("SubCmd", c_ubyte),
|
| | | ("ItemIndex", c_ubyte), # 物品在砍树背包的索引
|
| | | ("OPType", c_ubyte), # 操作类型:1-替换;2-分解
|
| | | ("AutoDecompose", c_ubyte), # 替换后是否自动分解原装备:0否1是,仅替换操作下有用
|
| | | ]
|
| | | Head = tagHead()
|
| | | IndexCount = 0 #(BYTE IndexCount)
|
| | | ItemIndexList = list() #(vector<BYTE> ItemIndexList)// 物品在砍树背包的索引列表
|
| | | OPType = 0 #(BYTE OPType)// 操作类型:1-替换;2-分解
|
| | | AutoDecompose = 0 #(BYTE AutoDecompose)// 替换后是否自动分解原装备:0否1是,仅替换操作下有用
|
| | | data = None
|
| | |
|
| | | def __init__(self):
|
| | | self.Clear()
|
| | | self.Cmd = 0xB2
|
| | | self.SubCmd = 0x22
|
| | | self.Head.Cmd = 0xB2
|
| | | self.Head.SubCmd = 0x22
|
| | | return
|
| | |
|
| | | def ReadData(self, stringData, _pos=0, _len=0):
|
| | | def ReadData(self, _lpData, _pos=0, _Len=0):
|
| | | self.Clear()
|
| | | memmove(addressof(self), stringData[_pos:], self.GetLength())
|
| | | return _pos + self.GetLength()
|
| | | _pos = self.Head.ReadData(_lpData, _pos)
|
| | | self.IndexCount,_pos = CommFunc.ReadBYTE(_lpData, _pos)
|
| | | for i in range(self.IndexCount):
|
| | | value,_pos=CommFunc.ReadBYTE(_lpData,_pos)
|
| | | self.ItemIndexList.append(value)
|
| | | self.OPType,_pos = CommFunc.ReadBYTE(_lpData, _pos)
|
| | | self.AutoDecompose,_pos = CommFunc.ReadBYTE(_lpData, _pos)
|
| | | return _pos
|
| | |
|
| | | def Clear(self):
|
| | | self.Cmd = 0xB2
|
| | | self.SubCmd = 0x22
|
| | | self.ItemIndex = 0
|
| | | self.Head = tagHead()
|
| | | self.Head.Clear()
|
| | | self.Head.Cmd = 0xB2
|
| | | self.Head.SubCmd = 0x22
|
| | | self.IndexCount = 0
|
| | | self.ItemIndexList = list()
|
| | | self.OPType = 0
|
| | | self.AutoDecompose = 0
|
| | | return
|
| | |
|
| | | def GetLength(self):
|
| | | return sizeof(tagCMCutTreeEquipOP)
|
| | | length = 0
|
| | | length += self.Head.GetLength()
|
| | | length += 1
|
| | | length += 1 * self.IndexCount
|
| | | length += 1
|
| | | length += 1
|
| | |
|
| | | return length
|
| | |
|
| | | def GetBuffer(self):
|
| | | return string_at(addressof(self), self.GetLength())
|
| | | data = ''
|
| | | data = CommFunc.WriteString(data, self.Head.GetLength(), self.Head.GetBuffer())
|
| | | data = CommFunc.WriteBYTE(data, self.IndexCount)
|
| | | for i in range(self.IndexCount):
|
| | | data = CommFunc.WriteBYTE(data, self.ItemIndexList[i])
|
| | | data = CommFunc.WriteBYTE(data, self.OPType)
|
| | | data = CommFunc.WriteBYTE(data, self.AutoDecompose)
|
| | | return data
|
| | |
|
| | | def OutputString(self):
|
| | | DumpString = '''// B2 22 砍树装备操作 //tagCMCutTreeEquipOP:
|
| | | Cmd:%s,
|
| | | SubCmd:%s,
|
| | | ItemIndex:%d,
|
| | | DumpString = '''
|
| | | Head:%s,
|
| | | IndexCount:%d,
|
| | | ItemIndexList:%s,
|
| | | OPType:%d,
|
| | | AutoDecompose:%d
|
| | | '''\
|
| | | %(
|
| | | self.Cmd,
|
| | | self.SubCmd,
|
| | | self.ItemIndex,
|
| | | self.Head.OutputString(),
|
| | | self.IndexCount,
|
| | | "...",
|
| | | self.OPType,
|
| | | self.AutoDecompose
|
| | | )
|
| | |
| | |
|
| | |
|
| | | m_NAtagCMCutTreeEquipOP=tagCMCutTreeEquipOP()
|
| | | ChNetPackDict[eval("0x%02x%02x"%(m_NAtagCMCutTreeEquipOP.Cmd,m_NAtagCMCutTreeEquipOP.SubCmd))] = m_NAtagCMCutTreeEquipOP
|
| | | ChNetPackDict[eval("0x%02x%02x"%(m_NAtagCMCutTreeEquipOP.Head.Cmd,m_NAtagCMCutTreeEquipOP.Head.SubCmd))] = m_NAtagCMCutTreeEquipOP
|
| | |
|
| | |
|
| | | #------------------------------------------------------
|
| | |
| | | 1000 * 10, # 跨服排位
|
| | | 1000 * 10, # 跨服妖魔boss
|
| | | 1000 * 10, # 仙盟阵法
|
| | | 300, # 砍树
|
| | | ]
|
| | | TYPE_Player_Tick_Count = len(TYPE_Player_Tick_Time)
|
| | |
|
| | |
| | | TYPE_Player_Tick_Championship, #跨服排位
|
| | | TYPE_Player_Tick_CrossYaomoBoss, #跨服妖魔boss
|
| | | TYPE_Player_Tick_FamilyZhenfa, #仙盟阵法
|
| | | TYPE_Player_Tick_CutTree, #砍树
|
| | | ) = range(0, TYPE_Player_Tick_Count)
|
| | |
|
| | | #---------------------------------------------------------------------
|
| | |
| | | # B2 22 砍树装备操作 #tagCMCutTreeEquipOP
|
| | |
|
| | | class tagCMCutTreeEquipOP(Structure):
|
| | | _pack_ = 1
|
| | | _fields_ = [
|
| | | ("Cmd", c_ubyte),
|
| | | ("SubCmd", c_ubyte),
|
| | | ("ItemIndex", c_ubyte), # 物品在砍树背包的索引
|
| | | ("OPType", c_ubyte), # 操作类型:1-替换;2-分解
|
| | | ("AutoDecompose", c_ubyte), # 替换后是否自动分解原装备:0否1是,仅替换操作下有用
|
| | | ]
|
| | | Head = tagHead()
|
| | | IndexCount = 0 #(BYTE IndexCount)
|
| | | ItemIndexList = list() #(vector<BYTE> ItemIndexList)// 物品在砍树背包的索引列表
|
| | | OPType = 0 #(BYTE OPType)// 操作类型:1-替换;2-分解
|
| | | AutoDecompose = 0 #(BYTE AutoDecompose)// 替换后是否自动分解原装备:0否1是,仅替换操作下有用
|
| | | data = None
|
| | |
|
| | | def __init__(self):
|
| | | self.Clear()
|
| | | self.Cmd = 0xB2
|
| | | self.SubCmd = 0x22
|
| | | self.Head.Cmd = 0xB2
|
| | | self.Head.SubCmd = 0x22
|
| | | return
|
| | |
|
| | | def ReadData(self, stringData, _pos=0, _len=0):
|
| | | def ReadData(self, _lpData, _pos=0, _Len=0):
|
| | | self.Clear()
|
| | | memmove(addressof(self), stringData[_pos:], self.GetLength())
|
| | | return _pos + self.GetLength()
|
| | | _pos = self.Head.ReadData(_lpData, _pos)
|
| | | self.IndexCount,_pos = CommFunc.ReadBYTE(_lpData, _pos)
|
| | | for i in range(self.IndexCount):
|
| | | value,_pos=CommFunc.ReadBYTE(_lpData,_pos)
|
| | | self.ItemIndexList.append(value)
|
| | | self.OPType,_pos = CommFunc.ReadBYTE(_lpData, _pos)
|
| | | self.AutoDecompose,_pos = CommFunc.ReadBYTE(_lpData, _pos)
|
| | | return _pos
|
| | |
|
| | | def Clear(self):
|
| | | self.Cmd = 0xB2
|
| | | self.SubCmd = 0x22
|
| | | self.ItemIndex = 0
|
| | | self.Head = tagHead()
|
| | | self.Head.Clear()
|
| | | self.Head.Cmd = 0xB2
|
| | | self.Head.SubCmd = 0x22
|
| | | self.IndexCount = 0
|
| | | self.ItemIndexList = list()
|
| | | self.OPType = 0
|
| | | self.AutoDecompose = 0
|
| | | return
|
| | |
|
| | | def GetLength(self):
|
| | | return sizeof(tagCMCutTreeEquipOP)
|
| | | length = 0
|
| | | length += self.Head.GetLength()
|
| | | length += 1
|
| | | length += 1 * self.IndexCount
|
| | | length += 1
|
| | | length += 1
|
| | |
|
| | | return length
|
| | |
|
| | | def GetBuffer(self):
|
| | | return string_at(addressof(self), self.GetLength())
|
| | | data = ''
|
| | | data = CommFunc.WriteString(data, self.Head.GetLength(), self.Head.GetBuffer())
|
| | | data = CommFunc.WriteBYTE(data, self.IndexCount)
|
| | | for i in range(self.IndexCount):
|
| | | data = CommFunc.WriteBYTE(data, self.ItemIndexList[i])
|
| | | data = CommFunc.WriteBYTE(data, self.OPType)
|
| | | data = CommFunc.WriteBYTE(data, self.AutoDecompose)
|
| | | return data
|
| | |
|
| | | def OutputString(self):
|
| | | DumpString = '''// B2 22 砍树装备操作 //tagCMCutTreeEquipOP:
|
| | | Cmd:%s,
|
| | | SubCmd:%s,
|
| | | ItemIndex:%d,
|
| | | DumpString = '''
|
| | | Head:%s,
|
| | | IndexCount:%d,
|
| | | ItemIndexList:%s,
|
| | | OPType:%d,
|
| | | AutoDecompose:%d
|
| | | '''\
|
| | | %(
|
| | | self.Cmd,
|
| | | self.SubCmd,
|
| | | self.ItemIndex,
|
| | | self.Head.OutputString(),
|
| | | self.IndexCount,
|
| | | "...",
|
| | | self.OPType,
|
| | | self.AutoDecompose
|
| | | )
|
| | |
| | |
|
| | |
|
| | | m_NAtagCMCutTreeEquipOP=tagCMCutTreeEquipOP()
|
| | | ChNetPackDict[eval("0x%02x%02x"%(m_NAtagCMCutTreeEquipOP.Cmd,m_NAtagCMCutTreeEquipOP.SubCmd))] = m_NAtagCMCutTreeEquipOP
|
| | | ChNetPackDict[eval("0x%02x%02x"%(m_NAtagCMCutTreeEquipOP.Head.Cmd,m_NAtagCMCutTreeEquipOP.Head.SubCmd))] = m_NAtagCMCutTreeEquipOP
|
| | |
|
| | |
|
| | | #------------------------------------------------------
|
| | |
| | | # @remarks 函数详细说明.
|
| | | def OnExec(curPlayer, playerList):
|
| | | if not playerList:
|
| | | GameWorld.DebugAnswer(curPlayer, "背包类型:1-装备;2-背包;5-仓库;30-寻宝;32-神兽;33-神兽装备;34-垃圾收集")
|
| | | GameWorld.DebugAnswer(curPlayer, "背包类型:1-装备;2-背包;5-仓库;8-砍树;30-寻宝;32-神兽;33-神兽装备;34-垃圾收集")
|
| | | return
|
| | |
|
| | | if len(playerList) == 1:
|
| | |
| | | ("list", "RangeAtkBackDefRate", 0),
|
| | | ("list", "RangeSuckHPPer", 0),
|
| | | ("list", "RangeSuckHPDefPer", 0),
|
| | | ("DWORD", "MoneyBase", 0),
|
| | | ),
|
| | |
|
| | | "EquipColorPlace":(
|
| | |
| | | self.RangeAtkBackRate = []
|
| | | self.RangeAtkBackDefRate = []
|
| | | self.RangeSuckHPPer = []
|
| | | self.RangeSuckHPDefPer = [] |
| | | self.RangeSuckHPDefPer = []
|
| | | self.MoneyBase = 0 |
| | | return |
| | | |
| | | def GetEquipColor(self): return self.EquipColor # 装备颜色
|
| | |
| | | def GetRangeAtkBackRate(self): return self.RangeAtkBackRate # 反击范围
|
| | | def GetRangeAtkBackDefRate(self): return self.RangeAtkBackDefRate # 抗反击范围
|
| | | def GetRangeSuckHPPer(self): return self.RangeSuckHPPer # 吸血范围
|
| | | def GetRangeSuckHPDefPer(self): return self.RangeSuckHPDefPer # 抗吸血范围 |
| | | def GetRangeSuckHPDefPer(self): return self.RangeSuckHPDefPer # 抗吸血范围
|
| | | def GetMoneyBase(self): return self.MoneyBase # 分解基础货币值 |
| | | |
| | | # 装备品质部位表 |
| | | class IPY_EquipColorPlace(): |
| | |
| | | return item.GetUserAttr(ShareDefine.Def_IudetItemCount)
|
| | | return item.GetCount()
|
| | |
|
| | | def GetItemLV(item): return item.GetUserAttr(ShareDefine.Def_IudetItemLV)
|
| | |
|
| | | def GetItemNeedPackCount(packType, itemData, itemCount, isAuctionItem=0):
|
| | | # 20201223 主干取消拍品有效时长设定
|
| | | # if isAuctionItem:
|
| | |
| | | baseAttrIDList, baseAttrValueList = [], []
|
| | | for attrID in [ShareDefine.Def_Effect_Atk, ShareDefine.Def_Effect_MaxHP, ShareDefine.Def_Effect_Def, ShareDefine.Def_Effect_AtkSpeed]:
|
| | | valueList = baseAttrDict[attrID]
|
| | | atkValue = __GetRandAttrValueByRatio(valueList, reRatio, upDownRateList)
|
| | | atkValue = __GetRandAttrValueByRatio(attrID, valueList, reRatio, upDownRateList)
|
| | | if not atkValue:
|
| | | continue
|
| | | baseAttrIDList.append(attrID)
|
| | |
| | | battleAttrIDList = battleAttrIDList[:battleAttrCount]
|
| | | batAttrIDList, batAttrValueList= [], []
|
| | | for attrID in battleAttrIDList:
|
| | | atkValue = __GetRandAttrValueByRatio(battleAttrDict[attrID], reRatio, upDownRateList)
|
| | | atkValue = __GetRandAttrValueByRatio(attrID, battleAttrDict[attrID], reRatio, upDownRateList)
|
| | | if not atkValue:
|
| | | continue
|
| | | batAttrIDList.append(attrID)
|
| | |
| | | battleDefAttrIDList = battleDefAttrIDList[:battleDefAttrCount]
|
| | | batDefAttrIDList, batDefAttrValueList= [], []
|
| | | for attrID in battleDefAttrIDList:
|
| | | atkValue = __GetRandAttrValueByRatio(battleDefAttrDict[attrID], reRatio, upDownRateList)
|
| | | atkValue = __GetRandAttrValueByRatio(attrID, battleDefAttrDict[attrID], reRatio, upDownRateList)
|
| | | if not atkValue:
|
| | | continue
|
| | | batDefAttrIDList.append(attrID)
|
| | |
| | | GameWorld.DebugLog(" legendAttrIDList=%s,legendAttrValueList=%s" % (legendAttrIDList, legendAttrValueList))
|
| | | return
|
| | |
|
| | | def __GetRandAttrValueByRatio(valueList, reRatio, upDownRateList):
|
| | | def __GetRandAttrValueByRatio(attrID, valueList, reRatio, upDownRateList):
|
| | | ## 根据参考比例随机属性值
|
| | | valueMin, valueMax = valueList
|
| | | if reRatio < 0 or reRatio > 1:
|
| | |
| | | randValueMin = int(reValue - math.ceil(diffValue * downRate / 10000.0)) # 至少-1
|
| | | randValueMax = int(reValue + math.ceil(diffValue * upRate / 10000.0)) # 至少+1
|
| | | randValue = random.randint(randValueMin, randValueMax)
|
| | | GameWorld.DebugLog(" valueList=%s,reRatio=%s,upDownRateList=%s,diffValue=%s,reValue=%s,%s~%s,%s" |
| | | % (valueList, reRatio, upDownRateList, diffValue, reValue, randValueMin, randValueMax, randValue))
|
| | | GameWorld.DebugLog(" attrID=%s,valueList=%s,reRatio=%s,upDownRateList=%s,diffValue=%s,reValue=%s,%s~%s,%s" |
| | | % (attrID, valueList, reRatio, upDownRateList, diffValue, reValue, randValueMin, randValueMax, randValue))
|
| | | return randValue
|
| | |
|
| | | def UpdateItemUserData(curItem, updateDict={}, delKeyList=[], isUpdateGS=False):
|
| | |
| | | if itemJob and itemJobList and itemJob not in itemJobList:
|
| | | continue
|
| | | curIsSuit = suiteID > 0
|
| | | if curIsSuit != isSuit:
|
| | | if curIsSuit != isSuit and isSuit != None:
|
| | | continue
|
| | | itemIDList.append(itemID)
|
| | |
|
| | |
| | | cutCount = clientData.CutCount
|
| | | playerID = curPlayer.GetPlayerID()
|
| | |
|
| | | if not GameWorld.SetPlayerTickTime(curPlayer, ChConfig.TYPE_Player_Tick_CutTree, tick):
|
| | | GameWorld.DebugLog("砍树CD中...", playerID)
|
| | | return
|
| | | |
| | | identifyPack = curPlayer.GetItemManager().GetPack(IPY_GameWorld.rptIdentify)
|
| | | packCount = identifyPack.GetCount()
|
| | | for i in range(0, packCount):
|
| | |
| | | maxRate = 10000
|
| | | totalRate = 0
|
| | | colorRateList = []
|
| | | for equipColor, colorRate in enumerate(equipColorRateList):
|
| | | for equipColor, colorRate in enumerate(equipColorRateList, 1):
|
| | | if not colorRate:
|
| | | continue
|
| | | totalRate += colorRate
|
| | | colorRateList.append([totalRate, equipColor])
|
| | |
|
| | | if totalRate != maxRate:
|
| | | GameWorld.SendGameError("GameWarning", "CutTreeTotalRateError:%s!=%s" % (totalRate, maxRate)) |
| | | GameWorld.SendGameError("GameWarning", "CutTreeTotalRateError:%s!=%s,treeLV=%s" % (totalRate, maxRate, treeLV)) |
| | | if not colorRateList:
|
| | | return
|
| | | GameWorld.DebugLog(" colorRateList=%s,totalRate=%s" % (colorRateList, totalRate), playerID)
|
| | |
|
| | | playerLV = curPlayer.GetLV()
|
| | | classLV = int(playerLV / 50 + 1)
|
| | | classLVMax = min(15, classLV + 1)
|
| | | classLVMin = max(1, min(classLV - 1, classLVMax - 2)) |
| | | classLVList = range(classLVMin, classLVMax + 1)
|
| | | GameWorld.DebugLog(" classLVList=%s,playerLV=%s,classLVMin=%s,classLVMax=%s" |
| | | % (classLVList, playerLV, classLVMin, classLVMax), playerID)
|
| | | |
| | | classLV, isSuit = 0, None
|
| | | placeList = ChConfig.EquipPlace_Base + ChConfig.EquipPlace_Special
|
| | | jobList = [curPlayer.GetJob()]
|
| | | randEquipIDList = []
|
| | | for _ in range(cutCount):
|
| | | itemColor = GameWorld.GetResultByRandomList(colorRateList)
|
| | | if not itemColor:
|
| | | continue
|
| | | # 产出装备规则待扩展,先固定
|
| | | classLV = random.choice(classLVList)
|
| | | isSuit = 0
|
| | | placeList = ChConfig.EquipPlace_Base
|
| | | jobList = [curPlayer.GetJob()]
|
| | | equipIDList = NPCCommon.__GetEquipIDList(0, classLV, itemColor, isSuit, placeList, jobList, findType="CutTree")
|
| | | if not equipIDList:
|
| | | continue
|
| | | randEquipIDList.append(random.choice(equipIDList))
|
| | | randEquipID = random.choice(equipIDList)
|
| | | GameWorld.DebugLog(" 随机装备ID: %s, itemColor=%s,%s" % (randEquipID, itemColor, equipIDList), playerID)
|
| | | randEquipIDList.append(randEquipID)
|
| | |
|
| | | GameWorld.DebugLog(" 预产出装备: randEquipIDList=%s" % randEquipIDList, playerID)
|
| | | |
| | | |
| | | giveItemListEx = []
|
| | | giveEquipIDList = []
|
| | | for equipItemID in randEquipIDList:
|
| | |
| | | #struct tagCMCutTreeEquipOP
|
| | | #{
|
| | | # tagHead Head;
|
| | | # BYTE ItemIndex; // 物品在砍树背包的索引
|
| | | # BYTE IndexCount;
|
| | | # BYTE ItemIndexList[IndexCount]; // 物品在砍树背包的索引列表
|
| | | # BYTE OPType; // 操作类型:1-替换;2-分解
|
| | | # BYTE AutoDecompose; // 替换后是否自动分解原装备:0否1是,仅替换操作下有用
|
| | | #};
|
| | | def OnCutTreeEquipOP(index, clientData, tick):
|
| | | curPlayer = GameWorld.GetPlayerManager().GetPlayerByIndex(index)
|
| | | opType = clientData.OPType
|
| | | itemIndex = clientData.ItemIndex
|
| | | itemIndexList = clientData.ItemIndexList
|
| | | autoDecompose = clientData.AutoDecompose
|
| | | playerID = curPlayer.GetPlayerID()
|
| | |
|
| | | identifyPack = curPlayer.GetItemManager().GetPack(IPY_GameWorld.rptIdentify)
|
| | | if itemIndex >= identifyPack.GetCount():
|
| | | GameWorld.DebugLog("砍树背包索引不存在: itemIndex=%s" % itemIndex, playerID)
|
| | | return
|
| | | curEquip = identifyPack.GetAt(itemIndex)
|
| | | if not ItemCommon.CheckItemCanUse(curEquip):
|
| | | GameWorld.DebugLog("砍树背包物品不存在: itemIndex=%s" % itemIndex, playerID)
|
| | | return
|
| | | GameWorld.DebugLog("砍树装备操作: itemIndex=%s,opType=%s,autoDecompose=%s" % (itemIndex, opType, autoDecompose), playerID)
|
| | | |
| | | # 替换
|
| | | if opType == 1:
|
| | | equipIndex = ItemCommon.GetEquipPackIndex(curEquip)
|
| | | if not ChEquip.DoPlayerEquipItem(curPlayer, curEquip, equipIndex, tick):
|
| | | return
|
| | | GameWorld.DebugLog("砍树装备操作: itemIndexList=%s,opType=%s,autoDecompose=%s" % (itemIndexList, opType, autoDecompose), playerID)
|
| | | for itemIndex in itemIndexList:
|
| | | if itemIndex >= identifyPack.GetCount():
|
| | | GameWorld.DebugLog("砍树背包索引不存在: itemIndex=%s" % itemIndex, playerID)
|
| | | continue
|
| | | curEquip = identifyPack.GetAt(itemIndex)
|
| | | if not ItemCommon.CheckItemCanUse(curEquip):
|
| | | GameWorld.DebugLog("砍树背包物品不存在: itemIndex=%s" % itemIndex, playerID)
|
| | | continue
|
| | |
|
| | | if autoDecompose:
|
| | | __DoEquipDecompose(curPlayer, identifyPack.GetAt(itemIndex)) # 需重新获得装备对象
|
| | | # 替换
|
| | | if opType == 1:
|
| | | equipIndex = ItemCommon.GetEquipPackIndex(curEquip)
|
| | | if not ChEquip.DoPlayerEquipItem(curPlayer, curEquip, equipIndex, tick):
|
| | | continue
|
| | |
|
| | | # 分解
|
| | | elif opType == 2:
|
| | | __DoEquipDecompose(curPlayer, curEquip)
|
| | | if autoDecompose:
|
| | | __DoEquipDecompose(curPlayer, identifyPack.GetAt(itemIndex)) # 需重新获得装备对象
|
| | | |
| | | # 分解
|
| | | elif opType == 2:
|
| | | __DoEquipDecompose(curPlayer, curEquip)
|
| | | |
| | | # 放入备用仓库
|
| | | elif opType == 3:
|
| | | pass
|
| | |
|
| | | # 放入备用仓库
|
| | | elif opType == 3:
|
| | | pass
|
| | | |
| | | else:
|
| | | return
|
| | | |
| | | return
|
| | |
|
| | | def __DoEquipDecompose(curPlayer, curEquip):
|
| | | if not curEquip:
|
| | | return
|
| | | itemID = curEquip.GetItemTypeID()
|
| | | itemColor = curEquip.GetItemColor()
|
| | | itemLV = ItemControler.GetItemLV(curEquip)
|
| | | playerID = curPlayer.GetPlayerID()
|
| | | GameWorld.DebugLog("装备分解: itemID=%s" % (itemID), playerID)
|
| | |
|
| | | # 这边执行分解逻辑,待扩展...
|
| | | colorIpyData = IpyGameDataPY.GetIpyGameData("EquipColor", itemColor)
|
| | | moneyBase = colorIpyData.GetMoneyBase() if colorIpyData else 0
|
| | | GameWorld.DebugLog("装备分解: itemID=%s,itemColor=%s,itemLV=%s,moneyBase=%s" % (itemID, itemColor, itemLV, moneyBase), playerID)
|
| | |
|
| | | ItemCommon.DelItem(curPlayer, curEquip, curEquip.GetCount(), True, ChConfig.ItemDel_EquipDecompose)
|
| | |
|
| | | moneyType = IPY_GameWorld.TYPE_Price_Gold_Paper
|
| | | moneyValye = eval(IpyGameDataPY.GetFuncCompileCfg("CutTree", 3))
|
| | | if moneyValye:
|
| | | addDataDict = {ChConfig.Def_Give_Reason_SonKey:itemID, "itemColor":itemColor, "itemLV":itemLV}
|
| | | PlayerControl.GiveMoney(curPlayer, moneyType, moneyValye, "EquipDecompose", addDataDict)
|
| | | |
| | | PlayerTask.AddTaskValue(curPlayer, ChConfig.TaskType_EquipDecompose, 1)
|
| | | return
|
| | |
|