From 39b53de0a35949fe203ebee2aec40dbcc2395887 Mon Sep 17 00:00:00 2001
From: xdh <xiefantasy@qq.com>
Date: 星期三, 29 八月 2018 14:47:15 +0800
Subject: [PATCH] fix:3028 【后端】免费寻宝增加多少次必出的保底库配置,和消耗仙玉的独立分开

---
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Attack/AttackLogic/AttackCommon.py |   76 ++++++++++++++++++++++++++++++++++----
 1 files changed, 68 insertions(+), 8 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 6cf2e53..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
@@ -1562,8 +1562,21 @@
     if tick - defObj.GetDictByKey(ChConfig.Def_PlayerKey_SomersaultTime) < 500:
         return 0, ChConfig.Def_HurtType_Miss
     
+    summonAtkPer = 1    # 召唤继承提高基础攻击力,取表
+    if atkObj.GetGameObjType() == IPY_GameWorld.gotNPC and atkObj.GetGameNPCObjType() == IPY_GameWorld.gnotSummon:
+        summonAtkPerValue = atkObj.GetDictByKey(ChConfig.Def_GameObjKey_InheritOwner)
+        if summonAtkPerValue > 0:
+            # 暴风雪类召唤兽转化为主人计算伤害
+            atkObj = NPCCommon.GetSummonOwnerDetel(atkObj)
+            if not atkObj:
+                return 0, ChConfig.Def_HurtType_Miss
+            
+            summonAtkPer = summonAtkPerValue*1.0/ChConfig.Def_MaxRateValue
+            #GameWorld.DebugLog("召唤兽取主人---------%s-%s-%s-%s"%(atkObj.GetID(), atkSkillPer, atkSkillValue, summonAtkPer))
+        
     atkObjType = atkObj.GetGameObjType()
     defObjType = defObj.GetGameObjType()
+
 
     atkType = GetBattleType(atkObj, curSkill)
     happenState = happenState if happenState else SkillShell.GetHappenState(curSkill)
@@ -1580,6 +1593,7 @@
     dMissSuccessRate += PassiveBuffEffMng.GetPassiveSkillValueByTriggerType(defObj, atkObj, None, ChConfig.TriggerType_MissSuccessPer)
     skillID = curSkill.GetSkillID() if curSkill else 0
     
+    
     atkIsBoss = 0 # 攻击方是否boss
     suppressValueLV = 0 # 等级最终压制值, 由压制规则及相关参数计算得出,可作为伤害公式计算参数使用
     suppressValueFP = 0 # 战力最终压制值, 由压制规则及相关参数计算得出,可作为伤害公式计算参数使用
@@ -1588,6 +1602,13 @@
     suppressNPCFightPower = 0 # 压制NPC战力
     #当攻击方为NPC,防守方为玩家时,计算压制等级 及 压制战力
     if atkObjType == IPY_GameWorld.gotNPC and defObjType == IPY_GameWorld.gotPlayer:
+        
+        if curSkill and curSkill.GetFuncType() == ChConfig.Def_SkillFuncType_RealmSuppress:
+            # 境界压制技能不对高等级境界玩家产生攻击
+            aRealmLV, dRealmLV = GetPVERealmLVs(atkObj, defObj, atkObjType, defObjType) 
+            if aRealmLV <= dRealmLV:
+                return 0, ChConfig.Def_HurtType_Immune   # 免疫
+        
         atkIsBoss = 1 if ChConfig.IsGameBoss(atkObj) else 0
         if NPCCommon.GetIsLVSuppress(atkObj):
             suppressLV = max(0, aLV - dLV)
@@ -1658,11 +1679,14 @@
     rand = random.random()                #种子数 0~1
     
     #------- 攻击方
-    aMinAtk = atkObj.GetMinAtk()        # 攻击方最小攻击
-    aMaxAtk = atkObj.GetMaxAtk()        # 攻击方最大攻击
+    aMinAtk = atkObj.GetMinAtk() * summonAtkPer        # 攻击方最小攻击
+    aMaxAtk = atkObj.GetMaxAtk() * summonAtkPer       # 攻击方最大攻击
+    
     aIceAtk = atkObj.GetIceAtk()        # 冰攻, 元素真伤, 玩家及NPC通用
     aIceAtk += PassiveBuffEffMng.GetPassiveSkillValueByTriggerType(atkObj, defObj, curSkill, ChConfig.TriggerType_AddIceAtk)
     #------- 防守方
+    dMinAtk = defObj.GetMinAtk()        # 防守方最小攻击
+    dMaxAtk = defObj.GetMaxAtk()        # 防守方最大攻击
     dDef = defObj.GetDef()              # 防守方防御力
     dHP = GameObj.GetHP(defObj)                # 防守方当前血量
     dMaxHP = GameObj.GetMaxHP(defObj)          # 防守方最大血量
@@ -1678,6 +1702,7 @@
         aDamagePer += PassiveBuffEffMng.GetValueByPassiveBuffTriggerType(atkObj, defObj, curSkill, ChConfig.TriggerType_AddDamagePer)
         
         aDamagePerPVP = PlayerControl.GetDamagePerPVP(atkObj)     # 外层PVP伤害加成
+        aFinalHurtPer = PlayerControl.GetFinalHurtPer(atkObj) # 最外层伤害加成
         aFinalHurt = PlayerControl.GetFinalHurt(atkObj)     # 最终固定伤害
         # 被动增加最终伤害
         aFinalHurt += PassiveBuffEffMng.GetPassiveSkillValueByTriggerType(atkObj, defObj, curSkill, ChConfig.TriggerType_AttackAddFinalValue)
@@ -1693,9 +1718,9 @@
             aSkillAtkRate += atkObj.GetSkillAtkRate()
         aDamagePer = 0      # 外层伤害加成
         aDamagePerPVP = 0   # 外层PVP伤害加成
+        aFinalHurtPer = 0 # 最外层伤害加成
         aFinalHurt = NPCCommon.GetFinalHurt(atkObj) # 最终固定伤害
         aFightPower = NPCCommon.GetSuppressFightPower(atkObj)
-
         
     #防守方的类型
     if defObjType == IPY_GameWorld.gotPlayer:
@@ -1732,7 +1757,7 @@
             suppressFPFormula = hurtDist[suppressFormulaKeyFP]
             suppressValueFP = eval(FormulaControl.GetCompileFormula(suppressFormulaKeyFP, suppressFPFormula))
     
-    # 境界压制百分比, 仅限PVP
+    # 境界压制百分比
     SuppressValueRealmRate = 10000 # 默认值
     suppressRealm = 0
     if atkObjType == IPY_GameWorld.gotPlayer and defObjType == IPY_GameWorld.gotPlayer:
@@ -1751,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)
@@ -1787,9 +1824,32 @@
     hurtFormula = hurtDist[hurtFormulaKey]
     hurtValue = int(eval(FormulaControl.GetCompileFormula(hurtFormulaKey, hurtFormula)))
     
+    if hurtType == ChConfig.Def_HurtType_Normal and SuppressValueRealmRate > 10000:
+        # 存在压制
+        return hurtValue, ChConfig.Def_HurtType_RealmSupress
+    
     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