#!/usr/bin/python
|
# -*- coding: GBK -*-
|
#-------------------------------------------------------------------------------
|
#
|
#-------------------------------------------------------------------------------
|
#
|
##@package SkillModule_9
|
#
|
# @todo: ³åײ
|
# @author Alee
|
# @date 2010-12-16 20:50
|
# @version 1.4
|
#
|
# ÏêϸÃèÊö:³åײ£¬Ö±ÏßÖÐÓÐÕϰµã¿Í»§¶Ë»á¹ÕÍ䣬·þÎñ¶Ë²»ÏÞÖÆ
|
#
|
#------------------------------------------------------------------------------
|
"""Version = 2013-11-05 19:00"""
|
#------------------------------------------------------------------------------
|
#µ¼Èë
|
|
import ChConfig
|
import GameWorld
|
import BaseAttack
|
import PlayerControl
|
import IPY_GameWorld
|
import GameObj
|
#---------------------------------------------------------------------
|
#È«¾Ö±äÁ¿
|
#---------------------------------------------------------------------
|
|
#---------------------------------------------------------------------
|
##³åײ # Óë¿Í»§¶ËÔ¼¶¨³å·æÇ°·¢°ü£¬Ä¿±êΪµØµã£¬Óëսǰ³å·æ²»Í¬
|
def UseSkill(attacker, defender, curSkill, tagRoundPosX, tagRoundPosY, isEnhanceSkill, tick):
|
if attacker.GetGameObjType() == IPY_GameWorld.gotPlayer:
|
destX = attacker.GetUseSkillPosX()
|
destY = attacker.GetUseSkillPosY()
|
else:
|
destX = defender.GetPosX()
|
destY = defender.GetPosY()
|
|
#ÊÇÕϰµã,²»ÄÜÊÍ·Å£¬Ìø³ö
|
if not GameWorld.GetMap().CanMove(destX, destY):
|
#PlayerControl.NotifyCode(attacker, "04BBF813-7A30-47A8-927DE1ACCC4F378E")
|
return False
|
|
result = True
|
|
if defender: # ÓÐÄ¿±ê²ÅËãÉ˺¦
|
|
skillEffect = curSkill.GetEffect(0)
|
skillPer = skillEffect.GetEffectValue(0) / float(ChConfig.Def_MaxRateValue)
|
skillEnhance = skillEffect.GetEffectValue(1)
|
|
#ʹÓü¼ÄÜ£¬ÎÞÐèÌáÉý±©»÷ÂÊ
|
result = BaseAttack.Attack(attacker, defender, curSkill, tick, skillPer,
|
skillEnhance, 1, isEnhanceSkill)
|
|
else:
|
# ֪ͨ¼¼ÄÜÊÍ·Å
|
BaseAttack.DoSkillEx_AttackSucess(attacker, None, curSkill, tick, isEnhanceSkill)
|
|
#·þÎñ¶ËÖÃλ
|
#GameWorld.ResetPlayerPos(attacker, destX, destY)
|
attacker.StopMove()
|
#GameWorld.DebugLog("-----¼¼Äܳ巿ģ°å9 %s %s"%([attacker.GetPosX(), attacker.GetPosY()], [destX, destY]))
|
attacker.ChangePos(destX, destY)
|
|
#===========================================================================
|
# if curSkill.GetSkillID() == ChConfig.Def_SkillID_Somersault:
|
# attacker.SetDict(ChConfig.Def_PlayerKey_SomersaultTime, tick)
|
#===========================================================================
|
return result
|
|