|
|
@@ -222,17 +222,23 @@ end
|
|
|
|
|
|
-- 获取当前打开的钻石宝箱数量
|
|
|
local function TreasureChestLogic_GetAutoOpenNum(human)
|
|
|
+ if not human.db.TreasureChest then
|
|
|
+ TreasureChestLogic_CreateDB(human)
|
|
|
+ end
|
|
|
+
|
|
|
return human.db.TreasureChest.nOpenNum
|
|
|
end
|
|
|
|
|
|
-- 记录打开钻石宝箱数量
|
|
|
local function TreasureChestLogic_AddAutoNum(human, nType, nNum)
|
|
|
if TREASURECHEST_OPEN_AUTO_TYPE ~= nType then
|
|
|
+ print("[TreasureChestLogic_AddAutoNum] 类型不正确返回")
|
|
|
return
|
|
|
end
|
|
|
|
|
|
local nNowNum = TreasureChestLogic_GetAutoOpenNum(human)
|
|
|
if TREASURECHEST_OPEN_AUTO_NUM <= nNowNum then
|
|
|
+ print("[TreasureChestLogic_AddAutoNum] 数量已经足够 nNowNum = "..nNowNum)
|
|
|
return
|
|
|
end
|
|
|
|
|
|
@@ -252,9 +258,10 @@ function TreasureChestLogic_Query(human)
|
|
|
|
|
|
TreasureChestLogic_UpdatePointPrize(human)
|
|
|
|
|
|
- --table.print_lua_table(human.db.TreasureChest)
|
|
|
- --print("\n")
|
|
|
+ -- table.print_lua_table(human.db.TreasureChest)
|
|
|
+ -- print("\n")
|
|
|
|
|
|
+ --local nOpenNum = TreasureChestLogic_GetAutoOpenNum(human)
|
|
|
local tMsgData = Msg.gc.GC_TEEASURECHEST_QUERY
|
|
|
tMsgData.nNowPoint = TreasureChestLogic_GetDBPoint(human)
|
|
|
tMsgData.nAuto = TreasureChestLogic_GetAutoOpenNum(human) >= TREASURECHEST_OPEN_AUTO_NUM and 1 or 0
|
|
|
@@ -264,6 +271,8 @@ function TreasureChestLogic_Query(human)
|
|
|
local tBoxPointConf = TreasureChestLogic_GetPointConf()
|
|
|
local tBoxTypeConf = TreasureChestLogic_GetBoxTypeConf()
|
|
|
|
|
|
+ --print("[TreasureChestLogic_Query] nAuto = "..tMsgData.nAuto.." num = "..nOpenNum)
|
|
|
+
|
|
|
-- 下一阶段需要的积分信息
|
|
|
for nID, v in ipairs(tBoxPointConf) do
|
|
|
local nState = TreasureChestLogic_GetDBPointPrize(human, nID)
|
|
|
@@ -484,5 +493,7 @@ end
|
|
|
|
|
|
-- 购买终身月卡解锁自动开宝箱
|
|
|
function TreasureChestLogic_BuyOpenAuto(human)
|
|
|
+ --local nOpenNum = TreasureChestLogic_GetAutoOpenNum(human)
|
|
|
+ --print("[TreasureChestLogic_BuyOpenAuto] nOpenNum = "..nOpenNum)
|
|
|
TreasureChestLogic_AddAutoNum(human, TREASURECHEST_OPEN_AUTO_TYPE, TREASURECHEST_OPEN_AUTO_NUM)
|
|
|
end
|