| | |
| | | import ChItem
|
| | |
|
| | | FBDict_IsOver = 'FBDict_IsOver' #是否已结算, 结算时的tick
|
| | | FBDict_IsPlayerOver = 'IsPlayerOver_%s' #玩家是否已经结算掉落的,参数playerID
|
| | |
|
| | | g_ownerInfo = {} # 归属者信息 {funcLineID:[ownerID, ownerName], }
|
| | |
|
| | |
| | | PyGameData.g_fbPickUpItemDict.pop(playerID, 0)
|
| | | if not GameWorld.IsCrossServer():
|
| | | PlayerFairyDomain.SetFairyDomainFBEventState(curPlayer, ChConfig.Def_FBMapID_DemonKing, funcLineID, PlayerFairyDomain.FDEventState_Visiting)
|
| | | |
| | | gameFB = GameWorld.GetGameFB()
|
| | | ## 副本已经结束,但是没有结算掉落的玩家直接通知结束
|
| | | if gameFB.GetGameFBDictByKey(FBDict_IsOver) and not gameFB.GetGameFBDictByKey(FBDict_IsPlayerOver % playerID):
|
| | | __NotifyFBOver(curPlayer, 0)
|
| | | return
|
| | |
|
| | | ## 副本总逻辑计时器
|
| | |
| | |
|
| | | ## 关闭副本
|
| | | def OnCloseFB(tick):
|
| | | global g_ownerInfo
|
| | | funcLineID = GetCurFBFuncLineID()
|
| | | g_ownerInfo.pop(funcLineID, None)
|
| | | GameWorld.GetGameWorld().SetPropertyID(0)
|
| | |
| | |
|
| | | ## 执行副本杀怪逻辑
|
| | | def __FBNPCOnKilled(curNPC, tick):
|
| | | global g_ownerInfo
|
| | | |
| | | bossID = curNPC.GetNPCID()
|
| | | funcLineID = GetCurFBFuncLineID()
|
| | | if bossID != GetCurFBLineBOSSID(lineID=funcLineID):
|
| | |
| | | if not curPlayer:
|
| | | continue
|
| | | playerID = curPlayer.GetPlayerID()
|
| | | gameFB.SetGameFBDict(FBDict_IsPlayerOver % playerID, 1)
|
| | | isOwner = playerID == ownerID
|
| | | if isOwner:
|
| | | ownerName = curPlayer.GetPlayerName()
|
| | |
| | | if not isItemAllPickUp:
|
| | | return
|
| | |
|
| | | isPass = 1
|
| | | __NotifyFBOver(curPlayer, 1)
|
| | | return
|
| | |
|
| | | def __NotifyFBOver(curPlayer, isPass):
|
| | | global g_ownerInfo
|
| | | playerID = curPlayer.GetPlayerID()
|
| | | mapID = ChConfig.Def_FBMapID_CrossDemonKing if GameWorld.IsCrossServer() else ChConfig.Def_FBMapID_DemonKing
|
| | | funcLineID = GetCurFBFuncLineID()
|
| | | leaveTick = FBCommon.GetFBLineStepTime(mapID, funcLineID) * 1000
|
| | | ownerID, ownerName = g_ownerInfo.pop(funcLineID, [0, ""])
|
| | | ownerID, ownerName = g_ownerInfo.get(funcLineID, [0, ""])
|
| | | jsonItemList = PyGameData.g_fbPickUpItemDict.pop(playerID, [])
|
| | | overDict = {FBCommon.Over_ownerID:ownerID, FBCommon.Over_ownerName:ownerName, FBCommon.Over_itemInfo:jsonItemList}
|
| | | FBCommon.NotifyFBOver(curPlayer, mapID, funcLineID, isPass, overDict)
|