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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
#!/usr/bin/python
# -*- coding: GBK -*-
#-------------------------------------------------------------------------------
#
#-------------------------------------------------------------------------------
#
##@package SkillModule_10
#
# @todo: Ë²ÒÆ
# @author Alee
# @date 2010-12-16 20:50
# @version 1.2
#
# @change: "2013-04-17 20:35" Alee ÏÈÊͷż¼ÄܺóÔÙÉÁ˸£¬Ö§³Ö¿Í»§¶Ë¶¯×÷
# @change: "2013-11-05 21:00" Alee ·­¹öÕϰ­µãÏÞÖÆ
#------------------------------------------------------------------------------ 
"""Version = 2013-11-05 21:00"""
#------------------------------------------------------------------------------
#µ¼Èë
import GameWorld
import BaseAttack
import IPY_GameWorld
import GameMap
#---------------------------------------------------------------------
#È«¾Ö±äÁ¿
#---------------------------------------------------------------------
 
#---------------------------------------------------------------------
##Ë²ÒÆ
# @param attacker ¹¥»÷ÕßʵÀý
# @param attacker ¹¥»÷ÕßʵÀý
# @param defender ·ÀÊØÕßʵÀý
# @param curSkill ¼¼ÄÜʵÀý
# @param tagRoundPosX ÇøÓò×ø±êX
# @param tagRoundPosY ÇøÓò×ø±êY
# @param isEnhanceSkill ÊÇ·ñΪ¸½¼Ó¼¼ÄÜ
# @param tick Ê±¼ä´Á
# @return ·µ»ØÖµÎªÕæ, Êͷųɹ¦
# @remarks Ë²ÒÆ
def UseSkill(attacker, defender, curSkill, tagRoundPosX, tagRoundPosY, isEnhanceSkill, tick):
    startPosX, startPosY = attacker.GetPosX(), attacker.GetPosY()
    
    #===========================================================================
    # #¹­ÊÖ·­¹öÌØÊâ´¦Àí²»ÄÜÔ½¹ýÕϰ­Ìø
    # if curSkill.GetSkillTypeID() == 7460:
    #    #¹­ÊÖ·­¹öÓÃË²ÒÆÄ£°å£¬ÌøÅü¶¯×÷
    #    if not (GameWorld.GetMap().CanLineTo(tagRoundPosX, tagRoundPosY, startPosX, startPosY) \
    #        and GameWorld.GetMap().CanLineTo(startPosX, startPosY, tagRoundPosX, tagRoundPosY)):
    #        return False
    #===========================================================================
    
    #´¦Àí¼¼ÄÜ´¥·¢ºÍ¹¥»÷³É¹¦Âß¼­
    reslut = BaseAttack.DoSkillEx_AttackSucess(attacker, defender, curSkill, tick, isEnhanceSkill)
    
    #NPC
    if attacker.GetGameObjType() == IPY_GameWorld.gotNPC:
        posX, posY = GameMap.GetNearbyPosByDis(defender.GetPosX(), defender.GetPosY(), 1)
        if posX == 0 and posY == 0:
            return
        
        attacker.ResetPos(defender.GetPosX(), defender.GetPosY(), curSkill.GetSkillID())
    
    #Íæ¼Ò
    elif attacker.GetGameObjType() == IPY_GameWorld.gotPlayer:
        GameWorld.ResetPlayerPos(attacker, tagRoundPosX, tagRoundPosY, curSkill.GetSkillID())
        
    else:
        return
    
    return reslut