hch
2018-11-26 0ff8e21c92b39adfdf062b40c4e0147213bba70a
4923 【后端】【1.3】神兵技能
4个文件已修改
6个文件已添加
300 ■■■■ 已修改文件
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Attack/AttackLogic/AttackCommon.py 19 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/GameBuffs/Buff_520.py 49 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/GameBuffs/Buff_802.py 27 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/GameBuffs/Buff_807.py 33 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/PassiveBuff/PassiveBuff_807.py 52 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/PassiveBuff/PassiveSkill_4065.py 34 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/PassiveBuff/PassiveSkill_4066.py 34 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/PassiveBuff/PassiveSkill_4067.py 35 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/PassiveBuffEffMng.py 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
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):
        # 麒麟护盾吸收伤害,将抵消的伤害存储
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功能类型定义
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/GameBuffs/Buff_520.py
New file
@@ -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
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/GameBuffs/Buff_802.py
New file
@@ -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
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
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/PassiveBuff/PassiveBuff_807.py
New file
@@ -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
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/PassiveBuff/PassiveSkill_4065.py
New file
@@ -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))
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/PassiveBuff/PassiveSkill_4066.py
New file
@@ -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))
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/PassiveBuff/PassiveSkill_4067.py
New file
@@ -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
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)