ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/PassiveBuff/PassiveSkill_5005.py
@@ -14,6 +14,25 @@
#-------------------------------------------------------------------------------
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_TurnSkillSuccessPetState):
            #GameWorld.DebugLog("该灵宠释放过技能! 不再触发独立首次!", useSkillPetID.GetID())
            return False
    elif effType == 2:
        # 共享首次,直接取主人的状态
        if attacker.GetDictByKey(ChConfig.Def_Obj_Dict_TurnSkillSuccessPetState):
            #GameWorld.DebugLog("已经有灵宠释放过技能! 不再触发共享首次!", attacker.GetID())
            return False
    return GameWorld.CanHappen(effect.GetEffectValue(0))