| | |
| | |
|
| | | def CalcEquipGS(curItem):
|
| | | '''计算装备评分
|
| | | 评分组成:装备基础 + 传奇属性 + 绝版属性
|
| | | 评分组成:装备基础 + 传奇属性
|
| | | '''
|
| | | if not CheckNoteEquipGS(curItem):
|
| | | #GameWorld.DebugLog("不设置装备评分")
|
| | |
| | | break
|
| | | attrDict[effectID] = attrDict.get(effectID, 0) + curEffect.GetEffectValue(0)
|
| | |
|
| | | skillGS = 0
|
| | | gsValueEx = 0
|
| | | skillGSDict = IpyGameDataPY.GetFuncCfg("EquipGSFormula", 4)
|
| | | for i in xrange(curItem.GetAddSkillCount()):
|
| | | addSkillID = curItem.GetAddSkill(i)
|
| | | if not addSkillID:
|
| | | break
|
| | | skillGS += skillGSDict.get(str(addSkillID), 0)
|
| | | gsValueEx += skillGSDict.get(str(addSkillID), 0)
|
| | |
|
| | | itemID = curItem.GetItemTypeID()
|
| | | classLV = GetItemClassLV(curItem)
|
| | | color = curItem.GetItemColor()
|
| | | isSuit = 1 if curItem.GetSuiteID() > 0 else 0
|
| | | gsParamIpyData = IpyGameDataPY.GetIpyGameData("EquipGSParam", classLV, color, isSuit)
|
| | | gsParamIpyData = IpyGameDataPY.GetIpyGameDataNotLog("EquipGSParam", classLV, color, isSuit)
|
| | | # 传奇属性
|
| | | legendAttrIDCnt = curItem.GetUserAttrCount(ShareDefine.Def_IudetLegendAttrID)
|
| | | legendAttrValueCnt = curItem.GetUserAttrCount(ShareDefine.Def_IudetLegendAttrValue)
|
| | |
| | | attrValue = curItem.GetUserAttrByIndex(ShareDefine.Def_IudetLegendAttrValue, i)
|
| | | attrDict[attrID] = attrDict.get(attrID, 0) + attrValue
|
| | |
|
| | | lingQiIpyData = IpyGameDataPY.GetIpyGameDataNotLog("LingQiAttr", itemID)
|
| | | if lingQiIpyData:
|
| | | gsValueEx += lingQiIpyData.GetLingQiAttrScore()
|
| | | |
| | | Atk = attrDict.get(ShareDefine.Def_Effect_Atk, 0)
|
| | | MinAtk = attrDict.get(ShareDefine.Def_Effect_MinAtk, 0) + Atk
|
| | | MaxAtk = attrDict.get(ShareDefine.Def_Effect_MaxAtk, 0) + Atk
|
| | |
| | | ArmorDefPer = 0
|
| | | IceAtk = attrDict.get(ShareDefine.Def_Effect_IceAtk, 0)
|
| | | IceDef = attrDict.get(ShareDefine.Def_Effect_IceDef, 0)
|
| | | FabaoHurt = attrDict.get(ShareDefine.Def_Effect_FabaoHurt, 0)
|
| | |
|
| | | BaseEquipMaxHPAddPer = attrDict.get(ShareDefine.Def_Effect_BaseEquipMaxHPAddPer, 0) * (1 if not gsParamIpyData else gsParamIpyData.GetBaseEquipMaxHPAddPerC())
|
| | | BaseEquipAtkAddPer = attrDict.get(ShareDefine.Def_Effect_BaseEquipAtkAddPer, 0) * (1 if not gsParamIpyData else gsParamIpyData.GetBaseEquipAtkAddPerC())
|
| | |
| | | SkillAtkRateReduce = 0#attrDict.get(ShareDefine.Def_Effect_SkillAtkRateReduce, 0) * (1 if not gsParamIpyData else gsParamIpyData.GetSkillAtkRateReduceC())
|
| | | Hit = attrDict.get(ShareDefine.Def_Effect_Hit, 0) * (1 if not gsParamIpyData else gsParamIpyData.GetHitC())
|
| | | Miss = attrDict.get(ShareDefine.Def_Effect_Miss, 0) * (1 if not gsParamIpyData else gsParamIpyData.GetMissC())
|
| | | SkillAddPerA = 0#attrDict.get(ShareDefine.Def_Effect_SkillAddPer1, 0) * (1 if not gsParamIpyData else gsParamIpyData.GetSkillAddPer1C())
|
| | | SkillAddPerB = 0#attrDict.get(ShareDefine.Def_Effect_SkillAddPer2, 0) * (1 if not gsParamIpyData else gsParamIpyData.GetSkillAddPer2C())
|
| | | SkillAddPerC = 0#attrDict.get(ShareDefine.Def_Effect_SkillAddPer3, 0) * (1 if not gsParamIpyData else gsParamIpyData.GetSkillAddPer3C())
|
| | | SkillAddPerD = 0#attrDict.get(ShareDefine.Def_Effect_SkillAddPer4, 0) * (1 if not gsParamIpyData else gsParamIpyData.GetSkillAddPer4C())
|
| | | SkillAddPerE = 0#attrDict.get(ShareDefine.Def_Effect_SkillAddPer5, 0) * (1 if not gsParamIpyData else gsParamIpyData.GetSkillAddPer5C())
|
| | | SkillAddPerF = 0#attrDict.get(ShareDefine.Def_Effect_SkillAddPer6, 0) * (1 if not gsParamIpyData else gsParamIpyData.GetSkillAddPer6C())
|
| | | SkillAddPerG = 0#attrDict.get(ShareDefine.Def_Effect_SkillAddPer7, 0) * (1 if not gsParamIpyData else gsParamIpyData.GetSkillAddPer7C())
|
| | | SkillReducePerA = 0#attrDict.get(ShareDefine.Def_Effect_SkillReducePer1, 0) * (1 if not gsParamIpyData else gsParamIpyData.GetSkillReducePer1C())
|
| | | SkillReducePerB = 0#attrDict.get(ShareDefine.Def_Effect_SkillReducePer2, 0) * (1 if not gsParamIpyData else gsParamIpyData.GetSkillReducePer2C())
|
| | | SkillReducePerC = 0#attrDict.get(ShareDefine.Def_Effect_SkillReducePer3, 0) * (1 if not gsParamIpyData else gsParamIpyData.GetSkillReducePer3C())
|
| | | SkillReducePerD = 0#attrDict.get(ShareDefine.Def_Effect_SkillReducePer4, 0) * (1 if not gsParamIpyData else gsParamIpyData.GetSkillReducePer4C())
|
| | | SkillReducePerE = 0#attrDict.get(ShareDefine.Def_Effect_SkillReducePer5, 0) * (1 if not gsParamIpyData else gsParamIpyData.GetSkillReducePer5C())
|
| | | SkillReducePerF = 0#attrDict.get(ShareDefine.Def_Effect_SkillReducePer6, 0) * (1 if not gsParamIpyData else gsParamIpyData.GetSkillReducePer6C())
|
| | | SkillReducePerG = 0#attrDict.get(ShareDefine.Def_Effect_SkillReducePer7, 0) * (1 if not gsParamIpyData else gsParamIpyData.GetSkillReducePer7C())
|
| | | SkillAddPerA = 0
|
| | | SkillAddPerB = 0
|
| | | SkillAddPerC = 0
|
| | | SkillAddPerD = 0
|
| | | SkillAddPerE = 0
|
| | | SkillAddPerF = 0
|
| | | SkillAddPerG = 0
|
| | | SkillReducePerA = 0
|
| | | SkillReducePerB = 0
|
| | | SkillReducePerC = 0
|
| | | SkillReducePerD = 0
|
| | | SkillReducePerE = 0
|
| | | SkillReducePerF = 0
|
| | | SkillReducePerG = 0
|
| | |
|
| | | # 攻速不默认乘,仅作为参数提供策划使用
|
| | | AtkSpeed = 0#attrDict.get(ShareDefine.Def_Effect_AtkSpeed, 0)
|
| | | AtkSpeedC = 1#1 if not gsParamIpyData else gsParamIpyData.GetAtkSpeedC()
|
| | | |
| | | # 绝版
|
| | | outOfPrintAttrIDCnt = curItem.GetUserAttrCount(ShareDefine.Def_IudetOutOfPrintAttrID)
|
| | | outOfPrintAttrValueCnt = curItem.GetUserAttrCount(ShareDefine.Def_IudetOutOfPrintAttrValue)
|
| | | if outOfPrintAttrIDCnt and outOfPrintAttrIDCnt == outOfPrintAttrValueCnt:
|
| | | for i in xrange(legendAttrIDCnt):
|
| | | attrID = curItem.GetUserAttrByIndex(ShareDefine.Def_IudetOutOfPrintAttrID, i)
|
| | | attrValue = curItem.GetUserAttrByIndex(ShareDefine.Def_IudetOutOfPrintAttrValue, i)
|
| | | attrDict[attrID] = attrDict.get(attrID, 0) + attrValue
|
| | |
|
| | | OnlyFinalHurt = attrDict.get(ShareDefine.Def_Effect_OnlyFinalHurt, 0)
|
| | | PVPAtkBackHP = attrDict.get(ShareDefine.Def_Effect_PVPAtkBackHP, 0)
|
| | |
| | | value = eval(FormulaControl.GetCompileFormula("EquipGSFormula3", IpyGameDataPY.GetFuncCfg("EquipGSFormula", 3)))
|
| | | else:
|
| | | value = eval(FormulaControl.GetCompileFormula("EquipGSFormula", IpyGameDataPY.GetFuncCfg("EquipGSFormula")))
|
| | | value += skillGS
|
| | | value += gsValueEx
|
| | | return value
|
| | |
|
| | | def GetZhuXianEquipTotalGS(curPlayer):
|
| | | ##诛仙装备总评分
|
| | | equipScoreTotal = 0
|
| | | zhuXianEquipPack = curPlayer.GetItemManager().GetPack(ShareDefine.rptZhuXianEquip)
|
| | | for equipIndex in xrange(zhuXianEquipPack.GetCount()):
|
| | | curEquip = zhuXianEquipPack.GetAt(equipIndex) |
| | | if curEquip.IsEmpty():
|
| | | continue
|
| | | equipScoreTotal += GetEquipGearScore(curEquip)
|
| | | return equipScoreTotal
|
| | |
|
| | | #---------------------------------------------------------------------
|
| | | ## 通过效果ID,检查是否为指定物品
|
| | |
| | | if not classEquip or classEquip.IsEmpty():
|
| | | continue
|
| | | equipID = classEquip.GetItemTypeID()
|
| | | equipStar = ChEquip.GetEquipPartStarByRank(curPlayer, index, classEquip)
|
| | | classItems.append([equipID, equipStar])
|
| | | star = ChEquip.GetEquipPartStarByRank(curPlayer, index, classEquip)
|
| | | classItems.append([equipID, star])
|
| | |
|
| | | cacheInfo = [guid, itemID, equipStar, plusLV, plusEvolveLV, washLV, washValueList, stoneIDList, classItems]
|
| | | cacheInfo = json.dumps(cacheInfo, ensure_ascii=False)
|
| | |
| | | # @remarks 函数详细说明.
|
| | | def SwitchItem(curPlayer, curItem, switchItem, putInPackIndex):
|
| | | ##物品绑定字段判定 -> 装备绑定
|
| | | if putInPackIndex in [IPY_GameWorld.rptEquip, ShareDefine.rptZhuXianEquip]:
|
| | | if putInPackIndex in [IPY_GameWorld.rptEquip]:
|
| | | DoLogic_ItemBindType(curPlayer, switchItem, ChConfig.Def_BindType_DoEquipBind)
|
| | |
|
| | | # 装备技能书、坐骑装备绑定
|
| | | if putInPackIndex in [IPY_GameWorld.rptHorseEquip, ShareDefine.rptZhuXianEquip]:
|
| | | if putInPackIndex in [IPY_GameWorld.rptHorseEquip]:
|
| | | DoLogic_ItemBindType(curPlayer, curItem, ChConfig.Def_BindType_DoEquipBind)
|
| | |
|
| | | #交换装备
|
| | |
| | | return
|
| | |
|
| | | ##物品绑定字段判定 -> 装备绑定
|
| | | if putInPackIndex in [IPY_GameWorld.rptEquip, ShareDefine.rptZhuXianEquip]:
|
| | | if putInPackIndex in [IPY_GameWorld.rptEquip]:
|
| | | DoLogic_ItemBindType(curPlayer, switchItem, ChConfig.Def_BindType_DoEquipBind)
|
| | |
|
| | | # 装备技能书、坐骑装备绑定
|
| | | if putInPackIndex in [IPY_GameWorld.rptHorseEquip, ShareDefine.rptZhuXianEquip]:
|
| | | if putInPackIndex in [IPY_GameWorld.rptHorseEquip]:
|
| | | DoLogic_ItemBindType(curPlayer, emptyItem, ChConfig.Def_BindType_DoEquipBind)
|
| | |
|
| | | if switchItem.GetGameWorldItemType() == IPY_GameWorld.gwitRoleItem:
|
| | |
| | | def GetIsDogzEquip(curItem):
|
| | | ## 返回是否神兽装备
|
| | | return curItem.GetType() in ChConfig.Def_DogzEquiipType
|
| | |
|
| | | def GetIsZhuXianEquip(curItem):
|
| | | ## 返回是否诛仙装备
|
| | | return curItem.GetType() in ChConfig.Def_ZhuXianEquiipType
|
| | |
|
| | | #---------------------------------------------------------------------
|
| | | ##遍历数据库查找合适的物品, 通过 效果ID + 效果A值确定物品
|
| | |
| | | return itemDict
|
| | |
|
| | | def GetWeightItemListByAlchemyDiffLV(curPlayer, weightList, alchemyDiffLV):
|
| | | ## 根据炼丹等级差异等级过滤权重列表中不满足的物品,返回新的权重列表
|
| | | ''' 根据炼丹等级差异等级过滤权重列表中不满足的物品,返回新的权重列表
|
| | | @param weightList: 物品权重信息列表
|
| | | @param alchemyDiffLV: 是否过滤掉大于X级的炼丹等级物品,0-不过滤,1-过滤且读默认配置,>1-特殊功能指定的过滤等级
|
| | | '''
|
| | | resultWeightList = []
|
| | | if alchemyDiffLV:
|
| | | # 如果有指定大于1的等级则取指定等级,没有的话取默认等级差
|
| | | if alchemyDiffLV == 1:
|
| | | alchemyDiffLV = IpyGameDataPY.GetFuncCfg("AlchemyDiffLV", 1)
|
| | | curAlchemyLV = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_AlchemyLV)
|
| | | for itemInfo in weightList:
|
| | | itemID = itemInfo[1][0]
|
| | | itemData = GameWorld.GetGameData().GetItemByTypeID(itemID)
|
| | | if not itemData:
|
| | | continue
|
| | | if GetItemClassLV(itemData) > curAlchemyLV + alchemyDiffLV:
|
| | | continue
|
| | | if itemID: # 支持配置ID为0时代表不产出
|
| | | itemData = GameWorld.GetGameData().GetItemByTypeID(itemID)
|
| | | if not itemData:
|
| | | continue
|
| | | if GetItemClassLV(itemData) > curAlchemyLV + alchemyDiffLV:
|
| | | continue
|
| | | resultWeightList.append(itemInfo)
|
| | | else:
|
| | | resultWeightList = weightList
|