From a075f7841fb2d0a3b32bf10c8bc2df5bf02d6acb Mon Sep 17 00:00:00 2001
From: hxp <ale99527@vip.qq.com>
Date: 星期日, 14 十二月 2025 14:24:28 +0800
Subject: [PATCH] 129 【战斗】战斗系统-服务端(贾诩所有技能;5022效果支持配置buff额外属性计算方式;)

---
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerBeauty.py |   53 +++++++++++++++++++----------------------------------
 1 files changed, 19 insertions(+), 34 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 413f347..e31417f 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerBeauty.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerBeauty.py
@@ -25,10 +25,9 @@
 import PlayerGoldRush
 import NetPackCommon
 import ItemControler
+import PyGameData
 import PlayerTask
 import FBCommon
-import ObjPool
-import PyGameData
 
 # 红颜解锁方式
 (
@@ -50,7 +49,7 @@
 EffType_BootyPer, # 1. 主线战利品上限提高百分比(对所有主线战利品生效)  Value:百分比
 EffType_ArenaItemEx, # 2. 演武场挑战胜利,概率额外获得1个物品的概率    TypeValue:物品ID  Value:概率
 EffType_TravelEnergy, # 3.游历体力上限增加     Value:增加上限
-EffType_FBZhanchuiAwardPer, # 4.白骨盈野扫荡奖励增加百分比     Value:百分比
+EffType_FBZhanchuiItemEx, # 4.白骨盈野扫荡额外物品奖励      TypeValue:物品ID  Value:数量
 ) = range(1, 1 + 4)
 
 def OnPlayerLogin(curPlayer):
@@ -188,7 +187,7 @@
             return
         
     elif unlockWay == UnlockWay_TravelCnt:
-        travelCnt = 0
+        travelCnt = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_TravelCnt)
         needTravelCnt = unlockNeedCnt
         if travelCnt < needTravelCnt:
             GameWorld.DebugLog("激活红颜所需游历次数不足! beautyID=%s,travelCnt=%s < %s" % (beautyID, travelCnt, needTravelCnt), playerID)
@@ -239,21 +238,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 +273,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" 
@@ -587,7 +572,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 +591,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 +604,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