Commit 0e3ab88d04e95b0378457c1b2d17da34e701a6a6

Authored by zhouhaihai
1 parent 76dc6fb7

中继层

@@ -60,7 +60,7 @@ ItemType = { @@ -60,7 +60,7 @@ ItemType = {
60 --在这个里面的会记录的是功能开放 对应类型open 而不是 ID 60 --在这个里面的会记录的是功能开放 对应类型open 而不是 ID
61 FuncOpenType = { 61 FuncOpenType = {
62 AdvEndless = 2, -- 无尽模式 62 AdvEndless = 2, -- 无尽模式
63 - AdvRelay = 3, -- 中继开放 63 + AdvRelay = 3, -- 中继开放 -- 删掉了
64 AdvWS = 6, -- 工坊解锁 64 AdvWS = 6, -- 工坊解锁
65 AdvWheelSurf = 7, -- 抽奖解锁 65 AdvWheelSurf = 7, -- 抽奖解锁
66 TimeBoxSlot = 8, -- 时钟箱槽 66 TimeBoxSlot = 8, -- 时钟箱槽
@@ -102,6 +102,9 @@ AdvSpecialStage = { @@ -102,6 +102,9 @@ AdvSpecialStage = {
102 [2] = "Out", 102 [2] = "Out",
103 [3] = "BOSS", 103 [3] = "BOSS",
104 [4] = "LinkChoose", 104 [4] = "LinkChoose",
  105 + [5] = "Exit",
  106 + [6] = "InOut",
  107 + [7] = "Diner"
105 } 108 }
106 --客户端需要知道这个 109 --客户端需要知道这个
107 AdvEventType = { 110 AdvEventType = {
@@ -110,6 +113,11 @@ AdvEventType = { @@ -110,6 +113,11 @@ AdvEventType = {
110 Out = -2, --出口 113 Out = -2, --出口
111 BOSS = -3, -- boss 114 BOSS = -3, -- boss
112 LinkChoose = -4, -- 连续选择 115 LinkChoose = -4, -- 连续选择
  116 + Exit = -5, -- 中继点专属退出出口
  117 + InOut = -6, -- 出入口集合体
  118 + Diner = -7, -- 料理台
  119 +
  120 +
113 -- 普通事件(随机) 121 -- 普通事件(随机)
114 Choose = 1, --选择点 122 Choose = 1, --选择点
115 Drop = 2, --物品掉落点 123 Drop = 2, --物品掉落点
src/actions/AdvAction.lua
@@ -91,36 +91,32 @@ function _M.startAdvRpc( agent, data ) @@ -91,36 +91,32 @@ function _M.startAdvRpc( agent, data )
91 local chapterData = csvdb["adv_chapterCsv"][chapterId] 91 local chapterData = csvdb["adv_chapterCsv"][chapterId]
92 if not chapterData or layer < 1 then return 1 end 92 if not chapterData or layer < 1 then return 1 end
93 93
94 - --是否是中继层  
95 - if (layer - 1) % globalCsv.adv_can_out_layer_pre ~= 0 then return 3 end  
96 -  
97 local advPass = role:getProperty("advPass") 94 local advPass = role:getProperty("advPass")
98 - if AdvCommon.isEndless(chapterId) then 95 +
  96 + if AdvCommon.isEndless(chapterId) then -- 无尽模式判断
  97 +
99 if chapterId ~= role.advElChapter then return end -- 不是当前进行的章节 98 if chapterId ~= role.advElChapter then return end -- 不是当前进行的章节
100 if not isOpenEndless(role) then return end 99 if not isOpenEndless(role) then return end
  100 +
101 if role.dailyData:getProperty("advElC") >= role:getAdvElLimit() then return 2 end -- 是否有体力 101 if role.dailyData:getProperty("advElC") >= role:getAdvElLimit() then return 2 end -- 是否有体力
102 - if not role:isFuncOpen(FuncOpenType.AdvEndless) or not role:isFuncOpen(FuncOpenType.AdvRelay) then return 11 end -- 开放了中继模式 和 无尽模式 才可以玩儿无尽模式  
103 - local maxl = math.floor(role:getProperty("advElM") / 10) * 10  
104 - local openLayer = {}  
105 - for i = 0, (globalCsv.adv_endless_open_relay - 1) do  
106 - local l = maxl - i * globalCsv.adv_can_out_layer_pre  
107 - if l < 0 then  
108 - break  
109 - end  
110 - openLayer[l] = 1  
111 - end  
112 - if not openLayer[layer - 1] then return 10 end 102 + if not role:isFuncOpen(FuncOpenType.AdvEndless) then return 11 end -- 无尽模式 才可以玩儿无尽模式
  103 +
  104 + local advElM = role:getProperty("advElM") --最高通关的层数
113 105
114 if layer == 1 then 106 if layer == 1 then
115 if not role:advChapterIsOpen(chapterId, layer) then return 13 end 107 if not role:advChapterIsOpen(chapterId, layer) then return 13 end
  108 + else
  109 + local relayData = role:getAdvData():isHaveRelay(layer, chapterId)
  110 + if not relayData then return end -- 不是中继层
  111 + if advElM < relayData.unlockfloor then return end --未解锁
116 end 112 end
117 - else 113 + else -- 普通模式判断
118 if role.dailyData:getProperty("advC") >= role:getAdvHangLimit() then return 2 end -- 是否有体力 114 if role.dailyData:getProperty("advC") >= role:getAdvHangLimit() then return 2 end -- 是否有体力
119 if layer > chapterData.limitlevel then return 4 end 115 if layer > chapterData.limitlevel then return 4 end
120 -- 关卡开放判断 116 -- 关卡开放判断
121 if not role:advChapterIsOpen(chapterId, layer) then return 5 end 117 if not role:advChapterIsOpen(chapterId, layer) then return 5 end
122 - --中继开放判断  
123 - if layer ~= 1 and (not role:isFuncOpen(FuncOpenType.AdvRelay) or (advPass[chapterId] or 0) < (layer - 1)) then return 6 end 118 + -- 普通模式没有中继 只能从1 开始 中继开放判断
  119 + if layer ~= 1 then return 6 end
124 end 120 end
125 121
126 if not checkFormat(role, format) then return 7 end 122 if not checkFormat(role, format) then return 7 end
@@ -141,7 +137,7 @@ function _M.startAdvRpc( agent, data ) @@ -141,7 +137,7 @@ function _M.startAdvRpc( agent, data )
141 role.dailyData:updateProperty({field = "advC", delta = 1}) 137 role.dailyData:updateProperty({field = "advC", delta = 1})
142 end 138 end
143 139
144 - role:getAdvData():initByChapter(chapterId, layer) 140 + role:getAdvData():initByChapter(chapterId, layer, false, false, layer ~= 1, true)
145 role:checkTaskEnter("AdvStart", {id = chapterId}) 141 role:checkTaskEnter("AdvStart", {id = chapterId})
146 role:checkTaskEnter("AdvStartSelf", {id = chapterId}) 142 role:checkTaskEnter("AdvStartSelf", {id = chapterId})
147 SendPacket(actionCodes.Adv_startAdvRpc, '') 143 SendPacket(actionCodes.Adv_startAdvRpc, '')
@@ -241,10 +237,10 @@ function _M.buyAdvCountRpc(agent , data) @@ -241,10 +237,10 @@ function _M.buyAdvCountRpc(agent , data)
241 local isEl = msg.isEl -- 是否是无尽模式 237 local isEl = msg.isEl -- 是否是无尽模式
242 local cost 238 local cost
243 if isEl then 239 if isEl then
244 - if math.illegalNum(count, 1, math.min(globalCsv.adv_endless_daily_buy_count - role.dailyData:getProperty("advElBC"), role.dailyData:getProperty("advElC"))) then return end 240 + if math.illegalNum(count, 1, globalCsv.adv_endless_daily_buy_count - role.dailyData:getProperty("advElBC")) then return end
245 cost = {[ItemId.Diamond] = count * globalCsv.adv_endless_daily_buy_cost} 241 cost = {[ItemId.Diamond] = count * globalCsv.adv_endless_daily_buy_cost}
246 else 242 else
247 - if math.illegalNum(count, 1, math.min(globalCsv.adv_daily_buy_count - role.dailyData:getProperty("advBC"), role.dailyData:getProperty("advC"))) then return end 243 + if math.illegalNum(count, 1, globalCsv.adv_daily_buy_count - role.dailyData:getProperty("advBC")) then return end
248 cost = {[ItemId.Diamond] = count * globalCsv.adv_daily_buy_cost} 244 cost = {[ItemId.Diamond] = count * globalCsv.adv_daily_buy_cost}
249 end 245 end
250 246
@@ -31,6 +31,7 @@ function Adv:initByInfo(advInfo) @@ -31,6 +31,7 @@ function Adv:initByInfo(advInfo)
31 self.level = advInfo.level or 1 31 self.level = advInfo.level or 1
32 self.round = advInfo.round or 0 32 self.round = advInfo.round or 0
33 self.score = advInfo.score or {} 33 self.score = advInfo.score or {}
  34 + self.isRelay = advInfo.isRelay
34 self.lastEnemyId = advInfo.lastEId or 1 35 self.lastEnemyId = advInfo.lastEId or 1
35 self.mapStack = advInfo.mstack or {} 36 self.mapStack = advInfo.mstack or {}
36 self.lchoose = advInfo.lch or {} 37 self.lchoose = advInfo.lch or {}
@@ -45,9 +46,23 @@ function Adv:initByInfo(advInfo) @@ -45,9 +46,23 @@ function Adv:initByInfo(advInfo)
45 46
46 self:initBattle() 47 self:initBattle()
47 end 48 end
  49 +-- 找出level 是否存在中继层
  50 +function Adv:isHaveRelay(level, chapterId)
  51 + level = chapterId or self.level
  52 + chapterId = chapterId or self.chapterId
  53 + if level == 1 then return end
  54 +
  55 + local campsiteCsv = csvdb["adv_chapter_campsiteCsv"][chapterId]
  56 + for _, campsite in ipairs(campsiteCsv) do
  57 + if campsite.floor == level then
  58 + return campsite
  59 + end
  60 + end
  61 + return nil
  62 +end
48 63
49 -- 随机新的地图 64 -- 随机新的地图
50 -function Adv:initByChapter(chapterId, level, isToNext, notNotify) 65 +function Adv:initByChapter(chapterId, level, isToNext, notNotify, isRelay, isEnter)
51 if not self.chapterId then -- 开始新的章节 66 if not self.chapterId then -- 开始新的章节
52 self.chapterId = chapterId 67 self.chapterId = chapterId
53 self:checkAchievement(Adv.AchievType.StartBattle, 1) 68 self:checkAchievement(Adv.AchievType.StartBattle, 1)
@@ -65,9 +80,33 @@ function Adv:initByChapter(chapterId, level, isToNext, notNotify) @@ -65,9 +80,33 @@ function Adv:initByChapter(chapterId, level, isToNext, notNotify)
65 self.shopStatus = self.shopStatus or {} 80 self.shopStatus = self.shopStatus or {}
66 81
67 -- 随机出地图 82 -- 随机出地图
68 - local mapId = self:randomMapId(chapterId, level) 83 + local mapId
  84 + if isRelay then
  85 + local relayData = self:isHaveRelay(level, chapterId)
  86 + if relayData then
  87 + mapId = relayData.map
  88 + else
  89 + isRelay = false
  90 + mapId = self:randomMapId(chapterId, level)
  91 + end
  92 + else
  93 + mapId = self:randomMapId(chapterId, level)
  94 + end
  95 + self.isRelay = isRelay
  96 + local isNewRelay = false
  97 + if self.isRelay then -- 中继层
  98 + local advRelay = self.owner:getProperty("advRelay")
  99 + local chapter = self:isEndless() and -1 or self.chapterId
  100 + if not (advRelay[chapter] or {})[self.level] then
  101 + isNewRelay = true
  102 + advRelay[chapter] = advRelay[chapter] or {}
  103 + advRelay[chapter][self.level] = 1
  104 + self.owner:updateProperty({field = advRelay, value = advRelay})
  105 + end
  106 + end
  107 +
69 self.maps = {} 108 self.maps = {}
70 - self.maps[1] = AdvMap.new(self, 1, mapId) 109 + self.maps[1] = AdvMap.new(self, 1, mapId, isEnter, isNewRelay)
71 110
72 self:initBattle() 111 self:initBattle()
73 112
@@ -95,6 +134,7 @@ function Adv:clear() @@ -95,6 +134,7 @@ function Adv:clear()
95 self.maps = {} 134 self.maps = {}
96 self.battle = nil 135 self.battle = nil
97 self.waitArtifact = nil 136 self.waitArtifact = nil
  137 + self.isRelay = nil
98 self.cacheUnlock = {} 138 self.cacheUnlock = {}
99 self.shopStatus = {} 139 self.shopStatus = {}
100 end 140 end
@@ -128,6 +168,7 @@ function Adv:saveDB(notNotify) @@ -128,6 +168,7 @@ function Adv:saveDB(notNotify)
128 advInfo.level = self.level 168 advInfo.level = self.level
129 advInfo.round = self.round 169 advInfo.round = self.round
130 advInfo.score = self.score 170 advInfo.score = self.score
  171 + advInfo.isRelay = self.isRelay
131 advInfo.lastEId = self.lastEnemyId 172 advInfo.lastEId = self.lastEnemyId
132 advInfo.mstack = self.mapStack 173 advInfo.mstack = self.mapStack
133 advInfo.lch = self.lchoose 174 advInfo.lch = self.lchoose
@@ -586,14 +627,12 @@ local function clickOut(self, room, block, params) @@ -586,14 +627,12 @@ local function clickOut(self, room, block, params)
586 self.owner:changeUpdates({{type = "advPass", field = self.chapterId, value = self.level}}) 627 self.owner:changeUpdates({{type = "advPass", field = self.chapterId, value = self.level}})
587 end 628 end
588 end 629 end
589 - if params.relay then  
590 - if self.level % globalCsv.adv_can_out_layer_pre ~= 0 or not self.owner:isFuncOpen(FuncOpenType.AdvRelay) then return end  
591 - end  
592 - 630 +
593 self:checkAchievement(Adv.AchievType.OverWin, 1, self.level) 631 self:checkAchievement(Adv.AchievType.OverWin, 1, self.level)
594 self:checkAdvUnlock(2, self.level) 632 self:checkAdvUnlock(2, self.level)
595 local levellimit = csvdb["adv_chapterCsv"][self.chapterId].limitlevel 633 local levellimit = csvdb["adv_chapterCsv"][self.chapterId].limitlevel
596 - if params.relay or (not self:isEndless() and (self.level >= levellimit or not self.owner:advChapterIsOpen(self.chapterId, self.level + 1))) then --关卡结束 634 +
  635 + if not self:isEndless() and (self.level >= levellimit or not self.owner:advChapterIsOpen(self.chapterId, self.level + 1)) then --关卡结束
597 self:over(true, not self:isEndless() and self.level >= levellimit) 636 self:over(true, not self:isEndless() and self.level >= levellimit)
598 else 637 else
599 self.battle.player:triggerPassive(Passive.DOWN_LAYER) 638 self.battle.player:triggerPassive(Passive.DOWN_LAYER)
@@ -601,7 +640,12 @@ local function clickOut(self, room, block, params) @@ -601,7 +640,12 @@ local function clickOut(self, room, block, params)
601 if curFloorData then 640 if curFloorData then
602 self:backReward(self:award({[ItemId.AdvPoint] = curFloorData.exp})) 641 self:backReward(self:award({[ItemId.AdvPoint] = curFloorData.exp}))
603 end 642 end
604 - self:initByChapter(self.chapterId, self.level + 1, true, true) 643 + local isHaveRelay = self:isHaveRelay(self.level)
  644 + if isHaveRelay and not self.isRelay then
  645 + self:initByChapter(self.chapterId, self.level, true, true, true, false)
  646 + else
  647 + self:initByChapter(self.chapterId, self.level + 1, true, true, false, false)
  648 + end
605 self:backNext() --下一关 649 self:backNext() --下一关
606 end 650 end
607 651
@@ -611,6 +655,11 @@ local function clickOut(self, room, block, params) @@ -611,6 +655,11 @@ local function clickOut(self, room, block, params)
611 end 655 end
612 end 656 end
613 657
  658 +local function clickExit(self, room, block, params)
  659 + self:over(true, not self:isEndless() and self.level >= levellimit)
  660 + return true
  661 +end
  662 +
614 --战斗 普通攻击 663 --战斗 普通攻击
615 local function clickMonster(self, room, block, params) 664 local function clickMonster(self, room, block, params)
616 self.battle:battleBegin(room.roomId, block.blockId, params) 665 self.battle:battleBegin(room.roomId, block.blockId, params)
@@ -937,6 +986,8 @@ end @@ -937,6 +986,8 @@ end
937 986
938 local eventCallFunc = { 987 local eventCallFunc = {
939 [AdvEventType.Out] = clickOut, 988 [AdvEventType.Out] = clickOut,
  989 + [AdvEventType.InOut] = clickOut,
  990 + [AdvEventType.Exit] = clickExit,
940 [AdvEventType.BOSS] = clickMonster, 991 [AdvEventType.BOSS] = clickMonster,
941 [AdvEventType.Monster] = clickMonster, 992 [AdvEventType.Monster] = clickMonster,
942 [AdvEventType.Choose] = clickChoose, 993 [AdvEventType.Choose] = clickChoose,
@@ -991,7 +1042,7 @@ function Adv:clickBlock(roomId, blockId, params) @@ -991,7 +1042,7 @@ function Adv:clickBlock(roomId, blockId, params)
991 end 1042 end
992 local needChange = true 1043 local needChange = true
993 if clickEvent and block.event then 1044 if clickEvent and block.event then
994 - if block:getEventType() == AdvEventType.Out then 1045 + if block:getEventType() == AdvEventType.Out or block:getEventType() == AdvEventType.InOut or block:getEventType() == AdvEventType.Exit then
995 needChange = false 1046 needChange = false
996 end 1047 end
997 end 1048 end
src/adv/AdvBattle.lua
@@ -63,6 +63,10 @@ function Battle:initPlayer() @@ -63,6 +63,10 @@ function Battle:initPlayer()
63 63
64 player = {} 64 player = {}
65 player.level = 1 65 player.level = 1
  66 + if self.adv.level ~= 1 then
  67 + local relayData = self.adv:isHaveRelay()
  68 + player.level = relayData.level
  69 + end
66 player.exp = 0 70 player.exp = 0
67 player.sp = getAdvLvAttrUp(advAddAttrs, "sp", 100) 71 player.sp = getAdvLvAttrUp(advAddAttrs, "sp", 100)
68 player.growth = {} 72 player.growth = {}
@@ -89,6 +93,7 @@ function Battle:initPlayer() @@ -89,6 +93,7 @@ function Battle:initPlayer()
89 end 93 end
90 player[attrName] = getAdvLvAttrUp(advAddAttrs, attrName, player[attrName]) 94 player[attrName] = getAdvLvAttrUp(advAddAttrs, attrName, player[attrName])
91 player.growth[attrName] = player[attrName] * 0.025 95 player.growth[attrName] = player[attrName] * 0.025
  96 + player[attrName] = player[attrName] + player.growth[attrName] * (player.level - 1)
92 end 97 end
93 98
94 player.hpMax = player.hp or 0 99 player.hpMax = player.hp or 0
src/adv/AdvMap.lua
@@ -8,10 +8,10 @@ local Map = class(&quot;AdvMap&quot;) @@ -8,10 +8,10 @@ local Map = class(&quot;AdvMap&quot;)
8 local createMap, getEventLib 8 local createMap, getEventLib
9 9
10 10
11 -function Map:ctor(adv, mapIdx, mapInfo) 11 +function Map:ctor(adv, mapIdx, mapInfo, isEnter, isNewRelay)
12 self.adv = adv 12 self.adv = adv
13 if type(mapInfo) == "number" then -- mapInfo 传入 id 13 if type(mapInfo) == "number" then -- mapInfo 传入 id
14 - mapInfo = createMap(self, mapInfo) -- 生成地图 14 + mapInfo = createMap(self, mapInfo, isEnter, isNewRelay) -- 生成地图
15 end 15 end
16 if not mapInfo then return end 16 if not mapInfo then return end
17 17
@@ -217,7 +217,8 @@ end @@ -217,7 +217,8 @@ end
217 217
218 -----------------------------随机地图----------------------------- 218 -----------------------------随机地图-----------------------------
219 219
220 -createMap = function(self, mapId) 220 +-- isEnter isNewRelay 区分中继层的类型 --是否是开始进入 是否是第一次进入
  221 +createMap = function(self, mapId, isEnter, isNewRelay)
221 local mapInfo = {} 222 local mapInfo = {}
222 mapInfo.rooms = {} 223 mapInfo.rooms = {}
223 mapInfo.mapId = mapId 224 mapInfo.mapId = mapId
@@ -260,6 +261,18 @@ createMap = function(self, mapId) @@ -260,6 +261,18 @@ createMap = function(self, mapId)
260 randomFunc[AdvEventType.In] = function()end 261 randomFunc[AdvEventType.In] = function()end
261 --出口 262 --出口
262 randomFunc[AdvEventType.Out] = function() end 263 randomFunc[AdvEventType.Out] = function() end
  264 + --中继点出口
  265 + randomFunc[AdvEventType.Exit] = function()
  266 + if not self.adv.isRelay or isEnter then return false end
  267 + end
  268 + --开放出口
  269 + randomFunc[AdvEventType.InOut] = function() end
  270 +
  271 + --开放出口
  272 + randomFunc[AdvEventType.Diner] = function()
  273 + if not self.adv.isRelay or isEnter or isNewRelay then return false end
  274 + end
  275 +
263 --boss 276 --boss
264 randomFunc[AdvEventType.BOSS] = function() 277 randomFunc[AdvEventType.BOSS] = function()
265 if haveBoss then return false end 278 if haveBoss then return false end
@@ -294,9 +307,15 @@ createMap = function(self, mapId) @@ -294,9 +307,15 @@ createMap = function(self, mapId)
294 --掉落点 307 --掉落点
295 randomFunc[AdvEventType.Drop] = randomCommon 308 randomFunc[AdvEventType.Drop] = randomCommon
296 --交易所 309 --交易所
297 - randomFunc[AdvEventType.Trader] = randomCommon 310 + randomFunc[AdvEventType.Trader] = function()
  311 + if self.adv.isRelay and isNewRelay then return false end
  312 + return randomCommon()
  313 + end
298 --建筑 314 --建筑
299 - randomFunc[AdvEventType.Build] = randomCommon 315 + randomFunc[AdvEventType.Build] = function()
  316 + if self.adv.isRelay and isEnter then return false end
  317 + return randomCommon()
  318 + end
300 --陷阱 319 --陷阱
301 randomFunc[AdvEventType.Trap] = randomCommon 320 randomFunc[AdvEventType.Trap] = randomCommon
302 --点击生效 321 --点击生效
src/adv/AdvRoom.lua
@@ -15,19 +15,22 @@ function Room:ctor(map, roomId, csvData, info, isPath) @@ -15,19 +15,22 @@ function Room:ctor(map, roomId, csvData, info, isPath)
15 15
16 self.blocks = {} 16 self.blocks = {}
17 self:loadBlocks(csvData, info) 17 self:loadBlocks(csvData, info)
18 -  
19 end 18 end
20 19
21 function Room:loadBlocks(csvData, info) 20 function Room:loadBlocks(csvData, info)
22 for blockId, _ in pairs(csvData["blocks"]) do 21 for blockId, _ in pairs(csvData["blocks"]) do
23 self.blocks[blockId] = Block.new(self, blockId, info.event[blockId], info.open == 1 or info.open[blockId], info.trap[blockId]) 22 self.blocks[blockId] = Block.new(self, blockId, info.event[blockId], info.open == 1 or info.open[blockId], info.trap[blockId])
  23 + if self.map.adv.isRelay then -- 中继层全部开放
  24 + self.blocks[blockId].isOpen = true
  25 + self.blocks[blockId]:randomEvent()
  26 + end
24 if not self.isPath and self.blocks[blockId]:isBoss() then 27 if not self.isPath and self.blocks[blockId]:isBoss() then
25 self.isBossRoom = true 28 self.isBossRoom = true
26 end 29 end
27 if self.blocks[blockId].isOpen then 30 if self.blocks[blockId].isOpen then
28 self.isShow = true 31 self.isShow = true
29 else 32 else
30 - if self.blocks[blockId]:getEventType() == AdvEventType.In then -- 开放 33 + if self.blocks[blockId]:getEventType() == AdvEventType.In or self.blocks[blockId]:getEventType() == AdvEventType.InOut then -- 开放
31 self.isShow = true 34 self.isShow = true
32 self.blocks[blockId].isOpen = true 35 self.blocks[blockId].isOpen = true
33 --入口房间只会在这里首次展示开放 --触发固有技 36 --入口房间只会在这里首次展示开放 --触发固有技
src/models/Daily.lua
@@ -48,7 +48,11 @@ function Daily:refreshDailyData(notify) @@ -48,7 +48,11 @@ function Daily:refreshDailyData(notify)
48 redisproxy:del(FRIEND_POINT:format(self.owner:getProperty("id"))) 48 redisproxy:del(FRIEND_POINT:format(self.owner:getProperty("id")))
49 local dataMap = {} 49 local dataMap = {}
50 for field, schema in pairs(self.schema) do 50 for field, schema in pairs(self.schema) do
51 - if field ~= "key" then 51 + if field == "advC" or field == "advElC" then
  52 + if self:getProperty("field") > 0 then
  53 + dataMap[field] = 0
  54 + end
  55 + elseif field ~= "key" then
52 local typ, def = table.unpack(schema) 56 local typ, def = table.unpack(schema)
53 dataMap[field] = def 57 dataMap[field] = def
54 end 58 end
src/models/Role.lua
@@ -75,6 +75,7 @@ Role.schema = { @@ -75,6 +75,7 @@ Role.schema = {
75 advStoryB = {"table", {}}, -- 冒险故事完成记录 (连锁事件绑定的故事) -- {storyId = 1} 75 advStoryB = {"table", {}}, -- 冒险故事完成记录 (连锁事件绑定的故事) -- {storyId = 1}
76 advShop = {"table", {}}, -- 冒险內的商店限制购买次数记录 {goodId = count} 76 advShop = {"table", {}}, -- 冒险內的商店限制购买次数记录 {goodId = count}
77 advEAchiev = {"table", {}}, -- 冒险无尽冒险手册 77 advEAchiev = {"table", {}}, -- 冒险无尽冒险手册
  78 + advRelay = {"table", {}}, -- 冒险中继点记录 {[chapter] = {[level] = 1}, [-1] = {[level] = 1}} -- -1 无尽 方便重置
78 79
79 --挂机相关 80 --挂机相关
80 hangPass = {"table", {}}, -- 挂机通过的最大关卡 81 hangPass = {"table", {}}, -- 挂机通过的最大关卡
@@ -257,6 +258,7 @@ function Role:data() @@ -257,6 +258,7 @@ function Role:data()
257 advAchiev = self:getProperty("advAchiev"), 258 advAchiev = self:getProperty("advAchiev"),
258 advL = self:getProperty("advL"), 259 advL = self:getProperty("advL"),
259 advElM = self:getProperty("advElM"), 260 advElM = self:getProperty("advElM"),
  261 + advElS = self:getProperty("advElS"),
260 advElChapter = self.advElChapter, 262 advElChapter = self.advElChapter,
261 advOverTime = self.advOverTime, 263 advOverTime = self.advOverTime,
262 advAFGet = self:getProperty("advAFGet"), 264 advAFGet = self:getProperty("advAFGet"),
src/models/RolePlugin.lua
@@ -776,11 +776,10 @@ function RolePlugin.bind(Role) @@ -776,11 +776,10 @@ function RolePlugin.bind(Role)
776 -- 重置一下冒险 776 -- 重置一下冒险
777 local nowSeason = tonum(redisproxy:hget("adv_season", "idx")) 777 local nowSeason = tonum(redisproxy:hget("adv_season", "idx"))
778 if self:getProperty("advElS") ~= nowSeason then 778 if self:getProperty("advElS") ~= nowSeason then
779 - local ml = self:getProperty("advElM")  
780 -  
781 - local nl = math.max(0, ml - (math.floor(ml / 50) + 2) * 10)  
782 - self:setProperty("advElM", math.floor(nl / 10) * 10)  
783 - self:setProperty("advElS", nowSeason) 779 + -- 胡博文让注释掉 衰减 从0开始
  780 + -- local ml = self:getProperty("advElM")
  781 + -- local nl = math.max(0, ml - (math.floor(ml / 50) + 2) * 10)
  782 + -- self:setProperty("advElM", math.floor(nl / 10) * 10)
784 783
785 -- 正在无尽冒险清掉 784 -- 正在无尽冒险清掉
786 local adv = self:getAdvData() 785 local adv = self:getAdvData()
@@ -801,6 +800,8 @@ function RolePlugin.bind(Role) @@ -801,6 +800,8 @@ function RolePlugin.bind(Role)
801 -- 清掉冒险手册 800 -- 清掉冒险手册
802 self:updateProperties({ 801 self:updateProperties({
803 advEAchiev = {}, 802 advEAchiev = {},
  803 + advElM = 0,
  804 + advElS = nowSeason,
804 }, notNotify) 805 }, notNotify)
805 end 806 end
806 end 807 end