From acc06594fb3e4c4f158d2636858456d472d1d266 Mon Sep 17 00:00:00 2001
From: hxp <ale99527@vip.qq.com>
Date: 星期一, 17 十一月 2025 14:22:08 +0800
Subject: [PATCH] 129 【战斗】战斗系统-服务端(修复额外治疗计算bug;)
---
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Item/ItemControler.py | 21 +++++++++++++++++----
1 files changed, 17 insertions(+), 4 deletions(-)
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Item/ItemControler.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Item/ItemControler.py
index 0ef20d0..79539df 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Item/ItemControler.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Item/ItemControler.py
@@ -25,6 +25,7 @@
import traceback
import random
import ReadChConfig
+import PlayerActivity
import ChPyNetSendPack
import NetPackCommon
import PlayerXiangong
@@ -901,6 +902,18 @@
GameWorld.SendMsgToClientServer(ShareDefine.CrossServerMsg_PutInItem, itemMsg, [serverGroupID])
return
+ def __autoUseByEffectID(self, curPlayer, tagItem, itemEff, itemID, itemCount):
+ effectID = itemEff.GetEffectID()
+
+ # 物品碎片
+ if effectID == ChConfig.Def_Effect_ItemCount:
+ SetItemCountByID(curPlayer, itemID, GetItemCountByID(curPlayer, itemID) + itemCount)
+ # 活跃度
+ elif effectID == ChConfig.Def_Effect_AddActivity:
+ PlayerActivity.DoAddActivity(curPlayer, itemCount)
+
+ return
+
## 放入物品
# @param packIndex 背包索引
# @param tagItem 物品
@@ -939,11 +952,11 @@
# tagItem.Clear()
# return True
itemEff = tagItem.GetEffectByIndex(0)
- #物品碎片
- if itemEff.GetEffectID() == ChConfig.Def_Effect_ItemCount:
- SetItemCountByID(curPlayer, itemID, GetItemCountByID(curPlayer, itemID) + tagItemCount)
+ if itemEff.GetEffectID() in ChConfig.AutoUseItemEffectIDList:
+ self.__autoUseByEffectID(curPlayer, tagItem, itemEff, itemID, tagItemCount)
tagItem.Clear()
return True
+
#气运
if itemEff.GetEffectID() == ChConfig.Def_Effect_TiandaoQiyun:
isAutoUse = itemEff.GetEffectValue(1)
@@ -2179,7 +2192,7 @@
if itemData.GetItemTypeID() in ChConfig.Def_TransformItemIDList or itemData.GetType() == ChConfig.Def_ItemType_AutoUseMoney:
return True
itemEff = itemData.GetEffectByIndex(0)
- if itemEff.GetEffectID() == ChConfig.Def_Effect_ItemCount:
+ if itemEff.GetEffectID() in ChConfig.AutoUseItemEffectIDList:
return True
return False
--
Gitblit v1.8.0