| | |
| | |
|
| | | allAttrListStar = [{} for _ in range(4)] # 星数属性
|
| | | #allAttrListEquip = [{} for _ in range(4)] # 装备其他
|
| | | #allAttrListPlusBase = [{} for _ in range(4)] # 基础强化属性
|
| | | allAttrListPlusBase = [{} for _ in range(4)] # 基础强化属性
|
| | | allAttrListStone = [{} for _ in range(4)] # 宝石属性
|
| | | allAttrListSuit = [{} for _ in range(4)] # 套装属性
|
| | | allAttrListWash = [{} for _ in range(4)] # 洗练属性
|
| | |
| | | # PlayerControl.CalcAttrDict_Type(effectID, effectValue, allAttrListEquip)
|
| | | # baseEquipAttrDict[effectID] = baseEquipAttrDict.get(effectID, 0) + effectValue
|
| | |
|
| | | # groupType = GetEquipPartSuiteGroupType(curPlayer, equipIndex)
|
| | | # for suiteType in range(1, maxSuiteType + 1):
|
| | | # suitelv = GetEquipPartSuiteLV(curPlayer, equipIndex, suiteType)
|
| | | # if suitelv:
|
| | | # maxSuiteLV = Operate_EquipSuitCompose.GetEquipCanDoMaxSuiteLV(curPlayer, curEquip, suiteType, groupType)
|
| | | # suiteLV = min(suitelv, maxSuiteLV)
|
| | | # if suiteLV:
|
| | | # suiteKey = '%s_%s_%s' % (groupType, suiteType, suitelv)
|
| | | # suitCntDict[suiteKey] = suitCntDict.get(suiteKey, 0) + 1
|
| | |
|
| | | #星数属性
|
| | | equipPartStar = GetEquipPartStarByRank(curPlayer, equipIndex, curEquip) #生效的星数
|
| | |
| | | suitCntDict[suiteID] = []
|
| | | suitCntDict[suiteID].append(equipPartStar)
|
| | |
|
| | | #物品强化属性,佩饰强化不同要区分
|
| | | # if equipIndex in equipPartStarIndexList:
|
| | | # equipPartStarLV = GetEquipPartPlusLVByRank(curPlayer, packType, equipIndex, curEquip)
|
| | | # CalcAttr_ItemPlus(curPlayer, curEquip, allAttrListPlusBase, equipPartStarLV)
|
| | | #物品强化属性
|
| | | equipPartPlusLV = GetEquipPartPlusLVByRank(curPlayer, packType, equipIndex, curEquip)
|
| | | equipPartPlusEvolveLV = GetEquipPartPlusEvolveLVByEquip(curPlayer, packType, equipIndex, curEquip)
|
| | | CalcAttr_ItemPlus(curPlayer, curEquip, allAttrListPlusBase, equipPartPlusLV, equipPartPlusEvolveLV)
|
| | |
|
| | | #传奇属性
|
| | | #CalcAttr_LegendAttr(curPlayer, curEquip, allAttrListEquip, legendAttrDict)
|
| | |
| | | # @param curPlayer 当前玩家
|
| | | # @param curPlayer allAttrList 属性缓存
|
| | | # @return None
|
| | | def CalcAttr_ItemPlus(curPlayer, curEquip, allAttrList, equipPartStarLV=None):
|
| | | def CalcAttr_ItemPlus(curPlayer, curEquip, allAttrList, equipPartStarLV, equipPartPlusEvolveLV):
|
| | | if not equipPartStarLV:
|
| | | return
|
| | | plusType = GetEquipPlusType(curEquip)
|
| | |
| | | attrTypeList, attrValueList = ipyData.GetAttrType(), ipyData.GetAttrValue()
|
| | | for i, attrID in enumerate(attrTypeList):
|
| | | PlayerControl.CalcAttrDict_Type(attrID, attrValueList[i], allAttrList)
|
| | | |
| | | #进化属性
|
| | | equipPlace = curEquip.GetEquipPlace()
|
| | | ipyData = IpyGameDataPY.GetIpyGameData('EquipPlusEvolve', equipPlace, equipPartPlusEvolveLV)
|
| | | if not ipyData:
|
| | | return
|
| | | for attrID, attrValue in ipyData.GetAttr().items():
|
| | | PlayerControl.CalcAttrDict_Type(attrID, attrValue, allAttrList)
|
| | | return
|
| | |
|
| | |
|
| | |
| | | oldEquipShowSwitch = curPlayer.GetEquipShowSwitch()
|
| | | if updEquipShowSwitch == oldEquipShowSwitch:
|
| | | return
|
| | | classLV, isSuite = updEquipShowSwitch/10, updEquipShowSwitch%10
|
| | | equipPack = curPlayer.GetItemManager().GetPack(IPY_GameWorld.rptEquip)
|
| | | #验证套装
|
| | | realSuit=True
|
| | | for place in ChConfig.Def_SuitEquipPlaceList:
|
| | | ipyData = IpyGameDataPY.GetIpyGameData('EquipPlaceIndexMap', classLV, place)
|
| | | if not ipyData:
|
| | | realSuit = False
|
| | | break
|
| | | gridIndex = ipyData.GetGridIndex()
|
| | | curEquip = equipPack.GetAt(gridIndex)
|
| | | if not ItemCommon.CheckItemCanUse(curEquip):
|
| | | realSuit = False
|
| | | break
|
| | | if not curEquip.GetSuiteID():
|
| | | realSuit = False
|
| | | break
|
| | | if realSuit != isSuite:
|
| | | GameWorld.DebugLog('SetEquipShowSwitch 前端发的isSuite 和实际不一致!')
|
| | | return
|
| | |
|
| | | #通知外观装备
|
| | | updFaceEquipIndex = 0
|
| | | equipIndexList = []
|
| | | |
| | | for equipPlace in [ShareDefine.retWeapon, ShareDefine.retWeapon2, ShareDefine.retClothes]:
|
| | | ipyData = IpyGameDataPY.GetIpyGameData('EquipPlaceIndexMap', 1, equipPlace)
|
| | | ipyData = IpyGameDataPY.GetIpyGameData('EquipPlaceIndexMap', classLV, equipPlace)
|
| | | if not ipyData:
|
| | | continue
|
| | | gridIndex = ipyData.GetGridIndex()
|
| | | updFaceEquipIndex = updFaceEquipIndex * 1000 + gridIndex
|
| | | equipIndexList.append(gridIndex)
|
| | | PlayerControl.SetFaceEquipIndex(curPlayer, updFaceEquipIndex)
|
| | | equipPack = curPlayer.GetItemManager().GetPack(IPY_GameWorld.rptEquip)
|
| | | |
| | | for equipPackIndex in equipIndexList:
|
| | | curEquip = equipPack.GetAt(equipPackIndex)
|
| | | if not ItemCommon.CheckItemCanUse(curEquip):
|
| | |
| | |
|
| | | ## 获取公共部位强化星级, 因装备的最高可强化星级影响,用于算当前装备属性使用, 不影响全身星级
|
| | | def GetEquipPartPlusLVByRank(curPlayer, packType, index, curEquip):
|
| | | maxStarLV = ItemCommon.GetItemMaxPlusLV(curEquip)
|
| | | maxStarLV = ItemCommon.GetItemMaxPlusLV(curPlayer, index, curEquip)
|
| | | return min(curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_EquipPartPlusLV % (packType, index)), maxStarLV)
|
| | |
|
| | |
|
| | |
| | | return
|
| | |
|
| | |
|
| | | ## 获取公共部位强化进化等级, 用于算当前装备属性使用, 不影响全身星级
|
| | | def GetEquipPartPlusEvolveLVByEquip(curPlayer, packType, index, curEquip):
|
| | | maxEvolveLV = ItemCommon.GetItemMaxPlusEvolveLV(curPlayer, index, curEquip)
|
| | | return min(curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_EquipPartPlusEvolveLV % (packType, index)), maxEvolveLV)
|
| | |
|
| | |
|
| | | ## 获取公共部位强化进化等级
|
| | | def GetEquipPartPlusEvolveLV(curPlayer, packType, index):
|
| | | return curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_EquipPartPlusEvolveLV % (packType, index))
|
| | |
|
| | |
|
| | | ## 设置公共部位强化进化等级
|
| | | def SetEquipPartPlusEvolveLV(curPlayer, packType, index, evolveLV):
|
| | | if GetEquipPartPlusEvolveLV(curPlayer, packType, index) == evolveLV:
|
| | | return
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_EquipPartPlusEvolveLV % (packType, index), evolveLV)
|
| | | return
|
| | |
|
| | | ## 通知公共部位强化等级
|
| | | def NotifyEquipPartPlusLV(curPlayer, packType=None, index=None):
|
| | | ePartStarLVPack = ChPyNetSendPack.tagMCEquipPartStarLVInfo()
|
| | | ePartStarLVPack = ChPyNetSendPack.tagMCEquipPartPlusInfo()
|
| | | ePartStarLVPack.Clear()
|
| | | ePartStarLVPack.InfoList = []
|
| | |
|
| | |
| | | if index != None and index != i:
|
| | | continue
|
| | |
|
| | | ePartStarLV = ChPyNetSendPack.tagMCEquipPartStarLV()
|
| | | ePartStarLV = ChPyNetSendPack.tagMCEquipPartPlusLV()
|
| | | ePartStarLV.Clear()
|
| | | ePartStarLV.PackType = pType
|
| | | ePartStarLV.EquipIndex = i
|
| | | ePartStarLV.EquipPartStarLV = GetEquipPartPlusLV(curPlayer, pType, i)
|
| | | ePartStarLV.Proficiency = GetEquipPartProficiency(curPlayer, pType, i)
|
| | | ePartStarLV.EvolveLV = GetEquipPartPlusEvolveLV(curPlayer, pType, i)
|
| | | ePartStarLVPack.InfoList.append(ePartStarLV)
|
| | |
|
| | | ePartStarLVPack.Count = len(ePartStarLVPack.InfoList)
|
| | |
| | | activeCnt = clientData.Cnt
|
| | | if activeType == 0:
|
| | | key = ChConfig.Def_PDict_EquipActiveStarLV
|
| | | elif activeType == 1:
|
| | | key = ChConfig.Def_PDict_EquipActiveStars
|
| | | # elif activeType == 1:
|
| | | # key = ChConfig.Def_PDict_EquipActiveStars
|
| | | else:
|
| | | return
|
| | | curCnt = curPlayer.NomalDictGetProperty(key)
|
| | |
| | | continue
|
| | | if aType == 0:
|
| | | key = ChConfig.Def_PDict_EquipActiveStarLV
|
| | | elif aType == 1:
|
| | | key = ChConfig.Def_PDict_EquipActiveStars
|
| | | # elif aType == 1:
|
| | | # key = ChConfig.Def_PDict_EquipActiveStars
|
| | | else:
|
| | | return
|
| | | curCnt = curPlayer.NomalDictGetProperty(key)
|