5039 【1.3】【后端】组队功能和助战积分优化——宗门、大境界修改
| | |
| | | import PlayerSuccess
|
| | | import EventShell
|
| | | import EventReport
|
| | | import FBHelpBattle
|
| | |
|
| | | import math
|
| | | import time
|
| | |
|
| | | #当前副本地图的状态
|
| | | (
|
| | | FB_Step_Open, # 地图开启
|
| | | FB_Step_CallHelp, # 助战召唤
|
| | | FB_Step_MapPrepare, # 地图准备
|
| | | FB_Step_Fighting, # 战斗中
|
| | | FB_Step_LeaveTime, # 自由时间
|
| | |
| | |
|
| | |
|
| | | def GetRealmFBTimeCfg():
|
| | | lineID = FBCommon.GetFBPropertyMark()
|
| | | lineID = 1 if FBCommon.GetFBPropertyMark() else 0
|
| | | return FBCommon.GetFBLineStepTime(ChConfig.Def_FBMapID_DuJie, lineID)
|
| | |
|
| | | def GetDuJieBossID():
|
| | |
| | | return
|
| | |
|
| | | lineID = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_ReqFBFuncLine)
|
| | | if lineID: #小境界0 大境界为境界等级
|
| | | lineID = curPlayer.GetOfficialRank()
|
| | | if not FBCommon.GetHadSetFBPropertyMark():
|
| | | FBCommon.SetFBPropertyMark(lineID)
|
| | | FBCommon.SetFBStep(FB_Step_MapPrepare, tick)
|
| | | if lineID == 0:
|
| | | FBCommon.SetFBStep(FB_Step_MapPrepare, tick)
|
| | |
|
| | | |
| | |
|
| | |
|
| | | fbPlayerCnt = gameFB.GetGameFBDictByKey(ChConfig.Def_FB_NPCStrengthenPlayerCnt)
|
| | |
| | |
|
| | | GameWorld.DebugLog('玩家进入副本')
|
| | |
|
| | | if lineID == 0 or fbPlayerCnt == 1 or curPlayer.GetTeamLV() == IPY_GameWorld.tmlLeader:
|
| | | __SetFBLeaderPlayer(curPlayer)
|
| | | if gameFB.GetFBStep() == FB_Step_Fighting:
|
| | | __OnDuJieFBStart(tick)
|
| | | isHelpFight = lineID == 1 and curPlayer.GetTeamLV() != IPY_GameWorld.tmlLeader and fbPlayerCnt > 1
|
| | | joinType = FBCommon.GetFBJoinType(curPlayer, isHelpFight)
|
| | | EventReport.WriteEvent_FB(curPlayer, ChConfig.Def_FBMapID_DuJie, lineID, ChConfig.CME_Log_Start, joinType)
|
| | | |
| | | |
| | | #if lineID == 0 or fbPlayerCnt == 1 or curPlayer.GetTeamLV() == IPY_GameWorld.tmlLeader:
|
| | | __SetFBLeaderPlayer(curPlayer)
|
| | | # if gameFB.GetFBStep() == FB_Step_Fighting:
|
| | | # __OnDuJieFBStart(tick)
|
| | | fbStep = gameFB.GetFBStep()
|
| | | |
| | | if lineID !=0 and fbStep == FB_Step_CallHelp:
|
| | | FBHelpBattle.SendGameServer_RefreshHelpBattlePlayer(curPlayer, ChConfig.Def_FBMapID_DuJie, lineID)
|
| | | return
|
| | | |
| | | if fbStep == FB_Step_MapPrepare:
|
| | | #初始化并通知等待倒计时
|
| | | __EnterFBInPrepare(curPlayer, DuJieFBCfg[Def_Time_MapPrepare] * 1000, gameFB, tick)
|
| | |
| | |
|
| | | DoFBHelp(curPlayer, tick)
|
| | |
|
| | | return
|
| | |
|
| | | ## 召唤助战完成
|
| | | def OnCallHelpBattleOK(curPlayer, tick):
|
| | | lineID = 1 if FBCommon.GetFBPropertyMark() else 0
|
| | | EventReport.WriteEvent_FB(curPlayer, ChConfig.Def_FBMapID_DuJie, lineID, ChConfig.CME_Log_Start, 0)
|
| | | DuJieFBCfg = GetRealmFBTimeCfg()
|
| | | FBCommon.SetFBStep(FB_Step_MapPrepare, tick)
|
| | | __EnterFBInPrepare(curPlayer, DuJieFBCfg[Def_Time_MapPrepare] * 1000, GameWorld.GetGameFB(), tick)
|
| | | return
|
| | |
|
| | | def __SetFBLeaderPlayer(curPlayer):
|
| | |
| | | return
|
| | |
|
| | | def __OnDuJieFBStart(tick):
|
| | | lineID = FBCommon.GetFBPropertyMark()
|
| | | lineID = 1 if FBCommon.GetFBPropertyMark() else 0
|
| | | if not GameWorld.GetGameFB().GetGameFBDictByKey(DuJieFB_LeaderPlayerID):
|
| | | findLeader = False
|
| | | playerManager = GameWorld.GetMapCopyPlayerManager()
|
| | |
| | | curStar = gameFB.GetGameFBDictByKey(DuJieFB_Star)
|
| | | realmLV = gameFB.GetGameFBDictByKey(DuJieFB_RealmLV)
|
| | | realmIpyData = PlayerPrestigeSys.GetRealmIpyData(realmLV)
|
| | | lineID = FBCommon.GetFBPropertyMark()
|
| | | FBPropertyMark = FBCommon.GetFBPropertyMark()
|
| | | lineID = 1 if FBPropertyMark else 0
|
| | | leaveTick = invadeCfg[Def_Time_Leave] * 1000
|
| | | overDict = {FBCommon.Over_costTime:costTime,FBCommon.Over_grade:curStar, FBCommon.Over_leaderID:leaderPlayerID}
|
| | | playerCnt = copyMapPlayerManager.GetPlayerCount()
|
| | |
| | |
|
| | | if curPlayer == None or curPlayer.IsEmpty():
|
| | | continue
|
| | | isHelpFight = lineID == 1 and curPlayer.GetPlayerID() != leaderPlayerID
|
| | | joinType = FBCommon.GetFBJoinType(curPlayer, isHelpFight)
|
| | | EventReport.WriteEvent_FB(curPlayer, ChConfig.Def_FBMapID_DuJie, lineID, ChConfig.CME_Log_End, joinType, isPass)
|
| | | # isHelpFight = lineID == 1 and curPlayer.GetPlayerID() != leaderPlayerID
|
| | | # joinType = FBCommon.GetFBJoinType(curPlayer, isHelpFight)
|
| | | EventReport.WriteEvent_FB(curPlayer, ChConfig.Def_FBMapID_DuJie, lineID, ChConfig.CME_Log_End, 0, isPass)
|
| | |
|
| | | curPlayer.Sync_TimeTick(IPY_GameWorld.tttLeaveMap, 0, leaveTick, True)
|
| | | FBCommon.NotifyFBOver(curPlayer, ChConfig.Def_FBMapID_DuJie, lineID, isPass, overDict)
|
| | |
| | | #清除CD
|
| | | FBCommon.SetFBPDictValue(curPlayer, ChConfig.Def_PDict_LastEnterFBTick % ChConfig.Def_FBMapID_DuJie, 0)
|
| | | FBCommon.SyncFBEnterTick(curPlayer)
|
| | | else:
|
| | | #帮忙打的给奖励
|
| | | __GiveTeamAward(curPlayer, leaderPlayer, realmIpyData, curStar)
|
| | | EventShell.EventRespons_DujieFBHelpPass(curPlayer)
|
| | | FBCommon.AddFBHelpPoint(curPlayer, ChConfig.Def_FBMapID_DuJie, 1)
|
| | | if lineID:
|
| | | FBHelpBattle.DoSingleFBAddXianyuanCoin(curPlayer, ChConfig.Def_FBMapID_DuJie, FBPropertyMark)
|
| | | # else:
|
| | | # #帮忙打的给奖励
|
| | | # __GiveTeamAward(curPlayer, leaderPlayer, realmIpyData, curStar)
|
| | | # EventShell.EventRespons_DujieFBHelpPass(curPlayer)
|
| | | # FBCommon.AddFBHelpPoint(curPlayer, ChConfig.Def_FBMapID_DuJie, 1)
|
| | |
|
| | | if realmIpyData and realmIpyData.GetIsBigRealm():
|
| | | #成就
|
| | |
| | | FBCommon.Notify_FBHelp(curPlayer, helpDict)
|
| | | return
|
| | |
|
| | | def DoFB_Npc_KillNPC(attacker, curNPC, tick):
|
| | | __FBNPCOnKilled(curNPC, tick)
|
| | | return
|
| | |
|
| | | ## 执行副本杀怪逻辑
|
| | | # @param curPlayer 杀怪的人
|
| | |
| | | # @param tick 当前时间
|
| | | # @return None
|
| | | def DoFB_Player_KillNPC(curPlayer, curNPC, tick):
|
| | | |
| | | __FBNPCOnKilled(curNPC, tick)
|
| | | return
|
| | |
|
| | | def __FBNPCOnKilled(curNPC, tick):
|
| | | bossID = curNPC.GetNPCID()
|
| | | if bossID != GetDuJieBossID():
|
| | | return
|
| | |
| | | # PlayerControl.WorldNotify(0, "jiazu_liubo_202580", [curPlayer.GetFamilyName(), mapID, bossID])
|
| | | __DoDoJieFBOver(True, tick)
|
| | | return
|
| | |
|
| | | ## 检查是否可攻击, 主判定不可攻击的情况,其他逻辑由外层决定
|
| | | # @param attacker 攻击方
|
| | | # @param defender 防守方
|
| | |
| | | import PyGameData
|
| | | import EventShell
|
| | | import NPCCommon
|
| | | import FBHelpBattle
|
| | |
|
| | | import math
|
| | |
|
| | |
| | |
|
| | | # 副本状态
|
| | | (
|
| | | FB_Step_Open, #开启
|
| | | FB_Step_CallHelp, # 助战召唤
|
| | | FB_Step_Prepare, #准备中
|
| | | FB_Step_Fight, # 战斗中
|
| | | FB_Step_PickItem, # 拾取物品中
|
| | |
| | | if not FBCommon.GetHadSetFBPropertyMark():
|
| | | lineID = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_ReqFBFuncLine)
|
| | | FBCommon.SetFBPropertyMark(lineID)
|
| | | if gameFB.GetFBStep() == FB_Step_Open:
|
| | | FBCommon.SetFBStep(FB_Step_Prepare, tick)
|
| | | gameFB.SetGameFBDict(ZMSL_FBNextRefreshStep, 0)
|
| | | gameFB.SetGameFBDict(ZMSL_FBNPCCnt, 0)
|
| | | gameFB.SetGameFBDict(ZMSL_FBNPCRefreshCnt, 0)
|
| | | # if gameFB.GetFBStep() == FB_Step_Open:
|
| | | # FBCommon.SetFBStep(FB_Step_Prepare, tick)
|
| | | # gameFB.SetGameFBDict(ZMSL_FBNextRefreshStep, 0)
|
| | | # gameFB.SetGameFBDict(ZMSL_FBNPCCnt, 0)
|
| | | # gameFB.SetGameFBDict(ZMSL_FBNPCRefreshCnt, 0)
|
| | | |
| | | lineID = FBCommon.GetFBPropertyMark()
|
| | | GameWorld.DebugLog("ZMSL DoEnterFB lineID=%s!" % lineID, curPlayer.GetID())
|
| | | # 进入消耗处理
|
| | |
| | | FBCommon.SetHadDelTicket(curPlayer)
|
| | | PyGameData.g_fbPickUpItemDict.pop(curPlayer.GetPlayerID(), 0)
|
| | | curPlayer.SetDict(ChConfig.Def_PlayerKey_IsInFBOnDay, 0)
|
| | | isHelpFight = False
|
| | | if FBCommon.SetIsHelpFight(curPlayer):
|
| | | isHelpFight = True
|
| | | GameWorld.DebugLog("ZMSL 助战进入副本!", curPlayer.GetID())
|
| | | joinType = FBCommon.GetFBJoinType(curPlayer, isHelpFight)
|
| | | EventReport.WriteEvent_FB(curPlayer, mapID, lineID, ChConfig.CME_Log_Start, joinType)
|
| | | # isHelpFight = False
|
| | | # if FBCommon.SetIsHelpFight(curPlayer):
|
| | | # isHelpFight = True
|
| | | # GameWorld.DebugLog("ZMSL 助战进入副本!", curPlayer.GetID())
|
| | | # joinType = FBCommon.GetFBJoinType(curPlayer, isHelpFight)
|
| | | # EventReport.WriteEvent_FB(curPlayer, mapID, lineID, ChConfig.CME_Log_Start, joinType)
|
| | | if gameFB.GetFBStep() == FB_Step_CallHelp:
|
| | | FBHelpBattle.SendGameServer_RefreshHelpBattlePlayer(curPlayer, mapID, lineID)
|
| | | return
|
| | | ZMSLCfg = GetMTFBLineStepTime()
|
| | | fbStep = gameFB.GetFBStep()
|
| | | if fbStep <= FB_Step_Prepare:
|
| | |
| | |
|
| | | __UpdZMSLFBStar(tick, True, curPlayer)
|
| | | DoFBHelp(curPlayer, tick)
|
| | | return
|
| | |
|
| | | ## 召唤助战完成
|
| | | def OnCallHelpBattleOK(curPlayer, tick):
|
| | | ZMSLCfg = GetMTFBLineStepTime()
|
| | | FBCommon.SetFBStep(FB_Step_Prepare, tick)
|
| | | notify_tick = ZMSLCfg[Def_PrepareTime] * 1000 - (tick - GameWorld.GetGameFB().GetFBStepTick())
|
| | | curPlayer.Sync_TimeTick(IPY_GameWorld.tttWaitStart, 0, max(notify_tick, 0), True)
|
| | | lineID = FBCommon.GetFBPropertyMark()
|
| | | EventReport.WriteEvent_FB(curPlayer, ChConfig.Def_FBMapID_MunekadoTrial, lineID, ChConfig.CME_Log_Start) |
| | | return
|
| | |
|
| | | ## 刷怪
|
| | |
| | | GameWorld.SetDictValueByBit(curPlayer, ChConfig.Def_Player_Dict_PlayerFBStar_MapId, lineID, star, False, [mapID])
|
| | | needSyncFBData = True
|
| | | isInFBOnDay = curPlayer.GetDictByKey(ChConfig.Def_PlayerKey_IsInFBOnDay)
|
| | | isHelpFight = FBCommon.GetIsHelpFight(curPlayer)
|
| | | |
| | | |
| | | if star == 5:
|
| | | joinType = FBCommon.GetFBJoinType(curPlayer, isHelpFight)
|
| | | |
| | | EventReport.WriteEvent_FB(curPlayer, mapID, lineID, ChConfig.CME_Log_End, joinType, 1)
|
| | | EventReport.WriteEvent_FB(curPlayer, mapID, lineID, ChConfig.CME_Log_End, 0, 1)
|
| | | EventShell.EventRespons_FBEvent(curPlayer, "zmsl_%s_%s" % (lineID, star))
|
| | | PlayerSuccess.DoAddSuccessProgress(curPlayer, ShareDefine.SuccType_MunekadoTrial, 1, [playerCount, star, lineID+1])
|
| | | EventShell.EventRespons_FBEvent(curPlayer, "passzmsl")
|
| | | #增加助战积分
|
| | | if isHelpFight:
|
| | | EventShell.EventRespons_FBEvent(curPlayer, "helpzmsl_%s"%lineID)
|
| | | FBCommon.AddFBHelpPoint(curPlayer, mapID, 1)
|
| | | overDict.pop(FBCommon.Over_itemInfo, 0)
|
| | | # if isHelpFight:
|
| | | # EventShell.EventRespons_FBEvent(curPlayer, "helpzmsl_%s"%lineID)
|
| | | # FBCommon.AddFBHelpPoint(curPlayer, mapID, 1)
|
| | | # overDict.pop(FBCommon.Over_itemInfo, 0)
|
| | | # else:
|
| | | # 如果在副本中过天,则只给物品奖励,不变更过关信息
|
| | | if not isInFBOnDay:
|
| | | FBCommon.AddEnterFBCount(curPlayer, mapID, 1)
|
| | | FBHelpBattle.DoSingleFBAddXianyuanCoin(curPlayer, mapID, lineID)
|
| | | needSyncFBData = False
|
| | | else:
|
| | | # 如果在副本中过天,则只给物品奖励,不变更过关信息
|
| | | if not isInFBOnDay:
|
| | | FBCommon.AddEnterFBCount(curPlayer, mapID, 1)
|
| | | needSyncFBData = False
|
| | | else:
|
| | | curPlayer.SetDict(ChConfig.Def_PlayerKey_IsInFBOnDay, 0)
|
| | | PlayerSuccess.DoAddSuccessProgress(curPlayer, ShareDefine.SuccType_MunekadoTrialEx, 1)
|
| | | curPlayer.SetDict(ChConfig.Def_PlayerKey_IsInFBOnDay, 0)
|
| | | PlayerSuccess.DoAddSuccessProgress(curPlayer, ShareDefine.SuccType_MunekadoTrialEx, 1)
|
| | |
|
| | | #=======================================================================================
|
| | | # #给奖励
|
| | |
| | | #overDict[FBCommon.Over_itemInfo] = FBCommon.GetJsonItemList(prizeItemList)
|
| | | #=======================================================================================
|
| | |
|
| | | jsonItemList, totalExp, totalMoney = NPCCommon.GiveKillNPCDropPrize(curPlayer, ChConfig.Def_FBMapID_MunekadoTrial, {killNPCID:1})
|
| | | # 通知结果
|
| | | overDict[FBCommon.Over_itemInfo] = jsonItemList
|
| | | jsonItemList, totalExp, totalMoney = NPCCommon.GiveKillNPCDropPrize(curPlayer, ChConfig.Def_FBMapID_MunekadoTrial, {killNPCID:1})
|
| | | # 通知结果
|
| | | overDict[FBCommon.Over_itemInfo] = jsonItemList
|
| | |
|
| | | if needSyncFBData:
|
| | | FBCommon.Sync_FBPlayerFBInfoData(curPlayer, mapID)
|
| | |
| | | npcIDList.append(npcid)
|
| | | return npcIDList
|
| | |
|
| | | def DoFB_Npc_KillNPC(attacker, curNPC, tick):
|
| | | __FBNPCOnKilled(curNPC, tick)
|
| | | return
|
| | |
|
| | | ##玩家杀死NPC
|
| | | # @param curPlayer:玩家实例
|
| | | # @param curNPC:当前被杀死的NPC
|
| | |
| | | # @return 返回值无意义
|
| | | # @remarks 玩家主动离开副本.
|
| | | def DoFB_Player_KillNPC(curPlayer, curNPC, tick):
|
| | | __FBNPCOnKilled(curNPC, tick)
|
| | | return
|
| | |
|
| | | def __FBNPCOnKilled(curNPC, tick):
|
| | | if curNPC.GetNPCID() not in __GetAllNPCIDList():
|
| | | return
|
| | | gameFB = GameWorld.GetGameFB()
|
| | |
| | |
|
| | | GameWorld.DebugLog("DoFB_Player_KillNPC, npcID=%s,ZMSL_FBNPCCnt=%s,needRefreshCnt=%s"
|
| | | % (curNPC.GetNPCID(), npcCnt, needRefreshCnt))
|
| | | |
| | | |
| | |
|
| | | if npcCnt <= 0 and needRefreshCnt <= 0:
|
| | | GameWorld.DebugLog("本波所有怪物已被击杀!")
|