#!/usr/bin/python # -*- coding: GBK -*- #------------------------------------------------------------------------------- # ##@package Skill.PassiveTrigger.PassiveEff_5009 # # @todo:¼ì²â³¡ÉÏ×î¸ß²ãbuff¸´ÖÆbuffµ½Ä¿±êÉÏ # @author hxp # @date 2025-10-28 # @version 1.0 # # ÏêϸÃèÊö: ¼ì²â³¡ÉÏ×î¸ß²ãbuff¸´ÖÆbuffµ½Ä¿±êÉÏ # #------------------------------------------------------------------------------- #"""Version = 2025-10-28 10:30""" #------------------------------------------------------------------------------- import TurnBuff import GameWorld import BattleObj import ChConfig def DoSkillEffectLogic(turnFight, batObj, tagObj, effSkill, curEffect, connSkill, connBuff, **kwargs): #effectID = curEffect.GetEffectID() buffStateList = curEffect.GetEffectValue(0) includeFriend = curEffect.GetEffectValue(1) # ͳ¼ÆbuffʱÊÇ·ñ°üº¬¼º·½µ¥Î» GameWorld.DebugLog("¼ì²â¸´ÖÆ×î¸ß²ãbuff! buffStateList=%s,includeFriend=%s" % (buffStateList, includeFriend)) if not buffStateList: return faction = batObj.GetFaction() lineupNum = batObj.GetLineupNum() if includeFriend: tagFaction = faction else: tagFaction = ChConfig.Def_FactionB if faction == ChConfig.Def_FactionA else ChConfig.Def_FactionA batFaction = turnFight.getBatFaction(tagFaction) batLineup = batFaction.getBatlineup(lineupNum) maxLayer = 0 maxLayerBuffList = [] batObjMgr = BattleObj.GetBatObjMgr() for objID in batLineup.posObjIDDict.values(): tObj = batObjMgr.getBatObj(objID) if not tObj: continue layerTotal = 0 curBuffList = [] buffMgr = tObj.GetBuffManager() for buffState in buffStateList: buffList = buffMgr.FindBuffListByState(buffState) if not buffList: #GameWorld.DebugLog("Ä¿±êûÓиÃ״̬buff! objID=%s,buffState=%s" % (objID, buffState)) continue for buff in buffList: if buff.GetIsCopy(): #GameWorld.DebugLog("±¾ÉíÊǸ´ÖƵÄbuff²»Ëã! objID=%s,buffID=%s" % (objID, buff.GetBuffID())) continue layerTotal += buff.GetLayer() curBuffList += buffList GameWorld.DebugLog("Ä¿±ê¸Ã״̬buff! objID=%s,layerTotal=%s" % (objID, layerTotal)) if maxLayer < layerTotal: maxLayer = layerTotal maxLayerBuffList = curBuffList if not maxLayerBuffList: return # ¸´ÖƸøÄ¿±ê buffOwner = batObj for tagBuff in maxLayerBuffList: skillID = tagBuff.GetSkillID() addBuff = TurnBuff.DoAddBuffBySkillID(turnFight, tagObj, skillID, buffOwner, connSkill, isSync=False) if not addBuff: GameWorld.DebugLog("¸´ÖÆÌí¼Óbuffʧ°Ü! skillID=%s" % skillID) continue GameWorld.DebugLog("¸´ÖÆÌí¼Óbuff³É¹¦! skillID=%s,addBuffID=%s" % (skillID, addBuff.GetBuffID())) TurnBuff.CopyBuff(turnFight, batObj, addBuff, tagBuff, connSkill, True, refreshTimeLayer=False) return True