|  |  |  | 
|---|
|  |  |  | 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 防守方 | 
|---|