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
#!/usr/bin/python
# -*- coding: GBK -*-
#-------------------------------------------------------------------------------
#
#-------------------------------------------------------------------------------
#
##@package Skill.GameSkills.SkillModule_33
#
# @todo: ´ò³ö×îºóÒ»»÷É˺¦µÄX%¸½¼ÓYÖµ
# @author hxp
# @date 2015-4-24
# @version 1.0
#
# ÏêϸÃèÊö: ´ò³ö×îºóÒ»»÷É˺¦µÄX%¸½¼ÓYÖµ
#
#---------------------------------------------------------------------
"""Version = 2015-4-27 17:00"""
 
#µ¼Èë
 
import ChConfig
#import GameWorld
import BaseAttack
 
##Á´Ê½¹¥»÷
# @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):
    lastHurtValue = attacker.GetDictByKey(ChConfig.Def_PlayerKey_LastHurtValue) # ×îºóÒ»»÷É˺¦Öµ
    #¼¼ÄÜÔöǿֵ
    skillPer = curSkill.GetEffect(0).GetEffectValue(0)
    #¼¼Äܸ½¼ÓÖµ
    addValue = curSkill.GetEffect(0).GetEffectValue(1)
    
    lostHP = int((lastHurtValue * skillPer / float(ChConfig.Def_MaxRateValue)) + addValue)
    
    if defender and tagRoundPosX == -1 and tagRoundPosY == -1:
        #ÆðµãÊǹ¥»÷·½£¬»¹ÊÇÊܺ¦·½£¬»¹ÊÇµãµØ
        tagRoundPosX = defender.GetPosX()
        tagRoundPosY = defender.GetPosY()
    
    #GameWorld.DebugLog("SkillModule_33 (x=%s,y=%s)lastHurtValue=%s,per=%s,addValue=%s,lostHP=%s" 
    #                   % (tagRoundPosX, tagRoundPosY, lastHurtValue, skillPer, addValue, lostHP))
    
    #µ÷Óù¥»÷Êý×é
    return BaseAttack.AreaSkillAttackLostHP(attacker, defender, tagRoundPosX, tagRoundPosY, curSkill, lostHP, tick)