From 97fef842ed56dfd7c7dd73f9c7acf20df55b9a23 Mon Sep 17 00:00:00 2001 From: hxp <ale99527@vip.qq.com> Date: 星期五, 05 九月 2025 11:35:20 +0800 Subject: [PATCH] 129 【战斗】战斗系统-服务端(优化主线掉落装备:改为按Boss类型掉落,祝福树区分不同的Boss类型掉落概率;分解装备按消耗的战锤进行均分计算分解所得;) --- ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerControl.py | 24 +++++++++++++++++++----- 1 files changed, 19 insertions(+), 5 deletions(-) diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerControl.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerControl.py index b74e0cb..d35a1a2 100644 --- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerControl.py +++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerControl.py @@ -2499,6 +2499,20 @@ NetPackCommon.SendFakePack(curPlayer, clientPack) return +def GetUnXiantaoCntEquip(curPlayer): + '''因为战锤对应装备是1个战锤可能对应多个装备掉落,所以分解装备的时候1个战锤需要支持可拆分 + 所以需要支持小数存储,暂定以支持3位小数存储 + ''' + return curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_UnXiantaoCntEquip) / 1000.0 +def AddUnXiantaoCntEquip(curPlayer, addCnt): + unXiantaoCntEquip = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_UnXiantaoCntEquip) + addCnt * 1000 + return NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_UnXiantaoCntEquip, unXiantaoCntEquip) +def SetUnXiantaoCntEquip(curPlayer, unXiantaoCntEquip): + ## 保存装备未结算战锤数,保留3位小数 + # @param unXiantaoCntEquip: 实际的未结算数量,支持小数 + unXiantaoCntEquip = int(round(unXiantaoCntEquip, 3) * 1000) # 保留3为小数 + return NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_UnXiantaoCntEquip, unXiantaoCntEquip) + ##玩家是否有钱款 # @param curPlayer 玩家实例 # @param TYPE_Price ,货币类型 @@ -2789,8 +2803,7 @@ unXiantaoCntExp = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_UnXiantaoCntExp) NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_UnXiantaoCntExp, unXiantaoCntExp + price) # 累加未结算战锤 - 装备 - unXiantaoCntEquip = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_UnXiantaoCntEquip) - NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_UnXiantaoCntEquip, unXiantaoCntEquip + price) + AddUnXiantaoCntEquip(curPlayer, price) # 累加未结算战锤 - 战利品 chapterID = GetMainLevelNowInfo(curPlayer)[0] chapterIpyData = IpyGameDataPY.GetIpyGameData("MainChapter", chapterID) @@ -4950,10 +4963,11 @@ if value == 0: curPlayer.NomalDictDelProperty(key, dType) - return + return 0 # 2^31 - 1 - curPlayer.NomalDictAddProperty(key, min(value, ChConfig.Def_UpperLimit_DWordEx), dType) - return + value = max(0, min(value, ChConfig.Def_UpperLimit_DWordEx)) + curPlayer.NomalDictAddProperty(key, value, dType) + return value ## 通知祝福值 def Sync_BlessValue(curPlayer, blessType, value, multiple=0): -- Gitblit v1.8.0