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
#!/usr/bin/python
# -*- coding: GBK -*-
#
# @todo: Âú×ãѪÁ¿µÍÓÚXX£¬µ¥´Î»ØÉúÃü°Ù·Ö±ÈѪ, ÓÃÓÚ´¥·¢¼¼ÄÜ
#
# @author: Alee
# @date 2018-1-31 ÏÂÎç03:17:30
# @version 1.0
#
# @note: 
#
#---------------------------------------------------------------------
#------------------------------------------------------------------------------
#µ¼Èë
import ChConfig
import SkillCommon
import BaseAttack
import GameObj
import GameWorld
#---------------------------------------------------------------------
#È«¾Ö±äÁ¿
#---------------------------------------------------------------------
 
#---------------------------------------------------------------------
##˲¼ä»ØÑª
# @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):
    layer = max(attacker.GetDictByKey("pointlayer"), 1) # ÌØÊâ²ã¼¶Ó°ÏìÖÎÁÆÐ§¹û
    attacker.SetDict("pointlayer", 0)
    cureSetEff = curSkill.GetEffect(0) # »Ö¸´¹æÔòÉ趨Ч¹û
    maxHP = GameObj.GetMaxHP(attacker)
    if GameObj.GetHP(attacker)*ChConfig.Def_MaxRateValue/maxHP >= cureSetEff.GetEffectValue(1):
        return
    
    #¹«Ê½¼ÆËãÖÎÁÆÖµ 
    cureHP = int((maxHP * float(cureSetEff.GetEffectValue(0))/ChConfig.Def_MaxRateValue))
    SkillCommon.SkillAddHP(attacker, curSkill.GetSkillTypeID(), cureHP*layer, True)
    #´¦Àí¼¼ÄÜ´¥·¢ºÍ¹¥»÷³É¹¦Âß¼­
    return True