1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
#!/usr/bin/python
# -*- coding: GBK -*-
#-------------------------------------------------------------------------------
#
##@package Skill.PassiveTrigger.PassiveEff_5015
#
# @todo:¼¯»ð¹¥»÷Ä¿±ê
# @author hxp
# @date 2025-09-23
# @version 1.0
#
# ÏêϸÃèÊö: ¼¯»ð¹¥»÷Ä¿±ê
#
#-------------------------------------------------------------------------------
#"""Version = 2025-09-23 17:00"""
#-------------------------------------------------------------------------------
 
import BattleObj
import TurnSkill
import GameWorld
import ChConfig
import TurnBuff
 
def DoSkillEffectLogic(turnFight, batObj, tagObj, effSkill, curEffect, connSkill, connBuff, **kwargs):
    
    tagBuffMgr = tagObj.GetBuffManager()
    fireBuff = tagBuffMgr.FindBuffByState(ChConfig.BatObjState_FocusFire)
    if not fireBuff:
        #GameWorld.DebugLog("¶Ô·½Ã»Óм¯»ðbuff: tagID=%s" % (tagObj.GetID()))
        return
    
    pursueAtkRateList = curEffect.GetEffectValue(0) # ÓѾü°´xxÅÅÐòµ¹ÐòºóµÄ×·»÷¸ÅÂÊÁбí
    pursueSkillFuncType = curEffect.GetEffectValue(1) # Ê¹ÓÃ×·»÷¼¼ÄÜ 1-ÆÕ¹¥£»2-Å­¼¼
    
    country = batObj.GetCountry()
    faction = batObj.GetFaction()
    lineupNum = batObj.GetLineupNum()
    batFaction = turnFight.getBatFaction(faction)
    batLineup = batFaction.getBatlineup(lineupNum)
    
    objList = []
    batObjMgr = BattleObj.GetBatObjMgr()
    for objID in batLineup.posObjIDDict.values():
        curBatObj = batObjMgr.getBatObj(objID)
        if not curBatObj:
            continue
        objList.append(curBatObj)
        
    sortRule = 0 # ÏȰ´Õ½Á¦£¬ÓÐÐèÒªÔÙÀ©Õ¹Ð§¹ûÖµ
    if sortRule == 0:
        objList.sort(key=lambda o:(o.GetFightPower()), reverse=True)
    elif sortRule == 1:
        objList.sort(key=lambda o:(o.GetAtk()), reverse=True)
    else:
        pass
    
    #ÓѾü°üº¬×Ô¼º£¬Í¬¹ú¸ÅÂÊ·­±¶
    for pursueIndex, curBatObj in enumerate(objList):
        if not tagObj.IsAlive():
            break
        rate = pursueAtkRateList[pursueIndex] if len(pursueAtkRateList) > pursueIndex else 0
        if curBatObj.GetCountry() == country:
            rate *= 2
        GameWorld.DebugLog("ÓѾü¼¯»ð¸ÅÂÊ: objID=%s,rate=%s,pursueIndex=%s" % (curBatObj.GetID(), rate, pursueIndex))
        if not GameWorld.CanHappen(rate, 100):
            continue
        passiveSkill = None
        skillManager = curBatObj.GetSkillManager()
        for index in range(0, skillManager.GetSkillCount()):
            skill = skillManager.GetSkillByIndex(index)
            if not skill:
                continue
            if skill.GetFuncType() == pursueSkillFuncType:
                passiveSkill = skill
                break
        if not passiveSkill:
            continue
        
        # ¼¯»ð×·»÷ÏÞÖÆÁ¬»÷
        TurnSkill.OnUseSkill(turnFight, curBatObj, passiveSkill, [tagObj], batType=ChConfig.TurnBattleType_Pursue, bySkill=connSkill, comboLimit=True)
        
    # É¾³ýÄ¿±ê¼¯»ðbuff
    TurnBuff.DoBuffDel(turnFight, tagObj, fireBuff, connSkill)
    return True