From c2d5e79d7266670f262f1d922fd0f357ac6a026c Mon Sep 17 00:00:00 2001
From: hxp <ale99527@vip.qq.com>
Date: 星期二, 11 十一月 2025 11:35:06 +0800
Subject: [PATCH] 121 【武将】武将系统-服务端(优化寻宝定制第x次x抽必出逻辑;)

---
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerTreasure.py |   24 ++++++++++++------------
 1 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerTreasure.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerTreasure.py
index cebd907..d2f2a7a 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerTreasure.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerTreasure.py
@@ -249,11 +249,9 @@
         beSureCountByIndexDict = beSureCountByIndexList[treasureIndex]
         maxIndexCount = min(9, max(beSureCountByIndexDict))
         curIndexCount = GameWorld.GetDataByDigitPlace(treasureCountEx, treasureIndex) + 1
-    rateByIndexCount = 0 # 第x次x抽必出可产出个数
-    rateByIndexCountList = []
+    beSureCountByIndexCfg = []
     if curIndexCount <= maxIndexCount and curIndexCount in beSureCountByIndexDict:
-        rateByIndexCountList = [[10000, beSureCountByIndexDict[curIndexCount]]]
-        rateByIndexCount = 1 # 可扩展支持产出多个,暂定单次抽奖仅定制产出1个
+        beSureCountByIndexCfg = beSureCountByIndexDict[curIndexCount]
         
     # 单抽产出优先级: 幸运物品 > 必出 > 保底 > 普通
     # 连抽没有优先级限制,只要满足条件即可产出
@@ -275,8 +273,17 @@
         
         curRateList = [] # 可能会改变饼图,每次抽奖使用新的饼图对象,不要改变配置的饼图概率
         
+        # 第x次x抽必出,优先级最高,无视其他
+        if not curRateList and beSureCountByIndexCfg:
+            if tIndex == 0:
+                curRateList = [[10000, beSureCountByIndexCfg[0]]]
+            else:
+                curRateList = beSureCountByIndexCfg[1]
+            GameWorld.DebugLog("    【第x次x抽必出】: treasureIndex=%s,curIndexCount=%s,%s" 
+                               % (treasureIndex, curIndexCount, curRateList), playerID)
+            
         # 满幸运必出
-        if stageLuck and updLuck >= stageLuck and luckItemRateList:
+        if not curRateList and stageLuck and updLuck >= stageLuck and luckItemRateList:
             curRateList = GetRemoveLimitGridRateList(luckItemRateList, gridNumCountInfo, gridNumMaxLimitInfo)
             GameWorld.DebugLog("    【满幸运必出饼图】: %s" % curRateList, playerID)
             
@@ -290,13 +297,6 @@
         if not curRateList and ensureCount and updTreasureCount % ensureCount == 0 and ensureRateList:
             curRateList = GetRemoveLimitGridRateList(ensureRateList, gridNumCountInfo, gridNumMaxLimitInfo)
             GameWorld.DebugLog("    【满%s次数必出饼图】: %s" % (ensureCount, curRateList), playerID)
-            
-        # 第x次x抽必出,优先级较低
-        if not curRateList and rateByIndexCountList and rateByIndexCount > 0:
-            rateByIndexCount -= 1
-            curRateList = rateByIndexCountList
-            GameWorld.DebugLog("    【第x次x抽必出】: treasureIndex=%s,curIndexCount=%s,rateByIndexCount=%s,%s" 
-                               % (treasureIndex, curIndexCount, rateByIndexCount, rateByIndexCountList), playerID)
             
         doCount = 0
         while doCount <= 50: # 限制最大次数

--
Gitblit v1.8.0