hxp
2024-09-13 cb3cad30df832143250b9c0f46daeadf10977f33
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
#!/usr/bin/python
# -*- coding: GBK -*-
#
##@package
#
# @todo: Éñ±ø»¤¶ÜÖµ½µÎªµÍÓÚXX%´¥·¢¼¼ÄÜ
#
# @author: Alee
# @date 2018-11-26 ÏÂÎç10:20:47
# @version 1.0
#
# @note: 
#
#---------------------------------------------------------------------
 
import ChConfig
import GameWorld
import GameObj
import PlayerControl
 
 
def CheckCanHappen(attacker, defender, effect, curSkill):
    beforeProDef = attacker.GetDictByKey(ChConfig.Def_PlayerKey_GodWeaponBeforeProDef)
    compPer = effect.GetEffectValue(0)
    curPorDef = PlayerControl.GetProDef(attacker)
    maxProDef = PlayerControl.GetMaxProDef(attacker)
    
    beforePer = beforeProDef*1.0/maxProDef*ChConfig.Def_MaxRateValue
    curPer = curPorDef*1.0/maxProDef*ChConfig.Def_MaxRateValue
    
    if beforePer > compPer and curPer <= compPer:
        # Ö»Óпç¹ýÄǸöÖµ²ÅÄÜ´¥·¢
        return True
    
    return False