| | |
| | | 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():
|
| | |
| | | # @param lineID 线路id
|
| | | # @return None
|
| | | def __CheckEnter(curPlayer, mapID, lineID):
|
| | | if lineID == 0 or curPlayer.GetTeamLV() == IPY_GameWorld.tmlLeader:
|
| | | if not GameFuncComm.GetFuncCanUse(curPlayer, ShareDefine.GameFuncID_Official):
|
| | | GameWorld.DebugLog("爵位境界功能未开启, 无法开启渡劫!curLV=%s" % curPlayer.GetLV())
|
| | | return False
|
| | | if lineID == 0 or curPlayer.GetTeamLV() == IPY_GameWorld.tmlLeader or (lineID == 1 and curPlayer.GetTeamID() == 0):
|
| | | curRealmLV = curPlayer.GetOfficialRank()
|
| | | realmIpyData = PlayerPrestigeSys.GetRealmIpyData(curRealmLV)
|
| | | if not realmIpyData:
|
| | |
| | | # if curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_RealmFBIsOpen) != 1:
|
| | | # return False
|
| | |
|
| | | if not GameFuncComm.GetFuncCanUse(curPlayer, ShareDefine.GameFuncID_Official):
|
| | | GameWorld.DebugLog("爵位境界功能未开启, 无法开启渡劫!curLV=%s" % curPlayer.GetLV())
|
| | | return False
|
| | | |
| | | return True
|
| | |
|
| | |
|
| | |
| | | # @return 无意义
|
| | | # @remarks 玩家进入副本
|
| | | def DoEnterFB(curPlayer, tick):
|
| | | lineID = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_ReqFBFuncLine)
|
| | | if not FBCommon.GetHadSetFBPropertyMark():
|
| | | FBCommon.SetFBPropertyMark(lineID)
|
| | | FBCommon.SetFBStep(FB_Step_MapPrepare, tick)
|
| | | |
| | | gameFB = GameWorld.GetGameFB()
|
| | | fbStep = gameFB.GetFBStep()
|
| | | if fbStep == FB_Step_LeaveTime:
|
| | | PlayerControl.PlayerLeaveFB(curPlayer)
|
| | | return
|
| | |
|
| | | lineID = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_ReqFBFuncLine)
|
| | | if not FBCommon.GetHadSetFBPropertyMark(): #此处副本属性和功能线路ID不同,故分开设置
|
| | | propertyMark = curPlayer.GetOfficialRank() if lineID else lineID #小境界0 大境界为境界等级
|
| | | GameWorld.GetGameFB().SetGameFBDict(ChConfig.Map_FBDict_PropertyMark, propertyMark + 1)
|
| | | PlayerControl.SetFBFuncLineID(curPlayer, lineID)
|
| | | #FBCommon.SetFBPropertyMark(lineID)
|
| | | if lineID == 0:
|
| | | FBCommon.SetFBStep(FB_Step_MapPrepare, tick)
|
| | |
|
| | | |
| | | |
| | | |
| | | fbPlayerCnt = gameFB.GetGameFBDictByKey(ChConfig.Def_FB_NPCStrengthenPlayerCnt)
|
| | | DuJieFBCfg = GetRealmFBTimeCfg()
|
| | | if not gameFB.GetGameFBDictByKey(DuJieFB_LeaderPlayerID):
|
| | | #重置属性加成
|
| | |
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_RealmFBAttrAdd % attrID, 0)
|
| | |
|
| | | GameWorld.DebugLog('玩家进入副本')
|
| | | if lineID == 0 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
|
| | | 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)
|
| | | 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):
|
| | |
| | | if tick - GameWorld.GetGameFB().GetFBStepTick() < invadeCfg[Def_Time_Leave] * 1000:
|
| | | return
|
| | | # 时间到,踢出还在副本的玩家等...
|
| | | FBCommon.DoLogic_FBKickAllPlayer()
|
| | | #FBCommon.DoLogic_FBKickAllPlayer()
|
| | | return
|
| | |
|
| | | def __OnDuJieFBStart(tick):
|
| | | lineID = 1 if FBCommon.GetFBPropertyMark() else 0
|
| | | if not GameWorld.GetGameFB().GetGameFBDictByKey(DuJieFB_LeaderPlayerID):
|
| | | findLeader = False
|
| | | playerManager = GameWorld.GetMapCopyPlayerManager()
|
| | |
| | | curPlayer = playerManager.GetPlayerByIndex(index)
|
| | | if not curPlayer:
|
| | | continue
|
| | | if curPlayer.GetTeamLV() == IPY_GameWorld.tmlLeader:
|
| | | if curPlayer.GetTeamLV() == IPY_GameWorld.tmlLeader or (lineID == 1 and curPlayer.GetTeamID() == 0):
|
| | | __SetFBLeaderPlayer(curPlayer)
|
| | | findLeader = True
|
| | | break
|
| | | if not findLeader:
|
| | | GameWorld.Log(' 准备倒计时已过,队长仍未进入副本!!! ')
|
| | | FBCommon.DoLogic_FBKickAllPlayer()
|
| | | return
|
| | | DuJieFBCfg = GetRealmFBTimeCfg()
|
| | | bossID = GetDuJieBossID()
|
| | | if not bossID:
|
| | | return
|
| | | mapID = GameWorld.GetMap().GetMapID()
|
| | | lineID = FBCommon.GetFBPropertyMark()
|
| | | |
| | | refreshBossMark = FBCommon.GetFBLineRefreshNPC(mapID, lineID)
|
| | | NPCCustomRefresh.SetNPCRefresh(refreshBossMark, [bossID])
|
| | |
|
| | |
| | |
|
| | | curStar = gameFB.GetGameFBDictByKey(DuJieFB_Star)
|
| | | realmLV = gameFB.GetGameFBDictByKey(DuJieFB_RealmLV)
|
| | | |
| | | lineID = FBCommon.GetFBPropertyMark()
|
| | | realmIpyData = PlayerPrestigeSys.GetRealmIpyData(realmLV)
|
| | | 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}
|
| | | for i in xrange(copyMapPlayerManager.GetPlayerCount()):
|
| | | playerCnt = copyMapPlayerManager.GetPlayerCount()
|
| | | for i in xrange(playerCnt):
|
| | |
|
| | | curPlayer = copyMapPlayerManager.GetPlayerByIndex(i)
|
| | |
|
| | | 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)
|
| | | if isPass and leaderPlayer:
|
| | | if curPlayer.GetPlayerID() == leaderPlayerID:
|
| | | #渡劫通过处理
|
| | |
| | | #清除CD
|
| | | FBCommon.SetFBPDictValue(curPlayer, ChConfig.Def_PDict_LastEnterFBTick % ChConfig.Def_FBMapID_DuJie, 0)
|
| | | FBCommon.SyncFBEnterTick(curPlayer)
|
| | | else:
|
| | | #帮忙打的给奖励
|
| | | __GiveTeamAward(curPlayer, leaderPlayer, realmLV, curStar)
|
| | | EventShell.EventRespons_DujieFBHelpPass(curPlayer)
|
| | | |
| | | realmIpyData = PlayerPrestigeSys.GetRealmIpyData(realmLV)
|
| | | if lineID:
|
| | | addXianyuanCoin, reason = FBHelpBattle.DoFBAddXianyuanCoin(curPlayer, ChConfig.Def_FBMapID_DuJie, FBPropertyMark)
|
| | | overDict[FBCommon.Over_xianyuanCoin] = [addXianyuanCoin, reason]
|
| | | |
| | | if realmIpyData and realmIpyData.GetIsBigRealm():
|
| | | #成就
|
| | | PlayerSuccess.DoAddSuccessProgress(curPlayer, ShareDefine.SuccType_DujieFBHelpPass, 1)
|
| | | |
| | | if playerCnt > 1: #多人组队渡劫
|
| | | EventShell.EventRespons_FBEvent(curPlayer, 'teamdujie')
|
| | | FBCommon.NotifyFBOver(curPlayer, ChConfig.Def_FBMapID_DuJie, lineID, isPass, overDict)
|
| | |
|
| | | return
|
| | |
|
| | | def __GiveTeamAward(curPlayer, leaderPlayer, realmLV, curStar):
|
| | | def __GiveTeamAward(curPlayer, leaderPlayer, realmIpyData, curStar):
|
| | | #帮忙打的给奖励
|
| | | realmIpyData = PlayerPrestigeSys.GetRealmIpyData(realmLV)
|
| | | if not realmIpyData:
|
| | | return
|
| | | teamAwardDict = realmIpyData.GetTeamAward()
|
| | |
| | | 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 防守方
|