From 38bdbd5e4429a852dc8b78cf0345016a8df83dd7 Mon Sep 17 00:00:00 2001
From: hxp <ale99527@vip.qq.com>
Date: 星期三, 10 九月 2025 14:44:29 +0800
Subject: [PATCH] 121 【武将】武将系统-服务端(上阵星级加成属性取有效最大星级;吞噬升星优先随机提升有效的槽位;)
---
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Attack/TurnAttack.py | 46 +++++++++++++++++++++++++++++++++++++++++-----
1 files changed, 41 insertions(+), 5 deletions(-)
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Attack/TurnAttack.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Attack/TurnAttack.py
index e73a6d4..dde3b29 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Attack/TurnAttack.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Attack/TurnAttack.py
@@ -35,6 +35,7 @@
import TurnPassive
import TurnSkill
import TurnBuff
+import CommFunc
import ObjPool
import FBLogic
@@ -182,7 +183,7 @@
self.nextTurnFight(msgDict)
return
- def nextTurnFight(self, msgDict={}):
+ def nextTurnFight(self, msgDict={}, resetByNextTeam=False):
## 一般用于玩家发起的战斗,在需要保留玩家阵容属性及状态的情况下,重置回合进入下一场战斗
self.turnNum = 1
self.enterLogic = False
@@ -192,6 +193,8 @@
self.timeline = 0
self.startTime = time.time()
self.costTime = 0
+ if resetByNextTeam:
+ ResetByNextTeam(self)
return
def haveNextLineup(self):
@@ -393,7 +396,9 @@
headStr = "%02x%02x" % (clientPack.Cmd, clientPack.SubCmd)
if self.isNeedReport:
packBuff = clientPack.GetBuffer()
- GameWorld.DebugLog("回合战斗过程封包: %s" % (headStr))
+ buffLen = len(packBuff)
+ GameWorld.DebugLog("回合战斗过程封包: %s, len:%s" % (headStr, buffLen))
+ self.batBuffer += CommFunc.WriteWORD("", buffLen)
self.batBuffer += packBuff
ObjPool.GetPoolMgr().release(clientPack)
else:
@@ -755,6 +760,37 @@
return
+def ResetByNextTeam(turnFight):
+ ## 切换下一小队时重置相关,目前设置仅保留血量、怒气、已被击杀的不复活,其他重置
+
+ batFaction = turnFight.getBatFaction(ChConfig.Def_FactionA)
+ if not batFaction:
+ return
+ GameWorld.DebugLog("切换小队重置玩家阵容武将...")
+ batLineup = batFaction.getBatlineup(1) # 只处理玩家阵容
+ batObjMgr = BattleObj.GetBatObjMgr()
+ for objID in batLineup.posObjIDDict.values():
+ batObj = batObjMgr.getBatObj(objID)
+ if not batObj:
+ continue
+ objName = GetObjName(batObj)
+ if not batObj.IsAlive():
+ GameWorld.DebugLog(" 已被击杀不处理! %s" % (objName))
+ continue
+ GameWorld.DebugLog(" 重置武将: %s, HP:%s/%s, XP:%s" % (objName, batObj.GetHP(), batObj.GetMaxHP(), batObj.GetXP()))
+
+ # 清除buff
+ buffMgr = batObj.GetBuffManager()
+ buffMgr.ClearBuff()
+
+ # 重置CD
+
+ # 重刷属性、被动
+ TurnBuff.RefreshBuffAttr(batObj)
+ TurnPassive.RefreshPassive(batObj)
+
+ return
+
#// B4 10 回合制战斗 #tagCMTurnFight
#
#struct tagCMTurnFight
@@ -836,7 +872,7 @@
turnFight.lineupIndex = index
GameWorld.DebugLog("对战NPC阵容: index=%s, lineupID=%s" % (index, lineupID))
if index > 0:
- turnFight.nextTurnFight()
+ turnFight.nextTurnFight(resetByNextTeam=True)
turnFight.setFactionLineup(ChConfig.Def_FactionB, {1:GetNPCLineupInfo(lineupID, strongerLV, difficulty)})
turnFight.sortActionQueue()
turnFight.startFight()
@@ -1006,9 +1042,9 @@
if winFaction:
nextLineupID = turnFight.nextLineupID()
if nextLineupID:
- GameWorld.DebugLog("---开始进入下一小队: lineupIndex=%s,nextLineupID=%s,%s" % (turnFight.lineupIndex, nextLineupID, turnFight.npcLineupIDList))
+ GameWorld.DebugLog("---开始进入下一小队: lineupIndex=%s,nextLineupID=%s,%s" % (turnFight.lineupIndex, nextLineupID, turnFight.lineupIDList))
- turnFight.nextTurnFight()
+ turnFight.nextTurnFight(resetByNextTeam=True)
# 切换小队时,玩家阵容不需要处理,保留状态
turnFight.setFactionLineup(ChConfig.Def_FactionB, {1:GetNPCLineupInfo(nextLineupID, turnFight.strongerLV, turnFight.difficulty)})
turnFight.sortActionQueue()
--
Gitblit v1.8.0