129 【战斗】战斗系统-服务端(吕布所有技能;优化效果5501支持同国层级;7002效果支持配置学习x技能生效;增加效果5511;)
1个文件已添加
3个文件已修改
81 ■■■■■ 已修改文件
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/PassiveTrigger/PassiveEff_5501.py 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/PassiveTrigger/PassiveEff_5511.py 53 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/TurnBuffs/BuffAtkType_1003.py 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/TurnSkill.py 18 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/PassiveTrigger/PassiveEff_5501.py
@@ -22,6 +22,7 @@
    skillID = curEffect.GetEffectValue(0) # 技能ID,为0时释放本技能
    setLayerCnt = curEffect.GetEffectValue(1) # 指定buff层级
    byTagStateList = curEffect.GetEffectValue(2) # 或根据目标xx状态 [状态1, 状态2, ...]总层级
    bySameCountryLayerEx = curEffect.GetEffectValue(3) # 触发来源是同国时额外增加层级
    if byTagStateList:
        layerTotal = 0
        tagBuffMgr = tagObj.GetBuffManager()
@@ -33,6 +34,12 @@
            layerTotal += buff.GetLayer()
        setLayerCnt = layerTotal
        
    if bySameCountryLayerEx:
        if "byFriendObj" in kwargs:
            byFriendObj = kwargs.pop("byFriendObj") # 直接取出,防止传递
            if batObj.GetCountry() == byFriendObj.GetCountry():
                setLayerCnt += bySameCountryLayerEx
    if setLayerCnt <= 0:
        return
    
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/PassiveTrigger/PassiveEff_5511.py
New file
@@ -0,0 +1,53 @@
#!/usr/bin/python
# -*- coding: GBK -*-
#-------------------------------------------------------------------------------
#
##@package Skill.PassiveTrigger.PassiveEff_5511
#
# @todo:触发释放技能(验证自己buff层级)
# @author hxp
# @date 2025-12-30
# @version 1.0
#
# 详细描述: 触发释放技能(验证自己buff层级)
#
#-------------------------------------------------------------------------------
#"""Version = 2025-12-30 18:30"""
#-------------------------------------------------------------------------------
import TurnBuff
import GameWorld
import TurnSkill
def DoSkillEffectLogic(turnFight, batObj, tagObj, effSkill, curEffect, connSkill, connBuff, **kwargs):
    buffState = curEffect.GetEffectValue(0) # buff״̬
    needLayers = curEffect.GetEffectValue(1) # 达到多少层可释放
    passiveSkillID = curEffect.GetEffectValue(2) # 释放技能ID
    if not buffState or not needLayers or not passiveSkillID:
        return
    curBuff = batObj.GetBuffManager().FindBuffByState(buffState)
    if not curBuff:
        return
    buffLayers = curBuff.GetLayer()
    if buffLayers < needLayers:
        GameWorld.DebugLogEx("buff状态层数不足不触发5511! buffState=%s,buffLayers=%s < %s", buffState, buffLayers, needLayers)
        return
    #noUseXP = curEffect.GetEffectValue(4) # 怒气时是否不消耗怒气
    #if noUseXP:
    #    kwargs["noUseXP"] = 1
    if not TurnSkill.OnUsePassiveSkill(turnFight, batObj, tagObj, passiveSkillID, connBuff=connBuff, **kwargs):
        return
    delLayers = curEffect.GetEffectValue(3) # 扣除层数,0不扣除
    if delLayers > 0:
        updLayer = buffLayers - delLayers
        TurnBuff.DoBuffLayerChange(turnFight, batObj, curBuff, updLayer, connSkill)
    return True
def DoBuffEffectLogic(turnFight, batObj, tagObj, effBuff, curEffect, connSkill, connBuff, **kwargs):
    effSkill = effBuff.GetSkillData().GetIpyData()
    return DoSkillEffectLogic(turnFight, batObj, tagObj, effSkill, curEffect, connSkill, connBuff, **kwargs)
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/TurnBuffs/BuffAtkType_1003.py
@@ -42,8 +42,7 @@
    GameWorld.DebugLog("计算护盾值(%s):skillID=%s,calcType=%s,baseValue=%s,skillPer=%s,aShieldPer=%s,dShieldPerDef=%s,angerOverflow=%s" 
                       % (shieldValue, skillID, calcType, baseValue, skillPer, aShieldPer, dShieldPerDef, angerOverflow))
    # 均摊
    hurtShareEff = curSkill.GetEffectByID(ChConfig.SkillEff_HurtShare)
    if hurtShareEff:
    if TurnSkill.HaveShareEff(attacker, curSkill):
        tagCnt = max(1, len(curSkill.GetTagObjList()))
        shieldValue = shieldValue / tagCnt
        GameWorld.DebugLogEx("    目标均摊盾值: shieldValue=%s,tagCnt=%s", shieldValue, tagCnt)
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/TurnSkill.py
@@ -2206,14 +2206,25 @@
        GameWorld.DebugLogEx("    伤害最高限制: hurtValue=%s,hurtAtkPerMax=%s,aAtk=%s", hurtValue, hurtAtkPerMax, aAtk)
        
    # 均摊
    hurtShareEff = curSkill.GetEffectByID(ChConfig.SkillEff_HurtShare)
    if hurtShareEff:
    if HaveShareEff(atkObj, curSkill):
        tagCnt = max(1, len(curSkill.GetTagObjList()))
        hurtValue = hurtValue / tagCnt
        GameWorld.DebugLogEx("    目标均摊伤害: hurtValue=%s,tagCnt=%s", hurtValue, tagCnt)
        
    hurtValue = max(1, int(hurtValue)) # 负值、保底防范,放最后
    return hurtValue, hurtTypes
def HaveShareEff(atkObj, curSkill):
    ## 玩家技能是否有分摊效果: 均摊伤害/治疗/承伤盾值
    hurtShareEff = curSkill.GetEffectByID(ChConfig.SkillEff_HurtShare)
    if not hurtShareEff:
        return False
    needLearnSkillID = hurtShareEff.GetEffectValue(0)
    if needLearnSkillID:
        if not atkObj.GetSkillManager().FindSkillByID(needLearnSkillID):
            GameWorld.DebugLogEx("所需技能未学习,分摊效果不生效! skillID=%s,needLearnSkillID=%s", curSkill.GetSkillID(), needLearnSkillID)
            return False
    return True
def GetAddSkillPer(turnFight, atkObj, defObj, curSkill):
    ## 获取额外增加的技能万分比
@@ -2832,8 +2843,7 @@
        cureHP = int(cureHP * multiValue)
        GameWorld.DebugLogEx("    治疗倍值: cureHP=%s,multiValue=%s", cureHP, multiValue)
        
    hurtShareEff = curSkill.GetEffectByID(ChConfig.SkillEff_HurtShare)
    if hurtShareEff:
    if HaveShareEff(userObj, curSkill):
        tagCnt = max(1, len(curSkill.GetTagObjList()))
        cureHP = cureHP / tagCnt
        GameWorld.DebugLogEx("    目标均摊治疗: cureHP=%s,tagCnt=%s", cureHP, tagCnt)