10019 【砍树】回合战斗(新增技能效果ID 1007、1008、4542、5012;新增技能释放方式51)
1. 新增技能效果ID 1007-根据目标状态变更技能伤害百分比;1008-根据目标血量变更技能伤害百分比
2. 增加锁定受到的最大伤害效果 4542-buff锁定受到伤害最大值,不会高于自身最大生命值x%
3. 增加技能被动效果ID 5012-目标闪避后触发技能
4. 增加技能释放方式51-打出目标xx属性的X%伤害,单体攻击,支持配置最大不超过自身xx属性x%
6个文件已修改
3个文件已添加
222 ■■■■ 已修改文件
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Attack/AttackLogic/AttackCommon.py 83 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Attack/BaseAttack.py 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerViewCacheTube.py 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/GameSkills/SkillModule_51.py 48 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/PassiveBuff/PassiveBuff_4542.py 28 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/PassiveBuff/PassiveSkill_5012.py 19 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/PassiveBuffEffMng.py 32 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/SkillShell.py 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Attack/AttackLogic/AttackCommon.py
@@ -1534,34 +1534,35 @@
# 改变技能伤害(效果ID1010), 野外小怪1009替换1010伤害(2018-03-07增加精英怪)
def ChangeSkillHurt(curPlayer, defObj, curSkill, skillPer, skillValue):
    
    findEffect = GetCanChangeSkillHurtEffect(curPlayer, defObj, curSkill)
    if not findEffect:
        return skillPer, skillValue
    return findEffect.GetEffectValue(0), findEffect.GetEffectValue(1)
    changeInfo = GetCanChangeSkillHurtEffect(curPlayer, defObj, curSkill, skillPer, skillValue)
    if changeInfo:
        skillPer, skillValue = changeInfo
    return skillPer, skillValue
# 对NPC伤害的特殊处理,为指定伤害替换 非额外加伤害
# 1. 对非BOSS怪的特殊伤害 2.对XX系怪物的特殊伤害
def GetCanChangeSkillHurtEffect(attacker, defObj, curSkill):
def GetCanChangeSkillHurtEffect(attacker, defObj, curSkill, skillPer, skillValue):
    if not curSkill:
        return
    if defObj.GetGameObjType() != IPY_GameWorld.gotNPC:
        return
    
    if attacker.GetGameObjType() == IPY_GameWorld.gotNPC and attacker.GetType() == IPY_GameWorld.ntMonster:
        # 普通怪无此效果
        return
    if not attacker.GetDictByKey(ChConfig.Def_Obj_Dict_TurnFightTimeline):
        if defObj.GetGameObjType() != IPY_GameWorld.gotNPC:
            return
        if attacker.GetGameObjType() == IPY_GameWorld.gotNPC and attacker.GetType() == IPY_GameWorld.ntMonster:
            # 普通怪无此效果
            return
        if defObj.GetIsBoss() > ChConfig.Def_NPCType_Ogre_Super:
            return
        if GameWorld.GetMap().GetMapFBType() != IPY_GameWorld.fbtNull and \
        GameWorld.GetMap().GetMapID() not in IpyGameDataPY.GetFuncEvalCfg('SkillXPAddByFB', 1):
            return
    
    if defObj.GetIsBoss() > ChConfig.Def_NPCType_Ogre_Super:
        return
    if GameWorld.GetMap().GetMapFBType() != IPY_GameWorld.fbtNull and \
    GameWorld.GetMap().GetMapID() not in IpyGameDataPY.GetFuncEvalCfg('SkillXPAddByFB', 1):
        return
    findEffect, effectID = GetSkillEffectByEffectIDs(curSkill, [ChConfig.Def_Skill_Effect_AttackReplace,
                                                                            ChConfig.Def_Skill_Effect_AttackReplaceByNPCSeries])
    effectIDList = [ChConfig.Def_Skill_Effect_AttackReplace, ChConfig.Def_Skill_Effect_AttackReplaceByNPCSeries,
                    ChConfig.Def_Skill_Effect_AttackReplaceByTagHP, ChConfig.Def_Skill_Effect_AttackReplaceByTagState]
    findEffect, effectID = GetSkillEffectByEffectIDs(curSkill, effectIDList)
    if not findEffect:
        return
    
@@ -1573,11 +1574,43 @@
        if GameWorld.GetMap().GetMapFBType() != IPY_GameWorld.fbtNull and \
        GameWorld.GetMap().GetMapID() not in IpyGameDataPY.GetFuncEvalCfg('SkillXPAddByFB', 1):
            return
        return findEffect.GetEffectValue(0), findEffect.GetEffectValue(1)
    elif effectID == ChConfig.Def_Skill_Effect_AttackReplaceByNPCSeries:
        # 对指定系造成指定伤害
        if findEffect.GetEffectValue(2)&NPCCommon.GetNPCSeries(defObj) == 0:
            return
    return findEffect
        return findEffect.GetEffectValue(0), findEffect.GetEffectValue(1)
    elif effectID == ChConfig.Def_Skill_Effect_AttackReplaceByTagHP:
        # 目标血量判断
        hpPer = findEffect.GetEffectValue(1)
        calcType = findEffect.GetEffectValue(2) #计算方式: 0-小于;1-大于;默认包含临界值
        tagHPPer = GameObj.GetHP(defObj) * float(ChConfig.Def_MaxRateValue) / GameObj.GetMaxHP(defObj)
        if calcType == 1:
            if tagHPPer < hpPer:
                return
        else:
            if tagHPPer > hpPer:
                return
        changeSkillPer = findEffect.GetEffectValue(0)
        GameWorld.DebugLog("        目标血量变更技能伤害! atkID=%s,defID=%s,tagHPPer=%s,hpPer=%s,changeSkillPer=%s,skillPer=%s"
                          % (attacker.GetID(), defObj.GetID(), tagHPPer, hpPer, changeSkillPer, skillPer))
        return changeSkillPer, skillValue
    elif effectID == ChConfig.Def_Skill_Effect_AttackReplaceByTagState:
        # 目标状态判断
        tagState = findEffect.GetEffectValue(1)
        if not GameObj.GetPyPlayerState(defObj, tagState):
            return
        changeSkillPer = findEffect.GetEffectValue(0)
        GameWorld.DebugLog("        目标状态变更技能伤害! atkID=%s,defID=%s,tagState=%s,changeSkillPer=%s,skillPer=%s"
                           % (attacker.GetID(), defObj.GetID(), tagState, changeSkillPer, skillPer))
        return changeSkillPer, skillValue
    return
    
    
# 从效果ID列表中找到其中一个效果
@@ -1975,6 +2008,12 @@
    
    hurtValue = CalcBloodShield(atkObj, defObj, hurtValue)
    
    # 受伤上限处理,必须放到最后
    beHurtMax = PassiveBuffEffMng.GetValueByPassiveBuffTriggerType(defObj, atkObj, None, ChConfig.TriggerType_BeHurtMax)
    if beHurtMax > 0:
        GameWorld.DebugLog("        最高受伤值限制: defID=%s,beHurtMax=%s,hurtValue=%s" % (defObj.GetID(), beHurtMax, hurtValue))
        hurtValue = min(hurtValue, beHurtMax)
    return hurtValue
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Attack/BaseAttack.py
@@ -1637,6 +1637,7 @@
            PassiveBuffEffMng.OnPetPassiveSkillTrigger(defender, attacker, None, ChConfig.TriggerType_BeSuperHit, tick)
        elif hurtType == ChConfig.Def_HurtType_Miss:
            PassiveBuffEffMng.OnPassiveSkillTrigger(defender, attacker, None, ChConfig.TriggerType_MissSkill, tick)
            PassiveBuffEffMng.OnPassiveSkillTrigger(attacker, defender, None, ChConfig.TriggerType_BeMissSkill, tick)
        elif hurtType == ChConfig.Def_HurtType_LuckyHit:
            PassiveBuffEffMng.OnPetPassiveSkillTrigger(defender, attacker, None, ChConfig.TriggerType_BeLuckyHit, tick)
            
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py
@@ -627,6 +627,8 @@
Def_Skill_Effect_AbsorbShieldXMZJ = 802    # 须弥真界 神兵技能吸收伤害 百分比
Def_Skill_Effect_BoomSeedHurt = 804 # BUFF种子单层伤害
Def_Skill_Effect_StoreBlood = 809 # 将期间受到的伤害总值,用于最后回血,不影响伤害
Def_Skill_Effect_AttackReplaceByTagState = 1007  #伤害技能替换(目标状态判断)
Def_Skill_Effect_AttackReplaceByTagHP = 1008  #伤害技能替换(目标血量判断)
Def_Skill_Effect_AttackReplace = 1009  #攻击计算,野外小怪伤害替换1010 (2018-03-07增加精英怪)
Def_Skill_Effect_Attack = 1010  #攻击计算
Def_Skill_Effect_LayerCnt = 1011 # BUFF层级数量 A值层数;B值:10位-是否非叠加属性,个位-层数处理方式0递增1递减;C值: 是否攻击减层
@@ -5138,7 +5140,9 @@
TriggerType_XPAttackAddSkillPer,  # 道法攻击增加伤害百分比 98
TriggerType_XPAttackOver,  # 道法攻击后触发99
TriggerType_TurnFightStart, # 回合开场触发 100
) = range(1, 101)
TriggerType_BeMissSkill,   # 目标闪避后触发技能 101
TriggerType_BeHurtMax,   # 锁定受到伤害最大值 102
) = range(1, 103)
#不可以佩戴翅膀的地图
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerViewCacheTube.py
@@ -257,7 +257,8 @@
    curPlayerPlusDict["TotalStoneLV"] = Operate_EquipStone.GetTotalStoneLV(curPlayer)
    curPlayerPlusDict["TotalEquipWashLV"] = Operate_EquipWash.GetTotalEquipWashLV(curPlayer)
    #主动技能总等级
    skillInfo = SkillShell.GetAllSkillCacheInfo(curPlayer, [ChConfig.Def_SkillFuncType_FbSkill, ChConfig.Def_SkillFuncType_NormalAttack])
    skillInfo = SkillShell.GetAllSkillCacheInfo(curPlayer, [ChConfig.Def_SkillFuncType_FbSkill, ChConfig.Def_SkillFuncType_NormalAttack,
                                                            ChConfig.Def_SkillFuncType_ShentongSkill, ChConfig.Def_SkillFuncType_ElfSkill])
    curPlayerPlusDict["SkillInfo"] = skillInfo
    curPlayerPlusDict["TotalSkillLV"] = sum(skillInfo.get("%s"%ChConfig.Def_SkillFuncType_FbSkill, {}).values())
    
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/GameSkills/SkillModule_51.py
New file
@@ -0,0 +1,48 @@
#!/usr/bin/python
# -*- coding: GBK -*-
#-------------------------------------------------------------------------------
#
##@package Skill.GameSkills.SkillModule_51
#
# @todo:打出目标xx属性的X%伤害,单体攻击
# @author hxp
# @date 2024-04-07
# @version 1.0
#
# 详细描述:
#    效果1:A值-百分比 B值-目标属性索引
#    效果2:A值-不超过自身百分比,0不限制 B值-自身属性索引
#
#-------------------------------------------------------------------------------
#"""Version = 2024-04-07 18:00"""
#-------------------------------------------------------------------------------
import ChConfig
import SkillCommon
import EffGetSet
import GameWorld
def UseSkill(attacker, defender, curSkill, tagRoundPosX, tagRoundPosY, isEnhanceSkill, tick):
    if not defender:
        return
    tagEffect = curSkill.GetEffect(0)
    skillPer = tagEffect.GetEffectValue(0) / float(ChConfig.Def_MaxRateValue)
    tagAttrIndex = tagEffect.GetEffectValue(1)
    tagAttrValue = EffGetSet.GetValueByEffIndex(defender, tagAttrIndex)
    hurtValue = int(tagAttrValue * skillPer)
    #GameWorld.DebugLog("打出目标xx属性的xx伤害! atkID=%s,defID=%s,tagAttrIndex=%s,tagAttrValue=%s,skillPer=%s,hurtValue=%s"
    #                   % (attacker.GetID(), defender.GetID(), tagAttrIndex, tagAttrValue, skillPer, hurtValue))
    selfEffect = curSkill.GetEffect(1)
    selfPer = selfEffect.GetEffectValue(0) / float(ChConfig.Def_MaxRateValue)
    selfAttrIndex = selfEffect.GetEffectValue(1)
    if selfPer:
        selfAttrValue = EffGetSet.GetValueByEffIndex(attacker, selfAttrIndex)
        hurtValueMax = int(selfAttrValue * selfPer)
        hurtValue = min(hurtValue, hurtValueMax)
        #GameWorld.DebugLog("    最高不超过自身属性! selfAttrIndex=%s,selfAttrValue=%s,selfPer=%s,hurtValueMax=%s"
        #                   % (selfAttrIndex, selfAttrValue, selfPer, hurtValueMax))
    return SkillCommon.SkillLostHP(defender, curSkill.GetSkillTypeID(), attacker, hurtValue, tick)
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/PassiveBuff/PassiveBuff_4542.py
New file
@@ -0,0 +1,28 @@
#!/usr/bin/python
# -*- coding: GBK -*-
#-------------------------------------------------------------------------------
#
##@package Skill.PassiveBuff.PassiveBuff_4542
#
# @todo:buff锁定受到伤害最大值,不会高于自身最大生命值x%
# @author hxp
# @date 2024-04-07
# @version 1.0
#
# 详细描述: buff锁定受到伤害最大值,不会高于自身最大生命值x%
#
#-------------------------------------------------------------------------------
#"""Version = 2024-04-07 18:00"""
#-------------------------------------------------------------------------------
import ChConfig
import GameObj
def CheckCanHappen(attacker, defender, passiveEffect, skillID, **skillkwargs):
    return True
def GetValue(attacker, defender, passiveEffect):
    # attacker-命名问题,实际是buff主体,在此效果中为被攻击者自身
    maxPer = passiveEffect.GetEffectValue(0)
    return int(GameObj.GetMaxHP(attacker) * maxPer / float(ChConfig.Def_MaxRateValue))
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/PassiveBuff/PassiveSkill_5012.py
New file
@@ -0,0 +1,19 @@
#!/usr/bin/python
# -*- coding: GBK -*-
#-------------------------------------------------------------------------------
#
##@package Skill.PassiveBuff.PassiveSkill_5012
#
# @todo:目标闪避后触发技能
# @author hxp
# @date 2024-04-07
# @version 1.0
#
# 详细描述: 目标闪避后触发技能
#
#-------------------------------------------------------------------------------
#"""Version = 2024-04-07 18:00"""
#-------------------------------------------------------------------------------
def CheckCanHappen(attacker, defender, effect, curSkill):
    return True
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/PassiveBuffEffMng.py
@@ -449,6 +449,7 @@
             5009:ChConfig.TriggerType_BounceHPPer,   # 受到攻击时,反弹伤害百分比值17
             5010:ChConfig.TriggerType_IsDealy,  # 是否触发致命一击 72
             5011:ChConfig.TriggerType_TurnFightStart, # 回合开场触发 100
             5012:ChConfig.TriggerType_BeMissSkill,   # 目标闪避后触发技能 101
             }
    return tdict.get(effectID, -1) 
    #===========================================================================
@@ -507,6 +508,7 @@
             4539:ChConfig.TriggerType_SkillValue,  # 增加技能伤害固定值 82
             4540:ChConfig.TriggerType_SuperHitPer, # 暴击伤害百分比
             4541:ChConfig.TriggerType_AttackAddSkillPer, # BUFF类:提高主动技能的技能伤害
             4542:ChConfig.TriggerType_BeHurtMax, # BUFF类:锁定受到伤害最大值 102
             
             803:ChConfig.TriggerType_BloodShield,  # 血盾
             806:ChConfig.TriggerType_BloodShield,  # 血盾
@@ -515,6 +517,11 @@
             }
    return tdict.get(effectID, -1)
# 触发值没有配置取值类型的默认累加
# 触发值取最大值的触发类型
TriggerValueMaxList = [ChConfig.TriggerType_IsDealy]
# 触发值取最小值的触发类型
TriggerValueMinList = [ChConfig.TriggerType_BeHurtMax]
#--------被动效果---------------------------
# 被动效果的来源可能是被动技能,被动buff,或者其他增益buff
@@ -1341,10 +1348,16 @@
        if callFunc is None:
            continue
        
        if triggerType == ChConfig.TriggerType_IsDealy:
            curValue = max(curValue, callFunc(attacker, defender, effect)) # 取最高倍值
        value = callFunc(attacker, defender, effect)
        if triggerType in TriggerValueMaxList:
            curValue = max(curValue, value) # 取最大值
        elif triggerType in TriggerValueMinList:
            if not curValue:
                curValue = value
            elif value > 0:
                curValue = min(curValue, value) # 取最小值
        else:
            curValue += callFunc(attacker, defender, effect)
            curValue += value
        if skillTypeID not in Def_PassiveSkillValueNoCD:
            if curSkill.GetCoolDownTime():
                SkillCommon.SetSkillRemainTime(curSkill, 0, tick, attacker)
@@ -1650,8 +1663,17 @@
            
            # 如被动技能:千幻冥炎真实伤害从2变4倍
            #curValue += GetPassiveSkillValueByTriggerType(attacker, defender, curSkill, ChConfig.TriggerType_PassiveBuffValue)
            curValue += callFunc(attacker, defender, passiveEffect)
            value = callFunc(attacker, defender, passiveEffect)
            if triggerType in TriggerValueMaxList:
                curValue = max(curValue, value) # 取最大值
            elif triggerType in TriggerValueMinList:
                if not curValue:
                    curValue = value
                elif value > 0:
                    curValue = min(curValue, value) # 取最小值
            else:
                curValue += value
    return curValue
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/SkillShell.py
@@ -3946,7 +3946,7 @@
        if curPlayerSkill == None:
            continue
        funcType = curPlayerSkill.GetFuncType()
        if funcType not in funcTypeList:
        if funcTypeList and funcType not in funcTypeList:
            continue
        funcTypeKey = str(funcType)
        if funcTypeKey not in skillDict: