#!/usr/bin/python  
 | 
# -*- coding: GBK -*-  
 | 
#  
 | 
# @todo: ¹¥»÷ʱĿ±ê´¦ÓÚÖ¸¶¨BUFFidÏ´¥·¢¼¼ÄÜ£¬²¢ÇÒΪ¹¥»÷ÕßµÄbuff  
 | 
#  
 | 
# @author: Alee  
 | 
# @date 2018-1-9 ÏÂÎç09:39:37  
 | 
# @version 1.0  
 | 
#  
 | 
# @note:   
 | 
#  
 | 
#---------------------------------------------------------------------  
 | 
  
 | 
import ChConfig  
 | 
import GameWorld  
 | 
import GameObj  
 | 
import PlayerControl  
 | 
import SkillCommon  
 | 
  
 | 
def CheckCanHappen(attacker, defender, effect, curSkill):  
 | 
    buffID = effect.GetEffectValue(0)  
 | 
    if not buffID:  
 | 
        return False  
 | 
      
 | 
    if not defender:  
 | 
        return  
 | 
      
 | 
    # Ä¿±êÉíÉϲéÕÒ  
 | 
    findSkill = GameWorld.GetGameData().GetSkillBySkillID(buffID)  
 | 
    if not findSkill:  
 | 
        return False  
 | 
      
 | 
    buffType = SkillCommon.GetBuffType(findSkill)  
 | 
    buffTuple = SkillCommon.GetBuffManagerByBuffType(defender, buffType)  
 | 
    if buffTuple == ():  
 | 
        return False  
 | 
      
 | 
    result = False  
 | 
    # forÑ»·ÕÒµ½ÊôÓÚ×Ô¼ºµÄBUFF  
 | 
    buffManager = buffTuple[0]  
 | 
    for i in range(buffManager.GetBuffCount()):  
 | 
        findBuff = buffManager.GetBuff(i)  
 | 
        if findBuff.GetBuffID() != buffID:  
 | 
            continue  
 | 
        if findBuff.GetOwnerID() == attacker.GetID():  
 | 
            # ºóÐø´¥·¢ÑªÁ¿»Ö¸´ÐèÒªÓõ½²ãÊý  
 | 
            attacker.SetDict("pointlayer", findBuff.GetLayer())  
 | 
            result = True  
 | 
            break  
 | 
          
 | 
    return result  
 | 
  
 | 
  
 |