hch
2019-04-27 f5e2429d47046ddf1ea5c699949886a1c63ee36a
6603 【后端】【2.0】增加新版的sp和被动技能 -- 肉盾反射战
8个文件已修改
3个文件已添加
277 ■■■■ 已修改文件
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Attack/AttackLogic/AttackCommon.py 28 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/OperControlManager.py 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/GameBuffs/BuffProcess_1033.py 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/GameBuffs/BuffProcess_1315.py 61 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/GameBuffs/Buff_801.py 43 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/PassiveBuff/PassiveBuff_4516.py 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/PassiveBuff/PassiveBuff_4530.py 51 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/PassiveBuff/PassiveBuff_4531.py 54 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/PassiveBuffEffMng.py 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/SkillShell.py 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Attack/AttackLogic/AttackCommon.py
@@ -1793,7 +1793,7 @@
    if GameObj.GetHP(defObj) > 0:
        # 被攻击者将部分伤害转化为血量, 返回转化的百分比(小数点)
        changePer = PassiveBuffEffMng.GetValueByPassiveBuffTriggerType(defObj, atkObj, None, ChConfig.TriggerType_ChangeHurtToHP)
        changePer = PassiveBuffEffMng.GetValueByPassiveBuffTriggerType(defObj, atkObj, curSkill, ChConfig.TriggerType_ChangeHurtToHP)
        if changePer:
            SkillCommon.SkillAddHP(defObj, 0, int(changePer*hurtValue))
    
@@ -1882,13 +1882,20 @@
                # 用于回血
                findBuff.SetValue(int(findBuff.GetValue() + absortValue))
    if defObj.GetDictByKey(ChConfig.Def_PlayerKey_AbsorbValue):
        defObj.SetDict(ChConfig.Def_PlayerKey_AbsorbValue, 0) #吸收的单次伤害,单次伤害必须清空
    if defObj.GetDictByKey(ChConfig.Def_PlayerKey_AbsorbShieldValue):
        # 麒麟护盾吸收伤害,将抵消的伤害存储
        absortValue = int(defObj.GetDictByKey(ChConfig.Def_PlayerKey_AbsorbShieldValue)/float(ShareDefine.Def_MaxRateValue)*hurtValue)
        hurtValue -= absortValue
        defObj.SetDict(ChConfig.Def_PlayerKey_AbsorbValue, absortValue) #吸收的单次伤害
    curEffect, plusValue, skillID = BuffSkill.FindBuffEffectPlusByEffectID(buffManager, ChConfig.Def_Skill_Effect_AbsorbShield)
    if skillID:
        absortValue = int(hurtValue*curEffect.GetEffectValue(0)/ShareDefine.Def_MaxRateValue)
        if absortValue:
            hurtValue -= absortValue
            findBuff = SkillCommon.FindBuffByID(defObj, skillID)[0]
            if findBuff:
                # 用于爆炸
                findBuff.SetValue1(min(findBuff.GetValue1() + absortValue, findBuff.GetValue()))
                if findBuff.GetValue() == findBuff.GetValue1():
                    # 满值则通知爆炸
                    findBuff.SetRemainTime(1)
        
    # 天罡护法,将期间受到的伤害总值用于回血,不改变伤害
    curEffect, plusValue, skillID2 = BuffSkill.FindBuffEffectPlusByEffectID(buffManager, ChConfig.Def_Skill_Effect_StoreBlood)
@@ -2325,7 +2332,7 @@
def AttackEventTrigger(atkObj, defObj, curSkill, resultHurtType, tick):
    
    #反弹伤害
    CalcBounceHP(atkObj, defObj, resultHurtType.LostHP, resultHurtType.HurtType)
    CalcBounceHP(atkObj, defObj, resultHurtType.LostHP, resultHurtType.HurtType, curSkill)
    #吸血
    CalcSuckBlood(atkObj, defObj, curSkill, resultHurtType.RealHurtHP, tick)
        
@@ -2393,7 +2400,7 @@
# @param defObj 防守者
# @param hurtValue 伤害值   
# @return None
def CalcBounceHP(atkObj, defObj, hurtValue, hurtType):
def CalcBounceHP(atkObj, defObj, hurtValue, hurtType, curSkill):
    if not atkObj.GetCanAttack():
        return
    
@@ -2417,6 +2424,7 @@
    #没有反弹退出
    defObj_DamageBackRate = defObj.GetDamageBackRate()
    defObj_DamageBackRate += PassiveBuffEffMng.GetPassiveSkillValueByTriggerType(defObj, None, None, ChConfig.TriggerType_BounceHPPer)
    defObj_DamageBackRate += PassiveBuffEffMng.GetValueByPassiveBuffTriggerType(atkObj, defObj, curSkill, ChConfig.TriggerType_BounceHPPerByAttacker)
    
    bounceHP = hurtValue * defObj_DamageBackRate / float(ChConfig.Def_MaxRateValue)
    bounceHP  = int(bounceHP + PassiveBuffEffMng.GetPassiveSkillValueByTriggerType(defObj, None, None, ChConfig.TriggerType_BounceHP))
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py
@@ -617,7 +617,7 @@
#---------需要记录在buff管理器中的效果ID,主要用于查找用---------------------------
Def_BuffManager_EffectsID = [Def_Skill_Effect_ProBloodPer, Def_Skill_Effect_AbsorbShieldXMZJ, Def_Skill_Effect_StoreBlood]
Def_BuffManager_EffectsID = [Def_Skill_Effect_AbsorbShield, Def_Skill_Effect_AbsorbShieldXMZJ, Def_Skill_Effect_StoreBlood]
#-------------------------------------------------------------------------
#基础属性效果ID
@@ -3051,8 +3051,6 @@
Def_PlayerKey_AttackFollowMaster = "FollowAtk"     # 召唤兽跟随攻击
Def_PlayerKey_MoreHurtValue = "MoreHurtValue"     # 额外的伤害值,一般用于不走公式
Def_PlayerKey_BloodShiledHurt = "BSHurt"     # 伤害值用于血盾抵消
Def_PlayerKey_AbsorbShieldValue = "AbsorbShieldValue"     # 麒麟盾吸收减免伤害百分比
Def_PlayerKey_AbsorbValue = "AbsorbValue"     # 麒麟盾吸收的单次伤害
Def_PlayerKey_StartEquipCnt = "StartEquipCnt"     # 珍品数量
Def_PlayerKey_TJGPackFullAfterEat = "TJGFullEat"     # 脱机挂吞噬后背包依然满的情况
Def_PlayerKey_TJGStartTime = "TJGStartTime"     # 脱机挂结算时间起点
@@ -4450,7 +4448,9 @@
TriggerType_ThumpHit, # 重击时 触发技能74
TriggerType_AddThumpHitPer, # 重击时 增加重击百分比 75
TriggerType_SkillSuccess, # 任何技能释放成功都可触发 76
) = range(1, 77)
TriggerType_BounceHPPerByAttacker,   # 反弹伤害百分比值, 由攻击方决定 77
TriggerType_NoControl,   # 使关联技能不受控制 78
) = range(1, 79)
#不可以佩戴翅膀的地图
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/OperControlManager.py
@@ -30,6 +30,7 @@
import PlayerHorse
import ShareDefine
import SkillCommon
import PassiveBuffEffMng
#GameObj字典-----------------------------------------------------------
@@ -98,10 +99,13 @@
# @param curOperState 请求状态
# @return boolֵ
# @remarks 判断对象是否可执行操作
def IsObjCanDoAction(curObj, keyType, curOperState):
def IsObjCanDoAction(curObj, keyType, curOperState, curSkill=None):
    if SkillCommon.GetUsingPassiveSkill(curObj):
        # 被动技能不限制
        return True
    if curSkill and PassiveBuffEffMng.GetPassiveSkillValueByTriggerType(curObj, None, curSkill, ChConfig.TriggerType_NoControl):
        return True
    curActionState = GetObjActStateByType(curObj, keyType)
    #GameWorld.Log("玩家 当前状态%s,判断行为 %s, 在 %s端的验证是否通过"%\
    #(curActionState, curOperState, keyType), curObj.GetID())
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/GameBuffs/BuffProcess_1033.py
@@ -40,9 +40,9 @@
    layer = max(curBuff.GetLayer(), 1)
    #单次伤害, 毒有层级的情况
    singleDecHP = curBuff.GetValue()*layer
    hurtPer = FindBuffPer(defender, curBuff)    # 找到另外一个buff对中毒的伤害加成
    #hurtPer = FindBuffPer(defender, curBuff)    # 找到另外一个buff对中毒的伤害加成
    
    singleDecHP = int((hurtPer + ChConfig.Def_MaxRateValue)*1.0/ChConfig.Def_MaxRateValue*singleDecHP)
    #singleDecHP = int((hurtPer + ChConfig.Def_MaxRateValue)*1.0/ChConfig.Def_MaxRateValue*singleDecHP)
    #GameWorld.DebugLog("1033---------%s-%s-%s-%s"%(curBuff.GetValue(), layer, hurtPer, singleDecHP ) )
    #buff拥有者
    buffOwner = SkillCommon.GetBuffOwner(curBuff)
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/GameBuffs/BuffProcess_1315.py
New file
@@ -0,0 +1,61 @@
#!/usr/bin/python
# -*- coding: GBK -*-
#
##@package
#
# @todo: 由服务端主导伤害的持续性技能, 献祭
#
# @author: Alee
# @date 2019-4-27 下午03:13:54
# @version 1.0
#
# @note:
#
#---------------------------------------------------------------------
#导入
import GameWorld
import SkillCommon
import BaseAttack
import ChConfig
import PassiveBuffEffMng
import SkillShell
import GameObj
import IPY_GameWorld
def ProcessBuff(tagObj, curBuff, curEffect, processBuffTick, tick):
    Attack(tagObj, curBuff, curEffect, tick)
#间隔攻击,buffvalue第一个值为攻击次数
def Attack(tagObj, curBuff, curEffect, tick):
    if curBuff.GetValue() == 0:
        return
    curSkill = curBuff.GetSkill()
    curBuff.SetValue(max(curBuff.GetValue() - 1, 0))
    lostHP = GameObj.GetHP(tagObj)*curEffect.GetEffectValue(1)/ChConfig.Def_MaxRateValue
    BaseAttack.AreaSkillAttackLostHP(tagObj, None, tagObj.GetPosX(), tagObj.GetPosY(),
                                     curSkill, lostHP, tick, isExSkill=True)
#buffvalue第一个值为攻击次数, 第二个值为被动增强
def CalcBuffValue(attacker, defender, curSkill, changeBuffValueDict):
    curEffect = curSkill.GetEffect(0)
    return [curEffect.GetEffectValue(0)]
## 添加BUFF后的逻辑
#  @param None
#  @return None
def DoAddBuffOver(curObj, addBuff, curEffect, tick):
    Attack(curObj, addBuff, curEffect, tick)   #立即执行一次攻击
    if GameObj.GetHP(curObj) != 0:
        addBuff.SetProcessInterval(tick)
    return
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/GameBuffs/Buff_801.py
@@ -3,7 +3,7 @@
#
#
##@package Buff_801
# @todo: 麒麟盾,吸收XX%伤害
# @todo: 增加可吸收受到伤害的10%护盾,护盾存在上限为生命20%血量,持续6秒,护盾破裂或者6秒后对周围目标造成吸收伤害值200%的伤害
#
# @author Alee
# @date 2017-10-31 14:10
@@ -13,12 +13,10 @@
"""Version = 2017-10-31 14:10"""
import IPY_GameWorld
import GameWorld
import ChConfig
import SkillShell
import PassiveBuffEffMng
import PySkillManager
import SkillCommon
import GameObj
@@ -26,23 +24,30 @@
#  @param None
#  @return None
def DoAddBuffOver(curObj, addBuff, curEffect, tick):
    buffValue = curEffect.GetEffectValue(0) + PassiveBuffEffMng.GetPassiveSkillValueByTriggerType(
                                            curObj, None, addBuff.GetSkill(), ChConfig.TriggerType_AbsorbShield)
    # 战斗属性 在刷新的时候会清空,不能用在此函数中
    curObj.SetDict(ChConfig.Def_PlayerKey_AbsorbShieldValue, buffValue)  # 吸收的伤害百分比
    # SetValue1用于当前吸收值
    addBuff.SetValue(GameObj.GetMaxHP(curObj)*curEffect.GetEffectValue(0)/ChConfig.Def_MaxRateValue) # 吸收上限
    return
##吸收伤害百分比
# @param attacker 攻击者实例
# @param curSkill 技能实例
# @param curEffect 当前技能效果1
# @return 总值
def CalcBuffValue(attacker, defender, curSkill, changeBuffValueDict):
    if not changeBuffValueDict:
        return []
    return [changeBuffValueDict.get(i, 0) for i in range(ChConfig.Def_BuffValue_Count)]
def OnBuffDisappear(curObj, curSkill, curBuff, curEffect, tick):
    curObj.SetDict(ChConfig.Def_PlayerKey_AbsorbShieldValue, 0)  # 吸收的伤害百分比
    boomValue = curBuff.GetValue1()
    # 剩余护盾值用于爆炸
    if boomValue == 0:
        return
    skillData = GameWorld.GetGameData().GetSkillBySkillID(curEffect.GetEffectValue(2))
    if not skillData:
        return
    # 存储起来用于伤害
    skillEffect = SkillCommon.GetSkillEffectByEffectID(skillData, ChConfig.Def_Skill_Effect_Attack)
    if not skillEffect:
        return
    boomValue = boomValue*skillEffect.GetEffectValue(2)/ChConfig.Def_MaxRateValue
    if boomValue == 0:
        return
    curObj.SetDict(ChConfig.Def_PlayerKey_MoreHurtValue, boomValue)
    SkillShell.Trigger_UseSkill(curObj, None, curSkill, tick, curObj.GetPosX(), curObj.GetPosY())
    curObj.SetDict(ChConfig.Def_PlayerKey_MoreHurtValue, 0)
    return
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/PassiveBuff/PassiveBuff_4516.py
@@ -12,8 +12,20 @@
#---------------------------------------------------------------------
import ChConfig
import GameObj
def CheckCanHappen(attacker, defender, passiveEffect, skillID, **skillkwargs):
    if passiveEffect.GetEffectValue(1):
        # 普通攻击有效
        useSkill = skillkwargs.get("useSkill", None)
        if useSkill and useSkill.GetFuncType() != ChConfig.Def_SkillFuncType_NormalAttack:
            return False
    if passiveEffect.GetEffectValue(2):
        if not GameObj.GetPyPlayerState(defender, passiveEffect.GetEffectValue(2)):
            #GameWorld.DebugLog("状态触发----%s"%effect.GetEffectValue(2))
            return False
    return True
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/PassiveBuff/PassiveBuff_4530.py
New file
@@ -0,0 +1,51 @@
#!/usr/bin/python
# -*- coding: GBK -*-
#
##@package
#
# @todo: buff中被标记的攻击者攻击标记方减层
#
# @author: Alee
# @date 2019-4-27 下午04:04:41
# @version 1.0
#
# @note:
#
#---------------------------------------------------------------------
import ChConfig
import GameWorld
import SkillCommon
import BuffSkill
import SkillShell
import IPY_GameWorld
def CheckCanHappen(attacker, defender, passiveEffect, skillID, **skillkwargs):
    if not defender:
        return
    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(curSkill.GetSkillTypeID())
    if not buff:
        return False
    if buff.GetLayer() <= 0:
        return False
    if buff.GetOwnerID() != defender.GetID():
        return False
    BuffSkill.SetBuffLayer(attacker, buff, buff.GetLayer()-1, skillTypeID=curSkill.GetSkillTypeID())
    return True
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/PassiveBuff/PassiveBuff_4531.py
New file
@@ -0,0 +1,54 @@
#!/usr/bin/python
# -*- coding: GBK -*-
#
# @todo: buff中被攻击反弹自身最大攻击力XX%伤害
#
# @author: Alee
# @date 2018-1-30 下午05:11:45
# @version 1.0
#
# @note:
#
#---------------------------------------------------------------------
import ChConfig
import GameWorld
import GameObj
import SkillCommon
def CheckCanHappen(attacker, defender, passiveEffect, skillID, **skillkwargs):
    if not defender:
        return False
    useSkill = skillkwargs.get("useSkill", None)
    if not useSkill:
        return False
    # 主动型技能才有效
    if useSkill.GetFuncType() not in [ChConfig.Def_SkillFuncType_FbSkill,
                                      ChConfig.Def_SkillFuncType_NormalAttack]:
        return False
    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(curSkill.GetSkillTypeID())
    if not buff:
        return False
    if buff.GetLayer() != 1:
        return False
    if buff.GetOwnerID() != defender.GetID():
        return False
    return True
def GetValue(attacker, defender, passiveEffect):
    return passiveEffect.GetEffectValue(0)
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/PassiveBuffEffMng.py
@@ -297,7 +297,7 @@
             4013:ChConfig.TriggerType_AttackAddFinalValue,   #攻击增加输出伤害11
             4014:ChConfig.TriggerType_HappenState,   #必定触发
             4015:ChConfig.TriggerType_AttackAddSkillPer,  # 所有攻击伤害(SkillPer)增加,含普攻,计算时 5
             4016:ChConfig.TriggerType_AbsorbShield,  # 提高麒麟佑身的减少伤害效果提升20% 13
             #4016:ChConfig.TriggerType_AbsorbShield,  # 提高麒麟佑身的减少伤害效果提升20% 13
             4017:ChConfig.TriggerType_BounceHP,   # 反弹伤害固定值14,
             4018:ChConfig.TriggerType_BuffDisappear,   # buff消失后触发技能15,
             4019:ChConfig.TriggerType_BuffTime,   # 延长BUFF时间16,
@@ -355,8 +355,6 @@
             4071:ChConfig.TriggerType_Buff_SuckBloodPer,   # 攻击 百分比吸血
             4072:ChConfig.TriggerType_SuperHitSkipCD, # 暴击无冷却 68
             4073:ChConfig.TriggerType_BuffHurtCnt, # 当持续buff伤害第X次时触发技能 69
             4074:ChConfig.TriggerType_BounceHP,   # 反弹伤害固定值14, 记录值
             4075:ChConfig.TriggerType_4074PerValue,   # 增加4074的反弹比例
             4076:ChConfig.TriggerType_dFinalHurtReducePer, # 防守方的最终伤害减少百分比 71 
             4077:ChConfig.TriggerType_AttackAddFinalPer, # 增加最终伤害百分比 59
             4078:ChConfig.TriggerType_AttackOver,  # 攻击(对敌技能)后被动技能被触发 4
@@ -374,6 +372,7 @@
             4090:ChConfig.TriggerType_AttackOver,  # 攻击(对敌技能)后被动技能被触发 4
             4091:ChConfig.TriggerType_SkillOverNoAttack,   # 技能释放后 与TriggerType_AttackOver相反19,
             4092:ChConfig.TriggerType_SkillSuccess,  # 任何技能释放成功都可触发 76  减印记
             4093:ChConfig.TriggerType_NoControl,   # 使关联技能不受控制 78
             }
    return tdict.get(effectID, -1) 
    #===========================================================================
@@ -419,6 +418,8 @@
             4527:ChConfig.TriggerType_AddThumpHitRate, # 增加重击概率
             4528:ChConfig.TriggerType_AddThumpHitPer, # 重击时 增加重击百分比 75
             4529:ChConfig.TriggerType_Buff_SuckBloodPer,   # BUFF类: 百分比吸血, 此处非属性类
             4530:ChConfig.TriggerType_Buff_AttackSubLayer,  # BUFF类:攻击减buff层,0消失
             4531:ChConfig.TriggerType_BounceHPPerByAttacker,  # 反弹伤害百分比值, 由攻击方决定 77
             
             803:ChConfig.TriggerType_BloodShield,  # 血盾
             806:ChConfig.TriggerType_BloodShield,  # 血盾
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/SkillShell.py
@@ -983,7 +983,7 @@
    #使用技能行为状态, 客户端限制    
    if not OperControlManager.IsObjCanDoAction(curPlayer, 
                                               ChConfig.Def_Obj_ActState_ClientSkill, 
                                               curSkill.GetSkillOfSeries()):
                                               curSkill.GetSkillOfSeries(), curSkill):
        AttackFailNotify(curPlayer, curSkill)
        return    
@@ -3356,7 +3356,6 @@
# 不受限制和影响的技能
def Trigger_UseSkill(attacker, defender, curSkill, tick, tagRoundPosX = 0, tagRoundPosY = 0, isEnhanceSkill = False):
    
    #这个技能是Buff
    if SkillCommon.IsBuff(curSkill):