| | |
| | | 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():
|
| | |
| | | if not realmIpyData:
|
| | | GameWorld.ErrLog("没有该境界等级数据! Lv=%s" % curRealmLV)
|
| | | return False
|
| | | needRealmPoint = realmIpyData.GetNeedPoint()
|
| | | if not needRealmPoint:
|
| | | needLV = realmIpyData.GetNeedLV()
|
| | | if not needLV:
|
| | | GameWorld.DebugLog("境界已是最大等级,不能升级! Lv=%s" % curRealmLV, curPlayer.GetPlayerID())
|
| | | return False
|
| | | if not PlayerControl.HaveMoney(curPlayer, ShareDefine.TYPE_Price_RealmPoint, needRealmPoint, False):
|
| | | GameWorld.DebugLog("境界修炼点不足,无法开启渡劫!needRealmPoint=%s" % (needRealmPoint), curPlayer.GetPlayerID())
|
| | | if curPlayer.GetLV() < needLV:
|
| | | GameWorld.DebugLog("等级不足,无法开启渡劫!needRealmPoint=%s" % (needLV), curPlayer.GetPlayerID())
|
| | | return False
|
| | | # if curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_RealmFBIsOpen) != 1:
|
| | | # return False
|
| | | |
| | | |
| | | if not realmIpyData.GetBossID():
|
| | | return False
|
| | |
|
| | | return True
|
| | |
|
| | |
|
| | |
| | | return
|
| | |
|
| | | lineID = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_ReqFBFuncLine)
|
| | | if not FBCommon.GetHadSetFBPropertyMark():
|
| | | FBCommon.SetFBPropertyMark(lineID)
|
| | | 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)
|
| | |
| | |
|
| | | 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)
|
| | | # 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)
|
| | | 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, realmIpyData, curStar)
|
| | | EventShell.EventRespons_DujieFBHelpPass(curPlayer)
|
| | | FBCommon.AddFBHelpPoint(curPlayer, ChConfig.Def_FBMapID_DuJie, 1)
|
| | | 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
|
| | |
|
| | |
| | | GameWorld.DebugLog("背包空间不够,发送邮件: mailItemList=%s" % str(prizeItemList), curPlayer.GetPlayerID())
|
| | | else:
|
| | | for itemID, itemCnt, isBind in prizeItemList:
|
| | | ItemControler.GivePlayerItem(curPlayer, itemID, itemCnt, isBind, [IPY_GameWorld.rptItem],
|
| | | ItemControler.GivePlayerItem(curPlayer, itemID, itemCnt, 0, [IPY_GameWorld.rptItem],
|
| | | event=["Dojie", False, {}])
|
| | | return
|
| | |
|
| | |
| | | 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 防守方
|
| | |
| | | # if curPlayer.GetFamilyID() <= 0:
|
| | | # GameWorld.DebugLog("没有战盟,不能请求守护!")
|
| | | # return
|
| | | |
| | | return
|
| | | realmLV = GameWorld.GetGameFB().GetGameFBDictByKey(DuJieFB_RealmLV)
|
| | | realmIpyData = PlayerPrestigeSys.GetRealmIpyData(realmLV)
|
| | | if not realmIpyData:
|
| | | return
|
| | | if realmIpyData.GetIsBigRealm():
|
| | | GameWorld.DebugLog("大境界渡劫,不能请求守护!")
|
| | | return
|
| | | |
| | | GameWorld.DebugLog("向盟友寻求渡劫守护!")
|
| | | atkAdd = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_RealmFBAttrAdd % ShareDefine.Def_Effect_BaseAtkAddPer)
|
| | | msgStr = str([atkAdd, isInspire])
|