From a464c80b1d44bdca78684f0bb5f5eba58d2fd87d Mon Sep 17 00:00:00 2001
From: hxp <ale99527@vip.qq.com>
Date: 星期一, 27 五月 2019 19:43:18 +0800
Subject: [PATCH] 6861 【后端】【2.0】暴击、会心战力计算优化

---
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerControl.py |   19 ++++++++++++++-----
 1 files changed, 14 insertions(+), 5 deletions(-)

diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerControl.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerControl.py
index d5dc3a8..bd5cfad 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerControl.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerControl.py
@@ -3570,7 +3570,7 @@
             attrName = self.__AttrName % attrIndex
             setattr(self, attrName, getattr(self, attrName) + value)
     
-    def GetModuleFightPower(self, fpParam, job):
+    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) # 最大攻击
@@ -3578,11 +3578,11 @@
         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) # 暴击率
+        SuperHitRate = getattr(self, self.__AttrName % ChConfig.TYPE_Calc_SuperHitRate) * fpParam.GetCftSuperHitRate() # 暴击率
         SuperHitRateReduce = getattr(self, self.__AttrName % ChConfig.TYPE_Calc_SuperHitRateReduce) # 暴击概率抗性
         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) # 会心一击
+        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) # 会心一击伤害固定减伤
@@ -3640,6 +3640,11 @@
         AtkSpeedParameter = fpParam.GetCftAtkSpeed()
         LuckyHitParameter = 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))
@@ -4533,6 +4538,7 @@
         curLV = curPlayer.GetLV()
         fpParam = IpyGameDataPY.GetIpyGameData("FightPowerParam", curLV)
         mfpDict = {} # 模块战斗力
+        mfpObjDict = {}
         for mfpType, attrFuncIndexList in ChConfig.MFPTypeAttrFuncIndexDict.items():
             mfpAttrList = [{} for _ in range(4)]
             mfpAttrExDict = {}
@@ -4558,8 +4564,11 @@
             mfpObj.SetCalcMFPBattleAttr(mfpAttrList)
             for attrIndex, value in mfpAttrExDict.items():
                 mfpObj.AddCalcMFPAttr(attrIndex, value)
-                
-            mfpValue = 0 if not fpParam else mfpObj.GetModuleFightPower(fpParam, curPlayer.GetJob())
+            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

--
Gitblit v1.8.0