hxp
2021-10-12 6ed7fdf75d8bfcdbde5e8eaf0f5698a45e359076
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
101
102
103
#!/usr/bin/python
# -*- coding: GBK -*-
#-------------------------------------------------------------------------------
#
#-------------------------------------------------------------------------------
#
##@package Event.EventSrc.FunctionNPCShopBuyCheck
#
# @todo:NPCÉ̵깺ÂòÎïÆ·ÏÞÖÆÌõ¼þÀ©Õ¹¼ì²éÄ£¿é
# @author hxp
# @date 2014-10-23
# @version 1.0
#
# ÏêϸÃèÊö: NPCÉ̵깺ÂòÎïÆ·ÏÞÖÆÌõ¼þÀ©Õ¹¼ì²éÄ£¿é
#
#---------------------------------------------------------------------
"""Version = 2014-10-23 16:00"""
 
import PlayerControl
import PlayerRune
#import GameWorld
#import ChConfig
 
 
(
ComType_Equal, # µÈÓÚ
ComType_LessEqual, # Ð¡ÓÚµÈÓÚ
ComType_GreatEqual, # ´óÓÚµÈÓÚ
) = range(3)
 
#ÏÞÖÆÀàÐÍΪByte£¬Çë¸ù¾ÝÐèÒªÁé»î·ÖÅä
#NPCÌØÓеÄÅжÏÏÞÖÆÀàÐÍ£¬²»Í¬NPCÖ®¼ä¿É¸´ÓøÃÀàÐÍ
 
#¹«¹²ÏÞÖÆÌõ¼þÅжϺ¯Êý
#def CheckPublic_ÏÞÖÆÀàÐÍ(curPlayer, limitValue):
#    return True or False
 
#¶ÔÓ¦NPCÌØÓÐÏÞÖÆÌõ¼þÅжϺ¯Êý
#def CheckByNPC_É̵êNPCID_ÏÞÖÆÀàÐÍ(curPlayer, limitValue):
#    return True or False
 
 
### ¶ñħÁÔÈËÆÕͨ¹ý¹ØÊý¹ºÂòÏÞÖÆ
## @param curPlayer: Íæ¼ÒʵÀý
## @param limitValue: ÏÞÖÆÖµ
## @return: Âú×ãÌõ¼þÓë·ñ
#def CheckByNPC_11006_100(curPlayer, limitValue):
#    curValue = xxx
#    isLimit = __CheckCompare(curPlayer, limitValue, curValue)
#    GameWorld.DebugLog("%s.CheckByNPC_11006_100 curValue=%s,limitValue=%s,isLimit=%s" 
#                       % (__name__, curValue, limitValue, isLimit))
#    return isLimit
#
### ¶ñħÁÔÈ˾«Ó¢¹ý¹ØÊý¹ºÂòÏÞÖÆ
## @param curPlayer: Íæ¼ÒʵÀý
## @param limitValue: ÏÞÖÆÖµ
## @return: Âú×ãÌõ¼þÓë·ñ
#def CheckByNPC_11006_101(curPlayer, limitValue):
#    curValue = xxx
#    isLimit = __CheckCompare(curPlayer, limitValue, curValue)
#    GameWorld.DebugLog("%s.CheckByNPC_11006_101 curValue=%s,limitValue=%s,isLimit=%s" 
#                       % (__name__, curValue, limitValue, isLimit))
#    return isLimit
#
### ¶ñħÁÔÈËÓ¢ÐÛ¹ý¹ØÊý¹ºÂòÏÞÖÆ
## @param curPlayer: Íæ¼ÒʵÀý
## @param limitValue: ÏÞÖÆÖµ
## @return: Âú×ãÌõ¼þÓë·ñ
#def CheckByNPC_11006_102(curPlayer, limitValue):
#    curValue = xxx
#    isLimit = __CheckCompare(curPlayer, limitValue, curValue)
#    GameWorld.DebugLog("%s.CheckByNPC_11006_102 curValue=%s,limitValue=%s,isLimit=%s" 
#                       % (__name__, curValue, limitValue, isLimit))
#    return isLimit
 
## ·ûÓ¡Ëþ¹ý¹ØÊý¹ºÂòÏÞÖÆ
# @param curPlayer: Íæ¼ÒʵÀý
# @param limitValue: ÏÞÖÆÖµ
# @return: Âú×ãÌõ¼þÓë·ñ
def CheckByNPC_2_100(curPlayer, itemID, limitValue):
    return not PlayerRune.GetIsOpenByRuneID(curPlayer, itemID)
    
 
## ÅжϷµ»Ø
# @param curPlayer: Íæ¼ÒʵÀý
# @return: 
def __CheckCompare(curPlayer, limitValue, curValue, msgMark='', paramList=[], 
                   comType = ComType_GreatEqual):
    isLimit = False
    if comType == ComType_GreatEqual and curValue < limitValue:
        isLimit = True
    
    elif comType == ComType_LessEqual and curValue > limitValue:
        isLimit = True
    
    elif comType == ComType_Equal and limitValue != curValue:
        isLimit = True
 
    if isLimit and msgMark:
        PlayerControl.NotifyCode(curPlayer, msgMark, paramList)
    
    return isLimit