From 0a93c7c66ea0047c8080d7e21ced94736fe25034 Mon Sep 17 00:00:00 2001
From: hch <305670599@qq.com>
Date: 星期二, 28 八月 2018 15:24:14 +0800
Subject: [PATCH] fix:2965 子 境界压制规则修改 / 【后端】境界压制规则修改

---
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Attack/AttackLogic/AttackCommon.py |   45 ++++++++++++++++++++++++++++++++++++++-------
 1 files changed, 38 insertions(+), 7 deletions(-)

diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Attack/AttackLogic/AttackCommon.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Attack/AttackLogic/AttackCommon.py
index ca2582a..22d3208 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Attack/AttackLogic/AttackCommon.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Attack/AttackLogic/AttackCommon.py
@@ -1564,14 +1564,14 @@
     
     summonAtkPer = 1    # 召唤继承提高基础攻击力,取表
     if atkObj.GetGameObjType() == IPY_GameWorld.gotNPC and atkObj.GetGameNPCObjType() == IPY_GameWorld.gnotSummon:
-        summonAtkPer = atkObj.GetDictByKey(ChConfig.Def_GameObjKey_InheritOwner)
-        if summonAtkPer > 0:
+        summonAtkPerValue = atkObj.GetDictByKey(ChConfig.Def_GameObjKey_InheritOwner)
+        if summonAtkPerValue > 0:
             # 暴风雪类召唤兽转化为主人计算伤害
             atkObj = NPCCommon.GetSummonOwnerDetel(atkObj)
             if not atkObj:
                 return 0, ChConfig.Def_HurtType_Miss
             
-            summonAtkPer = summonAtkPer*1.0/ChConfig.Def_MaxRateValue
+            summonAtkPer = summonAtkPerValue*1.0/ChConfig.Def_MaxRateValue
             #GameWorld.DebugLog("召唤兽取主人---------%s-%s-%s-%s"%(atkObj.GetID(), atkSkillPer, atkSkillValue, summonAtkPer))
         
     atkObjType = atkObj.GetGameObjType()
@@ -1776,16 +1776,28 @@
         #GameWorld.DebugLog("境界压制:aRealmLV=%s,dRealmLV=%s,aRealmGroup=%s,dRealmGroup=%s,SuppressValueRealmRate=%s" 
         #                   % (aRealmLV, dRealmLV, aRealmGroup, dRealmGroup, SuppressValueRealmRate))    
         
-    else:
-        #PVE 境界压制
+    elif atkObjType == IPY_GameWorld.gotNPC and defObjType == IPY_GameWorld.gotPlayer:
+        # EVP 境界压制
         aRealmLV, dRealmLV = GetPVERealmLVs(atkObj, defObj, atkObjType, defObjType) 
         if aRealmLV + dRealmLV != 0:
             #有压制
-            suppressRealm = aRealmLV - dRealmLV
+            suppressRealm = aRealmLV - dRealmLV # 存在负数
+            suppressRealmHurtPer = GetRealmHurtPer(aRealmLV, dRealmLV, 2) # 境界压制加成百分比,存在负数
+            suppressFormulaKeyRealm = "EVPSuppressValueRealm"
+            if suppressFormulaKeyRealm in hurtDist:
+                SuppressValueRealmRate = int(eval(FormulaControl.GetCompileFormula(suppressFormulaKeyRealm, hurtDist[suppressFormulaKeyRealm])))
+                
+    elif atkObjType == IPY_GameWorld.gotPlayer and defObjType == IPY_GameWorld.gotNPC:
+        # PVE 境界压制
+        aRealmLV, dRealmLV = GetPVERealmLVs(atkObj, defObj, atkObjType, defObjType) 
+        if aRealmLV + dRealmLV != 0:
+            #有压制
+            suppressRealm = aRealmLV - dRealmLV # 存在负数
+            suppressRealmHurtPer = GetRealmHurtPer(aRealmLV, dRealmLV, 3) # 境界压制加成百分比,存在负数
             suppressFormulaKeyRealm = "PVESuppressValueRealm"
             if suppressFormulaKeyRealm in hurtDist:
                 SuppressValueRealmRate = int(eval(FormulaControl.GetCompileFormula(suppressFormulaKeyRealm, hurtDist[suppressFormulaKeyRealm])))
-
+            
 
     atkStateMark = GetObjAtkStateMark(atkObj)
     defStateMark = GetObjAtkStateMark(defObj)
@@ -1818,7 +1830,26 @@
     
     return hurtValue, hurtType
 
+# 获取EVP和PVE伤害百分比差,PVE无境界压制, 境界等级对应列表的index,越界取最高
+def GetRealmHurtPer(aRealmLV, dRealmLV, gridIndex):
+    suppressRealmHurtPer = 0
+    suppressRealmDict = IpyGameDataPY.GetFuncEvalCfg("RealmGroup", gridIndex)
+    
+    plus_minus = 1  # 负数为反压制
+    if aRealmLV >= dRealmLV:
+        suppressList = range(dRealmLV+1, aRealmLV+1)
+    else:
+        suppressList = range(aRealmLV+1, dRealmLV+1)
+        plus_minus = -1
+    
+    
+    for realmLV in suppressList:
+        suppressRealmHurtPer += suppressRealmDict.get(realmLV, 0)
+        
+    return suppressRealmHurtPer*plus_minus
 
+
+# 获取双方境界值
 def GetPVERealmLVs(atkObj, defObj, atkObjType, defObjType):
     if atkObjType == IPY_GameWorld.gotNPC:
         aRealmLV = NPCCommon.GetRealmLV(atkObj)

--
Gitblit v1.8.0