From 0ff8e21c92b39adfdf062b40c4e0147213bba70a Mon Sep 17 00:00:00 2001 From: hch <305670599@qq.com> Date: 星期一, 26 十一月 2018 23:18:29 +0800 Subject: [PATCH] 4923 【后端】【1.3】神兵技能 --- ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/PassiveBuffEffMng.py | 4 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/GameBuffs/Buff_802.py | 27 +++++ ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/GameBuffs/Buff_520.py | 49 +++++++++ ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/PassiveBuff/PassiveSkill_4066.py | 34 ++++++ ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/GameBuffs/Buff_807.py | 33 +----- ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/PassiveBuff/PassiveSkill_4065.py | 34 ++++++ ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/PassiveBuff/PassiveSkill_4067.py | 35 +++++++ ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Attack/AttackLogic/AttackCommon.py | 19 +++ ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py | 13 +- ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/PassiveBuff/PassiveBuff_807.py | 52 ++++++++++ 10 files changed, 267 insertions(+), 33 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 3c4b876..b7f7d9f 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 @@ -1503,7 +1503,7 @@ return True # 攻击时防守方神兵护盾的处理 -def CalcAtkProDef(atkObj, defObj, hurtValue): +def CalcAtkProDef(atkObj, defObj, hurtValue, curSkill, tick): if defObj.GetGameObjType() != IPY_GameWorld.gotPlayer: return hurtValue @@ -1518,6 +1518,9 @@ PlayerControl.SetProDef(defObj, curProDef - absortValue) + # 被动技能触发 + defObj.SetDict(ChConfig.Def_PlayerKey_GodWeaponBeforeProDef, curProDef) + PassiveBuffEffMng.OnPassiveSkillTrigger(defObj, atkObj, curSkill, ChConfig.TriggerType_ProDefValue, tick) return hurtValue - absortValue ## 计算伤血值 @@ -1567,7 +1570,19 @@ hurtValue, hurtType = CalcHurtHP(atkObj, defObj, curSkill, atkSkillValue, atkSkillPer, tick, orgAtkObj=attacker) # 优先处理神兵护盾 - hurtValue = CalcAtkProDef(atkObj, defObj, hurtValue) + 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): # 麒麟护盾吸收伤害,将抵消的伤害存储 diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py index 45deeff..4bd73c9 100644 --- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py +++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py @@ -553,6 +553,7 @@ #写死的技能效果ID--------------------------------------------------------------------- Def_Skill_Effect_AddAtkByHP = 503 # 每损失XX血量增加攻击XX,最高攻击加成XX Def_Skill_Effect_AbsorbShield = 801 # A值记录吸收伤害值,B值记录吸收值上限为xx%血量上限值 C值为释放的爆炸技能ID 如麒麟盾 +Def_Skill_Effect_AbsorbShieldXMZJ = 802 # 须弥真界 神兵技能吸收伤害 百分比 Def_Skill_Effect_BoomSeedHurt = 804 # BUFF种子单层伤害 Def_Skill_Effect_AttackReplace = 1009 #攻击计算,野外小怪伤害替换1010 (2018-03-07增加精英怪) Def_Skill_Effect_Attack = 1010 #攻击计算 @@ -613,7 +614,7 @@ #---------需要记录在buff管理器中的效果ID,主要用于查找用--------------------------- -Def_BuffManager_EffectsID = [Def_Skill_Effect_ProBloodPer] +Def_BuffManager_EffectsID = [Def_Skill_Effect_ProBloodPer, Def_Skill_Effect_AbsorbShieldXMZJ] #------------------------------------------------------------------------- #基础属性效果ID @@ -1359,11 +1360,11 @@ #被动技能 Buf最大数目 Def_Max_PassiveBuff_Count = 30 #行为技能 buf最大数目 -Def_Max_ActionBuff_Count = 10 +Def_Max_ActionBuff_Count = 20 #持续增益BUFF最大数目 -Def_Max_ProcessBuff_Count = 10 +Def_Max_ProcessBuff_Count = 20 #持续减益BUFF最大数目 -Def_Max_ProcessDeBuff_Count = 10 +Def_Max_ProcessDeBuff_Count = 20 #马匹速度技能ID[马匹普通速度, 马匹加速] Def_Skill_TypeID_Speed = [60001, 60101] @@ -2987,6 +2988,7 @@ #---SetDict 玩家字典KEY,不存于数据库--- # key的长度不能超过29个字节 +Def_PlayerKey_GodWeaponBeforeProDef = "GWBPD" # 神兵护盾被攻击前的值 Def_PlayerKey_curHurtValue = "curHurtValue" # 计算中的临时伤害值,技能特殊用 Def_PlayerKey_DefenderObjID = "DefenderObjID" # 后续触发技能需要用到的对象ID,暂用于玩家 Def_PlayerKey_SomersaultTime = "Somersault" # 翻滚一定时间内无敌,表现为MISS @@ -4391,7 +4393,8 @@ TriggerType_AttackAddFinalPer, #增加最终伤害百分比 59 TriggerType_SummonDie, #自身召唤兽死亡触发技能 60 TriggerType_GiftReduceCD, # 天赋用的减CD 61 -) = range(1, 62) +TriggerType_ProDefValue, # 神兵护盾值下降时 62 +) = range(1, 63) # NPC功能类型定义 diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/GameBuffs/Buff_520.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/GameBuffs/Buff_520.py new file mode 100644 index 0000000..234c943 --- /dev/null +++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/GameBuffs/Buff_520.py @@ -0,0 +1,49 @@ +#!/usr/bin/python +# -*- coding: GBK -*- +# +##@package +# +# @todo: 神兵属性的百分比转化为指定属性的值 +# +# @author: Alee +# @date 2018-11-26 下午09:35:32 +# @version 1.0 +# +# @note: +# +#--------------------------------------------------------------------- +#导入 +import ChConfig +import EffGetSet +import IPY_GameWorld +import PlayerControl +#--------------------------------------------------------------------- + + +def OnCalcBuffEx(defender, curEffect, calcDict, curBuff): + if defender.GetGameObjType() != IPY_GameWorld.gotPlayer: + return + + attrList = PlayerControl.GetCalcAttrListValue(defender, ChConfig.Def_CalcAttrFunc_GodWeapon) + + value = attrList[2].get(curEffect.GetEffectValue(0), 0)*curEffect.GetEffectValue(1)/ChConfig.Def_MaxRateValue + + attrType = curEffect.GetEffectValue(2) + attrTypeList = [attrType] + # 攻击力有最大最小 特殊处理 + 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) + value + + return + + +## 返回buff类型,线性与否 +# @param +# @return None +# @remarks 函数详细说明. +def GetCalcType(): + return ChConfig.TYPE_Linear + + diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/GameBuffs/Buff_802.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/GameBuffs/Buff_802.py new file mode 100644 index 0000000..eb44167 --- /dev/null +++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/GameBuffs/Buff_802.py @@ -0,0 +1,27 @@ +#!/usr/bin/python +# -*- coding: GBK -*- +# +# +##@package Buff_802 +# @todo: (pvp)被玩家攻击3秒内吸收30%伤害并在状态结束后恢复吸收伤害等量的生命值,冷却30秒 +# +# @author Alee +# @date 2017-10-31 14:10 +# @version 1.0 +# +#--------------------------------------------------------------------- +"""Version = 2017-10-31 14:10""" + + +import SkillCommon + +def OnBuffDisappear(curObj, curSkill, curBuff, curEffect, tick): + if curObj.GetHP() <= 0: + return + + value = curBuff.GetValue() + if value <= 0: + return + + SkillCommon.SkillAddHP(curObj, 0, value) + return diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/GameBuffs/Buff_807.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/GameBuffs/Buff_807.py index 212895f..5a26f5d 100644 --- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/GameBuffs/Buff_807.py +++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/GameBuffs/Buff_807.py @@ -3,7 +3,7 @@ # ##@package # -# @todo: 神兵生命转换为血盾 +# @todo: 神兵生命转换为血盾, A值为百分比 # # @author: Alee # @date 2018-4-23 下午02:04:06 @@ -15,34 +15,15 @@ import GameWorld import ChConfig -import GameObj -import SkillShell +import PlayerControl def CalcBuffValue(attacker, defender, curSkill, changeBuffValueDict): + attrList = PlayerControl.GetCalcAttrListValue(attacker, ChConfig.Def_CalcAttrFunc_GodWeapon) + + hp = attrList[2].get(ChConfig.TYPE_Calc_AttrMaxHP, 0) + curEffect = curSkill.GetEffect(0) - return [int(float(curEffect.GetEffectValue(0))/ChConfig.Def_MaxRateValue*GameObj.GetMaxHP(attacker))] + return [hp*curEffect.GetEffectValue(0)/ChConfig.Def_MaxRateValue] -def OnBuffDisappear(curObj, curSkill, curBuff, curEffect, tick): - if curEffect.GetEffectValue(1) == 0: - return - boomValue = curBuff.GetValue() - # 剩余护盾值用于爆炸 - if boomValue == 0: - return - - boomValue = int(boomValue*float(curEffect.GetEffectValue(1))/ChConfig.Def_MaxRateValue) - #效果值 第三个值为技能ID - boomID = curEffect.GetEffectValue(2) - skillData = GameWorld.GetGameData().GetSkillBySkillID(boomID) - if not skillData: - return - - # 存储起来用于伤害 - curObj.SetDict(ChConfig.Def_PlayerKey_MoreHurtValue, boomValue) - - SkillShell.Trigger_UseSkill(curObj, None, skillData, tick, curObj.GetPosX(), curObj.GetPosY()) - curObj.SetDict(ChConfig.Def_PlayerKey_MoreHurtValue, 0) - - return \ No newline at end of file diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/PassiveBuff/PassiveBuff_807.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/PassiveBuff/PassiveBuff_807.py new file mode 100644 index 0000000..3db250f --- /dev/null +++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/PassiveBuff/PassiveBuff_807.py @@ -0,0 +1,52 @@ +#!/usr/bin/python +# -*- coding: GBK -*- +# +# @todo: 神兵生命转换为血盾 +# +# @author: Alee +# @date 2018-1-30 下午05:11:45 +# @version 1.0 +# +# @note: +# +#--------------------------------------------------------------------- + +import ChConfig +import GameWorld +import SkillCommon + +def CheckCanHappen(attacker, defender, passiveEffect, skillID, **skillkwargs): + curSkill = GameWorld.GetGameData().GetSkillBySkillID(skillID) + if not curSkill: + return False + + buffType = SkillCommon.GetBuffType(curSkill) + buffTuple = SkillCommon.GetBuffManagerByBuffType(attacker, buffType) + #通过类型获取目标的buff管理器为空,则跳出 + if buffTuple == (): + return False + + buffManager = buffTuple[0] + buff = buffManager.FindBuff(skillID) + if not buff: + return False + + buffValue = buff.GetValue() + if buffValue == 0: + return False + + hurtValue = attacker.GetDictByKey(ChConfig.Def_PlayerKey_BloodShiledHurt) + if hurtValue == 0: + return False + + buff.SetValue(max(buffValue - hurtValue, 0)) + attacker.SetDict(ChConfig.Def_PlayerKey_BloodShiledHurt, max(hurtValue - buffValue, 0)) + + if buff.GetValue() == 0: + buff.SetRemainTime(0) + return True + + +def GetValue(attacker, defender, passiveEffect): + return 1 + diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/PassiveBuff/PassiveSkill_4065.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/PassiveBuff/PassiveSkill_4065.py new file mode 100644 index 0000000..922beb8 --- /dev/null +++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/PassiveBuff/PassiveSkill_4065.py @@ -0,0 +1,34 @@ +#!/usr/bin/python +# -*- coding: GBK -*- +# +# @todo: 神兵等级差,增加PVP减伤效果 +# +# @author: Alee +# @date 2018-1-9 下午09:39:37 +# @version 1.0 +# +# @note: +# +#--------------------------------------------------------------------- + +import ChConfig +import GameWorld +import GameObj + + +def CheckCanHappen(attacker, defender, effect, curSkill): + attrLV = attacker.NomalDictGetProperty(ChConfig.Def_PDict_GodWeaponLV % effect.GetEffectValue(0)) + tagAttrLV = defender.NomalDictGetProperty(ChConfig.Def_PDict_GodWeaponLV % effect.GetEffectValue(0)) + + if tagAttrLV >= attrLV: + return False + + return True + + + +def GetValue(attacker, defender, effect): + attrLV = attacker.NomalDictGetProperty(ChConfig.Def_PDict_GodWeaponLV % effect.GetEffectValue(0)) + tagAttrLV = defender.NomalDictGetProperty(ChConfig.Def_PDict_GodWeaponLV % effect.GetEffectValue(0)) + + return min(effect.GetEffectValue(2), (attrLV - tagAttrLV)*effect.GetEffectValue(1)) diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/PassiveBuff/PassiveSkill_4066.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/PassiveBuff/PassiveSkill_4066.py new file mode 100644 index 0000000..5656afc --- /dev/null +++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/PassiveBuff/PassiveSkill_4066.py @@ -0,0 +1,34 @@ +#!/usr/bin/python +# -*- coding: GBK -*- +# +# @todo: 指定神兵等级差,增加PVP增加伤害效果 +# +# @author: Alee +# @date 2018-1-9 下午09:39:37 +# @version 1.0 +# +# @note: +# +#--------------------------------------------------------------------- + +import ChConfig +import GameWorld +import GameObj + + +def CheckCanHappen(attacker, defender, effect, curSkill): + attrLV = attacker.NomalDictGetProperty(ChConfig.Def_PDict_GodWeaponLV % effect.GetEffectValue(0)) + tagAttrLV = defender.NomalDictGetProperty(ChConfig.Def_PDict_GodWeaponLV % effect.GetEffectValue(0)) + + if tagAttrLV >= attrLV: + return False + + return True + + + +def GetValue(attacker, defender, effect): + attrLV = attacker.NomalDictGetProperty(ChConfig.Def_PDict_GodWeaponLV % effect.GetEffectValue(0)) + tagAttrLV = defender.NomalDictGetProperty(ChConfig.Def_PDict_GodWeaponLV % effect.GetEffectValue(0)) + + return min(effect.GetEffectValue(2), (attrLV - tagAttrLV)*effect.GetEffectValue(1)) diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/PassiveBuff/PassiveSkill_4067.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/PassiveBuff/PassiveSkill_4067.py new file mode 100644 index 0000000..f2225bc --- /dev/null +++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/PassiveBuff/PassiveSkill_4067.py @@ -0,0 +1,35 @@ +#!/usr/bin/python +# -*- coding: GBK -*- +# +##@package +# +# @todo: 神兵护盾值降为低于XX%触发技能 +# +# @author: Alee +# @date 2018-11-26 下午10:20:47 +# @version 1.0 +# +# @note: +# +#--------------------------------------------------------------------- + +import ChConfig +import GameWorld +import GameObj +import PlayerControl + + +def CheckCanHappen(attacker, defender, effect, curSkill): + beforeProDef = attacker.GetDictByKey(ChConfig.Def_PlayerKey_GodWeaponBeforeProDef) + compPer = effect.GetEffectValue(0) + curPorDef = PlayerControl.GetProDef(attacker) + maxProDef = PlayerControl.GetMaxProDef(attacker) + + beforePer = beforeProDef*1.0/maxProDef*ChConfig.Def_MaxRateValue + curPer = curPorDef*1.0/maxProDef*ChConfig.Def_MaxRateValue + + if beforePer > compPer and curPer <= compPer: + # 只有跨过那个值才能触发 + return True + + return False \ No newline at end of file diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/PassiveBuffEffMng.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/PassiveBuffEffMng.py index 4cac370..a2c7478 100644 --- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/PassiveBuffEffMng.py +++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/PassiveBuffEffMng.py @@ -340,6 +340,9 @@ 4062:ChConfig.TriggerType_AttackAddFinalPer, # 增加最终伤害百分比 59 4063:ChConfig.TriggerType_SummonDie, #自身召唤兽死亡触发技能 60 4064:ChConfig.TriggerType_GiftReduceCD, # 天赋减少CD9, #CD + 4065:ChConfig.TriggerType_DamageReducePVP, # PVP减少伤害 + 4066:ChConfig.TriggerType_AddDamagePer, # 提高增加伤害属性值,计算时 3 + 4067:ChConfig.TriggerType_ProDefValue, # 神兵护盾值下降时 62 } return tdict.get(effectID, -1) #=========================================================================== @@ -378,6 +381,7 @@ 4520:ChConfig.TriggerType_AddLayer, # BUFF类: 目标BUFF层级增加时 52 803:ChConfig.TriggerType_BloodShield, # 血盾 806:ChConfig.TriggerType_BloodShield, # 血盾 + 807:ChConfig.TriggerType_BloodShield, # 血盾 808:ChConfig.TriggerType_BloodShield, # 血盾 } return tdict.get(effectID, -1) -- Gitblit v1.8.0