| | |
| | | if addPoint == None:
|
| | | raise Exception('玩家获得升级属性点异常, curLV = %s PlayerID = %s' % (curLV, curPlayerID))
|
| | | return
|
| | | |
| | | return int(addPoint) + GetFabaoAddPoint(curPlayer)
|
| | | multiple = GetLVAddPointMultiple(curPlayer)
|
| | | return int(addPoint+ GetFabaoAddPoint(curPlayer)) * multiple
|
| | |
|
| | | def GetAllPointByLV(curPlayer):
|
| | | ##获取当前等级可得到属性点数
|
| | |
| | | curLV = curPlayer.GetLV()
|
| | | if curLV < openLV:
|
| | | return 0
|
| | | # 初始点+升级点+境界点
|
| | | # 初始点+(升级点+法宝效果)*称号效果倍数+境界点
|
| | | setFreePoint = IpyGameDataPY.GetFuncCfg("LVUPAddPoint", 2)
|
| | | fabaoAddPoint = GetFabaoAddPoint(curPlayer)
|
| | | multiple = GetLVAddPointMultiple(curPlayer)
|
| | | addPointDict = IpyGameDataPY.GetFuncEvalCfg("LVUPAddPoint", 1, {})
|
| | | for rangLVs, point in addPointDict.items():
|
| | | if curLV < rangLVs[0]:
|
| | | continue
|
| | | setFreePoint += (point + fabaoAddPoint) * (min(curLV, rangLVs[1]) - rangLVs[0] + 1)
|
| | | setFreePoint += (point + fabaoAddPoint) * multiple * (min(curLV, rangLVs[1]) - rangLVs[0] + 1)
|
| | |
|
| | | #境界提升点数
|
| | | setFreePoint += curPlayer.GetOfficialRank() * IpyGameDataPY.GetFuncCfg("LVUPAddPoint", 3)
|
| | | return setFreePoint
|
| | |
|
| | | def GetLVAddPointMultiple(curPlayer):
|
| | | # 获取等级加点的倍数
|
| | | multiple = 1
|
| | | titleID = IpyGameDataPY.GetFuncCfg("TitleAddPoint")
|
| | | if titleID and curPlayer.GetDienstgradManager().GetDienstgrad(titleID):
|
| | | multiple = IpyGameDataPY.GetFuncCfg("TitleAddPoint", 2) or 1
|
| | | return multiple
|
| | |
|
| | | def GetFabaoAddPoint(curPlayer):
|
| | | #法宝额外增加玩家每级获得的灵根点
|
| | |
| | | # @param expViewType 经验获得的渠道
|
| | | # @param isSysHint 是否系统提示(默认是)
|
| | | # @return 布尔值
|
| | | def AddExp(self, addExp, expViewType=ShareDefine.Def_ViewExpType_Mission, isSysHint=True):
|
| | | def AddExp(self, addExp, expViewType=ShareDefine.Def_ViewExpType_Mission, isSysHint=True, addSkillID=0):
|
| | | curPlayer = self.__Player
|
| | | finalAddExp, expNotifyType = self.__AddExp(curPlayer, addExp, expViewType, isSysHint)
|
| | | finalAddExp, expNotifyType = self.__AddExp(curPlayer, addExp, expViewType, isSysHint, addSkillID)
|
| | |
|
| | | # 通知客户端经验来源
|
| | | if finalAddExp:
|
| | |
| | |
|
| | | return finalAddExp
|
| | |
|
| | | def __AddExp(self, curPlayer, addExp, expViewType, isSysHint):
|
| | | # 参数 addSkillID 表示因什么技能杀死NPC获得经验
|
| | | def __AddExp(self, curPlayer, addExp, expViewType, isSysHint, addSkillID=0):
|
| | | if addExp == 0:
|
| | | # 不进入计算
|
| | | return addExp, expViewType
|
| | |
| | | if expViewType == ShareDefine.Def_ViewExpType_KillNPC:
|
| | | exp_rate = curPlayer.GetDictByKey(ChConfig.Def_PlayerKey_TotalExpRate)
|
| | | superRate = PassiveBuffEffMng.GetPassiveSkillValueByTriggerType(curPlayer, None, None, ChConfig.TriggerType_AddExpRate)
|
| | | if addSkillID == ChConfig.Def_SkillID_LXHY_AddExpRate:
|
| | | addSkill = GameWorld.GetGameData().GetSkillBySkillID(addSkillID)
|
| | | hasEffect = SkillCommon.GetSkillEffectByEffectID(addSkill, ChConfig.Def_Skill_Effect_AddExpRate)
|
| | | if hasEffect:
|
| | | superRate += hasEffect.GetEffectValue(0)
|
| | | exp_rate += superRate
|
| | | if superRate:
|
| | | expViewType = ShareDefine.Def_ViewExpType_KillNPCSuper
|
| | |
| | | PlayerGreatMaster.Sync_GreatMasterFreeSkillPoint(curPlayer)
|
| | | # 升级需要执行的游戏功能处理
|
| | | GameFuncComm.DoFuncOpenLogic(curPlayer)
|
| | | #ChEquip.CalcEquips_OutOfPrint(curPlayer) # 缓存绝版属性
|
| | | ChEquip.RefreshPlayerLingQiEquipAttr(curPlayer) # 灵器属性会随等级成长
|
| | | if aftLV%10 == 0:
|
| | | # 控制下刷新次数
|
| | | PlayerPet.CalcPetItemAddPlayerAttr(curPlayer) # 宠物有随等级变化的技能
|
| | |
| | | ChEquip.RefreshPlayerEquipAttribute(curPlayer)
|
| | | ChEquip.RefreshPlayerLingQiEquipAttr(curPlayer)
|
| | | #SkillShell.RefreshPlayerBuffOnAttrAddEffect(curPlayer)
|
| | | #PlayerWing.CalcWingAttr(curPlayer) # 翅膀暂时算在灵器里面
|
| | | PlayerHorse.CalcHorseAttrEx(curPlayer)
|
| | | PlayerPrestigeSys.CalcOfficialRankAttr(curPlayer)
|
| | | PlayerGodWeapon.CalcGodWeaponAttr(curPlayer)
|
| | |
| | | ChConfig.TYPE_Calc_StoneBasePer:funcAttrInfoList[ChConfig.Def_CalcAttrFunc_Stone],
|
| | | ChConfig.TYPE_Calc_RealmBasePer:funcAttrInfoList[ChConfig.Def_CalcAttrFunc_Prestige],
|
| | | ChConfig.TYPE_Calc_HorseAtkPer:funcAttrInfoList[ChConfig.Def_CalcAttrFunc_Horse],
|
| | | ChConfig.TYPE_Calc_WingHPPer:funcAttrInfoList[ChConfig.Def_CalcAttrFunc_Wing],
|
| | | }
|
| | | # 3.2 统计各功能之间非线性属性交叉影响累加
|
| | | funcCrossAttrPerInfoDict = {} # 百分比交叉影响所提升的属性值 {功能属性编号:{提升的属性类型:数值, ...}, ...}
|
| | |
| | | # 3.3 统计所有功能固定属性影响累加
|
| | | allFixAttrDict = {} # 固定属性层级总属性基值
|
| | | for funcIndex, funcAttrList in enumerate(funcAttrInfoList):
|
| | | # 技能模块不算计入功能固定属性、不计战力
|
| | | # 技能模块不计入功能固定属性、不计战力
|
| | | if funcIndex in ChConfig.CalcAttrFuncSkillList:
|
| | | continue
|
| | | AddAttrDictValue(allFixAttrDict, funcAttrList[ChConfig.CalcAttr_Battle])
|
| | |
| | | mfpAttrExDict = {}
|
| | | for funcIndex in attrFuncIndexList:
|
| | | if funcIndex in ChConfig.CalcAttrFuncSkillList:
|
| | | # 技能模块不算计入功能固定属性、不计战力
|
| | | # 技能模块不计入功能固定属性、不计战力
|
| | | continue
|
| | | funcAttrList = funcAttrInfoList[funcIndex]
|
| | | funcInsidePerAttrDict = funcInsidePerAttrList[funcIndex] # 功能点内部百分比加成属性
|
| | |
| | | if beforePointList[i] != afterPointList[i]:
|
| | | diffPointAttrList.append(attrID)
|
| | | SkillShell.RefreshElementSkillByAttr(curPlayer, diffPointAttrList)
|
| | | |
| | | # 更新开服活动灵根数据
|
| | | OpenServerCampaign.UpdOpenServerCampaignLingGenData(curPlayer)
|
| | | |
| | | # 同步前端战力,因为有 SetFightPower 所以累加战力放在这里所有刷新及计算处理完后才处理,才能正常触发set同步前端
|
| | | self.SendModuleFightPowerPack(curPlayer, mfpDict)
|
| | | billFuncCnt = len(PyGameData.g_refreshAttrBillboardFunc) # 只处理固定次数,防止死循环
|