| | |
| | |
|
| | | 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()
|
| | | OutOfPrintAttrFormatDict = IpyGameDataPY.GetFuncEvalCfg("OutOfPrintValue", 2, {})
|
| | |
|
| | | for equipPlace in ChConfig.EquipPlace_LingQi:
|
| | | |
| | | if equipPlace == ShareDefine.retWing:
|
| | | PlayerWing.CalcWingAttr(curPlayer)
|
| | | continue
|
| | |
|
| | | ipyData = IpyGameDataPY.GetIpyGameData('EquipPlaceIndexMap', classLV, equipPlace)
|
| | | if not ipyData:
|
| | |
| | | # 过期
|
| | | 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), allAttrList)
|
| | | PlayerControl.CalcAttrDict_Type(effID, curEff.GetEffectValue(0), lingQiAttrList)
|
| | |
|
| | | #GameWorld.DebugLog("灵器属性: %s" % allAttrList)
|
| | | #灵器属性
|
| | | lingQiIpyData = IpyGameDataPY.GetIpyGameDataNotLog("LingQiAttr", itemID)
|
| | | if lingQiIpyData:
|
| | | lingQiAttrIDList = lingQiIpyData.GetLingQiAttrID()
|
| | | lingQiAttrValueList = lingQiIpyData.GetLingQiAttrValue()
|
| | | for lqIndex, lqAttrID in enumerate(lingQiAttrIDList):
|
| | | if str(lqAttrID) in OutOfPrintAttrFormatDict:
|
| | | attrFormat = OutOfPrintAttrFormatDict[str(lqAttrID)]
|
| | | maxOOPValue = lingQiAttrValueList[lqIndex]
|
| | | lqAttrValue = eval(FormulaControl.GetCompileFormula("OutOfPrintAttrFormat_%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):
|
| | |
| | | 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):
|