From 2a6a87337c128ce22014d16532c79486efb3290c Mon Sep 17 00:00:00 2001
From: xdh <xiefantasy@qq.com>
Date: 星期二, 08 一月 2019 19:14:47 +0800
Subject: [PATCH] 5768 【后端】【1.5】新增8-14天活动功能封包

---
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Attack/AttackLogic/AttackCommon.py |   53 +++++++++++++++++++++++++++++++++++++++++++++--------
 1 files changed, 45 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 b7f7d9f..018883c 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
@@ -1520,7 +1520,7 @@
     
     # 被动技能触发
     defObj.SetDict(ChConfig.Def_PlayerKey_GodWeaponBeforeProDef, curProDef)
-    PassiveBuffEffMng.OnPassiveSkillTrigger(defObj, atkObj, curSkill, ChConfig.TriggerType_ProDefValue, tick)
+    PassiveBuffEffMng.OnPassiveSkillTrigger(defObj, atkObj, None, ChConfig.TriggerType_ProDefValue, tick)
     return hurtValue - absortValue
 
 ## 计算伤血值
@@ -1607,6 +1607,7 @@
     # 斩杀,濒死等情况的处理
     if PassiveBuffEffMng.GetPassiveSkillValueByTriggerType(atkObj, defObj, curSkill, ChConfig.TriggerType_AttackKill):
         # 斩杀
+        hurtType = ChConfig.Def_HurtType_Zhansha
         hurtValue = GameObj.GetHP(defObj)
         #伤害结构体
         resultHurtType.HurtHP = hurtValue
@@ -1627,7 +1628,20 @@
     
     remainHP = int(remainHP)    #防范
     if defObjType == IPY_GameWorld.gotPlayer:
+        curHP = GameObj.GetHP(defObj)
         GameObj.SetHP(defObj, remainHP, False)
+        
+        lockHPPer = PassiveBuffEffMng.OnObjsPassiveSkillLockHP(defObj, atkObj, curSkill, ChConfig.TriggerType_LockHP, tick)
+        if lockHPPer:
+            # 锁血情况
+            lockHP = GameObj.GetMaxHP(defObj)*lockHPPer/ChConfig.Def_MaxRateValue
+            if lockHP < curHP and remainHP < lockHP:
+                remainHP = lockHP
+            elif lockHP >= curHP:
+                remainHP = curHP
+            
+            #锁血纠正血量
+            GameObj.SetHP(defObj, remainHP, False)
             
     elif defObjType == IPY_GameWorld.gotNPC:
         if defObj.GetGameNPCObjType() == IPY_GameWorld.gnotPet:
@@ -1792,9 +1806,11 @@
     if PassiveBuffEffMng.GetPassiveSkillValueByTriggerType(defObj, atkObj, None, ChConfig.TriggerType_OneDamage):
         return 1, hurtType
     
+    wReFightPower = 0
     worldLV = GameWorld.GetGameWorld().GetGameWorldDictByKey(ShareDefine.Def_Notify_WorldKey_WorldAverageLv)
-    wLVIpyData = PlayerControl.GetPlayerLVIpyData(worldLV)
-    wReFightPower = 0 if not wLVIpyData else wLVIpyData.GetReFightPower() # 当前世界等级参考战力
+    if worldLV:
+        wLVIpyData = PlayerControl.GetPlayerLVIpyData(worldLV)
+        wReFightPower = 0 if not wLVIpyData else wLVIpyData.GetReFightPower() # 当前世界等级参考战力
     
     # 改变技能伤害
     atkSkillPer, atkSkillValue = ChangeSkillHurt(atkObj, defObj, curSkill, atkSkillPer, atkSkillValue)
@@ -1820,7 +1836,9 @@
     if isLuckyHit:
         # 会心一击时增加会心伤害百分比 
         aLuckyHit += PassiveBuffEffMng.GetPassiveSkillValueByTriggerType(atkObj, defObj, curSkill, ChConfig.TriggerType_LuckyHit)
-
+        aLuckyHit -= PassiveBuffEffMng.GetValueByPassiveBuffTriggerType(defObj, atkObj, curSkill, ChConfig.TriggerType_BeLuckyHitSubPer)
+        aLuckyHit = max(aLuckyHit, 0)
+        
     #参与运算的数值
     rand = random.random()                #种子数 0~1
     
@@ -1862,13 +1880,14 @@
         
     else:
         aIgnoreDefRate = 0  # 无视防御比率
+        aFinalHurtPer = GameObj.GetPetDamPer(atkObj) # 最外层伤害加成, 可能为负值
         aSkillAtkRate = NPCCommon.GetSkillAtkRate(atkObj)   # 技能攻击力加成
         if atkObjType == IPY_GameWorld.gotNPC and atkObj.GetGameNPCObjType() == IPY_GameWorld.gnotPet:
             aSkillAtkRate += atkObj.GetSkillAtkRate()
+            
         aNPCHurtAddPer = 0  # PVE伤害加成
         aDamagePer = 0      # 外层伤害加成
         aDamagePerPVP = 0   # 外层PVP伤害加成
-        aFinalHurtPer = 0 # 最外层伤害加成, 可能为负值
         aFinalHurt = NPCCommon.GetFinalHurt(atkObj) # 最终固定伤害
         aFightPower = NPCCommon.GetSuppressFightPower(atkObj)
         
@@ -1947,10 +1966,22 @@
             suppressFormulaKeyRealm = "PVESuppressValueRealm"
             if suppressFormulaKeyRealm in hurtDist:
                 SuppressValueRealmRate = int(eval(FormulaControl.GetCompileFormula(suppressFormulaKeyRealm, hurtDist[suppressFormulaKeyRealm])))
+        
+        
+    # 骑宠争夺最终伤害衰减           
+    if defObjType == IPY_GameWorld.gotNPC and FamilyRobBoss.IsHorsePetRobBoss(defObj.GetNPCID()):
+        ownerPlayer = None
+        # 召唤兽和宠物需要从人物获取状态
+        if atkObj.GetGameObjType() == IPY_GameWorld.gotNPC:
+            if atkObj.GetGameNPCObjType() == IPY_GameWorld.gnotPet:
+                ownerPlayer = PetControl.GetPetOwner(atkObj)
+            elif atkObj.GetGameNPCObjType() == IPY_GameWorld.gnotSummon:
+                ownerPlayer = NPCCommon.GetSummonNPCOwner(IPY_GameWorld.gotPlayer, atkObj)
+        else:
+            ownerPlayer = atkObj
             
-        # 骑宠争夺最终伤害衰减           
-        if FamilyRobBoss.IsHorsePetRobBoss(defObj.GetNPCID()):
-            findBuff = SkillCommon.FindBuffByID(atkObj, ChConfig.Def_SkillID_HorsePetRobBossKillCntBuff)[0]
+        if ownerPlayer:
+            findBuff = SkillCommon.FindBuffByID(ownerPlayer, ChConfig.Def_SkillID_HorsePetRobBossKillCntBuff)[0]
             if findBuff:
                 reduceFinalHurtPer = findBuff.GetSkill().GetEffect(0).GetEffectValue(0)
                 aFinalHurtPer -= reduceFinalHurtPer
@@ -2055,6 +2086,12 @@
     if objType == IPY_GameWorld.gotPlayer:
         return "P"
     
+    if objType == IPY_GameWorld.gotNPC:
+        if obj.GetType() == ChConfig.ntRobot:
+            return "Robot"
+        if obj.GetType() == ChConfig.ntHelpBattleRobot:
+            return "HelpRobot"
+        
     objType = obj.GetGameNPCObjType()
     if objType == IPY_GameWorld.gnotPet:
         return "Pet"

--
Gitblit v1.8.0