From f2aeecf0a02b97418b762bd6ee518c33d3ae2685 Mon Sep 17 00:00:00 2001 From: hxp <ale99527@vip.qq.com> Date: 星期五, 12 九月 2025 10:22:35 +0800 Subject: [PATCH] 129 【战斗】战斗系统-服务端(新增演武场;支持机器人;支持PVP战斗;每场战斗结束后支持查看战斗回放;榜单优化存储玩家形象Value5;主线关卡榜支持;支持查看玩家;) --- ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerOnline.py | 47 +++++++++++++++++++++++++++++------------------ 1 files changed, 29 insertions(+), 18 deletions(-) diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerOnline.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerOnline.py index 73e7616..2f18a62 100644 --- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerOnline.py +++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerOnline.py @@ -156,6 +156,8 @@ # 主线战斗 self.mainFight = TurnAttack.MainFight(playerID) + + self._lastBatBufferInfo = [] # 最后一场战斗临时回放 ["guid", "buffer"] return def OnClear(self): @@ -246,6 +248,11 @@ GameWorld.DebugLog("武将物品养成更新索引: %s, 影响阵容:%s" % (itemIndexList, effLineupIDList), self.playerID) return effLineupIDList + + def GetLastBatBuffer(self): return self._lastBatBufferInfo + def SetLastBatBuffer(self, guid, batBuffer): + self._lastBatBufferInfo = [guid, batBuffer] + return class OnlineMgr(): ## 准在线玩家管理 @@ -468,10 +475,11 @@ elif skinIDList: skinID = skinIDList[0] + starMax = PlayerHero.GetHeroStarMax(heroItem) InitAddPer += qualityIpyData.GetInitAddPer() - LVAddPer += qualityIpyData.GetLVAddPer() * heroLV + LVAddPer += qualityIpyData.GetLVAddPer() * max(0, heroLV - 1) BreakLVAddPer += qualityIpyData.GetBreakLVAddPer() * breakLV - StarAddPer += qualityIpyData.GetStarAddPer() * star + StarAddPer += qualityIpyData.GetStarAddPer() * min(star, starMax) lineupHero = lineup.GetLineupHero(posNum) #if False: @@ -498,21 +506,6 @@ selfAttrDict[int(k)] = v heroSelfAttrInfo[heroID] = selfAttrDict - # 星级天赋 - starTalentAttrDict = {} - idCount = heroItem.GetUserAttrCount(ShareDefine.Def_IudetHeroTalentID) - lvCount = heroItem.GetUserAttrCount(ShareDefine.Def_IudetHeroTalentIDLV) - for aIndex in range(min(idCount, lvCount)): - talentID = heroItem.GetUserAttrByIndex(ShareDefine.Def_IudetHeroTalentID, aIndex) - talentLV = heroItem.GetUserAttrByIndex(ShareDefine.Def_IudetHeroTalentIDLV, aIndex) - stIpyData = IpyGameDataPY.GetIpyGameData("HeroTalent", talentID) - if not stIpyData: - continue - attrID = stIpyData.GetAttrID() - attrValue = stIpyData.GetAttrValue() * talentLV - starTalentAttrDict[attrID] = starTalentAttrDict.get(attrID, 0) + attrValue - heroStarTalentInfo[heroID] = starTalentAttrDict - # 突破潜能 breakAttrDict = {} breakIpyDataList = IpyGameDataPY.GetIpyGameDataList("HeroBreak", heroID) @@ -532,12 +525,15 @@ heroBreakAttrInfo[heroID] = breakAttrDict # 觉醒天赋 + maxUnlockSlot = IpyGameDataPY.GetFuncCfg("HeroStarTalent", 1) # 常规天赋槽个数 awakeTalentAttrDict = {} - awakeIpyDataList = IpyGameDataPY.GetIpyGameDataList("HeroAwake", heroID) + awakeIpyDataList = IpyGameDataPY.GetIpyGameDataListNotLog("HeroAwake", heroID) if awakeIpyDataList: for awakeIpyData in awakeIpyDataList: if awakeIpyData.GetAwakeLV() > awakeLV: break + unlockTalentSlot = awakeIpyData.GetUnlockTalentSlot() + maxUnlockSlot = max(maxUnlockSlot, unlockTalentSlot) attrIDList = awakeIpyData.GetAttrIDList() attrValueList = awakeIpyData.GetAttrValueList() for aIndex in range(min(len(attrIDList), len(attrValueList))): @@ -549,6 +545,21 @@ lineupHero.heroSkillIDList.append(skillID) heroAwakeTalentInfo[heroID] = awakeTalentAttrDict + # 星级天赋 + starTalentAttrDict = {} + idCount = heroItem.GetUserAttrCount(ShareDefine.Def_IudetHeroTalentID) + lvCount = heroItem.GetUserAttrCount(ShareDefine.Def_IudetHeroTalentIDLV) + for aIndex in range(min(idCount, lvCount, maxUnlockSlot)): # 重生导致已觉醒槽位失效时属性也无效 + talentID = heroItem.GetUserAttrByIndex(ShareDefine.Def_IudetHeroTalentID, aIndex) + talentLV = heroItem.GetUserAttrByIndex(ShareDefine.Def_IudetHeroTalentIDLV, aIndex) + stIpyData = IpyGameDataPY.GetIpyGameData("HeroTalent", talentID) + if not stIpyData: + continue + attrID = stIpyData.GetAttrID() + attrValue = stIpyData.GetAttrValue() * talentLV + starTalentAttrDict[attrID] = starTalentAttrDict.get(attrID, 0) + attrValue + heroStarTalentInfo[heroID] = starTalentAttrDict + # 羁绊统计 for fetterID in heroIpyData.GetFetterIDList(): if fetterID not in fetterHeroInfo: -- Gitblit v1.8.0