xdh
2019-01-11 c310aeebcb242d5442128d86a670e5252228b007
5835 【后端】【1.5】物品每日使用次数共享
1个文件已修改
13 ■■■■ 已修改文件
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Item/ChItem.py 13 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Item/ChItem.py
@@ -571,13 +571,20 @@
    maxCnt = ItemCommon.GetCanUseCountDaily(curItem)
    if maxCnt <= 0:
        return -1
    curItemID = curItem.GetItemTypeID()
    useCnt = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_ItemUseCntToday % curItemID)
    for itemIDList in IpyGameDataPY.GetFuncEvalCfg('ShareUseCntItem'):
        if curItemID not in itemIDList:
            continue
        for itemID in itemIDList:
            if itemID == curItemID:
                continue
            useCnt += curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_ItemUseCntToday % itemID)
    
    itemID = curItem.GetItemTypeID()
    useCnt = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_ItemUseCntToday % itemID)
    canUseCnt = max(0, maxCnt - useCnt)
    
    if canUseCnt <= 0:
        GameWorld.DebugLog("已达到今日使用次数上限!itemID=%s,useCnt=%s,maxCnt=%s" % (itemID, useCnt, maxCnt))
        GameWorld.DebugLog("已达到今日使用次数上限!itemID=%s,useCnt=%s,maxCnt=%s" % (curItemID, useCnt, maxCnt))
        #PlayerControl.NotifyCode(curPlayer, notifyMark, [itemID])
        
    #GameWorld.DebugLog("物品ID(%s)今日已使用次数(%s), maxCnt=%s" % (itemID, useCnt, maxCnt))