| | |
| | | curPlayer.SetDict(ChConfig.Def_PlayerKey_AttrActivatyNotify, ChConfig.Def_AttrActivatyNotify_Equip)
|
| | |
|
| | | #先刷装备BUFF 再计算属性
|
| | | if changeItemEquipPlace == ShareDefine.retWing:
|
| | | PlayerWing.CalcWingAttr(curPlayer)
|
| | | else:
|
| | | if changeItemEquipPlace in ChConfig.EquipPlace_LingQi:
|
| | | RefreshPlayerLingQiEquipAttr(curPlayer)
|
| | | elif itemClassLV:
|
| | | RefreshPlayerEquipAttribute(curPlayer, itemClassLV)
|
| | |
|
| | | #刷新所有属性
|
| | |
| | | return True
|
| | |
|
| | |
|
| | | |
| | | ## 刷新装备对人物属性的改变
|
| | | # @param self 类实例
|
| | | # @return 返回值无意义
|
| | |
| | | if classLV not in classLVList:
|
| | | classLVList.append(classLV)
|
| | | #GameWorld.DebugLog("添加装备缓存变更阶: classLV=%s, %s" % (classLV, classLVList), playerID)
|
| | | return
|
| | |
|
| | | def OnPlayerEquipLoginLogic(curPlayer):
|
| | | ''' 玩家登录统一处理装备,只遍历一次装备背包,通知信息、更新一次数据,防止总等级统计异常
|
| | | 装备品质橙装及以上数量、装备总星数、强化总等级、进化总等级、洗练总等级、宝石总等级
|
| | | '''
|
| | | |
| | | #NotifyEquipPartPlusLV(curPlayer)
|
| | | #NotifyEquipPartStar(curPlayer)
|
| | | #Operate_EquipWash.OnEquipWashLogin(curPlayer)
|
| | | #通知套装信息
|
| | | #ChEquip.SyncAllEquipAttrActiveInfo(curPlayer)
|
| | | #装备位宝石镶嵌通知
|
| | | #Operate_EquipStone.OnLogin(curPlayer)
|
| | | |
| | | ePartStarLVPack = ChPyNetSendPack.tagMCEquipPartStarInfo() # A3 B1 装备部位星数信息 #tagMCEquipPartStarInfo
|
| | | ePartPlusLVPack = ChPyNetSendPack.tagMCEquipPartPlusInfo() # A3 B3 装备部位强化信息 #tagMCEquipPartPlusInfo
|
| | | ePartXLPack = ChPyNetSendPack.tagMCEquipPartXLAttrInfo() # A3 BB 装备位洗练属性信息 #tagMCEquipPartXLAttrInfo
|
| | | ePartStonePack = ChPyNetSendPack.tagMCStoneInfo() # A3 BC 通知装备位孔位宝石ID #tagMCStoneInfo
|
| | | |
| | | orangeEquipCount = 0
|
| | | totalStar = 0
|
| | | totalPlusLV = 0
|
| | | totalEvolveLV = 0
|
| | | totalWashLV = 0
|
| | | totalStoneLV = 0
|
| | | holeIndexList = Operate_EquipStone.GetAllEquipPlaceHoleIndex()
|
| | | |
| | | gameData = GameWorld.GetGameData()
|
| | | packType = IPY_GameWorld.rptEquip
|
| | | equipPack = curPlayer.GetItemManager().GetPack(packType)
|
| | | for index in xrange(equipPack.GetCount()):
|
| | | ipyData = IpyGameDataPY.GetIpyGameDataByCondition('EquipPlaceIndexMap', {'GridIndex':index}, isLogNone=False)
|
| | | if not ipyData:
|
| | | continue
|
| | | # 只计算有阶的境界装备
|
| | | if not ipyData.GetClassLV():
|
| | | continue
|
| | | |
| | | curEquip = equipPack.GetAt(index)
|
| | | if not curEquip.IsEmpty():
|
| | | if curEquip.GetItemColor() >= ShareDefine.Def_Item_Color_Orange:
|
| | | orangeEquipCount += 1
|
| | | |
| | | # 星级
|
| | | starLV = GetEquipPartStar(curPlayer, index)
|
| | | totalStar += starLV
|
| | | |
| | | # 强化等级
|
| | | plusProficiency = GetEquipPartProficiency(curPlayer, packType, index)
|
| | | plusLV = GetEquipPartPlusLV(curPlayer, packType, index)
|
| | | totalPlusLV += plusLV
|
| | | |
| | | # 进化等级
|
| | | evolveLV = GetEquipPartPlusEvolveLV(curPlayer, packType, index)
|
| | | totalEvolveLV += evolveLV
|
| | | |
| | | # 洗练等级
|
| | | washLV = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_EquipWashLV % index)
|
| | | totalWashLV += washLV
|
| | | |
| | | # 宝石等级
|
| | | stoneIDList, stoneIsBindList = [], []
|
| | | for holeIndex in holeIndexList:
|
| | | stoneID, stoneIsBind = Operate_EquipStone.GetEquipIndexStoneIDAndIsBand(curPlayer, index, holeIndex)
|
| | | stoneIDList.append(stoneID)
|
| | | stoneIsBindList.append(stoneIsBind)
|
| | | if stoneID == 0:
|
| | | continue
|
| | | curStone = gameData.GetItemByTypeID(stoneID)
|
| | | stoneLV = 0 if not curStone else curStone.GetEffectByIndex(0).GetEffectValue(1)
|
| | | totalStoneLV += stoneLV
|
| | | |
| | | # 星级信息包
|
| | | if starLV:
|
| | | ePartStarLV = ChPyNetSendPack.tagMCEquipPartStar()
|
| | | ePartStarLV.Clear()
|
| | | ePartStarLV.EquipPackIndex = index
|
| | | ePartStarLV.Star = starLV
|
| | | ePartStarLVPack.InfoList.append(ePartStarLV)
|
| | | |
| | | # 强化、进化信息包
|
| | | if plusLV or plusProficiency or evolveLV:
|
| | | ePartPlusLV = ChPyNetSendPack.tagMCEquipPartPlusLV()
|
| | | ePartPlusLV.Clear()
|
| | | ePartPlusLV.PackType = packType
|
| | | ePartPlusLV.EquipIndex = index
|
| | | ePartPlusLV.EquipPartStarLV = plusLV
|
| | | ePartPlusLV.Proficiency = plusProficiency
|
| | | ePartPlusLV.EvolveLV = evolveLV
|
| | | ePartPlusLVPack.InfoList.append(ePartPlusLV)
|
| | | |
| | | # 洗练信息包
|
| | | hasXLValue = False
|
| | | xlAttrList = []
|
| | | for attrNum in xrange(1, Operate_EquipWash.Def_EquipWashMaxAttrCount + 1):
|
| | | washValue = ChPyNetSendPack.tagMCEquipPartXLAttrValue()
|
| | | washValue.XLAttrValue = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_EquipWashValue % (index, attrNum))
|
| | | washValue.XLAttrChange = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_EquipWashValueTemp % (index, attrNum))
|
| | | xlAttrList.append(washValue)
|
| | | if washValue.XLAttrValue or washValue.XLAttrChange:
|
| | | hasXLValue = True
|
| | | if hasXLValue or washLV:
|
| | | ePartXLAttr = ChPyNetSendPack.tagMCEquipPartXLAttr()
|
| | | ePartXLAttr.EquipPlace = index
|
| | | ePartXLAttr.XLAttrLV = washLV
|
| | | ePartXLAttr.XLAttrList = xlAttrList
|
| | | ePartXLAttr.XLAttrCnt = len(ePartXLAttr.XLAttrList)
|
| | | ePartXLPack.InfoList.append(ePartXLAttr)
|
| | | |
| | | # 宝石信息包
|
| | | stoneCount = len(stoneIDList)
|
| | | if stoneIDList.count(0) != stoneCount:
|
| | | stoneMsg = ChPyNetSendPack.tagMCStoneMsg()
|
| | | stoneMsg.EquipPlace = index
|
| | | stoneMsg.MaxStoneCount = stoneCount |
| | | stoneMsg.StoneInfo = stoneIDList
|
| | | stoneMsg.StoneBind = stoneIsBindList
|
| | | ePartStonePack.InfoList.append(stoneMsg)
|
| | | |
| | | # 通知封包,有值时才通知
|
| | | if ePartStarLVPack.InfoList:
|
| | | ePartStarLVPack.Count = len(ePartStarLVPack.InfoList)
|
| | | NetPackCommon.SendFakePack(curPlayer, ePartStarLVPack)
|
| | | |
| | | if ePartPlusLVPack.InfoList:
|
| | | ePartPlusLVPack.Count = len(ePartPlusLVPack.InfoList)
|
| | | NetPackCommon.SendFakePack(curPlayer, ePartPlusLVPack)
|
| | | |
| | | if ePartXLPack.InfoList:
|
| | | ePartXLPack.Count = len(ePartXLPack.InfoList)
|
| | | NetPackCommon.SendFakePack(curPlayer, ePartXLPack)
|
| | | |
| | | if ePartStonePack.InfoList:
|
| | | ePartStonePack.EquipCount = len(ePartStonePack.InfoList) |
| | | NetPackCommon.SendFakePack(curPlayer, ePartStonePack)
|
| | | |
| | | # 更新统计汇总值
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PlayerKey_EquipOrangeCount, orangeEquipCount)
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_TotalEquipStar, totalStar)
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_TotalPlusLV, totalPlusLV)
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_TotalPlusEvolveLV, totalEvolveLV)
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_TotalEquipWashLV, totalWashLV)
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_TotalStoneLV, totalStoneLV)
|
| | | GameWorld.DebugLog("登录更新装备相关值汇总: orangeEquipCount=%s,totalStar=%s,totalPlusLV=%s,totalEvolveLV=%s,totalWashLV=%s,totalStoneLV=%s" |
| | | % (orangeEquipCount, totalStar, totalPlusLV, totalEvolveLV, totalWashLV, totalStoneLV)) |
| | | return
|
| | |
|
| | | ## 刷新所有装备对人物属性的改变
|
| | |
| | | return
|
| | |
|
| | | #先刷装备BUFF 再计算属性
|
| | | if equipPlace == ShareDefine.retWing:
|
| | | PlayerWing.CalcWingAttr(curPlayer)
|
| | | else:
|
| | | if equipPlace in ChConfig.EquipPlace_LingQi:
|
| | | RefreshPlayerLingQiEquipAttr(curPlayer)
|
| | | elif itemClassLV:
|
| | | RefreshPlayerEquipAttribute(curPlayer, itemClassLV)
|
| | |
|
| | | #刷新所有属性
|
| | |
| | |
|
| | | return
|
| | |
|
| | | def RefreshPlayerLingQiEquipAttr(curPlayer):
|
| | | ''' 刷新玩家灵器装备属性
|
| | | '''
|
| | | |
| | | classLV = 0 # 灵器阶默认为0
|
| | | allAttrList = [{} for _ in range(4)]
|
| | | lingQiAttrList = [{} for _ in range(4)]
|
| | | equipPack = curPlayer.GetItemManager().GetPack(IPY_GameWorld.rptEquip)
|
| | | equipScoreTotal = 0
|
| | | lv = curPlayer.GetLV()
|
| | | lqAttrFormatDict = IpyGameDataPY.GetFuncEvalCfg("OutOfPrintValue", 2, {})
|
| | | |
| | | for equipPlace in ChConfig.EquipPlace_LingQi:
|
| | | |
| | | ipyData = IpyGameDataPY.GetIpyGameData('EquipPlaceIndexMap', classLV, equipPlace)
|
| | | if not ipyData:
|
| | | continue
|
| | | |
| | | equipIndex = ipyData.GetGridIndex()
|
| | | curEquip = equipPack.GetAt(equipIndex)
|
| | | if not curEquip or curEquip.IsEmpty():
|
| | | continue
|
| | | |
| | | if not ItemCommon.CheckItemCanUseByExpireTime(curEquip):
|
| | | # 过期
|
| | | continue
|
| | | |
| | | equipScoreTotal += ItemCommon.GetEquipGearScore(curEquip)
|
| | | |
| | | itemID = curEquip.GetItemTypeID()
|
| | | #基础属性效果
|
| | | for effIndex in xrange(curEquip.GetEffectCount()):
|
| | | curEff = curEquip.GetEffectByIndex(effIndex)
|
| | | effID = curEff.GetEffectID()
|
| | | if effID == 0:
|
| | | break
|
| | | PlayerControl.CalcAttrDict_Type(effID, curEff.GetEffectValue(0), lingQiAttrList)
|
| | | |
| | | #灵器属性
|
| | | lingQiIpyData = IpyGameDataPY.GetIpyGameDataNotLog("LingQiAttr", itemID)
|
| | | if lingQiIpyData:
|
| | | lingQiAttrIDList = lingQiIpyData.GetLingQiAttrID()
|
| | | lingQiAttrValueList = lingQiIpyData.GetLingQiAttrValue()
|
| | | for lqIndex, lqAttrID in enumerate(lingQiAttrIDList):
|
| | | if str(lqAttrID) in lqAttrFormatDict:
|
| | | attrFormat = lqAttrFormatDict[str(lqAttrID)]
|
| | | maxOOPValue = lingQiAttrValueList[lqIndex]
|
| | | lqAttrValue = eval(FormulaControl.GetCompileFormula("LingQiAttrFormat_%s" % lqAttrID, attrFormat))
|
| | | else:
|
| | | lqAttrValue = lingQiAttrValueList[lqIndex]
|
| | | |
| | | PlayerControl.CalcAttrDict_Type(lqAttrID, lqAttrValue, lingQiAttrList)
|
| | | |
| | | #灵器各部位其他属性
|
| | | if equipPlace == ShareDefine.retWing:
|
| | | PlayerWing.CalcWingAttrEx(curPlayer, curEquip, allAttrList)
|
| | | |
| | | lqFightPowerEx = eval(IpyGameDataPY.GetFuncCompileCfg("FightpowerFormula", 2))
|
| | | curPlayer.SetDict(ChConfig.Def_PlayerKey_MFPEx % ShareDefine.Def_MFPType_LingQi, lqFightPowerEx)
|
| | | |
| | | #GameWorld.DebugLog("灵器属性1: %s" % allAttrList)
|
| | | #GameWorld.DebugLog("灵器属性2: %s" % lingQiAttrList)
|
| | | #GameWorld.DebugLog("灵器评分战力: equipScoreTotal=%s, %s" % (equipScoreTotal, lqFightPowerEx))
|
| | | PlayerControl.SetCalcAttrListValue(curPlayer, ChConfig.Def_CalcAttrFunc_LingQi, allAttrList)
|
| | | PlayerControl.SetCalcAttrListValue(curPlayer, ChConfig.Def_CalcAttrFunc_LingQiAttr, lingQiAttrList)
|
| | | return
|
| | |
|
| | | def __CalcEquips_Effect(curPlayer, classLV):
|
| | | ''' 境界装备系统属性
|
| | | 1. 装备模块,每个境界阶独立,每个境界战力独立模块计算
|
| | | 1.1 装备本身属性: 不能有影响其他境界装备的属性
|
| | | 基础属性: 物品表中的配置
|
| | | 传奇属性:
|
| | | 绝版属性: |
| | |
|
| | | 2.装备位星级模块
|
| | | 2.1 装备位升星属性:不能有影响其他境界装备的属性
|
| | |
| | | #stone_addEquipBaseAttrPerList = [{}, {}, {}] # 宝石功能点对装备基础的加成信息 [所有部位, 基础部位, 指定部位]
|
| | | allAttrListWash = [{} for _ in range(4)] # 洗练属性
|
| | | #wash_addEquipBaseAttrPerList = [{}, {}, {}] # 洗练功能点对装备基础的加成信息 [所有部位, 基础部位, 指定部位]
|
| | | #allAttrListOutOfPrintEquip = [{} for _ in range(4)] # 绝版装备属性 需在等级变化独立计算
|
| | |
|
| | | packType = IPY_GameWorld.rptEquip
|
| | | playerEquip = curPlayer.GetItemManager().GetPack(packType)
|
| | |
| | | PlayerControl.CalcAttrDict_Type(legendAttrID, legendAttrValue, allAttrListEquip)
|
| | | #GameWorld.DebugLog(" 传奇属性: ID=%s +%s" % (legendAttrID, legendAttrValue))
|
| | | __CalcFuncAddEquipAttrPer(equipPlace, legendAttrID, legendAttrValue, equip_addEquipBaseAttrPerList)
|
| | | |
| | | #绝世属性 - 暂不考虑
|
| | | #CalcAttr_OutOfPrintAttr(curPlayer, curEquip, allAttrListOutOfPrintEquip)
|
| | |
|
| | | #物品强化属性
|
| | | __CalcAttr_ItemPlus(curPlayer, curEquip, packType, equipIndex, allAttrListPlus, plus_addEquipBaseAttrPerList)
|
| | |
| | | #__CalcFuncAddEquipAttrValue(allEquipBaseAttrDict, baseEquipBaseAttrDict, equipBaseAttrDict, stone_addEquipBaseAttrPerList, insideAttrDictStone, "Stone")
|
| | | #__CalcFuncAddEquipAttrValue(allEquipBaseAttrDict, baseEquipBaseAttrDict, equipBaseAttrDict, wash_addEquipBaseAttrPerList, insideAttrDictWash, "Wash")
|
| | |
|
| | | #保存计算值
|
| | | #PlayerControl.SetCalcAttrListValue(curPlayer, ChConfig.Def_CalcAttrFunc_EquipOutOfPrint, allAttrListOutOfPrintEquip)
|
| | | #计算装备基础属性附加战力 (目前组成: 评分战力 + ...)
|
| | | equipFightPowerEx = eval(IpyGameDataPY.GetFuncCompileCfg("FightpowerFormula", 2))
|
| | |
|
| | |
| | | PlayerControl.CalcAttrDict_Type(attrID, value, allAttrListEquip)
|
| | | #legendAttrDict[attrID] = legendAttrDict.get(attrID, 0) + value
|
| | |
|
| | | return
|
| | |
|
| | |
|
| | | # 装备绝版属性,随等级变化需在升级再处理
|
| | | def CalcAttr_OutOfPrintAttr(curPlayer, curEquip, allAttrListOutOfPrintEquip):
|
| | | ## 计算绝版属性
|
| | | |
| | | # 绝版属性ID列表
|
| | | OutOfPrintAttrIDList = [curEquip.GetUserAttrByIndex(ShareDefine.Def_IudetOutOfPrintAttrID, i) \
|
| | | for i in range(curEquip.GetUserAttrCount(ShareDefine.Def_IudetOutOfPrintAttrID))]
|
| | | # 绝版属性值列表
|
| | | OutOfPrintAttrValueList = [curEquip.GetUserAttrByIndex(ShareDefine.Def_IudetOutOfPrintAttrValue, i) \
|
| | | for i in range(curEquip.GetUserAttrCount(ShareDefine.Def_IudetOutOfPrintAttrValue))]
|
| | | if not OutOfPrintAttrIDList or len(OutOfPrintAttrIDList) != len(OutOfPrintAttrValueList):
|
| | | return
|
| | | |
| | | lv = curPlayer.GetLV()
|
| | | OutOfPrintAttrFormatDict = IpyGameDataPY.GetFuncEvalCfg("OutOfPrintValue", 2, {})
|
| | | for i, attrID in enumerate(OutOfPrintAttrIDList):
|
| | | if str(attrID) not in OutOfPrintAttrFormatDict:
|
| | | continue
|
| | | attrFormat = OutOfPrintAttrFormatDict[str(attrID)]
|
| | | maxOOPValue = OutOfPrintAttrValueList[i]
|
| | | value = eval(FormulaControl.GetCompileFormula("OutOfPrintAttrFormat_%s" % attrID, attrFormat))
|
| | | GameWorld.DebugLog("加绝版属性: %s +%s" % (attrID, value))
|
| | | PlayerControl.CalcAttrDict_Type(attrID, value, allAttrListOutOfPrintEquip)
|
| | | |
| | | return
|
| | |
|
| | |
|
| | | ## 计算装备对基本属性的改变 |
| | | # @return None
|
| | | def CalcEquips_OutOfPrint(curPlayer):
|
| | | # 境界装备改版,先屏蔽,之后再处理
|
| | | return
|
| | | allAttrListOutOfPrintEquip = [{} for _ in range(4)] # 绝版装备属性 需在等级变化独立计算
|
| | | |
| | | packType = IPY_GameWorld.rptEquip
|
| | | playerEquip = curPlayer.GetItemManager().GetPack(packType)
|
| | |
|
| | | #玩家当前可装备的装备类型
|
| | | for equipIndex in xrange(playerEquip.GetCount()):
|
| | | if equipIndex not in ShareDefine.RoleEquipType :
|
| | | continue
|
| | | |
| | | # 翅膀属性在翅膀功能单独刷新
|
| | | if equipIndex == ShareDefine.retWing:
|
| | | continue
|
| | | |
| | | curEquip = playerEquip.GetAt(equipIndex)
|
| | | if curEquip.IsEmpty():
|
| | | continue
|
| | | |
| | | if not ItemCommon.CheckItemCanUseByExpireTime(curEquip):
|
| | | # 过期
|
| | | continue
|
| | | |
| | | #绝世属性
|
| | | CalcAttr_OutOfPrintAttr(curPlayer, curEquip, allAttrListOutOfPrintEquip)
|
| | |
|
| | | #保存计算值
|
| | | PlayerControl.SetCalcAttrListValue(curPlayer, ChConfig.Def_CalcAttrFunc_EquipOutOfPrint, allAttrListOutOfPrintEquip)
|
| | | return
|
| | |
|
| | | def __CalcAttr_ItemPlus(curPlayer, curEquip, packType, equipIndex, allAttrList, plus_addEquipBaseAttrPerList):
|
| | |
| | | return min(curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_EquipPartPlusLV % (packType, index)), maxStarLV)
|
| | |
|
| | |
|
| | | ## 获取公共部位强化星级
|
| | | ## 获取公共部位强化等级
|
| | | def GetEquipPartPlusLV(curPlayer, packType, index):
|
| | | return curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_EquipPartPlusLV % (packType, index))
|
| | |
|
| | |
|
| | | ## 设置公共部位强化星级
|
| | | def SetEquipPartPlusLV(curPlayer, packType, index, curEquip, starLV):
|
| | | if GetEquipPartPlusLV(curPlayer, packType, index) == starLV:
|
| | | ## 设置公共部位强化等级
|
| | | def SetEquipPartPlusLV(curPlayer, packType, index, curEquip, setPlusLV):
|
| | | befPlusLV = GetEquipPartPlusLV(curPlayer, packType, index)
|
| | | if befPlusLV == setPlusLV:
|
| | | return
|
| | |
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_EquipPartPlusLV % (packType, index), starLV)
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_EquipPartPlusLV % (packType, index), setPlusLV)
|
| | | #===========================================================================
|
| | | # if curEquip and not curEquip.IsEmpty():
|
| | | # curEquip.SetItemStarLV(starLV)
|
| | | #===========================================================================
|
| | |
|
| | | |
| | | # 同步更新强化总等级
|
| | | befTotalPlusLV = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_TotalPlusLV)
|
| | | updTotalPlusLV = max(0, befTotalPlusLV + setPlusLV - befPlusLV)
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_TotalPlusLV, updTotalPlusLV)
|
| | | GameWorld.DebugLog("设置强化等级: index=%s,befPlusLV=%s,setPlusLV=%s,befTotalPlusLV=%s,updTotalPlusLV=%s" |
| | | % (index, befPlusLV, setPlusLV, befTotalPlusLV, updTotalPlusLV))
|
| | | return
|
| | |
|
| | |
|
| | |
| | |
|
| | |
|
| | | ## 设置公共部位强化进化等级
|
| | | def SetEquipPartPlusEvolveLV(curPlayer, packType, index, evolveLV):
|
| | | if GetEquipPartPlusEvolveLV(curPlayer, packType, index) == evolveLV:
|
| | | def SetEquipPartPlusEvolveLV(curPlayer, packType, index, setEvolveLV):
|
| | | befEvolveLV = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_EquipPartPlusEvolveLV % (packType, index))
|
| | | if befEvolveLV == setEvolveLV:
|
| | | return
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_EquipPartPlusEvolveLV % (packType, index), evolveLV)
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_EquipPartPlusEvolveLV % (packType, index), setEvolveLV)
|
| | | |
| | | # 同步更新进化总等级
|
| | | befTotalPlusEvolveLV = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_TotalPlusEvolveLV)
|
| | | updTotalPlusEvolveLV = max(0, befTotalPlusEvolveLV + setEvolveLV - befEvolveLV)
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_TotalPlusEvolveLV, updTotalPlusEvolveLV)
|
| | | GameWorld.DebugLog("设置进化等级: index=%s,befEvolveLV=%s,setEvolveLV=%s,befTotalPlusEvolveLV=%s,updTotalPlusEvolveLV=%s" |
| | | % (index, befEvolveLV, setEvolveLV, befTotalPlusEvolveLV, updTotalPlusEvolveLV))
|
| | | return
|
| | |
|
| | | ## 通知公共部位强化等级
|
| | |
| | |
|
| | | ## 全身强化等级
|
| | | def GetTotalPlusLV(curPlayer, isActive=True):
|
| | | totalPlusLV = 0
|
| | | equipPack = curPlayer.GetItemManager().GetPack(IPY_GameWorld.rptEquip)
|
| | | equipPartIndexList = ChConfig.Pack_EquipPart_CanPlusStar[IPY_GameWorld.rptEquip]
|
| | | for i in equipPartIndexList:
|
| | | if isActive:
|
| | | curEquip = equipPack.GetAt(i)
|
| | | if not curEquip or curEquip.IsEmpty():
|
| | | continue
|
| | | |
| | | partStarLV = GetEquipPartPlusLV(curPlayer, IPY_GameWorld.rptEquip, i)
|
| | | totalPlusLV += partStarLV
|
| | | return totalPlusLV
|
| | | return curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_TotalPlusLV)
|
| | |
|
| | | ## 全身进化等级
|
| | | def GetTotalPlusEvolveLV(curPlayer):
|
| | | return curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_TotalPlusEvolveLV)
|
| | |
|
| | | ## 全身橙装及以上装备数
|
| | | def GetEquipOrangeCount(curPlayer):
|
| | | return curPlayer.NomalDictGetProperty(ChConfig.Def_PlayerKey_EquipOrangeCount)
|
| | |
|
| | |
|
| | | # 获取装备的强化类型
|
| | |
| | |
|
| | |
|
| | |
|
| | | def SetEquipPartStar(curPlayer, equipPackindex, star):
|
| | | def SetEquipPartStar(curPlayer, index, setStarLV):
|
| | | #设置公共部位星数
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_EquipPartStar % equipPackindex, star)
|
| | | |
| | | befStarLV = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_EquipPartStar % index)
|
| | | if befStarLV == setStarLV:
|
| | | return |
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_EquipPartStar % index, setStarLV)
|
| | | |
| | | # 同步更新星级总等级
|
| | | befTotalStarLV = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_TotalEquipStar)
|
| | | updTotalStarLV = max(0, befTotalStarLV + setStarLV - befStarLV)
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_TotalEquipStar, updTotalStarLV)
|
| | | GameWorld.DebugLog("设置部位星级: index=%s,befStarLV=%s,setStarLV=%s,befTotalStarLV=%s,updTotalStarLV=%s" |
| | | % (index, befStarLV, setStarLV, befTotalStarLV, updTotalStarLV))
|
| | | return
|
| | |
|
| | |
|
| | |
| | |
|
| | | def GetTotalEquipStars(curPlayer):
|
| | | ##获取部位总星数
|
| | | totalStar = 0
|
| | | equipMaxClasslv = IpyGameDataPY.GetFuncCfg('EquipMaxClasslv')
|
| | | for equipPlace in ChConfig.Pack_EquipPart_CanPlusStar.get(IPY_GameWorld.rptEquip, []):
|
| | | for classlv in xrange(1, equipMaxClasslv+1):
|
| | | ipyData = IpyGameDataPY.GetIpyGameData('EquipPlaceIndexMap', classlv, equipPlace)
|
| | | if not ipyData:
|
| | | continue
|
| | | totalStar +=GetEquipPartStar(curPlayer, ipyData.GetGridIndex())
|
| | | return totalStar
|
| | | return curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_TotalEquipStar)
|
| | |
|
| | | ## 通知公共部位星数
|
| | | def NotifyEquipPartStar(curPlayer, index=None):
|