| | |
| | |
|
| | | import CommFunc
|
| | | import ShareDefine
|
| | | import IpyGameDataPY
|
| | | import PlayerControl
|
| | | import ChPyNetSendPack
|
| | | import PyGameDataStruct
|
| | |
| | | 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]
|