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 -*-
#
##@package ¶àµãÔ¤¾¯¹¥»÷
#
# @todo: 
#
# @author: Alee
# @date 2018-4-3 ÏÂÎç10:20:25
# @version 1.0
#
# @note: 
#
#------------------------------------------------------------------------------
#µ¼Èë
import ChConfig
import BaseAttack
#---------------------------------------------------------------------
 
def UseSkill(attacker, defender, curSkill, tagRoundPosX, tagRoundPosY, isEnhanceSkill, tick):
    ## Ô¤¾¯ÕÙ»½
    if attacker.GetDictByKey(ChConfig.Def_NPC_Dict_SkillWarnSkillID) != curSkill.GetSkillID():
        return
    
    skillEffect = curSkill.GetEffect(0)
    skillPer = skillEffect.GetEffectValue(0) 
    skillEnhance = skillEffect.GetEffectValue(1)
    
    tagRoundPosX = attacker.GetPosX()
    tagRoundPosY = attacker.GetPosY()
 
    posX, posY = attacker.GetPosX(), attacker.GetPosY()
    posCnt = attacker.GetDictByKey(ChConfig.Def_NPC_Dict_SkillWarnPosCnt)
    attackDis = curSkill.GetAtkRadius()
    pointMatrix = ChConfig.MatrixDict.get(attackDis)
    skillMatrix = []
    for i in xrange(posCnt):
        # ÒÔÔ¤¾¯µãΪÖе㣬С¾ØÕóΪ·¶Î§£¬Ëã³öËùÓеã
        rebornPosX = attacker.GetDictByKey(ChConfig.Def_NPC_Dict_SkillWarnPosX % i)
        rebornPosY = attacker.GetDictByKey(ChConfig.Def_NPC_Dict_SkillWarnPosY % i)
 
        fixX = rebornPosX - posX
        fixY = rebornPosY - posY
 
        for point in pointMatrix:
            newPoint = [point[0] + fixX, point[1] + fixY]
            if newPoint not in skillMatrix:
                skillMatrix.append(newPoint)
    #ʹÓü¼ÄÜ
    return BaseAttack.AttackerSkillAttackArea(attacker, defender, tagRoundPosX, tagRoundPosY, 
                                              curSkill, skillPer, skillEnhance, tick,
                                              isExSkill = isEnhanceSkill, skillMatrix = skillMatrix)