From 24ca194417d6deb1f191463b4b210922ca287e15 Mon Sep 17 00:00:00 2001
From: xdh <xiefantasy@qq.com>
Date: 星期三, 23 一月 2019 17:26:03 +0800
Subject: [PATCH] 5919 【后端】【1.5.100】诛仙塔功能开发(S级的没CD)
---
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_MunekadoTrial.py | 134 ++++++++++++++++++++++++++++++++------------
1 files changed, 97 insertions(+), 37 deletions(-)
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_MunekadoTrial.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_MunekadoTrial.py
index 2bff3c9..4b13c4d 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_MunekadoTrial.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_MunekadoTrial.py
@@ -34,6 +34,7 @@
import PyGameData
import EventShell
import NPCCommon
+import FBHelpBattle
import math
@@ -50,7 +51,7 @@
# 副本状态
(
-FB_Step_Open, #开启
+FB_Step_CallHelp, # 助战召唤
FB_Step_Prepare, #准备中
FB_Step_Fight, # 战斗中
FB_Step_PickItem, # 拾取物品中
@@ -84,8 +85,9 @@
##---获得副本刷怪配置---
# @param None
# @return 配置信息
-def __GetZMSLnpcCfg(lineID):
- mapID = GameWorld.GetMap().GetMapID()
+def __GetZMSLnpcCfg(lineID, mapID=0):
+ if not mapID:
+ mapID = GameWorld.GetMap().GetMapID()
return FBCommon.GetFBLineRefreshNPC(mapID, lineID)
def GetMTFBLineStepTime(lineID=-1):
@@ -157,16 +159,16 @@
mapID = FBCommon.GetRecordMapID(mapID)
gameFB = GameWorld.GetGameFB()
-
# 设置副本公共属性的单独处理,防止队员进入后被修改
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())
# 进入消耗处理
@@ -174,12 +176,15 @@
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:
@@ -193,6 +198,16 @@
__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
## 刷怪
@@ -407,28 +422,21 @@
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 not isInFBOnDay:
+ FBCommon.AddEnterFBCount(curPlayer, mapID, 1)
+ addXianyuanCoin, reason = FBHelpBattle.DoFBAddXianyuanCoin(curPlayer, mapID, lineID)
+ overDict[FBCommon.Over_xianyuanCoin] = [addXianyuanCoin, reason]
+ 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)
#=======================================================================================
# #给奖励
@@ -444,9 +452,9 @@
#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)
@@ -456,6 +464,52 @@
GameWorld.DebugLog(' overDict=%s'%overDict, curPlayer.GetID())
FBCommon.Notify_FB_Over(curPlayer, overDict)
return
+
+## 可否扫荡
+def OnPlayerFBSweepAsk(curPlayer, mapID, lineID, sweepCnt, isFinish, dataEx):
+ if mapID != ChConfig.Def_FBMapID_MunekadoTrial:
+ return
+ # 暂写死,前两层不能扫
+ if lineID < 2:
+ GameWorld.DebugLog("前两层不能扫荡!")
+ return
+ historyStar = GameWorld.GetDictValueByBit(curPlayer, ChConfig.Def_Player_Dict_PlayerFBStar_MapId, lineID-1, False, [mapID])
+ if historyStar < 5:
+ GameWorld.DebugLog("没有S级不能扫荡!")
+ return
+
+ return True
+
+## 助战扫荡结果
+def OnPlayerFBHelpBattleSweepResult(curPlayer, mapID, lineID, helpBattlePlayerDict, addXianyuanCoin, reason):
+ #扣门票要在公共逻辑中完成
+
+ refreshNPCList = __GetZMSLnpcCfg(lineID, mapID)[0]
+ if not refreshNPCList:
+ return
+ lastNPCList = refreshNPCList[-1]
+ if not lastNPCList:
+ return
+ killNPCID = lastNPCList[0][0] # 默认最后一波的NPCID为通关boss奖励ID
+ GameWorld.DebugLog("扫荡宗门试炼: killNPCID=%s,addXianyuanCoin=%s,reason=%s,helpBattlePlayerDict=%s"
+ % (killNPCID, addXianyuanCoin, reason, helpBattlePlayerDict))
+
+ star = 5
+ EventReport.WriteEvent_FB(curPlayer, mapID, lineID, ChConfig.CME_Log_End, 0, 1)
+
+ EventShell.EventRespons_FBEvent(curPlayer, "zmsl_%s_%s" % (lineID, star))
+ EventShell.EventRespons_FBEvent(curPlayer, "passzmsl")
+ PlayerSuccess.DoAddSuccessProgress(curPlayer, ShareDefine.SuccType_MunekadoTrialEx, 1)
+ PlayerSuccess.DoAddSuccessProgress(curPlayer, ShareDefine.SuccType_MunekadoTrial, 1, [1, star, lineID+1])
+ jsonItemList, totalExp, totalMoney = NPCCommon.GiveKillNPCDropPrize(curPlayer, ChConfig.Def_FBMapID_MunekadoTrial, {killNPCID:1}, curGrade=star)
+
+ # 通知结果
+ overDict = {FBCommon.Over_grade:star,FBCommon.Over_dataMapID:mapID,FBCommon.Over_isPass:1, FBCommon.Over_isSweep:1}
+ overDict[FBCommon.Over_helpPlayer] = helpBattlePlayerDict
+ overDict[FBCommon.Over_xianyuanCoin] = [addXianyuanCoin, reason]
+ overDict[FBCommon.Over_itemInfo] = jsonItemList
+ FBCommon.Notify_FB_Over(curPlayer, overDict)
+ return True
## 检查是否可攻击, 主判定不可攻击的情况,其他逻辑由外层决定
# @param attacker 攻击方
@@ -497,6 +551,10 @@
npcIDList.append(npcid)
return npcIDList
+def DoFB_Npc_KillNPC(attacker, curNPC, tick):
+ __FBNPCOnKilled(curNPC, tick)
+ return
+
##玩家杀死NPC
# @param curPlayer:玩家实例
# @param curNPC:当前被杀死的NPC
@@ -504,6 +562,10 @@
# @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()
@@ -515,8 +577,6 @@
GameWorld.DebugLog("DoFB_Player_KillNPC, npcID=%s,ZMSL_FBNPCCnt=%s,needRefreshCnt=%s"
% (curNPC.GetNPCID(), npcCnt, needRefreshCnt))
-
-
if npcCnt <= 0 and needRefreshCnt <= 0:
GameWorld.DebugLog("本波所有怪物已被击杀!")
--
Gitblit v1.8.0