| #!/usr/bin/python  | 
| # -*- coding: GBK -*-  | 
| #  | 
| ##@package Ä£°å30  | 
| #  | 
| # @todo: Çå³ýijÀàdebuffÆäÖÐÒ»¸ö, Def_SkillType_Count  | 
| #  | 
| # @author: Alee  | 
| # @date 2018-5-10 ÏÂÎç08:07:10  | 
| # @version 1.0  | 
| #  | 
| # @note:   | 
| #  | 
| #---------------------------------------------------------------------  | 
| import SkillCommon  | 
| import ChConfig  | 
| import BuffSkill  | 
| import SkillShell  | 
| import BaseAttack  | 
| import GameObj  | 
| import PlayerControl  | 
| import IPY_GameWorld  | 
| import NPCCommon  | 
| #------------------------------------------------------------------------------   | 
|   | 
|   | 
|   | 
| #def UseBuff(attacker, defender, curSkill, tick, tagRoundPosX, tagRoundPosY):  | 
| def UseSkill(attacker, defender, curSkill, tagRoundPosX, tagRoundPosY, isEnhanceSkill, tick):  | 
|     if not defender:  | 
|         return  | 
|       | 
|     buffType = ChConfig.Def_SkillBuffList.get(curSkill.GetEffect(0).GetEffectValue(0))  | 
|     buffTuple = SkillCommon.GetBuffManagerByBuffType(defender, buffType)  | 
|     if buffTuple == ():  | 
|         return  | 
|       | 
|     buffManager = buffTuple[0]  | 
|     if buffManager.GetBuffCount() == 0:  | 
|         return  | 
|       | 
|     curBuff = buffManager.GetBuff(0)  | 
|     ownerID, ownerType = curBuff.GetOwnerID(), curBuff.GetOwnerType()  | 
|       | 
|     #ɾ³ýBuff  | 
|     BuffSkill.DoBuffDisApper(defender, curBuff, tick)  | 
|     buffSkill = curBuff.GetSkill()  | 
|     skillID = buffSkill.GetSkillID()  | 
|     buffManager.DeleteBuffByTypeID(buffSkill.GetSkillTypeID())  | 
|     SkillShell.ClearBuffEffectBySkillID(defender, skillID, ownerID, ownerType)  | 
|       | 
|     #Ë¢ÐÂÊôÐÔ  | 
|     curObjType = defender.GetGameObjType()  | 
|     #Íæ¼Ò  | 
|     if curObjType == IPY_GameWorld.gotPlayer:  | 
|         #Ë¢ÐÂÍæ¼ÒÊôÐÔ  | 
|         playerControl = PlayerControl.PlayerControl(defender)  | 
|           | 
|         if buffType == IPY_GameWorld.bfActionBuff:  | 
|             playerControl.RefreshPlayerActionState()  | 
|             if BuffSkill.CheckBuffRefresh(buffSkill, False):  | 
|                 playerControl.RefreshPlayerAttrByBuff()  | 
|         else:  | 
|             playerControl.RefreshPlayerAttrByBuff()  | 
|     #NPC  | 
|     elif curObjType == IPY_GameWorld.gotNPC:  | 
|         npcControl = NPCCommon.NPCControl(defender)  | 
|           | 
|         if buffType == IPY_GameWorld.bfActionBuff:  | 
|             npcControl.RefreshNPCActionState()  | 
|             if BuffSkill.CheckBuffRefresh(buffSkill, False):  | 
|                 npcControl.RefreshNPCAttrState()  | 
|         else:  | 
|             npcControl.RefreshNPCAttrState()  | 
|           | 
|     return BaseAttack.DoSkillEx_AttackSucess(attacker, defender, curSkill, tick, isEnhanceSkill)  | 
|   | 
|      |