xdh
2018-08-10 e334d90099846d5eaf0ec42fb294b63db3932468
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
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
#!/usr/bin/python
# -*- coding: GBK -*-
#-------------------------------------------------------------------------------
#
##@package GameWorldLogic.FBProcess.GameLogic_BossHome
#
# @todo:BOSSÖ®¼Ò
# @author xdh
# @date 2017-11-09
# @version 1.0
#
# ÏêϸÃèÊö: BOSSÖ®¼Ò
#
#-------------------------------------------------------------------------------
#"""Version = 2017-11-09 14:30"""
#-------------------------------------------------------------------------------
 
import FBCommon
import GameWorld
import IpyGameDataPY
import IPY_GameWorld
import ChConfig
import ShareDefine
import PlayerVip
import PlayerControl
import EventReport
 
 
def __GetEnterCostMoney(lineID):
    BossHomeCostDict = IpyGameDataPY.GetFuncEvalCfg('BossHomeCost', 1, {})
    return BossHomeCostDict.get(lineID+1, 0)
 
## ÊÇ·ñÄܹ»Í¨¹ý»î¶¯²éѯ½øÈë
#  @param curPlayer Íæ¼ÒʵÀý
#  @param mapID µØÍ¼ID
#  @param lineID Ïß·id
#  @param tick Ê±¼ä´Á
#  @return ²¼¶ûÖµ
def OnEnterFBEvent(curPlayer, mapID, lineID, tick):
    canEnterLine = PlayerVip.GetPrivilegeValue(curPlayer, ChConfig.VIPPrivilege_BossHome)
    if not canEnterLine:
        return
    if lineID+1 > canEnterLine:
        #ÅжÏÇ®¹»²»¹»
        costGold = __GetEnterCostMoney(lineID)
        if not costGold:
            return False
        costMoneyList = PlayerControl.HaveMoneyEx(curPlayer, ShareDefine.TYPE_Price_Gold_Paper_Money, costGold)
        #GameWorld.Log('costMoneyList=%s,costGold=%s'%(costMoneyList,costGold))
        if not costMoneyList:
            return False
    return True
 
 
##¸±±¾Íæ¼Ò½øÈëµã
# @param curPlayer Íæ¼ÒʵÀý
# @param mapID µØÍ¼ID
# @param lineId ·ÖÏßID
# @param ipyEnterPosInfo ¹¦ÄÜÏß·IPYÅäÖÃ×ø±êÐÅÏ¢
# @param tick Ê±¼ä´Á
# @return posX, posY, Ëæ»ú°ë¾¶(¿ÉÑ¡)
def OnGetFBEnterPos(curPlayer, mapID, lineId, ipyEnterPosInfo, tick):
    return ipyEnterPosInfo
 
## ²éѯµØÍ¼ÊÇ·ñ¿ªÆô
#  @param tick Ê±¼ä´Á
#  @return ²¼¶ûÖµ
def OnCanOpen(tick):
    return True
 
##²éѯÊÇ·ñ¿ÉÒÔ½øÈëµØÍ¼
# @param ask:ÇëÇó½á¹¹Ìå(IPY_BMChangeMapAsk)
# @param tick:ʱ¼ä´Á
# @return IPY_GameWorld.cme Ã¶¾Ù
def OnChangeMapAsk(ask, tick):
    return IPY_GameWorld.cmeAccept
 
 
## ½ø¸±±¾
#  @param curPlayer
#  @param tick
#  @return None
def DoEnterFB(curPlayer, tick):
    playerID = curPlayer.GetPlayerID()
    if curPlayer.GetHP() == 0:
        PlayerControl.PlayerLeaveFB(curPlayer)
        return
    # ÉèÖø±±¾¹«¹²ÊôÐԵĵ¥¶À´¦Àí£¬·ÀÖ¹¶ÓÔ±½øÈëºó±»ÐÞ¸Ä
    if not FBCommon.GetHadSetFBPropertyMark():
        lineID = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_ReqFBFuncLine)
        FBCommon.SetFBPropertyMark(lineID)
        
    GameWorld.DebugLog("DoEnterFB...lineID=%s" % FBCommon.GetFBPropertyMark(), playerID)
    hadDelTicket = FBCommon.GetHadDelTicket(curPlayer)
    if not hadDelTicket:
        FBCommon.SetHadDelTicket(curPlayer)
        canEnterLine = PlayerVip.GetPrivilegeValue(curPlayer, ChConfig.VIPPrivilege_BossHome)
        lineID = FBCommon.GetFBPropertyMark()
        if lineID+1 > canEnterLine:
            costGold = __GetEnterCostMoney(lineID)
            costMoneyList = PlayerControl.HaveMoneyEx(curPlayer, ShareDefine.TYPE_Price_Gold_Paper_Money, costGold)
            mapID = GameWorld.GetMap().GetMapID()
            infoDict = {"MapID":mapID,"LineID":lineID}
            for moneyType, moneyNum in costMoneyList:
                if not PlayerControl.PayMoney(curPlayer, moneyType, moneyNum, ChConfig.Def_Cost_EnterFB, infoDict):
                    GameWorld.Log("ÏÉÓñ²»×ã!costGold=%s" % costGold)
                    PlayerControl.PlayerLeaveFB(curPlayer)
                    return
        EventReport.WriteEvent_FB(curPlayer, ChConfig.Def_FBMapID_BossHome, lineID, ChConfig.CME_Log_Start)
    
 
    #DoFBHelp(curPlayer, tick, True)
    return
 
##Íæ¼ÒÍ˳ö¸±±¾
# @param curPlayer Íæ¼ÒʵÀý
# @param tick Ê±¼ä´Á
# @return ÎÞÒâÒå
def DoExitFB(curPlayer, tick):
 
    return
 
##Íæ¼ÒÖ÷¶¯À뿪¸±±¾.
# @param curPlayer Íæ¼ÒʵÀý
# @param tick Ê±¼ä´Á
# @return ·µ»ØÖµÎÞÒâÒå
def DoPlayerLeaveFB(curPlayer, tick):
    FBCommon.SetHadDelTicket(curPlayer, 0)
    return
 
##Íæ¼ÒÇл»µØÍ¼
def DoPlayerChangeMapLogic(curPlayer):
    FBCommon.SetHadDelTicket(curPlayer, 0)
    return
 
## ÊÇ·ñ¸±±¾¸´»î
#  @param None
#  @return ÊÇ·ñ¸±±¾¸´»î
def OnPlayerReborn():
    return False
 
## Ñ¯ÎÊÍæ¼ÒÊÇ·ñÇл»Í¬¸ö¹¦ÄܵØÍ¼µÄ²»Í¬³¡¾°µØÍ¼
def CanChangeSameDataMapFB(curPlayer, mapID, lineID):
    return True
    
 
## »ñµÃ¸±±¾°ïÖúÐÅÏ¢
#  @param curPlayer µ±Ç°Íæ¼Ò£¨±»Í¨Öª¶ÔÏó£©
#  @param tick µ±Ç°Ê±¼ä
#  @return None
def DoFBHelp(curPlayer, tick, isEnter=False):
 
    return
 
## ¸±±¾ÐÐΪ
#  @param curPlayer Íæ¼Ò
#  @param actionType ÐÐΪÀàÐÍ
#  @param actionInfo ÐÐΪÐÅÏ¢
#  @param tick µ±Ç°Ê±¼ä
#  @return None
def DoFBAction(curPlayer, actionType, actionInfo, tick):
    
    return
 
##---¸±±¾×ÜÂß¼­¼ÆÊ±Æ÷---
# @param tick:ʱ¼ä´Á
# @return ÎÞÒâÒå
# @remarks ¸±±¾×ÜÂß¼­¼ÆÊ±Æ÷
def OnProcess(tick):
    return
 
##Íæ¼ÒËÀÍö.
# @param curPlayer:ËÀÍöµÄÍæ¼Ò 
# @param tick Ê±¼ä´Á
# @return ·µ»ØÖµÎÞÒâÒå
# @remarks Íæ¼ÒÖ÷¶¯À뿪¸±±¾.
def DoPlayerDead(curPlayer):
    FBCommon.Notify_FB_Over(curPlayer, {FBCommon.Over_isPass:0})
    lineID = FBCommon.GetFBPropertyMark()
    leaveTime = int(FBCommon.GetFBLineStepTime(ChConfig.Def_FBMapID_BossHome, lineID))
    curPlayer.Sync_TimeTick(IPY_GameWorld.tttLeaveMap, 0, leaveTime*1000, True)
    return