#!/usr/bin/python # -*- coding: GBK -*- #------------------------------------------------------------------------------- # ##@package Skill.PassiveTrigger.PassiveEff_5022 # # @todo:¶îÍâÔö¼Ó/¼õÉÙbuffЧ¹ûID/ÊôÐÔIDÖµ # @author hxp # @date 2025-10-30 # @version 1.0 # # ÏêϸÃèÊö: ¶îÍâÔö¼Ó/¼õÉÙbuffЧ¹ûID/ÊôÐÔIDÖµ # #------------------------------------------------------------------------------- #"""Version = 2025-10-30 16:00""" #------------------------------------------------------------------------------- import GameWorld import BattleObj def DoSkillEffectLogic(turnFight, batObj, tagObj, effSkill, curEffect, connSkill, connBuff, **kwargs): effEx1 = curEffect.GetEffectValue(0) # Ö§³Ö¶à¸öÊôÐÔ effEx2 = curEffect.GetEffectValue(1) # Ö§³Ö¶à¸öÊôÐÔ calcRule = curEffect.GetEffectValue(2) # ¸½¼Ó¼ÆËã¹æÔò£¬Ã»ÅäÖÃĬÈÏÔö¼Ó¹Ì¶¨Öµ effExAdd = [0, 0, 0] # ijÖÖÌõ¼þÏÂÔÙ¶îÍâЧ¹ûÖµ×é [buffЧ¹ûID/ÊôÐÔID, Öµ, ¼ÆË㷽ʽ] calcLayer = 1 # ûÅäÖõÄĬÈÏ1²ã£¬Ï൱Óڹ̶¨Öµ if calcRule: ruleType = calcRule[0] # 100 - °´ÓÑ·½Ä³¸ö¹ú¼ÒÎ佫Êý ²ÎÊý1£º¹ú¼Ò if ruleType == 100: country = calcRule[1] if len(calcRule) > 1 else 0 onlyAlive = calcRule[2] if len(calcRule) > 2 else 0 batLineup = batObj.GetBatLineup() countryCnt = 0 batObjMgr = BattleObj.GetBatObjMgr() for objID in batLineup.posObjIDDict.values(): batObj = batObjMgr.getBatObj(objID) if not batObj: continue if batObj.GetCountry() != country: continue if onlyAlive and not batObj.IsAlive(): continue countryCnt += 1 calcLayer = countryCnt GameWorld.DebugLogEx("°´ÓÑ·½Ä³¸ö¹ú¼ÒÎ佫Êý¼ÆËã¶îÍâbuffÊôÐÔ: ruleType=%s,country=%s,countryCnt=%s,onlyAlive=%s", ruleType, country, countryCnt, onlyAlive) # 101 - ½ö¶ÔÖ¸¶¨ÐÔ±ðÓÐЧ ²ÎÊý1£ºÐÔ±ð elif ruleType == 101: onlySex = calcRule[1] if len(calcRule) > 1 else 0 if tagObj.GetSex() != onlySex: GameWorld.DebugLogEx("5022¶îÍâbuff¶Ô¸ÃÐÔ±ðÎÞЧ: ruleType=%s,onlySex=%s,tagSex=%s,tagID=%s", ruleType, onlySex, tagObj.GetSex(), tagObj.GetID()) return # 102 - ͬ¹úÎ佫¶îÍâÌáÉý ²ÎÊý1£º¶îÍâÌáÉýÖµ elif ruleType == 102: if batObj.GetCountry() == tagObj.GetCountry() and len(calcRule) == 4: effExAdd = calcRule[1:] GameWorld.DebugLogEx("ͬ¹úÎ佫ÔÙ¶îÍâbuffÊôÐÔ: ruleType=%s,country=%s,effExAdd=%s", ruleType, tagObj.GetCountry(), effExAdd) if calcLayer <= 0: return for effEX in [effEx1, effEx2, effExAdd]: if not isinstance(effEX, list) or len(effEX) != 3: continue attrID, attrValue, calcType = effEX if not attrID or not attrValue: continue if calcLayer > 1: attrValue = int(attrValue * calcLayer) GameWorld.DebugLogEx("¶îÍâbuffЧ¹ûID/ÊôÐÔIDÖµ: attrID=%s,attrValue=%s,calcType=%s", attrID, attrValue, calcType) connBuff.AddEffectValueEx(attrID, attrValue, calcType) return True