| | |
| | | import FBLogic
|
| | | import ChPyNetSendPack
|
| | | import NetPackCommon
|
| | | import PlayerSuccess
|
| | | import ItemCommon
|
| | | import IpyGameDataPY
|
| | | import ShareDefine
|
| | | import GameFuncComm
|
| | | import FBHelpBattle
|
| | |
|
| | | import time
|
| | | import math
|
| | |
| | | # BYTE Cnt; // 扫荡次数
|
| | | # BYTE IsFinish; // 是否立即完成; 0-否;1-花钱立即完成;2-客户端自行倒计时间到后发送2代表领取扫荡完成奖励
|
| | | # DWORD DataEx; //附带信息
|
| | | # BYTE IsLittleHelper; // 是否小助手扫荡
|
| | | #};
|
| | | ## 玩家副本扫荡
|
| | | # @param playerIndex 玩家索引 |
| | | # @param clientData 客户端封包 |
| | | # @param tick 时间
|
| | | # @return None
|
| | | def OnPlayerFBWipeOut(playerIndex, clientData, tick):
|
| | | curPlayer = GameWorld.GetPlayerManager().GetPlayerByIndex(playerIndex)
|
| | |
|
| | |
| | | #isFinish = clientData.IsFinish
|
| | | isFinish = 1 # 暂时默认1,之后有需要扫荡等待的再说
|
| | | dataEx = clientData.DataEx
|
| | | isLittleHelper = clientData.IsLittleHelper
|
| | | if isLittleHelper:
|
| | | if not GameFuncComm.GetFuncCanUse(curPlayer, ShareDefine.GameFuncID_LittleHelper):
|
| | | GameWorld.DebugLog("玩家没有小助手功能权限!", curPlayer.GetPlayerID())
|
| | | return
|
| | | |
| | | if cnt <= 0:
|
| | | return
|
| | | |
| | | fbIpyData = FBCommon.GetFBIpyData(mapID)
|
| | | if FBCommon.GetRecordMapID(GameWorld.GetMap().GetMapID()) == FBCommon.GetRecordMapID(mapID):
|
| | | if fbIpyData and fbIpyData.GetDayTimes():#没有限制进入次数的不限制在目标地图扫荡
|
| | |
| | |
|
| | |
|
| | | fbLineIpyData = FBCommon.GetFBLineIpyData(mapID, lineID)
|
| | | if not fbLineIpyData:
|
| | | GameWorld.DebugLog("找不到该副本线路,无法扫荡!mapID=%s, lineID=%s" % (mapID, lineID))
|
| | | return
|
| | | |
| | | if FBCommon.CheckCanEnterFBComm(curPlayer, mapID, lineID, fbIpyData, fbLineIpyData, cnt) != ShareDefine.EntFBAskRet_OK:
|
| | | return
|
| | | costMoneyList = []
|
| | |
| | | % (mapID, lineID, curPlayer.GetLV(), sweepLVLimit), curPlayer.GetPlayerID())
|
| | | return
|
| | |
|
| | | #扫荡道具判断
|
| | | #扫荡道具判断,小助手不消耗扫荡道具
|
| | | sweepItemID = fbLineIpyData.GetSweepItemID()
|
| | | if sweepItemID:
|
| | | if sweepItemID and not isLittleHelper:
|
| | | sweepItemCnt = fbLineIpyData.GetSweepCostCnt()
|
| | | sweepCostCnt = sweepItemCnt * cnt
|
| | | #isEnough, sweepCostindexList = ItemCommon.GetItem_FromPack_ByID(sweepItemID, itemPack, sweepCostCnt)
|
| | |
| | | if not FBLogic.OnPlayerFBSweepAsk(curPlayer, mapID, lineID, cnt, isFinish, dataEx):
|
| | | return
|
| | |
|
| | | PlayerSuccess.DoAddSuccessProgress(curPlayer, ShareDefine.SuccType_FeastRedPack_FBSweep, 1, [mapID])
|
| | | |
| | | #扣除扫荡道具
|
| | | if sweepCostindexList and sweepCostCnt:
|
| | | ItemCommon.ReduceItem(curPlayer, itemPack, sweepCostindexList, sweepCostCnt, False, 'FBSweepCostItem')
|
| | |
| | | #增加副本进入次数
|
| | | if fbIpyData and fbIpyData.GetDayTimes():
|
| | | FBCommon.AddEnterFBCount(curPlayer, mapID, cnt)
|
| | | |
| | | |
| | | helpIpyData = IpyGameDataPY.GetIpyGameData("FBHelpBattle", mapID, lineID)
|
| | | if helpIpyData:
|
| | | FBHelpBattle.SendGameServer_SweepCallHelpBattlePlayer(curPlayer, mapID, lineID)
|
| | | return
|
| | | |
| | | #扫荡结果给奖励等
|
| | | FBLogic.OnPlayerFBSweepResult(curPlayer, mapID, lineID, cnt, isFinish, dataEx)
|
| | | return
|