#!/usr/bin/python  
 | 
# -*- coding: GBK -*-  
 | 
#  
 | 
# @todo: ±ôËÀʱ´¥·¢¼¼ÄÜ  
 | 
#  
 | 
# @author: Alee  
 | 
# @date 2018-1-9 ÏÂÎç09:39:37  
 | 
# @version 1.0  
 | 
#  
 | 
# @note:   
 | 
#  
 | 
#---------------------------------------------------------------------  
 | 
  
 | 
import ChConfig  
 | 
import GameWorld  
 | 
import GameObj  
 | 
import SkillCommon  
 | 
  
 | 
def CheckCanHappen(attacker, defender, effect, curSkill):  
 | 
  
 | 
    result = GameWorld.CanHappen(effect.GetEffectValue(0))  
 | 
    if result:  
 | 
        GameObj.SetHP(attacker, 1) # ÎªÁ˱ÜÃâÉúÃüΪ0ʱ£¬ÆÁ±Î¹ý¶àÂß¼  
 | 
        # Ìáǰ´¥·¢CD£¬ ²»È»Íâ²ãÎÞ·¨´¥·¢¼¼Äܵϰ¾Í²»½øÈëCD£¬ ÈçºÍƽģʽ  
 | 
        if curSkill.GetCoolDownTime():  
 | 
            SkillCommon.SetSkillRemainTime(curSkill, 0, GameWorld.GetGameWorld().GetTick(), attacker)  
 | 
        return True  
 | 
          
 | 
    if effect.GetEffectValue(1):  
 | 
        #²»ËÀѪÁ¿1£¬µ«²»´¥·¢¼¼ÄÜ  
 | 
        if GameWorld.CanHappen(effect.GetEffectValue(1)):  
 | 
            GameObj.SetHP(attacker, 1)  
 | 
            # Ìáǰ´¥·¢CD£¬ ²»È»Íâ²ãÎÞ·¨´¥·¢¼¼Äܵϰ¾Í²»½øÈëCD£¬ ÈçºÍƽģʽ  
 | 
            if curSkill.GetCoolDownTime():  
 | 
                SkillCommon.SetSkillRemainTime(curSkill, 0, GameWorld.GetGameWorld().GetTick(), attacker)  
 | 
            return False  
 | 
  
 | 
    return False  
 |