From 23876f36a929f7e8f1fe94ae543b03bc24a61f1e Mon Sep 17 00:00:00 2001
From: hxp <ale99527@vip.qq.com>
Date: 星期二, 25 二月 2025 20:24:08 +0800
Subject: [PATCH] 10263 【越南】【英文】【BT】【GM】【砍树】后端支持NPC仿真实玩家战斗和快速战斗(镜像回收时同步清除地图中缓存的镜像被动buff效果;)
---
ServerPython/CoreServerGroup/GameServer/Script/Player/PlayerCharm.py | 24 ++++++++++++++++++++++++
1 files changed, 24 insertions(+), 0 deletions(-)
diff --git a/ServerPython/CoreServerGroup/GameServer/Script/Player/PlayerCharm.py b/ServerPython/CoreServerGroup/GameServer/Script/Player/PlayerCharm.py
index dd31438..def7d09 100644
--- a/ServerPython/CoreServerGroup/GameServer/Script/Player/PlayerCharm.py
+++ b/ServerPython/CoreServerGroup/GameServer/Script/Player/PlayerCharm.py
@@ -17,6 +17,7 @@
import CommFunc
import ShareDefine
+import IpyGameDataPY
import PlayerControl
import ChPyNetSendPack
import PyGameDataStruct
@@ -175,6 +176,29 @@
charmValueRecMgr.charmValueRecDict[playerID] = {}
recTypeDataDict = charmValueRecMgr.charmValueRecDict[playerID]
+ dayCharmMax = IpyGameDataPY.GetFuncCfg("CharmCfg", 1)
+ couple = PyDataManager.GetDBPyCoupleManager().GetCouple(playerID)
+ coupleID = couple.GetCoupleID(playerID) if couple else 0
+ if dayCharmMax and offerPlayerID not in [playerID, coupleID]:
+ if CharmValueRecType_Day not in recTypeDataDict:
+ recTypeDataDict[CharmValueRecType_Day] = {}
+ dayOfferPlayerDict = recTypeDataDict[CharmValueRecType_Day]
+ dayFromOtherTotal = 0 # 今日非伴侣来源魅力
+ dayFromOtherList = []
+ for oID, recData in dayOfferPlayerDict.items():
+ if oID not in [playerID, coupleID]:
+ dayFromOtherTotal += recData.CharmValue
+ dayFromOtherList.append([oID, recData.CharmValue, dayFromOtherTotal])
+ if dayFromOtherTotal >= dayCharmMax:
+ GameWorld.Log("今日非自己或伴侣赠送获得魅力值已达上限! dayFromOtherTotal=%s >= %s, %s"
+ % (dayFromOtherTotal, dayCharmMax, dayFromOtherList), playerID)
+ return
+ canAddToday = dayCharmMax - dayFromOtherTotal
+ GameWorld.DebugLog("addValue=%s,canAddToday=%s,dayCharmMax=%s,dayFromOtherTotal=%s,%s"
+ % (addValue, canAddToday, dayCharmMax, dayFromOtherTotal, dayFromOtherList), playerID)
+ addValue = min(canAddToday, addValue)
+ GameWorld.DebugLog("实际增加: addValue=%s" % (addValue), playerID)
+
if playerID not in charmValueRecMgr.charmTotalDict:
charmValueRecMgr.charmTotalDict[playerID] = {}
recTypeValueDict = charmValueRecMgr.charmTotalDict[playerID]
--
Gitblit v1.8.0