#!/usr/bin/python  
 | 
# -*- coding: GBK -*-  
 | 
#  
 | 
#  
 | 
##@package Buff_801  
 | 
# @todo: ÷è÷ë¶Ü£¬ÎüÊÕXX%É˺¦£¬»¤¶ÜÎüÊÕÉ˺¦´ïµ½ÑªÁ¿ÉÏÏÞµÄxx%Öµ»òÕß3Ãëºó±¬·¢ËùÎüÊÕµÄÉ˺¦  
 | 
#  
 | 
# @author Alee  
 | 
# @date 2017-10-31 14:10  
 | 
# @version 1.0  
 | 
#  
 | 
#---------------------------------------------------------------------  
 | 
"""Version = 2017-10-31 14:10"""  
 | 
  
 | 
  
 | 
import IPY_GameWorld  
 | 
import GameWorld  
 | 
import ChConfig  
 | 
import SkillShell  
 | 
import PassiveBuffEffMng  
 | 
import PySkillManager  
 | 
import GameObj  
 | 
  
 | 
#===============================================================================  
 | 
# ## ¸ù¾ÝÊÍ·Å·½µÄÊôÐÔÌí¼ÓЧ¹û  
 | 
# #  @param defender Buff³ÐÊÜÕß  
 | 
# #  @param curEffect ¼¼ÄÜЧ¹û  
 | 
# #  @param calcDict ¼¼ÄÜЧ¹ûÀÛ¼Ó×Ü±í  
 | 
# #  @return None  
 | 
# def OnCalcBuffEx(curObj, curEffect, calcDict, curBuff):  
 | 
#    GameWorld.DebugLog("801 Ç° OnCalcBuffEx-------------%s"%curEffect.GetEffectValue(0))  
 | 
#    buffValue = curEffect.GetEffectValue(0) + PassiveBuffEffMng.GetPassiveSkillValueByTriggerType(  
 | 
#                                            curObj, None, curBuff.GetSkill(), ChConfig.TriggerType_AbsorbShield)  
 | 
#    GameWorld.DebugLog("801 Ç° OnCalcBuffEx------buffValue-------%s"%buffValue)  
 | 
#    # ÎüÊÕÉ˺¦±ÈÂÊ£¬ SetAtkAbsorb¼Ç¼ÒÑÎüÊÕÉ˺¦Öµ  
 | 
#    curObj.SetDefanceAbsorb(buffValue)  
 | 
#    maxValue = int(curEffect.GetEffectValue(1)/float(ChConfig.Def_MaxRateValue)*GameObj.GetMaxHP(curObj))  
 | 
#    curObj.SetAtkAbsorb(maxValue)  
 | 
#    return  
 | 
#   
 | 
#   
 | 
# ## ·µ»ØbuffÀàÐÍ£¬ÏßÐÔÓë·ñ  
 | 
# #  @param None  
 | 
# #  @return ÏßÐÔ  
 | 
# #  @remarks º¯ÊýÏêϸ˵Ã÷.  
 | 
# def GetCalcType():  
 | 
#    return ChConfig.TYPE_Linear  
 | 
#===============================================================================  
 | 
  
 | 
## Ìí¼ÓBUFFºóµÄÂß¼  
 | 
#  @param None  
 | 
#  @return None  
 | 
def DoAddBuffOver(curObj, addBuff, curEffect, tick):  
 | 
    buffValue = curEffect.GetEffectValue(0) + PassiveBuffEffMng.GetPassiveSkillValueByTriggerType(  
 | 
                                            curObj, None, addBuff.GetSkill(), ChConfig.TriggerType_AbsorbShield)  
 | 
    # Õ½¶·ÊôÐÔ ÔÚˢеÄʱºò»áÇå¿Õ£¬²»ÄÜÓÃÔڴ˺¯ÊýÖÐ  
 | 
    curObj.SetDict(ChConfig.Def_PlayerKey_AbsorbShieldValue, buffValue)  # ÎüÊÕµÄÉ˺¦°Ù·Ö±È  
 | 
    maxValue = int(curEffect.GetEffectValue(1)/float(ChConfig.Def_MaxRateValue)*GameObj.GetMaxHP(curObj))  
 | 
    curObj.SetDict(ChConfig.Def_PlayerKey_AbsorbShieldMax, maxValue)  # ÎüÊÕÉÏÏÞÖµ  
 | 
      
 | 
    return  
 | 
  
 | 
##ÎüÊÕÉ˺¦°Ù·Ö±È  
 | 
# @param attacker ¹¥»÷ÕßʵÀý  
 | 
# @param curSkill ¼¼ÄÜʵÀý  
 | 
# @param curEffect µ±Ç°¼¼ÄÜЧ¹û1  
 | 
# @return ×ÜÖµ  
 | 
def CalcBuffValue(attacker, defender, curSkill, changeBuffValueDict):  
 | 
    if not changeBuffValueDict:  
 | 
        return []  
 | 
      
 | 
    return [changeBuffValueDict.get(i, 0) for i in range(ChConfig.Def_BuffValue_Count)]  
 | 
  
 | 
def OnBuffDisappear(curObj, curSkill, curBuff, curEffect, tick):  
 | 
    if not curObj.GetDictByKey(ChConfig.Def_PlayerKey_AbsorbShield):  
 | 
        curObj.SetDict(ChConfig.Def_PlayerKey_AbsorbShieldValue, 0)  # ÎüÊÕµÄÉ˺¦°Ù·Ö±È  
 | 
        curObj.SetDict(ChConfig.Def_PlayerKey_AbsorbShieldMax, 0)  # ÎüÊÕÉÏÏÞÖµ  
 | 
        curObj.SetDict(ChConfig.Def_PlayerKey_AbsorbShield, 0)  
 | 
        return  
 | 
      
 | 
    #Ч¹ûÖµ µÚÈý¸öֵΪ¼¼ÄÜID  
 | 
    boomID = curEffect.GetEffectValue(2)  
 | 
    skillData = GameWorld.GetGameData().GetSkillBySkillID(boomID)  
 | 
    if not skillData:  
 | 
        curObj.SetDict(ChConfig.Def_PlayerKey_AbsorbShieldValue, 0)  # ÎüÊÕµÄÉ˺¦°Ù·Ö±È  
 | 
        curObj.SetDict(ChConfig.Def_PlayerKey_AbsorbShieldMax, 0)  # ÎüÊÕÉÏÏÞÖµ  
 | 
        curObj.SetDict(ChConfig.Def_PlayerKey_AbsorbShield, 0)  
 | 
        return  
 | 
      
 | 
    # ´æ´¢ÆðÀ´ÓÃÓÚÉ˺¦  
 | 
    curObj.SetDict(ChConfig.Def_PlayerKey_MoreHurtValue,   
 | 
                   curObj.GetDictByKey(ChConfig.Def_PlayerKey_AbsorbShield))  
 | 
      
 | 
    SkillShell.Trigger_UseSkill(curObj, None, skillData, tick, curObj.GetPosX(), curObj.GetPosY())  
 | 
    curObj.SetDict(ChConfig.Def_PlayerKey_MoreHurtValue, 0)  
 | 
      
 | 
    curObj.SetDict(ChConfig.Def_PlayerKey_AbsorbShieldValue, 0)  # ÎüÊÕµÄÉ˺¦°Ù·Ö±È  
 | 
    curObj.SetDict(ChConfig.Def_PlayerKey_AbsorbShieldMax, 0)  # ÎüÊÕÉÏÏÞÖµ  
 | 
    curObj.SetDict(ChConfig.Def_PlayerKey_AbsorbShield, 0)  
 | 
    return  
 |