From 649b36b642546062ab5102b6225b9f78ea72309d Mon Sep 17 00:00:00 2001
From: hxp <ale99527@vip.qq.com>
Date: 星期二, 04 十一月 2025 18:11:02 +0800
Subject: [PATCH] 129 【战斗】战斗系统-服务端(优化完整战报仅包含战斗相关封包,结算奖励相关如物品,经验,货币,挑战次数等统一放在战报数据B430后同步)
---
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_MainLevelBoss.py | 34 +++++++++++++++++++++++-----------
1 files changed, 23 insertions(+), 11 deletions(-)
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_MainLevelBoss.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_MainLevelBoss.py
index e3563de..91b8967 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_MainLevelBoss.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_MainLevelBoss.py
@@ -113,6 +113,28 @@
% (chapterID, levelNum, nextChapterID, nextLevelNum), playerID)
isAllPass = True
+ # 发放过关奖励
+ levelIpyData = IpyGameDataPY.GetIpyGameData("MainLevel", chapterID, levelNum)
+ itemList = levelIpyData.GetAwardItemList() if levelIpyData else []
+ GameWorld.DebugLog("过关奖励: chapterID=%s,levelNum=%s,itemList=%s" % (chapterID, levelNum, itemList), playerID)
+ overMsg.update({FBCommon.Over_itemInfo:FBCommon.GetJsonItemList(itemList)})
+
+ turnFight.awardData = [nextChapterID, nextLevelNum, isAllPass, itemList]
+ return
+
+def OnTurnFightAward(curPlayer, turnFight, mapID, funcLineID, awardData):
+ ## 回合战斗结算奖励
+ if not curPlayer:
+ return
+
+ if not awardData:
+ return
+
+ playerID = curPlayer.GetPlayerID()
+
+ nextChapterID, nextLevelNum, isAllPass, itemList = awardData
+ GameWorld.DebugLog("处理奖励数据: nextChapterID=%s,nextLevelNum=%s,isAllPass=%s,itemList=%s" % (nextChapterID, nextLevelNum, isAllPass, itemList))
+
updPassValue = PlayerControl.SetMainLevelPassInfo(curPlayer, nextChapterID, nextLevelNum, 0)
if isAllPass:
# 已通关的刷怪进度保持不变
@@ -120,17 +142,7 @@
GameWorld.DebugLog("已通关的刷怪进度保持不变: updNowValue=%s" % updNowValue, playerID)
else:
updNowValue = PlayerControl.SetMainLevelNowInfo(curPlayer, nextChapterID, nextLevelNum, 1)
- GameWorld.DebugLog("为通关的刷怪进度设置为下一关的第1波: updNowValue=%s" % updNowValue, playerID)
+ GameWorld.DebugLog("未通关的刷怪进度设置为下一关的第1波: updNowValue=%s" % updNowValue, playerID)
GameWorld.DebugLog("updPassValue=%s,updNowValue=%s" % (updPassValue, updNowValue), playerID)
-
- # 发放过关奖励
- levelIpyData = IpyGameDataPY.GetIpyGameData("MainLevel", chapterID, levelNum)
- if not levelIpyData:
- return
- itemList = levelIpyData.GetAwardItemList()
- GameWorld.DebugLog("过关奖励: chapterID=%s,levelNum=%s,itemList=%s" % (chapterID, levelNum, itemList), playerID)
-
ItemControler.GivePlayerItemOrMail(curPlayer, itemList, event=["MainLevelBoss", False, {}], isNotifyAward=False)
-
- overMsg.update({FBCommon.Over_itemInfo:FBCommon.GetJsonItemList(itemList)})
return
--
Gitblit v1.8.0