#!/usr/bin/python  
 | 
# -*- coding: GBK -*-  
 | 
#  
 | 
##@package  
 | 
#  
 | 
# @todo: Éñ±ø»¤¶ÜÖµ½µÎªµÍÓÚXX%´¥·¢¼¼ÄÜ  
 | 
#  
 | 
# @author: Alee  
 | 
# @date 2018-11-26 ÏÂÎç10:20:47  
 | 
# @version 1.0  
 | 
#  
 | 
# @note:   
 | 
#  
 | 
#---------------------------------------------------------------------  
 | 
  
 | 
import ChConfig  
 | 
import GameWorld  
 | 
import GameObj  
 | 
import PlayerControl  
 | 
  
 | 
  
 | 
def CheckCanHappen(attacker, defender, effect, curSkill):  
 | 
    beforeProDef = attacker.GetDictByKey(ChConfig.Def_PlayerKey_GodWeaponBeforeProDef)  
 | 
    compPer = effect.GetEffectValue(0)  
 | 
    curPorDef = PlayerControl.GetProDef(attacker)  
 | 
    maxProDef = PlayerControl.GetMaxProDef(attacker)  
 | 
      
 | 
    beforePer = beforeProDef*1.0/maxProDef*ChConfig.Def_MaxRateValue  
 | 
    curPer = curPorDef*1.0/maxProDef*ChConfig.Def_MaxRateValue  
 | 
      
 | 
    if beforePer > compPer and curPer <= compPer:  
 | 
        # Ö»Óпç¹ýÄǸöÖµ²ÅÄÜ´¥·¢  
 | 
        return True  
 | 
      
 | 
    return False 
 |