| | |
| | | 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):
|