[bt]====名望特权修改
parent
901cd5ff6c
commit
2358e7b4f5
|
@ -82,6 +82,7 @@ function this.LoginConfimRequest()
|
|||
Network:SendMessageWithCallBack(MessageTypeProto_pb.LOGIN_CONFIRM_REQUEST, MessageTypeProto_pb.LOGIN_CONFIRM_RESPONSE, nil, function()
|
||||
--LogGreen("登录确认成功")
|
||||
end)
|
||||
DynamicActivityManager.ChangeMingWangLv()
|
||||
end
|
||||
|
||||
--请求玩家数据
|
||||
|
|
|
@ -12,7 +12,7 @@ function PrivilegeManager.InitPrivilegeData(data)
|
|||
for i = 1, #data do
|
||||
--[[data:从后端接受到的数据 data是个列表 列表元素的结构id与priviledge的id对应 usedTimes使用次数 endTime 有效时间]]
|
||||
this._PrivilegeInfoList[data[i].id] = { id = data[i].id, usedTimes = data[i].usedTimes, endTime = data[i].effectTime }
|
||||
--LogGreen(string.format("特权ID = %s, 使用了的次数 = %s, 结束时间 = %s", data[i].id, data[i].usedTimes, data[i].effectTime))
|
||||
LogGreen(string.format("特权ID = %s, 使用了的次数 = %s, 结束时间 = %s", data[i].id, data[i].usedTimes, data[i].effectTime))
|
||||
end
|
||||
|
||||
this._PrivilegeTypeList = {}
|
||||
|
@ -37,7 +37,7 @@ function PrivilegeManager.OnPrivilegeUpdate(data)
|
|||
--LogGreen("后端特权推送:")
|
||||
for i = 1, #data do
|
||||
this._PrivilegeInfoList[data[i].id] = { id = data[i].id, usedTimes = data[i].usedTimes, endTime = data[i].effectTime }
|
||||
-- LogGreen(string.format("特权ID = %s, 使用了的次数 = %s, 结束时间 = %s", data[i].id, data[i].usedTimes, data[i].effectTime))
|
||||
LogGreen(string.format("特权ID = %s, 使用了的次数 = %s, 结束时间 = %s", data[i].id, data[i].usedTimes, data[i].effectTime))
|
||||
-- 发送特权解锁事件
|
||||
Game.GlobalEvent:DispatchEvent(GameEvent.Privilege.OnPrivilegeUpdate, data[i].id)
|
||||
end
|
||||
|
@ -100,6 +100,8 @@ local function _CompareCondition(type, condition, value)
|
|||
return MonthCardManager.GetMonthCardIsOpen(MONTH_CARD_TYPE.MONTHCARD)
|
||||
elseif type==9 then --神尊等级解锁
|
||||
return GetShenzunLv() >= condition
|
||||
elseif type==10 then --名望特权等级
|
||||
return DynamicActivityManager.curLevel >= condition
|
||||
else
|
||||
return false
|
||||
end
|
||||
|
@ -409,6 +411,40 @@ function PrivilegeManager.GetShenZunAddByLv(_shenzunLv)
|
|||
return list
|
||||
end
|
||||
|
||||
---获取神尊特权加成
|
||||
function PrivilegeManager.GetMingWangAddByLv(_shenzunLv)
|
||||
local list = {}
|
||||
local configList = ConfigManager.GetAllConfigsDataByKey(ConfigName.PrivilegeTypeConfig, "UnlockType", 10)
|
||||
for _, config in ipairs(configList) do
|
||||
if config.isShowName == 1 then
|
||||
for _, condition in ipairs(config.Condition) do
|
||||
if condition[1] == _shenzunLv then
|
||||
local tValue = condition[2]
|
||||
-- 根据类型返回相应得数值
|
||||
if config.IfFloat == 1 then
|
||||
tValue = tValue
|
||||
elseif config.IfFloat == 2 then
|
||||
tValue = tValue / 10000
|
||||
else
|
||||
tValue = tValue / 100
|
||||
end
|
||||
-- 如果是功能解锁,且解锁
|
||||
if config.Type == 1 and tValue ~= 0 then
|
||||
tValue = ""
|
||||
end
|
||||
table.insert(list, {content = GetLanguageStrById(config.Name), value = tValue,id = config.Id, IfFloat = config.IfFloat})
|
||||
break
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
return list
|
||||
end
|
||||
|
||||
|
||||
|
||||
|
||||
-- 获取特权剩余时间(非计时特权返回0)
|
||||
function PrivilegeManager.GetPrivilegeLeftTime(privilegeType)
|
||||
local isActive = this.GetPrivilegeOpenStatus(privilegeType)
|
||||
|
|
Loading…
Reference in New Issue