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_Arena.py | 51 ++++++++++++++++++++++++++++++++++++---------------
1 files changed, 36 insertions(+), 15 deletions(-)
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_Arena.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_Arena.py
index ec1dd8f..fb0c287 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_Arena.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_Arena.py
@@ -21,9 +21,12 @@
import ShareDefine
import PlayerControl
import IpyGameDataPY
+import PlayerActivity
import PlayerBillboard
+import PlayerZhanling
import ItemControler
import PlayerArena
+import PlayerGubao
import PyGameData
import FBCommon
import ChConfig
@@ -36,8 +39,8 @@
'''
playerID = curPlayer.GetPlayerID()
matchIDList = PyGameData.g_arenaPlayerMatchDict.get(playerID, [])
- #if tagPlayerID in matchIDList:
- # return matchIDList.index(tagPlayerID)
+ if tagPlayerID in matchIDList:
+ return matchIDList.index(tagPlayerID)
gameRecMgr = DBDataMgr.GetGameRecMgr()
atkRecMgr = gameRecMgr.GetRecTypeIDMgr(ShareDefine.Def_GameRecType_ArenaRecord, playerID)
@@ -64,7 +67,7 @@
if not PlayerControl.HaveMoney(curPlayer, ShareDefine.TYPE_Price_ArenaTicket, 1):
return
- return True
+ return True, funcLineID
def GetFBPlayerLineupID(curPlayer, mapID, funcLineID):
## 获取玩家使用的攻防阵容ID
@@ -121,22 +124,12 @@
atkAddScore, defDecScore = winScoreInfo
GameWorld.DebugLog("scoreIndex=%s,winScoreInfo=%s" % (scoreIndex, winScoreInfo), playerID)
- if not PlayerControl.PayMoney(curPlayer, ShareDefine.TYPE_Price_ArenaTicket, 1):
- return
-
# 无论胜负,只要挑战都给固定奖励
awardItemList = IpyGameDataPY.GetFuncEvalCfg("ArenaSet", 4)
- ItemControler.GivePlayerItemOrMail(curPlayer, awardItemList, event=["Arena", False, {}], isNotifyAward=False)
-
- __updArenaBatRecord(curPlayer, turnFight, tagPlayerID, isWin, atkAddScore, defDecScore)
-
overMsg.update({"tagPlayerID":tagPlayerID, "atkAddScore":atkAddScore, "defDecScore":defDecScore,
FBCommon.Over_itemInfo:FBCommon.GetJsonItemList(awardItemList)})
- PlayerArena.Sync_ArenaInfo(curPlayer)
-
- # 战斗结束系统强制刷新匹配
- PlayerArena.DoArenaMatchRefresh(curPlayer, True, isSys=True)
+ turnFight.awardData = [tagPlayerID, isWin, atkAddScore, defDecScore, awardItemList]
return
def __updArenaBatRecord(curPlayer, turnFight, tagPlayerID, isWin, atkAddScore, defDecScore):
@@ -171,7 +164,7 @@
# 被击方
if tagPlayerID < ShareDefine.RealPlayerIDStart:
- GameWorld.DebugLog("目标非真实玩家不处理! tagPlayerID=%s" % tagPlayerID, playerID)
+ #GameWorld.DebugLog("目标非真实玩家不处理! tagPlayerID=%s" % tagPlayerID, playerID)
return
# 以战斗记录作为最新积分的更新记录,支持离线玩家上线后更新最新积分
@@ -205,3 +198,31 @@
if defDecScore: # 防守方仅变更时更新
PlayerBillboard.UpdateBillboardByID(tagPlayerID, ShareDefine.Def_BT_Arena, updScore)
return
+
+def OnTurnFightAward(curPlayer, turnFight, mapID, funcLineID, awardData):
+ ## 回合战斗结算奖励
+ if not curPlayer:
+ return
+
+ if not awardData:
+ return
+
+ tagPlayerID, isWin, atkAddScore, defDecScore, awardItemList = awardData
+
+ if not PlayerControl.PayMoney(curPlayer, ShareDefine.TYPE_Price_ArenaTicket, 1):
+ return
+
+ # 无论胜负,只要挑战都给固定奖励
+ ItemControler.GivePlayerItemOrMail(curPlayer, awardItemList, event=["Arena", False, {}], isNotifyAward=False)
+
+ __updArenaBatRecord(curPlayer, turnFight, tagPlayerID, isWin, atkAddScore, defDecScore)
+
+ PlayerArena.Sync_ArenaInfo(curPlayer)
+
+ # 战斗结束系统强制刷新匹配
+ PlayerArena.DoArenaMatchRefresh(curPlayer, True, isSys=True)
+
+ PlayerZhanling.AddZhanlingValue(curPlayer, PlayerZhanling.ZhanlingType_ArenaCnt, 1)
+ PlayerGubao.AddGubaoSpecEffLayer(curPlayer, PlayerGubao.GubaoEffType_Arena, 1)
+ PlayerActivity.AddDailyTaskValue(curPlayer, ChConfig.DailyTask_Arena, 1)
+ return
--
Gitblit v1.8.0