hxp
2024-09-18 d0d6f28bee730ee64bf46adffa4f768d6af6ac0c
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#!/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