| #!/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) / float(ChConfig.Def_MaxRateValue)  | 
|     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)  | 
|   |