| | |
| | | import NetPackCommon
|
| | | import PlayerControl
|
| | | import GameWorld
|
| | | import PlayerLLMJ
|
| | | import PlayerPrestigeSys
|
| | | import IpyGameDataPY
|
| | | import PlayerOnline
|
| | | import NPCCommon
|
| | |
| | | self.waveMax = 6 # 本关最大波数,每波有多个小队,每个小队即为一张战斗 TurnFight
|
| | | self.wave = 0 # 当前刷怪波,注意不是玩家当前进度波,比如被击杀会回退一波
|
| | | self.turnFight = GetTurnFightMgr().addTurnFight(ChConfig.Def_FBMapID_Main, 0, playerID)
|
| | | |
| | | # 主线小怪战斗额外数据,一般用于分割与主线战斗表现无关的附加功能内容
|
| | | self.useZhanchui = 0
|
| | | self.mjExp = 0 # 历练秘笈额外经验
|
| | | self.killNPCCnt = 0
|
| | | return
|
| | | |
| | | def resetMainFightExDataRec(self):
|
| | | ## 重置主线战斗相关的额外数据记录,每次前端请求主线小怪战斗处理后需要重置
|
| | | self.useZhanchui = 0
|
| | | self.mjExp = 0
|
| | | self.killNPCCnt = 0
|
| | | return
|
| | |
|
| | | def isLevelBoss(self):
|
| | |
| | | break
|
| | |
|
| | | PlayerOnline.GetOnlinePlayer(curPlayer).SetLastBatBuffer(guid, turnFight.batBuffer)
|
| | | SyncTurnFightReport(curPlayer, guid, turnFight.batBuffer)
|
| | | SyncTurnFightReport(curPlayer, guid, turnFight.batBuffer) # 同步战报
|
| | | #在同步战报后再处理结算奖励,与战斗表现分离
|
| | | FBLogic.OnTurnFightAward(curPlayer, turnFight, mapID, funcLineID, turnFight.awardData)
|
| | | tfMgr.delTurnFight(guid)
|
| | | return True
|
| | |
| | | return
|
| | |
|
| | | GameWorld.DebugLog("------------------- 主线战斗请求: reqType=%s" % reqType, curPlayer.GetPlayerID())
|
| | | mainFightMgr = GetMainFightMgr(curPlayer)
|
| | | mainFightMgr.resetMainFightExDataRec() # 请求时补重置,防止异常时重复结算逻辑
|
| | | |
| | | clientPack = ChPyNetSendPack.tagSCTurnFightReportSign()
|
| | | clientPack.Sign = 0
|
| | | NetPackCommon.SendFakePack(curPlayer, clientPack) # 标记开始
|
| | |
| | | # 标记结束
|
| | | clientPack.Sign = 1
|
| | | NetPackCommon.SendFakePack(curPlayer, clientPack)
|
| | | |
| | | __doMainFightExDataFunc(curPlayer)
|
| | | return
|
| | |
|
| | | def __doMainFightExDataFunc(curPlayer):
|
| | | mainFightMgr = GetMainFightMgr(curPlayer)
|
| | | |
| | | # 本次消耗战锤数
|
| | | useZhanchui = mainFightMgr.useZhanchui
|
| | | if useZhanchui > 0:
|
| | | PlayerLLMJ.AddUseZhanchui(curPlayer, useZhanchui)
|
| | | PlayerPrestigeSys.AddRealmTaskValue(curPlayer, PlayerPrestigeSys.RealmTaskType_UseXiantao, useZhanchui)
|
| | | PlayerTask.AddTaskValue(curPlayer, ChConfig.TaskType_CutTree, useZhanchui)
|
| | | PlayerActivity.AddDailyTaskValue(curPlayer, ChConfig.DailyTask_CutTree, useZhanchui)
|
| | | |
| | | # 历练秘境额外经验
|
| | | mjExp = mainFightMgr.mjExp
|
| | | if mjExp > 0:
|
| | | PlayerLLMJ.AddExpEx(curPlayer, mjExp)
|
| | | |
| | | # 击杀怪物
|
| | | killNPCCnt = mainFightMgr.killNPCCnt
|
| | | if killNPCCnt > 0:
|
| | | PlayerTask.AddTaskValue(curPlayer, ChConfig.TaskType_KillNPC, killNPCCnt)
|
| | | PlayerActivity.AddDailyTaskValue(curPlayer, ChConfig.DailyTask_KillNPC, killNPCCnt)
|
| | | |
| | | # 结算逻辑最后重置数据
|
| | | mainFightMgr.resetMainFightExDataRec()
|
| | | return
|
| | |
|
| | | def __doExitMainFight(curPlayer):
|
| | |
| | |
|
| | | # 暂时只算主线小怪
|
| | | if curPlayer and turnFight.mapID == ChConfig.Def_FBMapID_Main and gameObj.GetFaction() != ChConfig.Def_FactionA:
|
| | | PlayerTask.AddTaskValue(curPlayer, ChConfig.TaskType_KillNPC, 1)
|
| | | PlayerActivity.AddDailyTaskValue(curPlayer, ChConfig.DailyTask_KillNPC, 1)
|
| | | GetMainFightMgr(curPlayer).killNPCCnt += 1
|
| | | return True
|
| | |
|
| | | def OnTurnAllOver(guid):
|