diff --git a/Assets/ManagedResources/~Lua/Common/functions.lua b/Assets/ManagedResources/~Lua/Common/functions.lua index b67922f3d5..936293e3e6 100644 --- a/Assets/ManagedResources/~Lua/Common/functions.lua +++ b/Assets/ManagedResources/~Lua/Common/functions.lua @@ -2788,6 +2788,24 @@ function CheckGMIsOpen(type,value) end +function GetTaiChuPriLv() + local lv=0 + local datas=ConfigManager.GetAllConfigsDataByKey(ConfigName.GMMaster,"Type",9) + if datas then + table.sort(datas,function(a,b) + return a.Id= condition elseif type==11 then - -- body + + elseif type==12 then + return GetTaiChuPriLv() >= condition else return false end @@ -138,6 +140,9 @@ function PrivilegeManager.GetPrivilegeNumberById(privilegeId, value) if not _CompareCondition(unlockType, condition[1], value) then break end -- 保存当前值 tValue = condition[2] + -- if privilegeId==4 or privilegeId==33 then + -- LogError("tValue==========="..tValue) + -- end end -- 根据类型返回相应得数值 if privilegeData.IfFloat == 1 then @@ -155,14 +160,25 @@ function PrivilegeManager.GetPrivilegeNumber(privilegeType, conValue) local privilegeList = this._PrivilegeTypeList[privilegeType] if not privilegeList then return 0 end local value = 0 + -- if privilegeType==4 or privilegeType==33 then + -- LogError("privilegeType==========="..privilegeType) + -- end + for _, config in ipairs(privilegeList) do local privilegeId = config.Id + -- if privilegeType==4 or privilegeType==33 then + -- LogError("id=============="..privilegeId) + -- end local v = this.GetPrivilegeNumberById(privilegeId, conValue) -- -1表示一直存在,无限次数 if v < 0 then return v end -- 所有值相同类型值相加 value = value + v end + -- if privilegeType==4 or privilegeType==33 then + -- LogError("value=============="..value) + -- end + return value end @@ -222,7 +238,6 @@ end function PrivilegeManager.GetPrivilegeRemainValue(privilegeType) local originalValue = this.GetPrivilegeNumber(privilegeType) local usedTimes = this.GetPrivilegeUsedTimes(privilegeType) - --LogBlue(string.format("originalValue:%s, usedTimes:%s",tostring(originalValue),tostring(usedTimes))) local remainNum = originalValue - usedTimes -- 剩余次数不会小于0,修正 if remainNum < 0 then