| #!/usr/bin/python  | 
| # -*- coding: GBK -*-  | 
| #  | 
| # ¶ÔÄ¿±êµÄbuff²ã¼¶´ïµ½µÚ¼¸²ã´¥·¢¼¼ÄÜ, ¸½¼ÓЧ¹ûÖ¸¶¨Ä¿±êΪ×î½üÒ»´Î¹¥»÷µÄÍæ¼Ò  | 
| #  | 
| # @author: Alee  | 
| # @date 2018-1-9 ÏÂÎç09:39:37  | 
| # @version 1.0  | 
| #  | 
| # @note:   | 
| #  | 
| #---------------------------------------------------------------------  | 
| import SkillShell  | 
| import GameWorld  | 
| import ChConfig  | 
| import IPY_GameWorld  | 
|   | 
| def CheckCanHappen(attacker, defender, effect, curSkill):     | 
|     if defender.GetDictByKey(ChConfig.Def_PlayerKey_AddBuffLayer) != effect.GetEffectValue(0):  | 
|         return False  | 
|       | 
|     if effect.GetEffectValue(1):  | 
|         # ×ßµ½´ËÂß¼ ÖÐbuffºÍÊÍ·ÅbuffÊÇͬһ¸öÈË  | 
|         #¸½¼ÓЧ¹ûÖ¸¶¨Ä¿±êΪ×î½üÒ»´Î¹¥»÷µÄÍæ¼Ò  | 
|         playerID = attacker.GetDictByKey(ChConfig.Def_PlayerKey_LastAttackerObjID)  | 
|         if not playerID:  | 
|             return False  | 
|         curObj = GameWorld.GetObj(playerID, IPY_GameWorld.gotPlayer)  | 
|           | 
|         #ÈËÎïÐèÒªÅжÏÊÇ·ñΪ¿Õ  | 
|         if not curObj:  | 
|             return False  | 
|         if curObj.IsEmpty():  | 
|             return False  | 
|       | 
|         #Ç¿ÐÐÊͷż¼ÄÜ  | 
|         SkillShell.UsePassiveTriggerSkill(attacker, curSkill, curObj, GameWorld.GetGameWorld().GetTick(), True)  | 
|         return False  | 
|     return True |