From d41a44a9fd316c021c4e85bde9cb0fab4c2e0be1 Mon Sep 17 00:00:00 2001 From: hch <305670599@qq.com> Date: 星期五, 15 三月 2019 17:23:43 +0800 Subject: [PATCH] 2683 子 天赋技能和新增双职业各两个技能 / 【后端】天赋技能 --- ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Attack/AttackLogic/AttackCommon.py | 76 ++++++++++++++++++++++++------------- 1 files changed, 49 insertions(+), 27 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 f35908b..2be3515 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 @@ -1639,31 +1639,7 @@ WriteHurtLog(attacker, defObj, curSkill, hurtValue, hurtType, "公式层") - # 优先处理神兵护盾 - hurtValue = CalcAtkProDef(atkObj, defObj, hurtValue, curSkill, tick) - - # 伤害吸收盾回血型 - buffManager = defObj.GetBuffState() - curEffect, plusValue, skillID = BuffSkill.FindBuffEffectPlusByEffectID(buffManager, ChConfig.Def_Skill_Effect_AbsorbShieldXMZJ) - if skillID: - absortValue = hurtValue*curEffect.GetEffectValue(0)/ShareDefine.Def_MaxRateValue - if absortValue: - hurtValue -= absortValue - findBuff = SkillCommon.FindBuffByID(defObj, skillID)[0] - if findBuff: - # 用于回血 - findBuff.SetValue(int(findBuff.GetValue() + absortValue)) - - if defObj.GetDictByKey(ChConfig.Def_PlayerKey_AbsorbShieldValue): - # 麒麟护盾吸收伤害,将抵消的伤害存储 - absortValue = int(defObj.GetDictByKey(ChConfig.Def_PlayerKey_AbsorbShieldValue)/float(ShareDefine.Def_MaxRateValue)*hurtValue) - hurtValue -= absortValue - - # 吸收至指定血量比例值 - absorbHurt = defObj.GetDictByKey(ChConfig.Def_PlayerKey_AbsorbShield) - if absorbHurt <= defObj.GetDictByKey(ChConfig.Def_PlayerKey_AbsorbShieldMax): - maxValue = min(absorbHurt + absortValue, defObj.GetDictByKey(ChConfig.Def_PlayerKey_AbsorbShieldMax)) - defObj.SetDict(ChConfig.Def_PlayerKey_AbsorbShield, maxValue) # 记录护盾吸收的伤害用于爆炸 + hurtValue = CalcHurtHPWithBuff(atkObj, defObj, hurtValue, curSkill, tick) # buff减少伤害百分比 reducePer = PassiveBuffEffMng.GetValueByPassiveBuffTriggerType(defObj, atkObj, None, ChConfig.TriggerType_ReduceHurtHPPer) @@ -1767,6 +1743,46 @@ #=========================================================================== return resultHurtType + +# 计算伤害后,因各种buff和状态的影响处理 +def CalcHurtHPWithBuff(atkObj, defObj, hurtValue, curSkill, tick): + # 优先处理神兵护盾 + hurtValue = CalcAtkProDef(atkObj, defObj, hurtValue, curSkill, tick) + + # 伤害吸收盾回血型 + buffManager = defObj.GetBuffState() + curEffect, plusValue, skillID = BuffSkill.FindBuffEffectPlusByEffectID(buffManager, ChConfig.Def_Skill_Effect_AbsorbShieldXMZJ) + if skillID: + absortValue = hurtValue*curEffect.GetEffectValue(0)/ShareDefine.Def_MaxRateValue + if absortValue: + hurtValue -= absortValue + findBuff = SkillCommon.FindBuffByID(defObj, skillID)[0] + if findBuff: + # 用于回血 + findBuff.SetValue(int(findBuff.GetValue() + absortValue)) + + if defObj.GetDictByKey(ChConfig.Def_PlayerKey_AbsorbShieldValue): + # 麒麟护盾吸收伤害,将抵消的伤害存储 + absortValue = int(defObj.GetDictByKey(ChConfig.Def_PlayerKey_AbsorbShieldValue)/float(ShareDefine.Def_MaxRateValue)*hurtValue) + hurtValue -= absortValue + + # 吸收至指定血量比例值 + absorbHurt = defObj.GetDictByKey(ChConfig.Def_PlayerKey_AbsorbShield) + if absorbHurt <= defObj.GetDictByKey(ChConfig.Def_PlayerKey_AbsorbShieldMax): + maxValue = min(absorbHurt + absortValue, defObj.GetDictByKey(ChConfig.Def_PlayerKey_AbsorbShieldMax)) + defObj.SetDict(ChConfig.Def_PlayerKey_AbsorbShield, maxValue) # 记录护盾吸收的伤害用于爆炸 + + # 天罡护法,将期间受到的伤害总值用于回血,不改变伤害 + curEffect, plusValue, skillID2 = BuffSkill.FindBuffEffectPlusByEffectID(buffManager, ChConfig.Def_Skill_Effect_StoreBlood) + if skillID2: + absortValue = hurtValue*curEffect.GetEffectValue(0)/ShareDefine.Def_MaxRateValue + if absortValue: + findBuff = SkillCommon.FindBuffByID(defObj, skillID2)[0] + if findBuff: + # 用于回血 + findBuff.SetValue(int(findBuff.GetValue() + absortValue)) + return hurtValue + # GM 命令 HurtLog 查看战斗伤害日志 @@ -1951,6 +1967,11 @@ # 暴击增加技能伤害 atkSkillPer += PassiveBuffEffMng.GetPassiveSkillValueByTriggerType(atkObj, defObj, curSkill, ChConfig.TriggerType_SuperHitSkillPer) + atkSkillPer += PassiveBuffEffMng.GetValueByPassiveBuffTriggerType(atkObj, defObj, curSkill, ChConfig.TriggerType_SuperHitSkillPer) + + # buff中暴击减层,无触发技能 + PassiveBuffEffMng.OnPassiveBuffTrigger(atkObj, defObj, curSkill, ChConfig.TriggerType_SuperHitSubLayer, tick) + if isLuckyHit: # 会心一击时增加会心伤害百分比 @@ -2195,7 +2216,8 @@ atkObj.SetDict(ChConfig.Def_PlayerKey_LastHurtValue, resultHurtType.RealHurtHP) if defObj.GetGameObjType() == IPY_GameWorld.gotNPC: atkObj.SetDict(ChConfig.Def_PlayerKey_LastHurtNPCObjID, defObj.GetID()) - + else: + defObj.SetDict(ChConfig.Def_PlayerKey_LastAttackerObjID, atkObj.GetID()) return @@ -2348,7 +2370,7 @@ atkBackHPPer += PassiveBuffEffMng.GetPassiveSkillValueByTriggerType(atkObj, defObj, curSkill, ChConfig.TriggerType_Buff_SuckBloodPer) atkBackHP += int(hurtValue * atkBackHPPer*1.0 / ChConfig.Def_MaxRateValue) - + suckHP += atkBackHP if suckHP <= 0: -- Gitblit v1.8.0