From cd710b03b00876a3aabf0575559d680b8a1f2bc1 Mon Sep 17 00:00:00 2001
From: hch <305670599@qq.com>
Date: 星期五, 09 十一月 2018 17:33:23 +0800
Subject: [PATCH] 2683 子 天赋技能和新增双职业各两个技能 / 【后端】天赋技能  - 召唤兽攻击百分比和属性点加成

---
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/GameBuffs/Buff_518.py        |    2 +-
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/GameBuffs/Buff_519.py        |    2 +-
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Attack/AttackLogic/AttackCommon.py |   41 ++++++++++++++++++-----------------------
 3 files changed, 20 insertions(+), 25 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 4bb0a12..b776166 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
@@ -1486,8 +1486,8 @@
 #  @param finalHurtPer 对最终计算出来的伤害影响效果(有正负,默认10000)
 #  @return None or HurtType 伤害结构体类 
 #  @remarks 函数详细说明.
-def GetHurtHP(atkObj, defObj, curSkill, atkSkillValue, atkSkillPer, tick):
-    atkObj = ElfChangeAttacker(atkObj)  # Elf灵为替身攻击,要取玩家的属性
+def GetHurtHP(attacker, defObj, curSkill, atkSkillValue, atkSkillPer, tick):
+    atkObj = ElfChangeAttacker(attacker)  # Elf灵为替身攻击,要取玩家的属性
     
     resultHurtType = HurtType()
     defObjType = defObj.GetGameObjType()
@@ -1519,7 +1519,7 @@
         #GameWorld.DebugAnswer(atkObj, "客户端伤害 %s 服务端伤害 %s"%([defObj.GetID(), clientValue, hurtType], hurtValue))
 
     else:
-        hurtValue, hurtType = CalcHurtHP(atkObj, defObj, curSkill, atkSkillValue, atkSkillPer, tick)
+        hurtValue, hurtType = CalcHurtHP(atkObj, defObj, curSkill, atkSkillValue, atkSkillPer, tick, orgAtkObj=attacker)
     
     if defObj.GetDictByKey(ChConfig.Def_PlayerKey_AbsorbShieldValue):
         # 麒麟护盾吸收伤害,将抵消的伤害存储
@@ -1615,22 +1615,23 @@
 
 # 计算攻击伤害
 # maxHurt参数用于模拟计算最大伤害,防范客户端攻击伤害过高
-def CalcHurtHP(atkObj, defObj, curSkill, atkSkillValue, atkSkillPer, tick, happenState=None, maxHurt=False):
+def CalcHurtHP(atkObj, defObj, curSkill, atkSkillValue, atkSkillPer, tick, happenState=None, **atkwargs):
     # 翻滚闪避特殊处理
     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)
+    summonAtkObj = atkwargs.get('orgAtkObj', None) if atkwargs.get('orgAtkObj', None) else atkObj
+    if summonAtkObj.GetGameObjType() == IPY_GameWorld.gotNPC and summonAtkObj.GetGameNPCObjType() == IPY_GameWorld.gnotSummon:
+        summonAtkPerValue = summonAtkObj.GetDictByKey(ChConfig.Def_GameObjKey_InheritOwner)
         if summonAtkPerValue > 0:
             # 暴风雪类召唤兽转化为主人计算伤害
-            atkObj = NPCCommon.GetSummonOwnerDetel(atkObj)
-            if not atkObj:
+            ownerAtkObj = NPCCommon.GetSummonOwnerDetel(summonAtkObj)
+            if not ownerAtkObj:
                 return 0, ChConfig.Def_HurtType_Miss
             
             summonAtkPer = summonAtkPerValue*1.0/ChConfig.Def_MaxRateValue
-            #GameWorld.DebugLog("召唤兽取主人---------%s-%s-%s-%s"%(atkObj.GetID(), atkSkillPer, atkSkillValue, summonAtkPer))
+            #GameWorld.DebugLog("召唤兽取主人---------%s-%s-%s-%s"%(ownerAtkObj.GetID(), atkSkillPer, atkSkillValue, summonAtkPer))
         
     atkObjType = atkObj.GetGameObjType()
     defObjType = defObj.GetGameObjType()
@@ -1680,8 +1681,8 @@
     #命中公式 攻击方类型不同,公式不同
     hitFormula = ReadChConfig.GetChConfig('CalcCanHit')
     
-    if not maxHurt and not PassiveBuffEffMng.GetValueByPassiveBuffTriggerType(atkObj, defObj, curSkill, 
-                           ChConfig.TriggerType_Buff_MustBeHit):     # maxHurt用于模拟计算, 被动有必命中效果
+    if not PassiveBuffEffMng.GetValueByPassiveBuffTriggerType(atkObj, defObj, curSkill, 
+                           ChConfig.TriggerType_Buff_MustBeHit):
         # 技能对指定BOSS无效果的返回MISS
         if defObjType == IPY_GameWorld.gotNPC and defObj.GetIsBoss() not in ChConfig.Def_SkillAttack_NPCIsBoss \
         and SkillCommon.GetSkillBattleType(curSkill) == ChConfig.Def_BattleRelationType_CommNoBoss:
@@ -1697,18 +1698,12 @@
             and eval(hitFormula) < 0:
             return 0, ChConfig.Def_HurtType_Miss
     
-    if maxHurt:     # 用于模拟计算最大伤害
-        rand = 1
-        isLuckyHit, aLuckyHit, dLuckyHitReduce = True, atkObj.GetLuckyHitVal(), 0
-        isSuperHit, aSuperHit, dSuperHitReduce = True, atkObj.GetSuperHit(), 0
-        dDamChanceDef = 0
-        hurtType = ChConfig.Def_HurtType_SuperHit
-    else:
-        hurtType, hurtTypeResultDict = CalcHurtTypeResult(atkObj, defObj, atkObjType, defObjType, happenState)
-        #GameWorld.DebugLog("GetHurtHP hurtType=%s, hurtTypeResultDict=%s" % (hurtType, hurtTypeResultDict))
-        isLuckyHit, aLuckyHit, dLuckyHitReduce = hurtTypeResultDict[ChConfig.Def_HurtType_LuckyHit] # 幸运一击
-        isSuperHit, aSuperHit, dSuperHitReduce = hurtTypeResultDict[ChConfig.Def_HurtType_SuperHit] # 暴击
-        dDamChanceDef = hurtTypeResultDict[ChConfig.Def_HurtType_Parry][2] # 抵御, 大于0代表触发抵御效果
+
+    hurtType, hurtTypeResultDict = CalcHurtTypeResult(atkObj, defObj, atkObjType, defObjType, happenState)
+    #GameWorld.DebugLog("GetHurtHP hurtType=%s, hurtTypeResultDict=%s" % (hurtType, hurtTypeResultDict))
+    isLuckyHit, aLuckyHit, dLuckyHitReduce = hurtTypeResultDict[ChConfig.Def_HurtType_LuckyHit] # 幸运一击
+    isSuperHit, aSuperHit, dSuperHitReduce = hurtTypeResultDict[ChConfig.Def_HurtType_SuperHit] # 暴击
+    dDamChanceDef = hurtTypeResultDict[ChConfig.Def_HurtType_Parry][2] # 抵御, 大于0代表触发抵御效果
 
     if PassiveBuffEffMng.GetPassiveSkillValueByTriggerType(defObj, atkObj, None, ChConfig.TriggerType_OneDamage):
         return 1, hurtType
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/GameBuffs/Buff_518.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/GameBuffs/Buff_518.py
index 2de14fc..05282ee 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/GameBuffs/Buff_518.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/GameBuffs/Buff_518.py
@@ -33,7 +33,7 @@
     if attrType in [ChConfig.TYPE_Calc_AttrATKMin, ChConfig.TYPE_Calc_AttrATKMax]:
         attrTypeList = [ChConfig.TYPE_Calc_AttrATKMin, ChConfig.TYPE_Calc_AttrATKMax]
     for tmpType in attrTypeList:
-        calcDict[tmpType] = calcDict.get(tmpType, 0) + curEffect.GetEffectValue(0)
+        calcDict[tmpType] = calcDict.get(tmpType, 0) + curEffect.GetEffectValue(0)*value
         
     return
 
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/GameBuffs/Buff_519.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/GameBuffs/Buff_519.py
index b59476e..8f01678 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/GameBuffs/Buff_519.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/GameBuffs/Buff_519.py
@@ -33,7 +33,7 @@
     if attrType in [ChConfig.TYPE_Calc_AttrATKMin, ChConfig.TYPE_Calc_AttrATKMax]:
         attrTypeList = [ChConfig.TYPE_Calc_AttrATKMin, ChConfig.TYPE_Calc_AttrATKMax]
     for tmpType in attrTypeList:
-        calcDict[tmpType] = calcDict.get(tmpType, 0) + curEffect.GetEffectValue(0)
+        calcDict[tmpType] = calcDict.get(tmpType, 0) + curEffect.GetEffectValue(0)*value
         
     return
 

--
Gitblit v1.8.0