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
55
56
#!/usr/bin/python
# -*- coding: GBK -*-
#-------------------------------------------------------------------------------
#
#-------------------------------------------------------------------------------
#
##@package SkillModule_17
#
# @todo: °´ÊÍ·ÅÆøÑªÉÏÏÞÌí¼Ó³ðºÞÖµ
# @author Alee
# @date 2011-04-06 16:40
# @version 1.0
#
# ÏêϸÃèÊö:
#------------------------------------------------------------------------------ 
"""Version = 2011-04-06 16:40"""
 
import IPY_GameWorld
import ChConfig
import NPCCommon
import BaseAttack
import GameObj
##°´ÑªÁ¿ÉÏÏÞÌí¼Ó³ðºÞ
# @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):
    #²»ÊÇNPC²»´¦Àí
    if defender.GetGameObjType() != IPY_GameWorld.gotNPC:
        return
    
    #²»¸øËÀÍöµÄNPCÌí¼Ó³ðºÞ
    if GameObj.GetHP(defender) <= 0:
        return False
    
    #---¼ÆËãÌí¼ÓµÄ³ðºÞÖµ---
    #Ìí¼Ó³ðºÞЧ¹û
    angryEffect = curSkill.GetEffect(0)
    angryPer = angryEffect.GetEffectValue(0) / float(ChConfig.Def_MaxRateValue)
    angryEnhance = angryEffect.GetEffectValue(1)
    addAngryValue = int(GameObj.GetMaxHP(attacker)* angryPer + angryEnhance)
    
    #---¸øNPCÌí¼Ó³ðºÞ---
    npcControl = NPCCommon.NPCControl(defender)
    npcControl.AddObjToAngryList(attacker, addAngryValue, True, False)
    
    #´¦Àí¼¼ÄÜ´¥·¢ºÍ¹¥»÷³É¹¦Âß¼­
    return BaseAttack.DoSkillEx_AttackSucess(attacker, defender, curSkill, tick, isEnhanceSkill)