| | |
| | | import CrossRealmPlayer
|
| | | import CrossPlayerData
|
| | | import ChNetSendPack
|
| | | #import EquipZhuXian
|
| | | import PlayerCoat
|
| | | import PlayerState
|
| | | import QuestCommon
|
| | | import PlayerDogz
|
| | | import ChPlayer
|
| | | import GMShell
|
| | | import GameObj
|
| | |
|
| | | import random
|
| | | import types
|
| | |
| | | CrossPlayerData.ClearCrossSyncDataCache(curPlayer)
|
| | | PyGameData.g_fbBuyBuffTimeDict.pop(playerID, None)
|
| | | #清除地图玩家缓存
|
| | | PyGameData.g_zhuXianSkillAddPerDict.pop(playerID, None)
|
| | | PyGameData.g_zhuXianSkillReducePerDict.pop(playerID, None)
|
| | | PyGameData.g_playerFuncAttrDict.pop(playerID, None)
|
| | | PyGameData.g_playerEquipPartAttrDict.pop(playerID, None)
|
| | | PyGameData.g_equipChangeClassLVInfo.pop(playerID, None)
|
| | | NPCCommon.ClearPriWoodPile(curPlayer)
|
| | | return
|
| | |
|
| | | ##更新保存玩家在线时间
|
| | |
| | | return playerlist
|
| | |
|
| | | #---------------------------------------------------------------------
|
| | | ##转变付费货币类型
|
| | | # @param curPlayer 玩家实例
|
| | | # @param moneyType 货币类型 1表示金子,2表示金票,3表示银子,4表示银票, 5:金子/金票 6:银子/银票
|
| | | # @return 返回值, 货币类型
|
| | | # @remarks 转变付费货币类型 |
| | | def ChangeMoneyType(curPlayer, moneyType):
|
| | | # if moneyType == 5:
|
| | | # return curPlayer.GetUseGoldType()
|
| | | # |
| | | # if moneyType == 6:
|
| | | # return curPlayer.GetUseSilverType()
|
| | | if moneyType not in ChConfig.Def_MoneyType_All:
|
| | | GameWorld.ErrLog("金钱类型填写错误 %s" % moneyType)
|
| | | |
| | | return moneyType
|
| | | #---------------------------------------------------------------------
|
| | | ##获取玩家货币数
|
| | | # @param curPlayer 玩家实例
|
| | | # @param TYPE_Price ,货币类型
|
| | |
| | | GameWorld.Log('###---扣钱异常 = %s' % (price), curPlayer.GetPlayerID())
|
| | | return False
|
| | |
|
| | | if type_Price == IPY_GameWorld.TYPE_Price_Gold_Paper:
|
| | | type_Price = IPY_GameWorld.TYPE_Price_Gold_Money #新版无绑玉,原先绑玉再仙玉的扣法改成 扣仙玉 2019/6/3
|
| | | |
| | | #金子支付
|
| | | if type_Price == IPY_GameWorld.TYPE_Price_Gold_Money:
|
| | | curPlayerGold = curPlayer.GetGold()
|
| | |
| | | GiveMoney(curPlayer, ShareDefine.TYPE_Price_BourseMoney, value)
|
| | | addDataDict["BourseMoney"] = GetMoney(curPlayer, ShareDefine.TYPE_Price_BourseMoney)
|
| | |
|
| | | elif priceType == IPY_GameWorld.TYPE_Price_Gold_Paper:
|
| | | if curPlayer.GetGoldPaper() + value > ChConfig.Def_PlayerTotalMoney_Gold:
|
| | | #超过金钱上限
|
| | | NotifyCode(curPlayer, "MoneyIsFull", [priceType])
|
| | | return
|
| | | |
| | | curPlayer.SetGoldPaper(curPlayer.GetGoldPaper() + value)
|
| | | # elif priceType == IPY_GameWorld.TYPE_Price_Gold_Paper:
|
| | | # if curPlayer.GetGoldPaper() + value > ChConfig.Def_PlayerTotalMoney_Gold:
|
| | | # #超过金钱上限
|
| | | # NotifyCode(curPlayer, "MoneyIsFull", [priceType])
|
| | | # return
|
| | | # |
| | | # curPlayer.SetGoldPaper(curPlayer.GetGoldPaper() + value)
|
| | |
|
| | | elif priceType == IPY_GameWorld.TYPE_Price_Silver_Money:
|
| | | # 金钱支持超过20亿, 暂不做上限控制
|
| | |
| | | PlayerSuccess.DoAddSuccessProgress(curPlayer, ShareDefine.SuccType_GetRealmPoint, value)
|
| | | EventShell.EventRespons_GetRealmPoint(curPlayer)
|
| | | else:
|
| | | GameWorld.Log("金钱类型错误, priceType = %s" % (priceType), curPlayer.GetPlayerID())
|
| | | GameWorld.ErrLog("金钱类型错误, priceType=%s,value=%s,giveType=%s" % (priceType, value, giveType), curPlayer.GetPlayerID())
|
| | | DataRecordPack.DR_GiveMoneyError(curPlayer, priceType, value, giveType, addDataDict)
|
| | | return
|
| | |
|
| | | if isSysHint and priceType != ShareDefine.TYPE_Price_BourseMoney:
|
| | |
| | | if addPoint == None:
|
| | | raise Exception('玩家获得升级属性点异常, curLV = %s PlayerID = %s' % (curLV, curPlayerID))
|
| | | return
|
| | | |
| | | return int(addPoint)
|
| | | return int(addPoint+ GetFabaoAddPoint(curPlayer) + GetTitleAddExtraPoint(curPlayer))
|
| | |
|
| | | def GetAllPointByLV(curPlayer):
|
| | | ##获取当前等级可得到属性点数
|
| | |
| | | curLV = curPlayer.GetLV()
|
| | | if curLV < openLV:
|
| | | return 0
|
| | | # 初始点+升级点+境界点
|
| | | # 初始点+(升级点+法宝效果)*称号效果倍数+境界点
|
| | | setFreePoint = IpyGameDataPY.GetFuncCfg("LVUPAddPoint", 2)
|
| | | |
| | | fabaoAddPoint = GetFabaoAddPoint(curPlayer)
|
| | | titleAddPoint = GetTitleAddExtraPoint(curPlayer)
|
| | | addPointDict = IpyGameDataPY.GetFuncEvalCfg("LVUPAddPoint", 1, {})
|
| | | for rangLVs, point in addPointDict.items():
|
| | | if curLV < rangLVs[0]:
|
| | | continue
|
| | | setFreePoint += point * (min(curLV, rangLVs[1]) - rangLVs[0] + 1)
|
| | | setFreePoint += (point + fabaoAddPoint + titleAddPoint) * (min(curLV, rangLVs[1]) - rangLVs[0] + 1)
|
| | |
|
| | | #境界提升点数
|
| | | setFreePoint += curPlayer.GetOfficialRank() * IpyGameDataPY.GetFuncCfg("LVUPAddPoint", 3)
|
| | | return setFreePoint
|
| | |
|
| | | def GetTitleAddExtraPoint(curPlayer):
|
| | | # 称号额外增加玩家每级获得的灵根点
|
| | | titleID = IpyGameDataPY.GetFuncCfg("TitleAddPoint")
|
| | | if titleID and curPlayer.GetDienstgradManager().GetDienstgrad(titleID):
|
| | | return IpyGameDataPY.GetFuncCfg("TitleAddPoint", 2)
|
| | | return 0
|
| | |
|
| | | def GetFabaoAddPoint(curPlayer):
|
| | | #法宝额外增加玩家每级获得的灵根点
|
| | | mwID = IpyGameDataPY.GetFuncCfg('FabaoAddPoint', 1)
|
| | | if not PlayerMagicWeapon.GetIsActiveMagicWeapon(curPlayer, mwID, lv=1):
|
| | | return 0
|
| | | return IpyGameDataPY.GetFuncCfg('FabaoAddPoint', 2)
|
| | |
|
| | | def DoAddPointOpen(curPlayer):
|
| | | '''加点功能开启'''
|
| | |
| | | attrName = self.__AttrName % attrIndex
|
| | | setattr(self, attrName, getattr(self, attrName) + value)
|
| | |
|
| | | def GetModuleFightPower(self, fpParam):
|
| | | def GetModuleFightPower(self, fpParam, curPlayer):
|
| | | MaxHP = getattr(self, self.__AttrName % ChConfig.TYPE_Calc_AttrMaxHP) # 最大血量
|
| | | MinAtk = getattr(self, self.__AttrName % ChConfig.TYPE_Calc_AttrATKMin) # 最小攻击
|
| | | MaxAtk = getattr(self, self.__AttrName % ChConfig.TYPE_Calc_AttrATKMax) # 最大攻击
|
| | |
| | | Hit = getattr(self, self.__AttrName % ChConfig.TYPE_Calc_AttrHit) * fpParam.GetCftHit() # 命中值
|
| | | Miss = getattr(self, self.__AttrName % ChConfig.TYPE_Calc_AttrMiss) * fpParam.GetCftMiss() # 闪避值
|
| | | AtkSpeed = getattr(self, self.__AttrName % ChConfig.TYPE_Calc_AttrAtkSpeed) # 攻击速度(数值非攻击间隔)
|
| | | SuperHitRate = getattr(self, self.__AttrName % ChConfig.TYPE_Calc_SuperHitRate) # 暴击率
|
| | | SuperHitRateReduce = getattr(self, self.__AttrName % ChConfig.TYPE_Calc_SuperHitRateReduce) # 暴击概率抗性
|
| | | SuperHitRate = getattr(self, self.__AttrName % ChConfig.TYPE_Calc_SuperHitRate) * fpParam.GetCftSuperHitRate() # 暴击率
|
| | | SuperHitRateReduce = getattr(self, self.__AttrName % ChConfig.TYPE_Calc_SuperHitRateReduce) * fpParam.GetCftSuperHitRateReduce() # 暴击概率抗性
|
| | | SuperHit = getattr(self, self.__AttrName % ChConfig.TYPE_Calc_SuperHit) # 暴击伤害固定值
|
| | | SuperHitReduce = getattr(self, self.__AttrName % ChConfig.TYPE_Calc_SuperHitReduce) * fpParam.GetCftSuperHitReduce() # 暴击固定减伤
|
| | | LuckyHitRate = getattr(self, self.__AttrName % ChConfig.TYPE_Calc_LuckyHitRate) # 会心一击
|
| | | SuperHitReduce = getattr(self, self.__AttrName % ChConfig.TYPE_Calc_SuperHitReduce) # 暴击固定减伤
|
| | | LuckyHitRate = getattr(self, self.__AttrName % ChConfig.TYPE_Calc_LuckyHitRate) * fpParam.GetCftLuckyHitRate() # 会心一击
|
| | | LuckyHitRateReduce = getattr(self, self.__AttrName % ChConfig.TYPE_Calc_LuckyHitRateReduce) * fpParam.GetCftLuckyHitRateReduce() # 会心一击概率抗性
|
| | | LuckyHit = getattr(self, self.__AttrName % ChConfig.TYPE_Calc_LuckyHit) # 会心一击伤害固定值
|
| | | LuckyHitReduce = getattr(self, self.__AttrName % ChConfig.TYPE_Calc_LuckyHitReduce) # 会心一击伤害固定减伤
|
| | | SkillAtkRate = getattr(self, self.__AttrName % ChConfig.TYPE_Calc_SkillAtkRate) * fpParam.GetCftSkillAtkRate() # 技能攻击比例加成
|
| | | SkillAtkRateReduce = getattr(self, self.__AttrName % ChConfig.TYPE_Calc_SkillAtkRateReduce) * fpParam.GetCftSkillAtkRateReduce() # 技能攻击比例减少
|
| | | DamagePVP = getattr(self, self.__AttrName % ChConfig.TYPE_Calc_DamagePVP) * fpParam.GetCftDamagePer() # PVP固定伤害
|
| | | DamagePVPReduce = getattr(self, self.__AttrName % ChConfig.TYPE_Calc_DamagePVPReduce) * fpParam.GetCftDamReduce() # PVP固定减伤
|
| | | DamagePVE = getattr(self, self.__AttrName % ChConfig.TYPE_Calc_DamagePVE) * fpParam.GetCftDamagePer() # PVE固定伤害
|
| | | DamagePVP = getattr(self, self.__AttrName % ChConfig.TYPE_Calc_DamagePVP) # PVP固定伤害
|
| | | DamagePVPReduce = getattr(self, self.__AttrName % ChConfig.TYPE_Calc_DamagePVPReduce) # PVP固定减伤
|
| | | DamagePVE = getattr(self, self.__AttrName % ChConfig.TYPE_Calc_DamagePVE) # PVE固定伤害
|
| | | HPRestore = getattr(self, self.__AttrName % ChConfig.TYPE_Calc_HPRestorePer) # 自动回复血量,固定值
|
| | | DamBackPer = getattr(self, self.__AttrName % ChConfig.TYPE_Calc_DamBackPer) * fpParam.GetCftDamBackPer() # 反伤百分比
|
| | | SpeedValue = getattr(self, self.__AttrName % ChConfig.TYPE_Calc_AttrSpeed) # 移动速度值
|
| | | SpeedPer = getattr(self, self.__AttrNameNoline % ChConfig.TYPE_Calc_AttrSpeed) * fpParam.GetCftSpeedPer() # 移动速度百分比系数
|
| | | SpeedPer = 0#getattr(self, self.__AttrNameNoline % ChConfig.TYPE_Calc_AttrSpeed) * fpParam.GetCftSpeedPer() # 移动速度百分比系数
|
| | | PetMinAtk = getattr(self, self.__AttrName % ChConfig.TYPE_Calc_PetMinAtk) # 宠物最小攻击
|
| | | PetMaxAtk = getattr(self, self.__AttrName % ChConfig.TYPE_Calc_PetMaxAtk) # 宠物最大攻击
|
| | | PetDamPer = getattr(self, self.__AttrName % ChConfig.TYPE_Calc_PetDamPer) # 宠物伤害百分比提升
|
| | |
| | | IgnoreDefRate = getattr(self, self.__AttrName % ChConfig.TYPE_Calc_IgnoreDefRate) * fpParam.GetCftIgnoreDefRate() # 无视防御几率
|
| | | IgnoreDefRateReduce = getattr(self, self.__AttrName % ChConfig.TYPE_Calc_IgnoreDefRateReduce) * fpParam.GetCftIgnoreDefRateReduce() # 无视防御概率抗性
|
| | | DamChanceDef = getattr(self, self.__AttrName % ChConfig.TYPE_Calc_DamChanceDef) * fpParam.GetCftDamChanceDef() # 20%的概率抵御伤害比率
|
| | | BleedDamage = getattr(self, self.__AttrName % ChConfig.TYPE_Calc_BleedDamage) * fpParam.GetCftBleedDamage() # 流血伤害
|
| | | BleedDamage = 0#getattr(self, self.__AttrName % ChConfig.TYPE_Calc_BleedDamage) * fpParam.GetCftBleedDamage() # 流血伤害
|
| | | AtkBackHP = getattr(self, self.__AttrName % ChConfig.TYPE_Calc_AtkBackHPPer) # 攻击回复血量
|
| | | FaintRate = getattr(self, self.__AttrName % ChConfig.TYPE_Calc_FaintRate) * fpParam.GetCftFaintRate() # 触发击晕
|
| | | FaintDefRate = getattr(self, self.__AttrName % ChConfig.TYPE_Calc_FaintDefRate) * fpParam.GetCftFaintDefRate() # 击晕抵抗
|
| | | FinalHurt = getattr(self, self.__AttrName % ChConfig.TYPE_Calc_FinalHurt) # 最终固定伤害增加
|
| | | FinalHurtReduce = getattr(self, self.__AttrName % ChConfig.TYPE_Calc_FinalHurtReduce) # 最终固定伤害减少
|
| | | FinalHurtPer = getattr(self, self.__AttrName % ChConfig.TYPE_Calc_FinalHurtPer) # 最终伤害万分率
|
| | | FinalHurtReducePer = getattr(self, self.__AttrName % ChConfig.TYPE_Calc_FinalHurtReducePer) # 最终伤害减少万分率
|
| | | FinalHurtPer = getattr(self, self.__AttrName % ChConfig.TYPE_Calc_FinalHurtPer) * fpParam.GetCftFinalHurtPer() # 最终伤害万分率
|
| | | FinalHurtReducePer = getattr(self, self.__AttrName % ChConfig.TYPE_Calc_FinalHurtReducePer) * fpParam.GetCftFinalHurtReducePer() # 最终伤害减少万分率
|
| | | DamagePerPVP = getattr(self, self.__AttrName % ChConfig.TYPE_Calc_DamagePerPVP) * fpParam.GetCftDamagePerPVP() # 伤害输出计算百分比PVP
|
| | | DamagePerPVPReduce = getattr(self, self.__AttrName % ChConfig.TYPE_Calc_DamagePerPVPReduce) * fpParam.GetCftDamagePerPVPReduce() # 伤害输出计算百分比PVP减少
|
| | | JobAHurtAddPer = getattr(self, self.__AttrName % ChConfig.TYPE_Calc_JobAHurtAddPer) * fpParam.GetCftJobAHurtAddPer() # 对目标战士伤害加成
|
| | |
| | | JobCAtkReducePer = getattr(self, self.__AttrName % ChConfig.TYPE_Calc_JobCAtkReducePer) * fpParam.GetCftJobCAtkReducePer() # 弓箭攻击伤害减免
|
| | |
|
| | | NormalHurt = getattr(self, self.__AttrName % ChConfig.TYPE_Calc_NormalHurt)
|
| | | NormalHurtPer = getattr(self, self.__AttrName % ChConfig.TYPE_Calc_NormalHurtPer) |
| | | NormalHurtPer = getattr(self, self.__AttrName % ChConfig.TYPE_Calc_NormalHurtPer) * fpParam.GetCftNormalHurtPer() # 普通附加伤害加成
|
| | | FabaoHurt = getattr(self, self.__AttrName % ChConfig.TYPE_Calc_FabaoHurt)
|
| | | FabaoHurtPer = getattr(self, self.__AttrName % ChConfig.TYPE_Calc_FabaoHurtPer)
|
| | | FabaoHurtPer = getattr(self, self.__AttrName % ChConfig.TYPE_Calc_FabaoHurtPer) * fpParam.GetCftFabaoHurtPer() # 法宝附加伤害加成
|
| | | Luck = getattr(self, self.__AttrName % ChConfig.TYPE_Calc_Luck)
|
| | |
|
| | | ComboRate = getattr(self, self.__AttrName % ChConfig.TYPE_Calc_ComboRate) # 连击几率
|
| | |
| | |
|
| | | OnlyFinalHurt = getattr(self, self.__AttrName % ChConfig.TYPE_Calc_OnlyFinalHurt) # 额外输出伤害
|
| | | PVPAtkBackHP = getattr(self, self.__AttrName % ChConfig.TYPE_Calc_PVPAtkBackHP) # PVP攻击回血
|
| | | NPCHurtAddPer = getattr(self, self.__AttrName % ChConfig.TYPE_Calc_NPCHurtAddPer) # 对怪物伤害加成
|
| | | NPCHurtAddPer = getattr(self, self.__AttrName % ChConfig.TYPE_Calc_NPCHurtAddPer) * fpParam.GetCftNPCHurtAddPer() # 对怪物伤害加成
|
| | |
|
| | | #其他需作为公式参数的系数
|
| | | AtkSpeedParameter = fpParam.GetCftAtkSpeed()
|
| | | LuckyHitParameter = fpParam.GetCftLuckyHit()
|
| | | LuckyHitParameter = 0#fpParam.GetCftLuckyHit()
|
| | | |
| | | #取总属性的
|
| | | SuperHitRateTotal = curPlayer.GetSuperHitRate()
|
| | | LuckyHitRateTotal = curPlayer.GetLuckyHitRate()
|
| | | |
| | | job = curPlayer.GetJob()
|
| | | diffAttrDict = self.__GetAttrFightPowerParamDiff(job)
|
| | | for paramName, diffValue in diffAttrDict.items():
|
| | | exec("%s = max(0, %s - %s)" % (paramName, paramName, diffValue))
|
| | |
|
| | | #获取策划配置的表格
|
| | | FightpowerFormula = IpyGameDataPY.GetFuncCfg("FightpowerFormula")
|
| | |
| | | totalFightPower = ShareDefine.Def_UpperLimit_DWord
|
| | | return totalFightPower
|
| | |
|
| | | def __GetAttrFightPowerParamDiff(self, job):
|
| | | ## 战力计算属性参数与实际属性差值
|
| | | |
| | | #角色基础模块某些属性不计算战力
|
| | | if self.mfpType != ShareDefine.Def_MFPType_Role:
|
| | | return {}
|
| | | |
| | | roleBaseAttrDict = IpyGameDataPY.GetFuncEvalCfg("CreatRoleBaseAttr", 1)
|
| | | notFightPowerEffIDNameDict = IpyGameDataPY.GetFuncEvalCfg("CreatRoleBaseAttr", 2)
|
| | | if job not in roleBaseAttrDict:
|
| | | return {}
|
| | | |
| | | diffAttrDict = {}
|
| | | jobBaseAttrDict = roleBaseAttrDict[job]
|
| | | for attrID, paramName in notFightPowerEffIDNameDict.items():
|
| | | if attrID not in jobBaseAttrDict:
|
| | | continue
|
| | | diffAttrDict[paramName] = jobBaseAttrDict[attrID]
|
| | | return diffAttrDict
|
| | | |
| | | def GetMFPAttrStr(self):
|
| | | attrStr = ""
|
| | | for attrIndex in xrange(1, ChConfig.Def_Calc_AllAttrType_MAX):
|
| | |
| | | # @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)
|
| | | exp_rate += superRate
|
| | | if superRate:
|
| | | # 龙凤镯 经验
|
| | | expViewType = ShareDefine.Def_ViewExpType_KillNPCSuper
|
| | | 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)
|
| | | expViewType = ShareDefine.Def_ViewExpType_LYZS
|
| | | exp_rate += superRate
|
| | |
|
| | | elif expViewType in [ShareDefine.Def_ViewExpType_GameEvent, ShareDefine.Def_ViewExpType_Sit]:
|
| | | exp_rate = curPlayer.GetGameEventExpRate()
|
| | |
| | | if aftLV > befLV:
|
| | | curPlayer.SetLV(aftLV, False) # 这里不再通知GameServer
|
| | | PlayerSuccess.UptateSuccessProgress(curPlayer, ShareDefine.SuccType_HeroLV, aftLV)
|
| | | PlayerActivity.DoAddActivityByLV(curPlayer, befLV, aftLV)
|
| | | |
| | | if aftFreePoint > befFreePoint:
|
| | | curPlayer.SetFreePoint(aftFreePoint)
|
| | | #NotifyCode(curPlayer, "ObtainAttributeDot", [aftFreePoint - befFreePoint])
|
| | |
| | | PlayerGreatMaster.Sync_GreatMasterFreeSkillPoint(curPlayer)
|
| | | # 升级需要执行的游戏功能处理
|
| | | GameFuncComm.DoFuncOpenLogic(curPlayer)
|
| | | #ChEquip.CalcEquips_OutOfPrint(curPlayer) # 缓存绝版属性
|
| | | ChEquip.RefreshPlayerLingQiEquipAttr(curPlayer) # 灵器属性会随等级成长
|
| | | if aftLV%10 == 0:
|
| | | # 控制下刷新次数
|
| | | PlayerPet.CalcPetItemAddPlayerAttr(curPlayer) # 宠物有随等级变化的技能
|
| | |
| | | OpenServerCampaign.UpdOpenServerCampaignRecordData(curPlayer, ShareDefine.Def_Campaign_Type_LV, curPlayer.GetLV())
|
| | | #神秘限购
|
| | | FunctionNPCCommon.MysticalLimitShopOpen(curPlayer, befLV, aftLV)
|
| | |
|
| | | #不需要做升级任务, 设置玩家经验
|
| | | SetPlayerTotalExp(curPlayer, curTotalExp)
|
| | | return
|
| | |
| | | #GameWorld.DebugLog("等级加属性: %s" % allAttrList)
|
| | |
|
| | | # 属性点属性
|
| | | pointValueInfo = {ShareDefine.Def_Effect_Metal:[lambda curObj:GetMetal(curObj), lambda curObj, value:SetMetalQualityLV(curObj, value)],
|
| | | ShareDefine.Def_Effect_Wood:[lambda curObj:GetWood(curObj), lambda curObj, value:SetWoodQualityLV(curObj, value)],
|
| | | ShareDefine.Def_Effect_Water:[lambda curObj:GetWater(curObj), lambda curObj, value:SetWaterQualityLV(curObj, value)],
|
| | | ShareDefine.Def_Effect_Fire:[lambda curObj:GetFire(curObj), lambda curObj, value:SetFireQualityLV(curObj, value)],
|
| | | ShareDefine.Def_Effect_Earth:[lambda curObj:GetEarth(curObj), lambda curObj, value:SetEarthQualityLV(curObj, value)],
|
| | | hadRefreshAttr = curPlayer.GetDictByKey(ChConfig.Def_Player_HadRefreshAttr) # 本地图是否刷新过属性
|
| | | pointFightPowerEx = 0
|
| | | pointValueInfo = {ShareDefine.Def_Effect_Metal:[lambda curObj:GetMetal(curObj), lambda curObj, value:SetMetalQualityLV(curObj, value), lambda curObj:GetMetalQualityLV(curObj)],
|
| | | ShareDefine.Def_Effect_Wood:[lambda curObj:GetWood(curObj), lambda curObj, value:SetWoodQualityLV(curObj, value), lambda curObj:GetWoodQualityLV(curObj)],
|
| | | ShareDefine.Def_Effect_Water:[lambda curObj:GetWater(curObj), lambda curObj, value:SetWaterQualityLV(curObj, value), lambda curObj:GetWaterQualityLV(curObj)],
|
| | | ShareDefine.Def_Effect_Fire:[lambda curObj:GetFire(curObj), lambda curObj, value:SetFireQualityLV(curObj, value), lambda curObj:GetFireQualityLV(curObj)],
|
| | | ShareDefine.Def_Effect_Earth:[lambda curObj:GetEarth(curObj), lambda curObj, value:SetEarthQualityLV(curObj, value), lambda curObj:GetEarthQualityLV(curObj)],
|
| | | }
|
| | | lingGenQualityAttrList = [{} for _ in range(4)]
|
| | | for pointAttrID, pointFuncInfo in pointValueInfo.items():
|
| | | pointValue = pointFuncInfo[0](curPlayer)
|
| | | befPQLV = pointFuncInfo[2](curPlayer)
|
| | | pointFuncInfo[1](curPlayer, 0)
|
| | | if not pointValue:
|
| | | continue
|
| | |
| | | if not ipyData:
|
| | | continue
|
| | | # 每点属性
|
| | | perPointAddAttrDict = ipyData.GetAddAttrInfoPerPoint()
|
| | | for perPointAttrID, perPointAttrValue in perPointAddAttrDict.items():
|
| | | pointAddValue = perPointAttrValue * pointValue
|
| | | CalcAttrDict_Type(perPointAttrID, pointAddValue, allAttrList)
|
| | | #GameWorld.DebugLog(" 属性点(%s)加属性: pointValue=%s,perPointAttrID=%s,pointAddValue=%s" % (pointAttrID, pointValue, perPointAttrID, pointAddValue))
|
| | | perPointAddAttrDict = ipyData.GetAddAttrInfoPerPoint() # {"职业":[[每X点,属性ID,值], ...], ..}
|
| | | addAttrList = perPointAddAttrDict.get(str(job), [])
|
| | | for needPoint, pointAddAttrID, pointAddAttrValue in addAttrList:
|
| | | pointAddValueTotal = pointAddAttrValue * (pointValue / needPoint)
|
| | | CalcAttrDict_Type(pointAddAttrID, pointAddValueTotal, allAttrList)
|
| | | #GameWorld.DebugLog(" 属性点(%s)加属性: pointValue=%s,pointAddAttrID=%s,pointAddValueTotal=%s" % (pointAttrID, pointValue, pointAddAttrID, pointAddValueTotal))
|
| | |
|
| | | pointFightPowerEx += (ipyData.GetFightPowerPerPoint() * pointValue)
|
| | | |
| | | # 点数品质属性
|
| | | curPQLV = 0
|
| | | pqIntervalList = ipyData.GetPointQualityIntervalList()
|
| | | for pqLV, pqValue in enumerate(pqIntervalList, 1):
|
| | | for pqLV, pqValue in enumerate(pqIntervalList, 1): # 灵根品级从1开始
|
| | | if pointValue >= pqValue:
|
| | | curPQLV = pqLV
|
| | | else:
|
| | |
| | | pointFuncInfo[1](curPlayer, curPQLV)
|
| | | if not curPQLV:
|
| | | continue
|
| | | pqAttrIDDict = ipyData.GetPointQualityAttrIDDict()
|
| | | pqAttrID = pqAttrIDDict[curPlayer.GetJob()]
|
| | | pqAttrValueDict = ipyData.GetPointQualityAttrValueDict()
|
| | | pqAttrValueList = pqAttrValueDict[str(curPlayer.GetJob())]
|
| | | pqAttrValue = 0 if curPQLV > len(pqAttrValueList) else pqAttrValueList[curPQLV - 1]
|
| | | CalcAttrDict_Type(pqAttrID, pqAttrValue, lingGenQualityAttrList)
|
| | | #GameWorld.DebugLog(" 属性点(%s)品阶等级属性: curPQLV=%s,pqAttrID=%s,pqAttrValue=%s" % (pointAttrID, curPQLV, pqAttrID, pqAttrValue))
|
| | | |
| | | pqAttrInfoDict = ipyData.GetPointQualityAttrDict().get(str(curPlayer.GetJob()), {})
|
| | | for pqAttrID, pqAttrValueList in pqAttrInfoDict.items():
|
| | | pqAttrValue = 0 if curPQLV > len(pqAttrValueList) else pqAttrValueList[curPQLV - 1]
|
| | | CalcAttrDict_Type(int(pqAttrID), pqAttrValue, lingGenQualityAttrList)
|
| | | #GameWorld.DebugLog(" 属性点(%s)品阶等级属性: befPQLV=%s,curPQLV=%s,pqAttrInfoDict=%s" % (pointAttrID, befPQLV, curPQLV, pqAttrInfoDict))
|
| | | if hadRefreshAttr and befPQLV < curPQLV:
|
| | | EventShell.EventRespons_LingGenQualityUP(curPlayer, pointAttrID, curPQLV)
|
| | | |
| | | #GameWorld.DebugLog("等级属性点加属性: %s" % allAttrList)
|
| | | #GameWorld.DebugLog("灵根品阶等级属性: %s" % lingGenQualityAttrList) |
| | | #GameWorld.DebugLog("灵根品阶等级属性: %s" % lingGenQualityAttrList)
|
| | | #GameWorld.DebugLog("灵根点数附加战力: %s" % pointFightPowerEx)
|
| | | curPlayer.SetDict(ChConfig.Def_PlayerKey_MFPEx % ShareDefine.Def_MFPType_Role, pointFightPowerEx) |
| | | SetCalcAttrListValue(curPlayer, ChConfig.Def_CalcAttrFunc_RoleBase, allAttrList)
|
| | | SetCalcAttrListValue(curPlayer, ChConfig.Def_CalcAttrFunc_LingGenQuailty, lingGenQualityAttrList)
|
| | | return
|
| | |
| | | #先压入BUFF的效果值及技能战斗力
|
| | | self.RefreshAllSkill()
|
| | | ChEquip.RefreshPlayerEquipAttribute(curPlayer)
|
| | | ChEquip.RefreshPlayerLingQiEquipAttr(curPlayer)
|
| | | #SkillShell.RefreshPlayerBuffOnAttrAddEffect(curPlayer)
|
| | | PlayerWing.CalcWingAttr(curPlayer)
|
| | | PlayerHorse.CalcHorseAttrEx(curPlayer)
|
| | | PlayerPrestigeSys.CalcOfficialRankAttr(curPlayer)
|
| | | PlayerGodWeapon.CalcGodWeaponAttr(curPlayer)
|
| | |
| | | PlayerFamilyTech.CalcFamilyTechAttr(curPlayer)
|
| | | PlayerEquipDecompose.RefreshEDAttr(curPlayer)
|
| | | PlayerDogz.RefreshDogzAttr(curPlayer)
|
| | | #EquipZhuXian.CalcZhuXianAttr(curPlayer)
|
| | | PlayerGatherSoul.RefreshGatherSoulAttr(curPlayer)
|
| | | PlayerCoat.CalcClothesCoatSkinAttr(curPlayer)
|
| | | self.RefreshAllState(isForce=True)
|
| | |
| | | beforeMaxHP = curPlayer.GetMaxHP()
|
| | | beforeMoveSpeedValue = GetSpeedValue(curPlayer)
|
| | | beforeMaxProDef = GetMaxProDef(curPlayer)
|
| | | #[金木水火土]
|
| | | beforePointList = [GetMetal(curPlayer), GetWood(curPlayer), GetWater(curPlayer), GetFire(curPlayer), GetEarth(curPlayer)]
|
| | | #构建玩家刷新通知客户端字典, 缓存[索引, 数值]
|
| | | playerStateDict = {}
|
| | | for index in xrange(1, ChConfig.Def_Calc_AllAttrType_MAX):
|
| | |
| | | # 3.1 战斗属性层级交叉影响基值数值汇总
|
| | | # 基础层级(角色基础属性)
|
| | | baseAttrList = AddAttrListValue([funcAttrInfoList[ChConfig.Def_CalcAttrFunc_RoleBase],
|
| | | funcAttrInfoList[ChConfig.Def_CalcAttrFunc_LingGen],
|
| | | funcAttrInfoList[ChConfig.Def_CalcAttrFunc_LingGenQuailty],
|
| | | ])
|
| | | #GameWorld.DebugLog("基础层级: %s" % baseAttrList)
|
| | |
|
| | |
| | | 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])
|
| | |
| | | curLV = curPlayer.GetLV()
|
| | | fpParam = IpyGameDataPY.GetIpyGameData("FightPowerParam", curLV)
|
| | | mfpDict = {} # 模块战斗力
|
| | | mfpObjDict = {}
|
| | | for mfpType, attrFuncIndexList in ChConfig.MFPTypeAttrFuncIndexDict.items():
|
| | | mfpAttrList = [{} for _ in range(4)]
|
| | | mfpAttrExDict = {}
|
| | | for funcIndex in attrFuncIndexList:
|
| | | if funcIndex in ChConfig.CalcAttrFuncSkillList:
|
| | | # 技能模块不计入功能固定属性、不计战力
|
| | | continue
|
| | | funcAttrList = funcAttrInfoList[funcIndex]
|
| | | funcInsidePerAttrDict = funcInsidePerAttrList[funcIndex] # 功能点内部百分比加成属性
|
| | | funcCrossPerAttrDict = funcCrossAttrPerInfoDict.get(funcIndex, {}) # 功能点交叉百分比加成属性
|
| | |
| | | CalcLineEffect.ChangePlayerAttrInLineEffectList(curPlayer, funcCrossPerAttrDict)
|
| | | CalcLineEffect.ChangePlayerAttrInLineEffectList(curPlayer, fixPerAttrDict)
|
| | | # 不算战力的
|
| | | if funcIndex in ChConfig.CalcAttrFuncNoFightPowerList or funcIndex in ChConfig.CalcAttrFuncSkillList:
|
| | | if funcIndex in ChConfig.CalcAttrFuncNoFightPowerList:
|
| | | continue
|
| | | mfpAttrList = AddAttrListValue([mfpAttrList, funcAttrList])
|
| | | AddAttrDictValue(mfpAttrExDict, funcInsidePerAttrDict)
|
| | |
| | | mfpObj.SetCalcMFPBattleAttr(mfpAttrList)
|
| | | for attrIndex, value in mfpAttrExDict.items():
|
| | | mfpObj.AddCalcMFPAttr(attrIndex, value)
|
| | | |
| | | mfpValue = 0 if not fpParam else mfpObj.GetModuleFightPower(fpParam)
|
| | | mfpObjDict[mfpType] = mfpObj
|
| | | |
| | | # 因为计算战力需要取到总属性,所以等各功能点属性累加完后再计算
|
| | | for mfpType, mfpObj in mfpObjDict.items():
|
| | | mfpValue = 0 if not fpParam else mfpObj.GetModuleFightPower(fpParam, curPlayer)
|
| | | mfpSkill = curPlayer.GetDictByKey(ChConfig.Def_PlayerKey_MFPSkill % mfpObj.mfpType)
|
| | | mfpEx = curPlayer.GetDictByKey(ChConfig.Def_PlayerKey_MFPEx % mfpObj.mfpType)
|
| | | mfpTotal = mfpValue + mfpSkill + mfpEx
|
| | |
| | |
|
| | | #通知基础属性
|
| | | self.__SyncBaseAttr(curPlayer, baseAttrList)
|
| | | #五行灵根变更需要处理的逻辑
|
| | | afterPointList = [GetMetal(curPlayer), GetWood(curPlayer), GetWater(curPlayer), GetFire(curPlayer), GetEarth(curPlayer)]
|
| | | if beforePointList != afterPointList:
|
| | | diffPointAttrList = []
|
| | | for i, attrID in enumerate([ShareDefine.Def_Effect_Metal, ShareDefine.Def_Effect_Wood, ShareDefine.Def_Effect_Water,
|
| | | ShareDefine.Def_Effect_Fire, ShareDefine.Def_Effect_Earth]):
|
| | | if beforePointList[i] != afterPointList[i]:
|
| | | diffPointAttrList.append(attrID)
|
| | | SkillShell.RefreshElementSkillByAttr(curPlayer, diffPointAttrList)
|
| | | # 更新开服活动灵根数据
|
| | | OpenServerCampaign.UpdOpenServerCampaignLingGenData(curPlayer)
|
| | |
|
| | | # 同步前端战力,因为有 SetFightPower 所以累加战力放在这里所有刷新及计算处理完后才处理,才能正常触发set同步前端
|
| | | self.SendModuleFightPowerPack(curPlayer, mfpDict)
|
| | |
| | | # 暂停刷新属性标志,必须被调用
|
| | | curPlayer.SetDict(ChConfig.Def_Player_RefreshAttr, 0)
|
| | | curPlayer.SetDict(ChConfig.Def_Player_RefreshAttrByBuff, 0)
|
| | | curPlayer.SetDict(ChConfig.Def_Player_HadRefreshAttr, 1)
|
| | | GameWorld.DebugLog("End RefreshPlayerAttrStateEx!!!")
|
| | | return True
|
| | |
|
| | |
| | | # 速度特殊处理 计算一次
|
| | | self.__RefreshMoveSpeed(allAttrListBuffs)
|
| | |
|
| | | # GM测试属性特殊逻辑
|
| | | self.__DoRefreshGMAttr()
|
| | | |
| | | # 刷新攻击速度
|
| | | self.__SetAtkInterval()
|
| | | GameWorld.DebugLog("Buff层属性: %s" % allAttrListBuffs)
|
| | | |
| | | # GM测试属性特殊逻辑
|
| | | self.__DoRefreshGMAttr() |
| | | return
|
| | |
|
| | | def __DoRefreshGMAttr(self):
|
| | |
| | | setAttrDict[ChConfig.AttrName_Def] = int(lvIpyData.GetReDef() * attrPer) # 防御
|
| | | setAttrDict[ChConfig.AttrName_Hit] = int(lvIpyData.GetReHit() * attrPer) # 命中
|
| | | setAttrDict[ChConfig.AttrName_DefRate] = int(lvIpyData.GetReMiss() * attrPer) # 闪避
|
| | | setAttrDict[ChConfig.AttrName_AtkSpeed] = int(lvIpyData.GetReAtkSpeed() * attrPer) # 攻击速度
|
| | | setAttrDict[ChConfig.AttrName_SkillAtkRate] = int(lvIpyData.GetReSkillAtkRate() * attrPer) # 技能伤害比例
|
| | | setAttrDict[ChConfig.AttrName_AtkSpeed] = int((lvIpyData.GetReAtkSpeed() + 10000) * attrPer) # 攻击速度, 策划等级表配置的是附加值,所以这里要加
|
| | | setAttrDict[ChConfig.AttrName_SkillAtkRate] = int(max(0, lvIpyData.GetReSkillAtkRate() - 10000) * attrPer) # 技能伤害比例, 策划等级表配置的是最终值,初始值是0,所以这里要减
|
| | | setAttrDict[ChConfig.AttrName_DamagePVP] = int(lvIpyData.GetReDamagePer() * attrPer) # PVP固定伤害
|
| | | setAttrDict[ChConfig.AttrName_DamagePVPReduce] = int(lvIpyData.GetReDamReduce() * attrPer) # PVP固定减伤
|
| | | setAttrDict[ChConfig.AttrName_IgnoreDefRate] = int(lvIpyData.GetReIgnoreDefRate() * attrPer) # 无视防御比例
|
| | |
| | | setAttrDict[ChConfig.AttrName_IceAtk] = int(lvIpyData.GetReIceAtk() * attrPer) # 真实伤害
|
| | | setAttrDict[ChConfig.AttrName_IceDef] = int(lvIpyData.GetReIceDef() * attrPer) # 真实抵御
|
| | | setAttrDict[ChConfig.AttrName_PetAtk] = int(lvIpyData.GetRePetAtk() * attrPer) # 灵宠攻击
|
| | | setAttrDict[ChConfig.AttrName_PetSkillAtkRate] = int(lvIpyData.GetRePetSkillAtkRate() * attrPer) # 灵宠技能
|
| | | setAttrDict[ChConfig.AttrName_PetSkillAtkRate] = int(max(0, lvIpyData.GetRePetSkillAtkRate() - 10000) * attrPer) # 灵宠技能, 策划等级表配置的是最终值,初始值是0,所以这里要减
|
| | | setAttrDict[ChConfig.AttrName_PetDamPer] = int(lvIpyData.GetRePetDamPer() * attrPer) # 灵宠伤害增加
|
| | | setAttrDict[ChConfig.AttrName_FinalHurt] = int(lvIpyData.GetReFinalHurt() * attrPer) # 固定伤害增加
|
| | | setAttrDict[ChConfig.AttrName_FinalHurtReduce] = int(lvIpyData.GetReFinalHurtReduce() * attrPer) # 固定伤害减少
|
| | |
| | | DoPlayerDead(curPlayer)
|
| | |
|
| | | PlayerTJG.PlayerTJGReborn(curPlayer, tick)
|
| | | GameObj.ClearPyPlayerState(curPlayer)
|
| | | return
|
| | |
|
| | |
|
| | |
| | | CrossPlayerData.ClearCrossSyncDataCache(curPlayer)
|
| | | return
|
| | |
|
| | | ## 前端自定义场景
|
| | | def GetCustomMapID(curPlayer): return curPlayer.GetExAttr14() / 1000
|
| | | def GetCustomLineID(curPlayer): return curPlayer.GetExAttr14() % 1000
|
| | | ## 自定义场景后端判断已结算后需直接重置为0,防止前端没有退出场景直接下线导致数据没有重置,可能引发可以重复进
|
| | | def SetCustomMap(curPlayer, mapID, lineID):
|
| | | value = mapID * 1000 + lineID
|
| | | if value != curPlayer.GetExAttr14():
|
| | | curPlayer.SetExAttr14(value, False, True)
|
| | | return
|
| | |
|
| | | ## 铜钱点, 支持铜钱超20亿
|
| | | def GetSilver(curPlayer): return curPlayer.GetExAttr6() * ChConfig.Def_PerPointValue + curPlayer.GetSilver()
|
| | | def SetSilver(curPlayer, totalSilver):
|
| | |
| | | # addAttrList[ChConfig.CalcAttr_BattleNoline] = {}
|
| | | # return addAttrList
|
| | | #===============================================================================
|
| | |
|
| | | def GetTotalLingGenPoint(curPlayer):
|
| | | # 总灵根点数(金木水火土+自由点数)
|
| | | return GetMetal(curPlayer) + GetWood(curPlayer) + GetWater(curPlayer) + GetFire(curPlayer) + GetEarth(curPlayer) + curPlayer.GetFreePoint()
|
| | |
|
| | | # 灵根 - 金木水火土
|
| | | def GetMetal(curPlayer): return curPlayer.GetDictByKey(ChConfig.Def_PlayerKey_Metal)
|
| | |
| | | curPlayer.SetDict(ChConfig.Def_PlayerKey_LostYinjiTime, value)
|
| | | curPlayer.SendPropertyRefresh(ShareDefine.CDBPlayerRefresh_YinjiTime, value, False)
|
| | |
|
| | | # 当前印记数
|
| | | def GetYinjiCnt(curPlayer): return curPlayer.GetDictByKey(ChConfig.Def_PlayerKey_YinjiCnt)
|
| | | def SetYinjiCnt(curPlayer, value): |
| | | curPlayer.SetDict(ChConfig.Def_PlayerKey_YinjiCnt, value)
|
| | | curPlayer.SendPropertyRefresh(ShareDefine.CDBPlayerRefresh_YinjiCnt, value, False)
|
| | |
|
| | | # 减少指定技能组CD XX%
|
| | | def GetTheFBSkillsCD(curPlayer): return curPlayer.GetDictByKey(ChConfig.Def_PlayerKey_TheFBSkillsCD)
|
| | | def SetTheFBSkillsCD(curPlayer, value): curPlayer.SetDict(ChConfig.Def_PlayerKey_TheFBSkillsCD, value)
|
| | | # 灼烧固定伤害
|
| | | def GetBurnValue(curPlayer): return curPlayer.GetDictByKey(ChConfig.Def_PlayerKey_BurnValue)
|
| | | def SetBurnValue(curPlayer, value): curPlayer.SetDict(ChConfig.Def_PlayerKey_BurnValue, value)
|
| | | # 延长灼烧时间百分比
|
| | | def GetBurnTimePer(curPlayer): return curPlayer.GetDictByKey(ChConfig.Def_PlayerKey_BurnTimePer)
|
| | | def SetBurnTimePer(curPlayer, value): curPlayer.SetDict(ChConfig.Def_PlayerKey_BurnTimePer, value)
|
| | | # 减移动速度百分比
|
| | | def GetSubSpeedPer(curPlayer): return curPlayer.GetDictByKey(ChConfig.Def_PlayerKey_SubSpeedPer)
|
| | | def SetSubSpeedPer(curPlayer, value): curPlayer.SetDict(ChConfig.Def_PlayerKey_SubSpeedPer, value)
|
| | |
|
| | | ## 计算功能背包物品属性
|
| | | # @param curPlayer 当前玩家
|
| | | # @param packType 背包类型
|
| | |
| | | NetPackCommon.SendFakePack(curPlayer, sendPack)
|
| | | return
|
| | |
|
| | | #同步设置 玩家和宠物及已召唤的召唤兽 视野层
|
| | | def SetPlayerSightLevel(curPlayer, sightLevel):
|
| | | curPlayer.SetSightLevel(sightLevel)
|
| | | rolePet = curPlayer.GetPetMgr().GetFightPet()
|
| | | #无出战宠物
|
| | | if rolePet:
|
| | | rolePet.SetSightLevel(sightLevel)
|
| | | |
| | | for i in range(curPlayer.GetSummonCount()):
|
| | | curSummon = curPlayer.GetSummonNPCAt(i)
|
| | | if not curSummon:
|
| | | continue
|
| | | curSummon.SetSightLevel(sightLevel)
|
| | | return |