#!/usr/bin/python # -*- coding: GBK -*- #------------------------------------------------------------------------------- # #------------------------------------------------------------------------------- # ##@package SkillModule_4 # # @todo: ½µµÍ³ðºÞ # @author Alee # @date 2010-12-16 20:50 # @version 1.0 # # ÏêϸÃèÊö:½µµÍ³ðºÞ # #------------------------------------------------------------------------------ """Version = 2010-12-16 20:50""" #------------------------------------------------------------------------------ #µ¼Èë import BaseAttack import ChConfig import IPY_GameWorld import ShareDefine 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 skillPer = curSkill.GetEffect(0).GetEffectValue(0) skillPer /= float(ChConfig.Def_MaxRateValue) attackerID = attacker.GetID() attackerType = attacker.GetGameObjType() npcAngry = defender.GetNPCAngry() #³ðºÞÁбíΪ¹Ì¶¨³¤¶ÈÁбí, ¿ÉÒÔÔÚforÖÐɾ³ý for i in range(0, npcAngry.GetAngryCount()): angryTag = npcAngry.GetAngryValueTag(i) angryID = angryTag.GetObjID() angryType = angryTag.GetObjType() #²»¼ì²é¿ÕID if angryID == 0: continue #Ê©·¨Õߣ¬Çå¿Õ³ðºÞÖµ if attackerID == angryID and attackerType == angryType: updAngryValue = int(GameObj.GetAngryValue(angryTag) * skillPer) GameObj.SetAngryValue(angryTag, updAngryValue) break #´¦Àí¼¼ÄÜ´¥·¢ºÍ¹¥»÷³É¹¦Âß¼­ return BaseAttack.DoSkillEx_AttackSucess(attacker, defender, curSkill, tick, isEnhanceSkill)