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
#!/usr/bin/python
# -*- coding: GBK -*-
#
##@package
#
# @todo: ÎüÊÕ¶Ô·½ÊôÐÔ£¬ÓÐÄ¿±ê¼¼ÄÜ£¨41£©, ÔöÒæbuff
#
# @author: Alee
# @date 2019-3-15 ÏÂÎç04:05:05
# @version 1.0
#
# @note: 
#
#---------------------------------------------------------------------
 
import ChConfig
import BaseAttack
import BuffSkill
import IPY_GameWorld
import SkillCommon
import EffGetSet
 
 
def UseSkill(attacker, defender, curSkill, tagRoundPosX, tagRoundPosY, isEnhanceSkill, tick):
    if not defender:
        return
    if defender.GetGameObjType() != IPY_GameWorld.gotPlayer:
        return
    
    addBuffValueList = []
    # Ð§¹ûID | ÊôÐÔÏÍò·ÖÂÊ
    # ×î¶àÎüÊÕÄ¿±ê3ÖÖÊôÐÔ ´æÈëbuffvalue
    for i in range(3):
        attrIndex = curSkill.GetEffect(i).GetEffectValue(0)
        if not attrIndex:
            break
        curValue = EffGetSet.GetValueByEffIndex(defender, attrIndex)
        curValue = int(curValue * curSkill.GetEffect(i).GetEffectValue(1) / ChConfig.Def_MaxRateValue)
        
        addBuffValueList.append(curValue)
        
    buffType = SkillCommon.GetBuffType(curSkill)
    BuffSkill.DoAddBuff(attacker, buffType, curSkill, tick, addBuffValueList, attacker)
    
    #´¦Àí¼¼ÄÜ´¥·¢ºÍ¹¥»÷³É¹¦Âß¼­
    return BaseAttack.DoSkillEx_AttackSucess(attacker, defender, curSkill, tick, isEnhanceSkill)