hxp
2024-09-18 d0d6f28bee730ee64bf46adffa4f768d6af6ac0c
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
#!/usr/bin/python
# -*- coding: GBK -*-
#-------------------------------------------------------------------------------
#
##@package Skill.PassiveBuff.PassiveSkill_5006
#
# @todo:Áé³è¹¥»÷ºó´¥·¢
# @author hxp
# @date 2024-03-26
# @version 1.0
#
# ÏêϸÃèÊö: Áé³è¹¥»÷ºó´¥·¢
#
#-------------------------------------------------------------------------------
#"""Version = 2024-03-26 19:00"""
#-------------------------------------------------------------------------------
 
import GameWorld
import ChConfig
 
def CheckCanHappen(attacker, defender, effect, curSkill):
    #ÉúЧÀàÐÍ£¨0-ÿ´Î£»1-¶ÀÁ¢Ê״Σ¬¼´Ã¿Ö»Áé³è¶ÀÁ¢ËãÊ״Σ»2-¹²ÏíÊ״Σ¬¼´±¾³¡Õ½¶·±¾·½¶àÖ»Áé³èµÄÇé¿öϽöÊ×´ÎÉúЧ£©
    effType = effect.GetEffectValue(1)
    if effType == 1:
        # ¶ÀÁ¢Ê״Σ¬È¡Áé³è×Ô¼ºµÄ״̬
        useSkillPetID = attacker.GetDictByKey("useSkillPetID")
        if not useSkillPetID:
            return False
        petObj = GameWorld.FindNPCByID(useSkillPetID)
        if not petObj:
            return False
        if petObj.GetDictByKey(ChConfig.Def_Obj_Dict_TurnAttackOverPetState):
            #GameWorld.DebugLog("¸ÃÁé³è¹¥»÷¹ý! ²»ÔÙ´¥·¢¶ÀÁ¢Ê״Σ¡", useSkillPetID))
            return False
    elif effType == 2:
        # ¹²ÏíÊ״Σ¬Ö±½ÓÈ¡Ö÷È˵Ä״̬
        if attacker.GetDictByKey(ChConfig.Def_Obj_Dict_TurnAttackOverPetState):
            #GameWorld.DebugLog("ÒѾ­ÓÐÁé³è¹¥»÷¹ý! ²»ÔÙ´¥·¢¹²ÏíÊ״Σ¡", attacker.GetID())
            return False
    return GameWorld.CanHappen(effect.GetEffectValue(0))