hxp
3 天以前 388823edfe6308cba6f76ca6dc4f20022c5cb2be
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
#!/usr/bin/python
# -*- coding: GBK -*-
#
# @todo: Ö¸¶¨Éñ±øµÈ¼¶²î£¬Ôö¼ÓPVPÔö¼ÓÉ˺¦Ð§¹û
#
# @author: Alee
# @date 2018-1-9 ÏÂÎç09:39:37
# @version 1.0
#
# @note: 
#
#---------------------------------------------------------------------
 
import ChConfig
import GameWorld
import GameObj
import IPY_GameWorld
 
def CheckCanHappen(attacker, defender, effect, curSkill):
    if not defender:
        return False
    if defender.GetGameObjType() != IPY_GameWorld.gotPlayer:
        return False
    
    if attacker.GetGameObjType() != IPY_GameWorld.gotPlayer:
        return False
    
    attrLV = attacker.NomalDictGetProperty(ChConfig.Def_PDict_GodWeaponLV % effect.GetEffectValue(0))
    tagAttrLV = defender.NomalDictGetProperty(ChConfig.Def_PDict_GodWeaponLV % effect.GetEffectValue(0))
    
    if tagAttrLV >= attrLV:
        return False
    
    return True
    
 
 
def GetValue(attacker, defender, effect):
    attrLV = attacker.NomalDictGetProperty(ChConfig.Def_PDict_GodWeaponLV % effect.GetEffectValue(0))
    tagAttrLV = defender.NomalDictGetProperty(ChConfig.Def_PDict_GodWeaponLV % effect.GetEffectValue(0))
    
    return min(effect.GetEffectValue(2), (attrLV - tagAttrLV)*effect.GetEffectValue(1))