hch
2019-03-15 d41a44a9fd316c021c4e85bde9cb0fab4c2e0be1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#!/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