From 09e416b2e9e97f4ac902bba159d9670ad066a8d5 Mon Sep 17 00:00:00 2001
From: hxp <ale99527@vip.qq.com>
Date: 星期五, 09 一月 2026 20:51:01 +0800
Subject: [PATCH] 247 【付费内容】特权卡-服务端(增加游历体力上限特权)

---
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerBeauty.py |   75 +++++++++++++++++++------------------
 1 files changed, 38 insertions(+), 37 deletions(-)

diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerBeauty.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerBeauty.py
index 3fe8f91..4900629 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerBeauty.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerBeauty.py
@@ -28,7 +28,6 @@
 import PyGameData
 import PlayerTask
 import FBCommon
-import ObjPool
 
 # 红颜解锁方式
 (
@@ -146,11 +145,13 @@
     if unlockWay == UnlockWay_Item:
         needItemID = unlockValue
         needItemCnt = unlockNeedCnt
-        itemCount = ItemControler.GetItemCountByID(curPlayer, needItemID)
-        if itemCount < needItemCnt:
-            GameWorld.DebugLog("激活红颜物品不足! beautyID=%s,needItemID=%s,itemCount=%s < %s" % (beautyID, needItemID, itemCount, needItemCnt), playerID)
+        
+        costItemIndexList, bindCnt, unBindCnt = ItemCommon.GetPackItemBindStateIndexInfo(curPlayer, needItemID, needItemCnt)
+        lackCnt = needItemCnt - bindCnt - unBindCnt
+        if lackCnt > 0:
+            GameWorld.DebugLog("激活红颜物品不足! beautyID=%s,needItemID=%s,needItemCnt=%s,lackCnt=%s" % (beautyID, needItemID, needItemCnt, lackCnt), playerID)
             return
-        ItemControler.DelItemCountByID(curPlayer, needItemID, needItemCnt)
+        ItemCommon.DelCostItemByBind(curPlayer, costItemIndexList, bindCnt, unBindCnt, needItemCnt, "Beauty")
         
     elif unlockWay == UnlockWay_TaskID:
         taskID = unlockValue
@@ -213,6 +214,18 @@
     SyncBeautyInfo(curPlayer, [beautyID])
     return
 
+def GetBeautyActCnt(curPlayer):
+    ## 红颜已激活总数
+    actCnt = 0
+    ipyDataMgr = IpyGameDataPY.IPY_Data()
+    for index in range(ipyDataMgr.GetBeautyCount()):
+        ipyData = ipyDataMgr.GetBeautyByIndex(index)
+        beautyID = ipyData.GetBeautyID()
+        if not GetBeautyState(curPlayer, beautyID):
+            continue
+        actCnt += 1
+    return actCnt
+
 #// B2 20 红颜好感度升级 #tagCSBeautyLVUP
 #
 #struct    tagCSBeautyLVUP
@@ -239,21 +252,15 @@
     quality = ipyData.GetBeautyQuality()
     curLV, curExp = GetBeautyLVInfo(curPlayer, beautyID)
     
-    isCommItem = True # 是否使用的常规通用物品
     commItemIDList = IpyGameDataPY.GetFuncEvalCfg("BeautyLVUP", 1)
     commExpList = IpyGameDataPY.GetFuncEvalCfg("BeautyLVUP", 2)
     if itemID in commItemIDList:
         index = commItemIDList.index(itemID)
         perExp = commExpList[index] if len(commExpList) > index else 0
     else:
-        isCommItem = False
-        unlockWay = ipyData.GetUnlockWay()
-        unlockValue = ipyData.GetUnlockValue()
-        if unlockWay != UnlockWay_Item:
-            GameWorld.DebugLog("非道具激活的不支持专属信物ID升级! beautyID=%s,unlockWay=%s" % (beautyID, unlockWay), playerID)
-            return
-        if itemID != unlockValue:
-            GameWorld.DebugLog("非该红颜专属信物ID! beautyID=%s,itemID=%s != %s" % (beautyID, itemID, unlockValue), playerID)
+        exclusiveItemID = ipyData.GetExclusiveItemID()
+        if itemID != exclusiveItemID:
+            GameWorld.DebugLog("非该红颜专属信物ID! beautyID=%s,itemID=%s != %s" % (beautyID, itemID, exclusiveItemID), playerID)
             return
         perExp = IpyGameDataPY.GetFuncCfg("BeautyLVUP", 3)
         
@@ -280,24 +287,16 @@
         if costItemCount < 1:
             return
         
-        if isCommItem:
-            costItemIndexList, bindCnt, unBindCnt = ItemCommon.GetPackItemBindStateIndexInfo(curPlayer, itemID, costItemCount)
-            lackCnt = costItemCount - bindCnt - unBindCnt
-            if lackCnt > 0:
-                costItemCount -= lackCnt
-                GameWorld.DebugLog("消耗道具不足,有多少消耗多少! itemID=%s,costItemCount=%s,bindCnt=%s,unBindCnt=%s,lackCnt=%s" 
-                                   % (itemID, costItemCount, bindCnt, unBindCnt, lackCnt))
-            # 扣除消耗
-            if costItemCount > 0:
-                ItemCommon.DelCostItemByBind(curPlayer, costItemIndexList, bindCnt, unBindCnt, costItemCount, "Beauty")
-        else:
-            itemCount = ItemControler.GetItemCountByID(curPlayer, itemID)
-            if itemCount < costItemCount:
-                costItemCount = itemCount
-                
-            if costItemCount > 0:
-                ItemControler.SetItemCountByID(curPlayer, itemID, itemCount - costItemCount)
-                
+        costItemIndexList, bindCnt, unBindCnt = ItemCommon.GetPackItemBindStateIndexInfo(curPlayer, itemID, costItemCount)
+        lackCnt = costItemCount - bindCnt - unBindCnt
+        if lackCnt > 0:
+            costItemCount -= lackCnt
+            GameWorld.DebugLog("消耗道具不足,有多少消耗多少! itemID=%s,costItemCount=%s,bindCnt=%s,unBindCnt=%s,lackCnt=%s" 
+                               % (itemID, costItemCount, bindCnt, unBindCnt, lackCnt))
+        # 扣除消耗
+        if costItemCount > 0:
+            ItemCommon.DelCostItemByBind(curPlayer, costItemIndexList, bindCnt, unBindCnt, costItemCount, "Beauty")
+            
     addExp = costItemCount * perExp
     updExp = curExp + addExp
     GameWorld.DebugLog("红颜加经验: beautyID=%s,quality=%s,curLV=%s,curExp=%s,addExp=%s,updExp=%s/%s,itemID=%s,costItemCount=%s,perExp=%s" 
@@ -314,7 +313,7 @@
     SyncBeautyInfo(curPlayer, [beautyID])
     
     # 有升级额外处理
-    if updLV > updLV:
+    if updLV > curLV:
         RefreshBeautyAttr(curPlayer)
         
     return
@@ -535,7 +534,9 @@
         effPerLVAdd = ipyData.GetEffPerLVAdd()
         if effType:
             effValue = effValue + effPerLVAdd * talentLV
-            effTypeDict[effType] = [effValue, effTypeValue]
+            if effType not in effTypeDict:
+                effTypeDict[effType] = [0, effTypeValue]
+            effTypeDict[effType][0] = effTypeDict[effType][0] + effValue
             #GameWorld.DebugLog("红颜特殊效果: beautyID=%s,effType=%s,talentLV=%s,%s" % (beautyID, effType, talentLV, effTypeDict), playerID)
             
         # 时装
@@ -587,7 +588,7 @@
         if not state and beautyIDList == None:
             continue
         lv, exp = GetBeautyLVInfo(curPlayer, beautyID)
-        beauty = ObjPool.GetPoolMgr().acquire(ChPyNetSendPack.tagSCBeauty)
+        beauty = ChPyNetSendPack.tagSCBeauty()
         beauty.BeautyID = beautyID
         beauty.State = state
         beauty.LV = lv
@@ -606,7 +607,7 @@
                 else:
                     if not skinInfo:
                         continue
-                beautySkin = ObjPool.GetPoolMgr().acquire(ChPyNetSendPack.tagSCBeautySkin)
+                beautySkin = ChPyNetSendPack.tagSCBeautySkin()
                 beautySkin.SkinID = skinID
                 beautySkin.State = 1 if IsBeautySkinCanUse(curPlayer, beautyID, skinID, ipyData) else 0
                 beautySkin.Used = GetBeautySkinUsed(curPlayer, skinID)
@@ -619,7 +620,7 @@
     if not beautyList:
         return
     
-    clientPack = ObjPool.GetPoolMgr().acquire(ChPyNetSendPack.tagSCBeautyInfo)
+    clientPack = ChPyNetSendPack.tagSCBeautyInfo()
     clientPack.BeautyList = beautyList
     clientPack.Count = len(clientPack.BeautyList)
     NetPackCommon.SendFakePack(curPlayer, clientPack)

--
Gitblit v1.8.0