#!/usr/bin/python # -*- coding: GBK -*- #------------------------------------------------------------------------------- # ##@package Skill.PassiveTrigger.PassiveEff_Attr # # @todo:±»¶¯´¥·¢ÊôÐÔ # @author hxp # @date 2025-09-16 # @version 1.0 # # ÏêϸÃèÊö: ±»¶¯´¥·¢ÊôÐÔ # #------------------------------------------------------------------------------- #"""Version = 2025-09-16 14:30""" #------------------------------------------------------------------------------- import GameWorld def GetHappenValue(attacker, defender, curEffect, effSkill, effBuff, connSkill, **skillkwargs): attrID = curEffect.GetEffectID() attrValue = curEffect.GetEffectValue(0) calcType = curEffect.GetEffectValue(1) # 10-¸ù¾Ý¶Ô·½buff²ã¼¶Ôö¼Ó if calcType == 10: buffStateList = curEffect.GetEffectValue(2) maxValue = curEffect.GetEffectValue(3) # ÀÛ¼Æ×î¸ßÔö¼ÓÖµ layerTotal = 0 buffMgr = defender.GetBuffManager() for buffState in buffStateList: for buff in buffMgr.FindBuffListByState(buffState): layerTotal += max(1, buff.GetLayer()) attrValue *= layerTotal if maxValue and attrValue > maxValue: attrValue = maxValue GameWorld.DebugLog("°´¶Ô·½buff²ã¼¶Ôö¼ÓÊôÐÔ: attrID=%s,attrValue=%s,buffStateList=%s,layerTotal=%s,maxValue=%s" % (attrID, attrValue, buffStateList, layerTotal, maxValue)) else: checkInStateList = curEffect.GetEffectValue(2) if checkInStateList: if not defender.CheckInState(checkInStateList): return onlyOwner = curEffect.GetEffectValue(3) # ÊÇ·ñ½ö¶ÔbuffÊ©·¨ÕßÓÐЧ£¬Ä¬ÈÏ0-·ñ£¬1-ÊÇ if onlyOwner: if not effBuff: return if effBuff.GetOwnerID() != defender.GetID(): return if calcType == 2: # ¼õÉÙ£¬ÆäËûĬÈÏÔö¼Ó attrValue = -attrValue return attrValue