hch
2018-11-26 0ff8e21c92b39adfdf062b40c4e0147213bba70a
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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
#!/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