9762 【BT8】【后端】藏宝阁(古宝特殊效果属性支持) 冲突 master
| | |
| | |
|
| | | allAttrListEquip = [{} for _ in range(4)] # 装备属性
|
| | | equip_addEquipBaseAttrPerList = [{}, {}, {}] # 装备功能点对装备基础的加成信息 [所有部位, 基础部位, 指定部位]
|
| | | baseAttrDictStar = {}
|
| | | allAttrListStar = [{} for _ in range(4)] # 升星属性
|
| | | star_addEquipBaseAttrPerList = [{}, {}, {}] # 升星功能点对装备基础的加成信息 [所有部位, 基础部位, 指定部位]
|
| | | baseAttrDictPlus = {}
|
| | | allAttrListPlus = [{} for _ in range(4)] # 强化属性
|
| | | plus_addEquipBaseAttrPerList = [{}, {}, {}] # 强化功能点对装备基础的加成信息 [所有部位, 基础部位, 指定部位]
|
| | | baseAttrDictStone = {}
|
| | | allAttrListStone = [{} for _ in range(4)] # 宝石属性
|
| | | #stone_addEquipBaseAttrPerList = [{}, {}, {}] # 宝石功能点对装备基础的加成信息 [所有部位, 基础部位, 指定部位]
|
| | | baseAttrDictWash = {}
|
| | | allAttrListWash = [{} for _ in range(4)] # 洗练属性
|
| | | #wash_addEquipBaseAttrPerList = [{}, {}, {}] # 洗练功能点对装备基础的加成信息 [所有部位, 基础部位, 指定部位]
|
| | |
|
| | |
| | | for starBaseAttrID, starBaseAttrValue in starBaseAttrDict.items():
|
| | | PlayerControl.CalcAttrDict_Type(starBaseAttrID, starBaseAttrValue, allAttrListStar)
|
| | | baseAttrDict[starBaseAttrID] = baseAttrDict.get(starBaseAttrID, 0) + starBaseAttrValue
|
| | | baseAttrDictStar[starBaseAttrID] = baseAttrDictStar.get(starBaseAttrID, 0) + starBaseAttrValue
|
| | | allEquipBaseAttrDict[starBaseAttrID] = allEquipBaseAttrDict.get(starBaseAttrID, 0) + starBaseAttrValue
|
| | | if isBaseEquip:
|
| | | baseEquipBaseAttrDict[starBaseAttrID] = baseEquipBaseAttrDict.get(starBaseAttrID, 0) + starBaseAttrValue
|
| | |
| | | __CalcFuncAddEquipAttrPer(equipPlace, legendAttrID, legendAttrValue, equip_addEquipBaseAttrPerList)
|
| | |
|
| | | #物品强化属性
|
| | | plusLV = __CalcAttr_ItemPlus(curPlayer, curEquip, packType, equipIndex, allAttrListPlus, plus_addEquipBaseAttrPerList)
|
| | | plusLV = __CalcAttr_ItemPlus(curPlayer, curEquip, packType, equipIndex, baseAttrDictPlus, allAttrListPlus, plus_addEquipBaseAttrPerList)
|
| | | if isBaseEquip:
|
| | | basePlusLVMin = plusLV if basePlusLVMin == None else min(basePlusLVMin, plusLV)
|
| | |
|
| | | #计算装备宝石加成
|
| | | CalcEquipStone_Effect(curPlayer, equipIndex, allAttrListStone)
|
| | | CalcEquipStone_Effect(curPlayer, equipIndex, baseAttrDictStone, allAttrListStone)
|
| | |
|
| | | #洗练属性
|
| | | Operate_EquipWash.CalcAttr_EquipWash(curPlayer, equipIndex, equipPlace, allAttrListWash)
|
| | | Operate_EquipWash.CalcAttr_EquipWash(curPlayer, equipIndex, equipPlace, baseAttrDictWash, allAttrListWash)
|
| | |
|
| | | # GameWorld.DebugLog(" 装备循环属性: %s" % (allAttrListEquip))
|
| | | # GameWorld.DebugLog(" 升星循环属性: %s" % (allAttrListStar))
|
| | |
| | | if playerID not in PyGameData.g_playerEquipPartAttrDict:
|
| | | PyGameData.g_playerEquipPartAttrDict[playerID] = {}
|
| | | equipPartAttrDict = PyGameData.g_playerEquipPartAttrDict[playerID]
|
| | | equipPartAttrDict[classLV] = [equipFightPowerEx, allAttrListEquip, insideAttrDictEquip, allAttrListStar, insideAttrDictStar,
|
| | | allAttrListPlus, insideAttrDictPlus, allAttrListStone, insideAttrDictStone, allAttrListWash, insideAttrDictWash]
|
| | | equipPartAttrDict[classLV] = [equipFightPowerEx, allAttrListEquip, insideAttrDictEquip, baseAttrDictStar, allAttrListStar, insideAttrDictStar,
|
| | | baseAttrDictPlus, allAttrListPlus, insideAttrDictPlus, baseAttrDictStone, allAttrListStone, insideAttrDictStone, |
| | | baseAttrDictWash, allAttrListWash, insideAttrDictWash]
|
| | |
|
| | | # GameWorld.DebugLog(" ----- 累加所有阶装备位养成属性")
|
| | | # GameWorld.DebugLog(" 本阶装备战力: equipScoreTotal=%s,equipFightPowerEx=%s" % (equipScoreTotal, equipFightPowerEx))
|
| | |
| | |
|
| | | allClassEquipFightPowerEx = 0
|
| | | allClassAttrListEquip, allClassInsideAttrDictEquip = [{} for _ in range(4)], {}
|
| | | allClassAttrListStar, allClassInsideAttrDictStar = [{} for _ in range(4)], {}
|
| | | allClassAttrListPlus, allClassInsideAttrDictPlus = [{} for _ in range(4)], {}
|
| | | allClassAttrListStone, allClassInsideAttrDictStone = [{} for _ in range(4)], {}
|
| | | allClassAttrListWash, allClassInsideAttrDictWash = [{} for _ in range(4)], {}
|
| | | allClassAttrListStar, allClassInsideAttrDictStar, customAttrDictStar, classBaseAttrDictStar = [{} for _ in range(4)], {}, {}, {}
|
| | | allClassAttrListPlus, allClassInsideAttrDictPlus, customAttrDictPlus, classBaseAttrDictPlus = [{} for _ in range(4)], {}, {}, {}
|
| | | allClassAttrListStone, allClassInsideAttrDictStone, customAttrDictStone, classBaseAttrDictStone = [{} for _ in range(4)], {}, {}, {}
|
| | | allClassAttrListWash, allClassInsideAttrDictWash, customAttrDictWash, classBaseAttrDictWash = [{} for _ in range(4)], {}, {}, {}
|
| | | for classLV, attrList in equipPartAttrDict.items():
|
| | | equipFightPowerEx, allAttrListEquip, insideAttrDictEquip, allAttrListStar, insideAttrDictStar, \
|
| | | allAttrListPlus, insideAttrDictPlus, allAttrListStone, insideAttrDictStone, allAttrListWash, insideAttrDictWash = attrList
|
| | | equipFightPowerEx, allAttrListEquip, insideAttrDictEquip, baseAttrDictStar, allAttrListStar, insideAttrDictStar, \
|
| | | baseAttrDictPlus, allAttrListPlus, insideAttrDictPlus, baseAttrDictStone, allAttrListStone, insideAttrDictStone, \
|
| | | baseAttrDictWash, allAttrListWash, insideAttrDictWash = attrList
|
| | | #GameWorld.DebugLog(" classLV=%s, %s" % (classLV, attrList))
|
| | | allClassEquipFightPowerEx += equipFightPowerEx
|
| | | for i in xrange(4):
|
| | |
| | | PlayerControl.AddAttrDictValue(allClassInsideAttrDictStone, insideAttrDictStone)
|
| | | PlayerControl.AddAttrDictValue(allClassInsideAttrDictWash, insideAttrDictWash)
|
| | |
|
| | | classBaseAttrDictStar[classLV] = baseAttrDictStar
|
| | | classBaseAttrDictPlus[classLV] = baseAttrDictPlus
|
| | | classBaseAttrDictStone[classLV] = baseAttrDictStone
|
| | | classBaseAttrDictWash[classLV] = baseAttrDictWash
|
| | | |
| | | customAttrDictStar["classBaseAttrDictStar"] = classBaseAttrDictStar
|
| | | customAttrDictPlus["classBaseAttrDictPlus"] = classBaseAttrDictPlus
|
| | | customAttrDictStone["classBaseAttrDictStone"] = classBaseAttrDictStone
|
| | | customAttrDictWash["classBaseAttrDictWash"] = classBaseAttrDictWash
|
| | | |
| | | # GameWorld.DebugLog(" 所有阶装备战力: %s" % (allClassEquipFightPowerEx))
|
| | | # GameWorld.DebugLog(" 所有阶装备属性: %s, 内部加成=%s" % (allClassAttrListEquip, allClassInsideAttrDictEquip))
|
| | | # GameWorld.DebugLog(" 所有阶升星属性: %s, 内部加成=%s" % (allClassAttrListStar, allClassInsideAttrDictStar))
|
| | |
| | | # GameWorld.DebugLog(" 所有阶洗练属性: %s, 内部加成=%s" % (allClassAttrListWash, allClassInsideAttrDictWash))
|
| | | curPlayer.SetDict(ChConfig.Def_PlayerKey_MFPEx % ShareDefine.Def_MFPType_Equip, allClassEquipFightPowerEx)
|
| | | PlayerControl.SetCalcAttrListValue(curPlayer, ChConfig.Def_CalcAttrFunc_Equip, allClassAttrListEquip, allClassInsideAttrDictEquip)
|
| | | PlayerControl.SetCalcAttrListValue(curPlayer, ChConfig.Def_CalcAttrFunc_Star, allClassAttrListStar, allClassInsideAttrDictStar)
|
| | | PlayerControl.SetCalcAttrListValue(curPlayer, ChConfig.Def_CalcAttrFunc_Plus, allClassAttrListPlus, allClassInsideAttrDictPlus)
|
| | | PlayerControl.SetCalcAttrListValue(curPlayer, ChConfig.Def_CalcAttrFunc_Stone, allClassAttrListStone, allClassInsideAttrDictStone)
|
| | | PlayerControl.SetCalcAttrListValue(curPlayer, ChConfig.Def_CalcAttrFunc_Wash, allClassAttrListWash, allClassInsideAttrDictWash)
|
| | | PlayerControl.SetCalcAttrListValue(curPlayer, ChConfig.Def_CalcAttrFunc_Star, allClassAttrListStar, allClassInsideAttrDictStar, customAttrDict=customAttrDictStar)
|
| | | PlayerControl.SetCalcAttrListValue(curPlayer, ChConfig.Def_CalcAttrFunc_Plus, allClassAttrListPlus, allClassInsideAttrDictPlus, customAttrDict=customAttrDictPlus)
|
| | | PlayerControl.SetCalcAttrListValue(curPlayer, ChConfig.Def_CalcAttrFunc_Stone, allClassAttrListStone, allClassInsideAttrDictStone, customAttrDict=customAttrDictStone)
|
| | | PlayerControl.SetCalcAttrListValue(curPlayer, ChConfig.Def_CalcAttrFunc_Wash, allClassAttrListWash, allClassInsideAttrDictWash, customAttrDict=customAttrDictWash)
|
| | | return
|
| | |
|
| | | def __CalcFuncAddEquipAttrPer(equipPlace, attrID, attrValue, addPerInfoList):
|
| | |
| | |
|
| | | return
|
| | |
|
| | | def __CalcAttr_ItemPlus(curPlayer, curEquip, packType, equipIndex, allAttrList, plus_addEquipBaseAttrPerList):
|
| | | def __CalcAttr_ItemPlus(curPlayer, curEquip, packType, equipIndex, baseAttrDictPlus, allAttrList, plus_addEquipBaseAttrPerList):
|
| | | ## 计算装备强化后的属性
|
| | | equipPartPlusLV = GetEquipPartPlusLV(curPlayer, packType, equipIndex)
|
| | | equipPartPlusEvolveLV = GetEquipPartPlusEvolveLV(curPlayer, packType, equipIndex)
|
| | |
| | | for i, attrID in enumerate(attrTypeList):
|
| | | #GameWorld.DebugLog(" 强化基础属性: ID=%s +%s" % (attrID, attrValueList[i]))
|
| | | PlayerControl.CalcAttrDict_Type(attrID, attrValueList[i], allAttrList)
|
| | | |
| | | baseAttrDictPlus[attrID] = baseAttrDictPlus.get(attrID, 0) + attrValueList[i]
|
| | | |
| | | if not equipPartPlusEvolveLV:
|
| | | return equipPartPlusLV
|
| | | #进化属性
|
| | |
| | | # @param curEquip 当前装备
|
| | | # @param allAttrList 属性信息
|
| | | # @return 无返回值
|
| | | def CalcEquipStone_Effect(curPlayer, equipIndex, allAttrList):
|
| | | def CalcEquipStone_Effect(curPlayer, equipIndex, baseAttrDictStone, allAttrList):
|
| | | gameData = GameWorld.GetGameData()
|
| | |
|
| | | effIndexList = [1, 2, 3, 4] # 第一个效果值是类型等级效果值,非属性效果值
|
| | |
| | | effectID, effectValue = curGemEffect.GetEffectID(), curGemEffect.GetEffectValue(0)
|
| | | if effectID and effectValue:
|
| | | PlayerControl.CalcAttrDict_Type(effectID, effectValue, allAttrList)
|
| | | baseAttrDictStone[effectID] = baseAttrDictStone.get(effectID, 0) + effectValue
|
| | | gemEffect = curGem.GetEffectByIndex(0)
|
| | | gemLV = gemEffect.GetEffectValue(1)
|
| | | gemLVList.append(gemLV)
|
| | |
| | | PlayerLove.CalcLoveAttr(curPlayer)
|
| | | PlayerCharm.CalcCharmAttr(curPlayer)
|
| | | PlayerLianTi.CalcLianTiAttr(curPlayer)
|
| | | PlayerGubao.CalcGubaoAttr(curPlayer)
|
| | | PlayerShentong.CalcShentongAttr(curPlayer)
|
| | | self.RefreshAllState(isForce=True)
|
| | | GameWorld.DebugLog("End ReCalcAllState!!!")
|
| | |
| | | if curPlayer.GetDictByKey(ChConfig.Def_Player_RefreshAttr) != 1:
|
| | | return False
|
| | |
|
| | | PlayerGubao.CalcGubaoAttr(curPlayer) # 古宝定位为对贯通所有游戏功能系统的属性玩法,所以每次都重新刷新
|
| | | |
| | | GameWorld.DebugLog("Start RefreshPlayerAttrStateEx!!!")
|
| | |
|
| | | #beforeAtkInterval = curPlayer.GetAtkInterval()
|
| | |
| | | # 基础属性等功能汇总完后统一刷新,因为各功能可能会加属性点数
|
| | | if funcIndex in [ChConfig.Def_CalcAttrFunc_RoleBase, ChConfig.Def_CalcAttrFunc_LingGenQuailty]:
|
| | | continue
|
| | | attrInfo, insidePerAttrDict = GetCalcAttrListValue(curPlayer, funcIndex)
|
| | | attrInfo, insidePerAttrDict = GetCalcAttrListValue(curPlayer, funcIndex)[:2]
|
| | | if attrInfo == notAttrList and not insidePerAttrDict:
|
| | | continue
|
| | | GameWorld.DebugLog("功能点属性: %s, %s, 内层百分比附加: %s" % (funcIndex, attrInfo, insidePerAttrDict))
|
| | | GameWorld.DebugLog("功能点属性: %s(%s), %s, 内层百分比附加: %s" % (funcIndex, ChConfig.FuncIndexName.get(funcIndex, ""), attrInfo, insidePerAttrDict))
|
| | | funcAttrInfoList[funcIndex] = attrInfo
|
| | | funcInsidePerAttrList[funcIndex] = insidePerAttrDict
|
| | | # 不同功能点间的数值累加,需使用支持衰减递增的计算方式
|
| | |
| | |
|
| | | # 功能有加基础属性值,这里再重新刷新一下基础属性, 基础属性会影响战斗属性, 每次都刷新角色基础属性
|
| | | hasChange_Qualitylv = self.CalcRoleBaseAttr(curPlayer)
|
| | | roleBaseAttrInfo, roleInsidePerAttrDict = GetCalcAttrListValue(curPlayer, ChConfig.Def_CalcAttrFunc_RoleBase)
|
| | | lingGenQualityAttrList, lingGenQualityInsidePerAttrDict = GetCalcAttrListValue(curPlayer, ChConfig.Def_CalcAttrFunc_LingGenQuailty)
|
| | | roleBaseAttrInfo, roleInsidePerAttrDict = GetCalcAttrListValue(curPlayer, ChConfig.Def_CalcAttrFunc_RoleBase)[:2]
|
| | | lingGenQualityAttrList, lingGenQualityInsidePerAttrDict = GetCalcAttrListValue(curPlayer, ChConfig.Def_CalcAttrFunc_LingGenQuailty)[:2]
|
| | | funcAttrInfoList[ChConfig.Def_CalcAttrFunc_RoleBase] = roleBaseAttrInfo
|
| | | funcInsidePerAttrList[ChConfig.Def_CalcAttrFunc_RoleBase] = roleInsidePerAttrDict
|
| | | funcAttrInfoList[ChConfig.Def_CalcAttrFunc_LingGenQuailty] = lingGenQualityAttrList
|
| | | funcInsidePerAttrList[ChConfig.Def_CalcAttrFunc_LingGenQuailty] = lingGenQualityInsidePerAttrDict
|
| | | GameWorld.DebugLog("功能点属性: %s, %s, 内层百分比附加: %s" % (ChConfig.Def_CalcAttrFunc_RoleBase, roleBaseAttrInfo, roleInsidePerAttrDict))
|
| | | GameWorld.DebugLog("功能点属性: %s, %s, 内层百分比附加: %s" % (ChConfig.Def_CalcAttrFunc_LingGenQuailty, lingGenQualityAttrList, lingGenQualityInsidePerAttrDict))
|
| | | GameWorld.DebugLog("功能点属性: %s(%s), %s, 内层百分比附加: %s" |
| | | % (ChConfig.Def_CalcAttrFunc_RoleBase, ChConfig.FuncIndexName.get(ChConfig.Def_CalcAttrFunc_RoleBase, ""), roleBaseAttrInfo, roleInsidePerAttrDict))
|
| | | GameWorld.DebugLog("功能点属性: %s(%s), %s, 内层百分比附加: %s" |
| | | % (ChConfig.Def_CalcAttrFunc_LingGenQuailty, ChConfig.FuncIndexName.get(ChConfig.Def_CalcAttrFunc_LingGenQuailty, ""), lingGenQualityAttrList, lingGenQualityInsidePerAttrDict))
|
| | |
|
| | | #self.PrintAttr(curPlayer, "基础后")
|
| | |
|
| | |
| | | #-------------------------------------------------------------------------------
|
| | |
|
| | | ## 设置保存功能事先计算好的属性值
|
| | | def SetCalcAttrListValue(curPlayer, funcIndex, allAttrList, insidePerAttrDict={}):
|
| | | def SetCalcAttrListValue(curPlayer, funcIndex, allAttrList, insidePerAttrDict=None, customAttrDict=None):
|
| | | # 设置值之前先清空重置
|
| | | # @param customAttrDict: 自定义的属性信息,必须是格式 {"自定义属性描述名key":属性信息, ...} 自定义属性描述名key - 建议不同功能点之间不要重复
|
| | | ClearCalcAttrListValue(curPlayer, funcIndex)
|
| | | |
| | | if insidePerAttrDict == None:
|
| | | insidePerAttrDict = {}
|
| | | if customAttrDict == None:
|
| | | customAttrDict = {}
|
| | | |
| | | battleAttrDict = allAttrList[ChConfig.CalcAttr_Battle]
|
| | | if ChConfig.TYPE_Calc_PerLVAtk in battleAttrDict:
|
| | | # 每1级加的攻击力不一定满1点,所以这里按万分率来算,支持小数算法
|
| | |
| | | if playerID not in PyGameData.g_playerFuncAttrDict:
|
| | | PyGameData.g_playerFuncAttrDict[playerID] = {}
|
| | | funcAttrDict = PyGameData.g_playerFuncAttrDict[playerID]
|
| | | funcAttrDict[funcIndex] = [allAttrList, insidePerAttrDict]
|
| | | funcAttrDict[funcIndex] = [allAttrList, insidePerAttrDict, customAttrDict]
|
| | | #GameWorld.DebugLog("保存功能点属性: funcIndex=%s, %s, %s" % (funcIndex, allAttrList, insidePerAttrDict))
|
| | | return
|
| | |
|
| | |
| | | ## 获取功能点预先计算的所加属性值
|
| | | attrList = [{} for _ in range(4)]
|
| | | insidePerAttrDict = {}
|
| | | customAttrDict = {}
|
| | | if isinstance(funcIndex, int):
|
| | | funcIndexList = [funcIndex]
|
| | | elif isinstance(funcIndex, list):
|
| | | funcIndexList = funcIndex
|
| | | else:
|
| | | return attrList, insidePerAttrDict
|
| | | return attrList, insidePerAttrDict, customAttrDict
|
| | |
|
| | | playerID = curPlayer.GetPlayerID()
|
| | | if playerID not in PyGameData.g_playerFuncAttrDict:
|
| | | return attrList, insidePerAttrDict
|
| | | return attrList, insidePerAttrDict, customAttrDict
|
| | | funcAttrDict = PyGameData.g_playerFuncAttrDict[playerID]
|
| | | for funcIndex in funcIndexList:
|
| | | if funcIndex not in funcAttrDict:
|
| | | continue
|
| | | funcAttrList, funcInsidePerAttrDict = funcAttrDict[funcIndex]
|
| | | funcAttrList, funcInsidePerAttrDict, funcCustomAttrDict = funcAttrDict[funcIndex]
|
| | | for i, attrDict in enumerate(attrList):
|
| | | curAttrDict = funcAttrList[i]
|
| | | AddAttrDictValue(attrDict, curAttrDict)
|
| | | customAttrDict.update(funcCustomAttrDict)
|
| | | AddAttrDictValue(insidePerAttrDict, funcInsidePerAttrDict)
|
| | | return attrList, insidePerAttrDict
|
| | | return attrList, insidePerAttrDict, customAttrDict
|
| | |
|
| | | ## 重置缓存
|
| | | def ClearCalcAttrListValue(curPlayer, funcIndex):
|