Commit 3923459ba4ca81a3f09dec2d47dfc2d7ce0d7de2
Merge branch 'tr/bugfix' into tr/publish/qa-dev
* tr/bugfix: (31 commits) gm 奖励 获取有效期物品 增加gm 方法 每日抽卡礼包bug 每日抽卡限时礼包触发时,清空购买记录 添加活动关卡gm指令, 活动代理拾荒数据清理 新春签到代码优化,支持不同时开同类型的签到活动,方便后期复用 新春签到领奖方法里 漏掉了一个int转string 拾荒活动积分up 新春签到 记录字段值的key改成string 拾荒bug 每日抽卡次数触发礼包 第一层奖励 错误单词 重置preload服务器时间 新春活动任务 第一层也发奖 假的boss 没有效果 地图 回魔 百分比 以上限 ...
Showing
16 changed files
with
240 additions
and
166 deletions
Show diff stats
src/GlobalVar.lua
@@ -242,6 +242,7 @@ AdvBackEventType = { | @@ -242,6 +242,7 @@ AdvBackEventType = { | ||
242 | BuffEffect = 27, -- buff 效果 | 242 | BuffEffect = 27, -- buff 效果 |
243 | PassiveEffect = 28, -- 被动 效果 | 243 | PassiveEffect = 28, -- 被动 效果 |
244 | ChooseDice = 29, -- 选择点随机效果 | 244 | ChooseDice = 29, -- 选择点随机效果 |
245 | + NoEffect = 30, -- 没有效果 | ||
245 | } | 246 | } |
246 | 247 | ||
247 | AdvScoreType = { | 248 | AdvScoreType = { |
@@ -355,6 +356,7 @@ TriggerEventType = { | @@ -355,6 +356,7 @@ TriggerEventType = { | ||
355 | AddNewHero = 5, | 356 | AddNewHero = 5, |
356 | SSRCount = 6, | 357 | SSRCount = 6, |
357 | AfterTs = 7, -- 某时间以后 | 358 | AfterTs = 7, -- 某时间以后 |
359 | + DrawHeroCnt = 8, -- 每日抽卡次数 | ||
358 | } | 360 | } |
359 | 361 | ||
360 | DrawCardType = { | 362 | DrawCardType = { |
src/actions/ActivityAction.lua
@@ -723,7 +723,9 @@ function _M.endBattleRpc(agent, data) | @@ -723,7 +723,9 @@ function _M.endBattleRpc(agent, data) | ||
723 | if check[cond[1]] and check[cond[1]](table.unpack(cond)) then | 723 | if check[cond[1]] and check[cond[1]](table.unpack(cond)) then |
724 | curStar = curStar + (1 << (i - 1)) | 724 | curStar = curStar + (1 << (i - 1)) |
725 | end | 725 | end |
726 | - end | 726 | + end |
727 | + | ||
728 | + role:checkTaskEnter("ActBattlePass", {chapterId = id}) | ||
727 | else | 729 | else |
728 | curStar = 0 | 730 | curStar = 0 |
729 | if battleCfg.rank ~= 0 then | 731 | if battleCfg.rank ~= 0 then |
@@ -1302,21 +1304,21 @@ function _M.newSignRpc(agent, data) | @@ -1302,21 +1304,21 @@ function _M.newSignRpc(agent, data) | ||
1302 | if not open then return 1 end | 1304 | if not open then return 1 end |
1303 | 1305 | ||
1304 | local actData = role.activity:getActData("NewSign") | 1306 | local actData = role.activity:getActData("NewSign") |
1305 | - if actData[actData[0] or 0] then | 1307 | + if actData[tostring(actData["0"] or 0)] then |
1306 | return 2 | 1308 | return 2 |
1307 | end | 1309 | end |
1308 | 1310 | ||
1309 | local actCfg = csvdb["activity_signInCsv"][actId] | 1311 | local actCfg = csvdb["activity_signInCsv"][actId] |
1310 | if not actCfg then return 4 end | 1312 | if not actCfg then return 4 end |
1311 | 1313 | ||
1312 | - local sumDay = actData[0] or 0 | 1314 | + local sumDay = actData["0"] or 0 |
1313 | local award = {} | 1315 | local award = {} |
1314 | for k, data in pairs(actCfg) do | 1316 | for k, data in pairs(actCfg) do |
1315 | - if not actData[data.day] and data.day <= sumDay then | 1317 | + if not actData[tostring(data.day)] and data.day <= sumDay then |
1316 | for id, value in pairs(data.reward:toNumMap()) do | 1318 | for id, value in pairs(data.reward:toNumMap()) do |
1317 | award[id] = (award[id] or 0) + value | 1319 | award[id] = (award[id] or 0) + value |
1318 | end | 1320 | end |
1319 | - actData[data.day] = 1 | 1321 | + actData[tostring(data.day)] = 1 |
1320 | end | 1322 | end |
1321 | end | 1323 | end |
1322 | 1324 |
src/actions/AdvAction.lua
@@ -334,7 +334,7 @@ function _M.startHangRpc(agent, data) | @@ -334,7 +334,7 @@ function _M.startHangRpc(agent, data) | ||
334 | role:changeUpdates({{type = "advHang", field = chapterId, value = info}}) | 334 | role:changeUpdates({{type = "advHang", field = chapterId, value = info}}) |
335 | 335 | ||
336 | role:changeAdvCount(adv_idle_energy) | 336 | role:changeAdvCount(adv_idle_energy) |
337 | - role:checkTaskEnter("AdvStart", {id = chapterId}) | 337 | + role:checkTaskEnter("AdvStart", {id = chapterId, actid = actid}) |
338 | role:mylog("adv_action", {desc = "startHang", int1 = chapterId}) | 338 | role:mylog("adv_action", {desc = "startHang", int1 = chapterId}) |
339 | 339 | ||
340 | SendPacket(actionCodes.Adv_startHangRpc, '') | 340 | SendPacket(actionCodes.Adv_startHangRpc, '') |
src/actions/GmAction.lua
@@ -80,6 +80,10 @@ function _M.pvp_cross_head(role, pms) | @@ -80,6 +80,10 @@ function _M.pvp_cross_head(role, pms) | ||
80 | return "成功" | 80 | return "成功" |
81 | end | 81 | end |
82 | 82 | ||
83 | +function _M.expire_item(role, pms) | ||
84 | + role:awardExpireItem(tonum(pms.pm1), pms.pm2, {log = {desc = "gm"}}) | ||
85 | + return "成功" | ||
86 | +end | ||
83 | 87 | ||
84 | local helpDes = {{"描述", "指令", "参数1", "参数2" ,"参数3"}} | 88 | local helpDes = {{"描述", "指令", "参数1", "参数2" ,"参数3"}} |
85 | 89 | ||
@@ -580,6 +584,50 @@ function _M.clearbag(role, pms) | @@ -580,6 +584,50 @@ function _M.clearbag(role, pms) | ||
580 | return "成功" | 584 | return "成功" |
581 | end | 585 | end |
582 | 586 | ||
587 | +table.insert(helpDes, {"发送跑马灯", "notice"}) | ||
588 | +function _M.notice(role, pms) | ||
589 | + local msg = pms.pm1 | ||
590 | + SendPacket(actionCodes.Sys_commonNotice, MsgPack.pack({body = msg})) | ||
591 | + | ||
592 | + return "成功" | ||
593 | +end | ||
594 | + | ||
595 | +table.insert(helpDes, {"活动关卡", "actbp", "id", "actid"}) | ||
596 | +function _M.actbp(role, pms) | ||
597 | + local id = tonum(pms.pm1, 0) | ||
598 | + local actid = tonum(pms.pm2, 0) | ||
599 | + if not role.activity:isOpenById(actid, "ChallengeLevel") then return end | ||
600 | + local actData = role.activity:getActData("ChallengeLevel") or {} | ||
601 | + | ||
602 | + local actCfg = csvdb["activity_battleCsv"][actid] | ||
603 | + if not actCfg then return end | ||
604 | + for k, v in pairs(actCfg) do | ||
605 | + if k <= id then | ||
606 | + local bpInfo = actData[i] or {} | ||
607 | + bpInfo["star"] = 1 | ||
608 | + actData[k] = bpInfo | ||
609 | + end | ||
610 | + end | ||
611 | + role.activity:updateActData("ChallengeLevel", actData) | ||
612 | + | ||
613 | + return "成功" | ||
614 | +end | ||
615 | + | ||
616 | +table.insert(helpDes, {"活动拾荒", "actadv", "id", "actid"}) | ||
617 | +function _M.actadv(role, pms) | ||
618 | + local id = tonum(pms.pm1, 0) | ||
619 | + local actid = tonum(pms.pm2, 0) | ||
620 | + if not role.activity:isOpenById(actid, "AdvLevel") then return end | ||
621 | + local actData = role.activity:getActData("AdvLevel") or {} | ||
622 | + local advInfo = actData[id] | ||
623 | + advInfo["pass"] = 1 | ||
624 | + actData[id] = advInfo | ||
625 | + | ||
626 | + role.activity:updateActData("AdvLevel", actData) | ||
627 | + | ||
628 | + return "成功" | ||
629 | +end | ||
630 | + | ||
583 | function _M.helpRpc(agent, data) | 631 | function _M.helpRpc(agent, data) |
584 | SendPacket(actionCodes.Gm_helpRpc, MsgPack.pack({help = helpDes})) | 632 | SendPacket(actionCodes.Gm_helpRpc, MsgPack.pack({help = helpDes})) |
585 | return true | 633 | return true |
src/actions/HeroAction.lua
@@ -72,6 +72,7 @@ function _M.breakRpc( agent, data ) | @@ -72,6 +72,7 @@ function _M.breakRpc( agent, data ) | ||
72 | if hero:getProperty("level") < hero:getMaxLevel() then return 2 end | 72 | if hero:getProperty("level") < hero:getMaxLevel() then return 2 end |
73 | if hero:getProperty("breakL") >= #csvdb["unit_breakCsv"] then return 3 end | 73 | if hero:getProperty("breakL") >= #csvdb["unit_breakCsv"] then return 3 end |
74 | local curData = csvdb["unit_breakCsv"][hero:getProperty("breakL")] | 74 | local curData = csvdb["unit_breakCsv"][hero:getProperty("breakL")] |
75 | + if hero:getProperty("wakeL") < curData["starLimit"] then return 4 end | ||
75 | local cost = {[ItemId.BreakCost] = curData.cost, [ItemId.Gold] = curData.gold} | 76 | local cost = {[ItemId.BreakCost] = curData.cost, [ItemId.Gold] = curData.gold} |
76 | if not role:checkItemEnough(cost) then return 4 end | 77 | if not role:checkItemEnough(cost) then return 4 end |
77 | role:costItems(cost, {log = {desc = "heroBreak", int1 = msg.id, int2 = hero:getProperty("type")}}) | 78 | role:costItems(cost, {log = {desc = "heroBreak", int1 = msg.id, int2 = hero:getProperty("type")}}) |
@@ -914,6 +915,8 @@ function _M.drawHeroRpc(agent, data) | @@ -914,6 +915,8 @@ function _M.drawHeroRpc(agent, data) | ||
914 | local ssrCount = 0 | 915 | local ssrCount = 0 |
915 | local reward = {} | 916 | local reward = {} |
916 | local logReward = {} | 917 | local logReward = {} |
918 | + -- 限时礼包 | ||
919 | + local dailyDrawCnt = role.dailyData:getProperty("drawHeroCnt") or 0 | ||
917 | for i = 1, drawCount[drawType] do | 920 | for i = 1, drawCount[drawType] do |
918 | floorHeroCount = floorHeroCount + 1 | 921 | floorHeroCount = floorHeroCount + 1 |
919 | local isFloorBack = draw_floor_back_counts and floorHeroCount >= draw_floor_back_counts | 922 | local isFloorBack = draw_floor_back_counts and floorHeroCount >= draw_floor_back_counts |
@@ -962,8 +965,13 @@ function _M.drawHeroRpc(agent, data) | @@ -962,8 +965,13 @@ function _M.drawHeroRpc(agent, data) | ||
962 | logReward[itemId] = (logReward[itemId] or 0) + 1 | 965 | logReward[itemId] = (logReward[itemId] or 0) + 1 |
963 | table.insert(reward, {id = itemId, count = 1}) | 966 | table.insert(reward, {id = itemId, count = 1}) |
964 | end | 967 | end |
968 | + | ||
969 | + dailyDrawCnt = dailyDrawCnt + 1 | ||
970 | + role:checkTaskEnter("DrawHeroLimitPack", {count = dailyDrawCnt}) | ||
965 | end | 971 | end |
966 | 972 | ||
973 | + role.dailyData:setProperty("drawHeroCnt", dailyDrawCnt) | ||
974 | + | ||
967 | if draw_floor_back_counts then | 975 | if draw_floor_back_counts then |
968 | local floorHero = role:getProperty("floorHero") | 976 | local floorHero = role:getProperty("floorHero") |
969 | floorHero[btype] = floorHeroCount | 977 | floorHero[btype] = floorHeroCount |
@@ -1126,7 +1134,7 @@ function _M.changeCrown(agent, data) | @@ -1126,7 +1134,7 @@ function _M.changeCrown(agent, data) | ||
1126 | 1134 | ||
1127 | local heroType = msg.heroType | 1135 | local heroType = msg.heroType |
1128 | 1136 | ||
1129 | - if not role:isHaveHero(heroType) then return true end | 1137 | + if heroType < 10000 and not role:isHaveHero(heroType) then return true end |
1130 | role:setProperty("crown", heroType) | 1138 | role:setProperty("crown", heroType) |
1131 | 1139 | ||
1132 | role:log("hero_show", { | 1140 | role:log("hero_show", { |
src/adv/Adv.lua
@@ -160,8 +160,11 @@ function Adv:initByChapter(params) | @@ -160,8 +160,11 @@ function Adv:initByChapter(params) | ||
160 | self:checkAdvUnlock(1, self.level) | 160 | self:checkAdvUnlock(1, self.level) |
161 | 161 | ||
162 | -- 中继进入奖励 | 162 | -- 中继进入奖励 |
163 | - if relayData and isEnter then | ||
164 | - self:awardRelay(relayData, notNotify) | 163 | + if isEnter then |
164 | + relayData = relayData or self:isHaveRelay(level, chapterId, true) | ||
165 | + if relayData then | ||
166 | + self:awardRelay(relayData, notNotify) | ||
167 | + end | ||
165 | end | 168 | end |
166 | 169 | ||
167 | if not notNotify then | 170 | if not notNotify then |
@@ -240,7 +243,6 @@ end | @@ -240,7 +243,6 @@ end | ||
240 | 243 | ||
241 | function Adv:awardRelay(relayData, notNotify) | 244 | function Adv:awardRelay(relayData, notNotify) |
242 | local gift = {} | 245 | local gift = {} |
243 | - | ||
244 | if relayData.artifact > 0 then | 246 | if relayData.artifact > 0 then |
245 | local pool = {} | 247 | local pool = {} |
246 | for id, temp in pairs(csvdb["adv_artifactCsv"]) do | 248 | for id, temp in pairs(csvdb["adv_artifactCsv"]) do |
@@ -265,7 +267,9 @@ function Adv:awardRelay(relayData, notNotify) | @@ -265,7 +267,9 @@ function Adv:awardRelay(relayData, notNotify) | ||
265 | local dropData = csvdb["event_dropCsv"][dropId] | 267 | local dropData = csvdb["event_dropCsv"][dropId] |
266 | if dropData then | 268 | if dropData then |
267 | local item = dropData["range"]:randWeight(true) | 269 | local item = dropData["range"]:randWeight(true) |
268 | - gift[item[1]] = (gift[item[1]] or 0) + item[2] | 270 | + if item[1] ~= 0 then |
271 | + gift[item[1]] = (gift[item[1]] or 0) + item[2] | ||
272 | + end | ||
269 | else | 273 | else |
270 | skynet.error(string.format("[ERROR]: event_dropCsv no id %s, adv_chapter_campsite", dropId)) | 274 | skynet.error(string.format("[ERROR]: event_dropCsv no id %s, adv_chapter_campsite", dropId)) |
271 | end | 275 | end |
@@ -827,7 +831,7 @@ function Adv:over(success, rewardRatio, overType) | @@ -827,7 +831,7 @@ function Adv:over(success, rewardRatio, overType) | ||
827 | local actData = self.owner.activity:getActData("AdvLevel") | 831 | local actData = self.owner.activity:getActData("AdvLevel") |
828 | 832 | ||
829 | -- 计算活动积分up | 833 | -- 计算活动积分up |
830 | - local upMap = actCfg["upCharacter"] | 834 | + local upMap = actCfg["upCharacter"]:toNumMap() |
831 | local team = self.owner:getProperty("advTeam") | 835 | local team = self.owner:getProperty("advTeam") |
832 | local format = self.owner:getTeamHerosInfo(team).heros | 836 | local format = self.owner:getTeamHerosInfo(team).heros |
833 | local upVal = 0 | 837 | local upVal = 0 |
@@ -1131,6 +1135,7 @@ function Adv:useItem(itemId, count, target) | @@ -1131,6 +1135,7 @@ function Adv:useItem(itemId, count, target) | ||
1131 | end | 1135 | end |
1132 | 1136 | ||
1133 | self:checkAchievement(self.AchievType.UseItem, count, itemId) | 1137 | self:checkAchievement(self.AchievType.UseItem, count, itemId) |
1138 | + self.owner:checkTaskEnter("AdvUseItem", {itemId = itemId, count = count}) | ||
1134 | self:mylog({desc = "useItem", int1 = itemId, int2 = count}) | 1139 | self:mylog({desc = "useItem", int1 = itemId, int2 = count}) |
1135 | 1140 | ||
1136 | self.owner:log("mission_pick_use", { | 1141 | self.owner:log("mission_pick_use", { |
@@ -1191,7 +1196,8 @@ function Adv:supplyPotion() | @@ -1191,7 +1196,8 @@ function Adv:supplyPotion() | ||
1191 | local old = advItems:getv(potionId,0) | 1196 | local old = advItems:getv(potionId,0) |
1192 | local need = max - old | 1197 | local need = max - old |
1193 | 1198 | ||
1194 | - if need < count then | 1199 | + if need < 0 then |
1200 | + elseif need < count then | ||
1195 | advItems = advItems:setv(potionId,max) | 1201 | advItems = advItems:setv(potionId,max) |
1196 | potionBag[potionId] = count - need | 1202 | potionBag[potionId] = count - need |
1197 | else | 1203 | else |
@@ -1376,7 +1382,7 @@ local function checkChooseCondFunc(self, condStr, room, block, tag, chooseData) | @@ -1376,7 +1382,7 @@ local function checkChooseCondFunc(self, condStr, room, block, tag, chooseData) | ||
1376 | for _, room in pairs(self:getCurMap().rooms) do | 1382 | for _, room in pairs(self:getCurMap().rooms) do |
1377 | for _, block in pairs(room.blocks) do | 1383 | for _, block in pairs(room.blocks) do |
1378 | if block:isMonster() then | 1384 | if block:isMonster() then |
1379 | - if not monsterId then return false end | 1385 | + if not monsterId or monsterId == 0 then return false end |
1380 | if block.event.id == monsterId then | 1386 | if block.event.id == monsterId then |
1381 | return false | 1387 | return false |
1382 | end | 1388 | end |
@@ -1386,7 +1392,7 @@ local function checkChooseCondFunc(self, condStr, room, block, tag, chooseData) | @@ -1386,7 +1392,7 @@ local function checkChooseCondFunc(self, condStr, room, block, tag, chooseData) | ||
1386 | else | 1392 | else |
1387 | for _, cblock in ipairs(self:getCurMap():getBlocksBySize(room.roomId, block.blockId, size)) do | 1393 | for _, cblock in ipairs(self:getCurMap():getBlocksBySize(room.roomId, block.blockId, size)) do |
1388 | if cblock:isMonster() then | 1394 | if cblock:isMonster() then |
1389 | - if not monsterId then return false end | 1395 | + if not monsterId or monsterId == 0 then return false end |
1390 | if cblock.event.id == monsterId then | 1396 | if cblock.event.id == monsterId then |
1391 | return false | 1397 | return false |
1392 | end | 1398 | end |
@@ -1401,7 +1407,7 @@ local function checkChooseCondFunc(self, condStr, room, block, tag, chooseData) | @@ -1401,7 +1407,7 @@ local function checkChooseCondFunc(self, condStr, room, block, tag, chooseData) | ||
1401 | for _, room in pairs(self:getCurMap().rooms) do | 1407 | for _, room in pairs(self:getCurMap().rooms) do |
1402 | for _, block in pairs(room.blocks) do | 1408 | for _, block in pairs(room.blocks) do |
1403 | if block:isBuild() then | 1409 | if block:isBuild() then |
1404 | - if not buildId then return false end | 1410 | + if not buildId or buildId == 0 then return false end |
1405 | if block.event.id == buildId then | 1411 | if block.event.id == buildId then |
1406 | return false | 1412 | return false |
1407 | end | 1413 | end |
@@ -1411,7 +1417,7 @@ local function checkChooseCondFunc(self, condStr, room, block, tag, chooseData) | @@ -1411,7 +1417,7 @@ local function checkChooseCondFunc(self, condStr, room, block, tag, chooseData) | ||
1411 | else | 1417 | else |
1412 | for _, cblock in ipairs(self:getCurMap():getBlocksBySize(room.roomId, block.blockId, size)) do | 1418 | for _, cblock in ipairs(self:getCurMap():getBlocksBySize(room.roomId, block.blockId, size)) do |
1413 | if cblock:isBuild() then | 1419 | if cblock:isBuild() then |
1414 | - if not buildId then return false end | 1420 | + if not buildId or buildId == 0 then return false end |
1415 | if cblock.event.id == buildId then | 1421 | if cblock.event.id == buildId then |
1416 | return false | 1422 | return false |
1417 | end | 1423 | end |
@@ -1426,7 +1432,7 @@ local function checkChooseCondFunc(self, condStr, room, block, tag, chooseData) | @@ -1426,7 +1432,7 @@ local function checkChooseCondFunc(self, condStr, room, block, tag, chooseData) | ||
1426 | for _, room in pairs(self:getCurMap().rooms) do | 1432 | for _, room in pairs(self:getCurMap().rooms) do |
1427 | for _, block in pairs(room.blocks) do | 1433 | for _, block in pairs(room.blocks) do |
1428 | if block:isChoose() then | 1434 | if block:isChoose() then |
1429 | - if not chooseId then return false end | 1435 | + if not chooseId or chooseId == 0 then return false end |
1430 | if block.event.id == chooseId then | 1436 | if block.event.id == chooseId then |
1431 | return false | 1437 | return false |
1432 | end | 1438 | end |
@@ -1436,7 +1442,7 @@ local function checkChooseCondFunc(self, condStr, room, block, tag, chooseData) | @@ -1436,7 +1442,7 @@ local function checkChooseCondFunc(self, condStr, room, block, tag, chooseData) | ||
1436 | else | 1442 | else |
1437 | for _, cblock in ipairs(self:getCurMap():getBlocksBySize(room.roomId, block.blockId, size)) do | 1443 | for _, cblock in ipairs(self:getCurMap():getBlocksBySize(room.roomId, block.blockId, size)) do |
1438 | if cblock:isChoose() then | 1444 | if cblock:isChoose() then |
1439 | - if not chooseId then return false end | 1445 | + if not chooseId or chooseId == 0 then return false end |
1440 | if cblock.event.id == chooseId then | 1446 | if cblock.event.id == chooseId then |
1441 | return false | 1447 | return false |
1442 | end | 1448 | end |
@@ -1470,7 +1476,9 @@ local function doChooseEffect(self, effectStr, room, block, tag, chooseData) | @@ -1470,7 +1476,9 @@ local function doChooseEffect(self, effectStr, room, block, tag, chooseData) | ||
1470 | local dropData = csvdb["event_dropCsv"][dropId] | 1476 | local dropData = csvdb["event_dropCsv"][dropId] |
1471 | if dropData then | 1477 | if dropData then |
1472 | local item = dropData["range"]:randWeight(true) | 1478 | local item = dropData["range"]:randWeight(true) |
1473 | - reward[item[1]] = (reward[item[1]] or 0) + item[2] | 1479 | + if item[1] ~= 0 then |
1480 | + reward[item[1]] = (reward[item[1]] or 0) + item[2] | ||
1481 | + end | ||
1474 | else | 1482 | else |
1475 | skynet.error(string.format("[ERROR]: event_dropCsv no id %s in %s id: %s", dropId, tag, chooseData.id)) | 1483 | skynet.error(string.format("[ERROR]: event_dropCsv no id %s in %s id: %s", dropId, tag, chooseData.id)) |
1476 | end | 1484 | end |
@@ -1755,6 +1763,7 @@ local function clickBuild(self, room, block, params) | @@ -1755,6 +1763,7 @@ local function clickBuild(self, room, block, params) | ||
1755 | self:checkTask(Adv.TaskType.Build, 1, oldId) | 1763 | self:checkTask(Adv.TaskType.Build, 1, oldId) |
1756 | self:checkAchievement(Adv.AchievType.Build, 1, oldId) | 1764 | self:checkAchievement(Adv.AchievType.Build, 1, oldId) |
1757 | self:checkAchievement(Adv.AchievType.BuildBySelect, 1, oldId, choose) | 1765 | self:checkAchievement(Adv.AchievType.BuildBySelect, 1, oldId, choose) |
1766 | + self.owner:checkTaskEnter("AdvBuild", {buildId = oldId}) | ||
1758 | 1767 | ||
1759 | if clearBlock then | 1768 | if clearBlock then |
1760 | block:clear() | 1769 | block:clear() |
@@ -1777,7 +1786,9 @@ local function clickClick(self, room, block, params) | @@ -1777,7 +1786,9 @@ local function clickClick(self, room, block, params) | ||
1777 | local reward = {} | 1786 | local reward = {} |
1778 | for _, dropId in ipairs(clickData.effect:toArray(true, "=")) do | 1787 | for _, dropId in ipairs(clickData.effect:toArray(true, "=")) do |
1779 | local item = csvdb["event_dropCsv"][dropId]["range"]:randWeight(true) | 1788 | local item = csvdb["event_dropCsv"][dropId]["range"]:randWeight(true) |
1780 | - reward[item[1]] = (reward[item[1]] or 0) + item[2] | 1789 | + if item[1] ~= 0 then |
1790 | + reward[item[1]] = (reward[item[1]] or 0) + item[2] | ||
1791 | + end | ||
1781 | end | 1792 | end |
1782 | self:award(reward, {log = {desc = "clickClick", int1 = block.event.id}}, {roomId = room.roomId, blockId = block.blockId}) | 1793 | self:award(reward, {log = {desc = "clickClick", int1 = block.event.id}}, {roomId = room.roomId, blockId = block.blockId}) |
1783 | end, | 1794 | end, |
@@ -1878,6 +1889,18 @@ function Adv:clickBlock(roomId, blockId, params) | @@ -1878,6 +1889,18 @@ function Adv:clickBlock(roomId, blockId, params) | ||
1878 | return | 1889 | return |
1879 | end | 1890 | end |
1880 | 1891 | ||
1892 | + if not block:isMonster() then | ||
1893 | + for _, one in ipairs(map:getAroundBlocksPlus(room, block)) do | ||
1894 | + local _room, _block = one[1], one[2] | ||
1895 | + if _block:isMonster() then | ||
1896 | + local enemy = self.battle:getEnemy(_room.roomId, _block.blockId) | ||
1897 | + if enemy:hadBuff(Buff.OBSTACLE_PLUS) then | ||
1898 | + return | ||
1899 | + end | ||
1900 | + end | ||
1901 | + end | ||
1902 | + end | ||
1903 | + | ||
1881 | if block:isHinder() then | 1904 | if block:isHinder() then |
1882 | if not checkAroundBlocks(true) then return end | 1905 | if not checkAroundBlocks(true) then return end |
1883 | end | 1906 | end |
@@ -2012,9 +2035,18 @@ function Adv:doActive(activeId, target) | @@ -2012,9 +2035,18 @@ function Adv:doActive(activeId, target) | ||
2012 | -- 5:放逐目标 | 2035 | -- 5:放逐目标 |
2013 | doActiveEffect[5] = function(_) | 2036 | doActiveEffect[5] = function(_) |
2014 | for _, target in ipairs(targers) do | 2037 | for _, target in ipairs(targers) do |
2038 | + local had = false | ||
2015 | if not target.lock and not target.isDead then | 2039 | if not target.lock and not target.isDead then |
2016 | - target:kill() | ||
2017 | - self:backBlockChange(target.roomId, target.blockId) | 2040 | + if target:getMonsterCsv().type == 5 then |
2041 | + -- 假boss 不能用 | ||
2042 | + had = true | ||
2043 | + else | ||
2044 | + target:kill() | ||
2045 | + self:backBlockChange(target.roomId, target.blockId) | ||
2046 | + end | ||
2047 | + end | ||
2048 | + if had then | ||
2049 | + self:pushBackEvent(AdvBackEventType.NoEffect) | ||
2018 | end | 2050 | end |
2019 | end | 2051 | end |
2020 | return true | 2052 | return true |
@@ -2043,13 +2075,8 @@ function Adv:doActive(activeId, target) | @@ -2043,13 +2075,8 @@ function Adv:doActive(activeId, target) | ||
2043 | end | 2075 | end |
2044 | 2076 | ||
2045 | -- 7=道具燃烧效果 | 2077 | -- 7=道具燃烧效果 |
2046 | - doActiveEffect[7] = function(_) | ||
2047 | - for _ , target in ipairs(targers) do | ||
2048 | - if target:getEventType() == AdvEventType.Drop then | ||
2049 | - target:updateEvent(nil) | ||
2050 | - self:backBlockChange(target.room.roomId, target.blockId) | ||
2051 | - end | ||
2052 | - end | 2078 | + doActiveEffect[7] = function(_, ctype) |
2079 | + self:blockDropChange(ctype, targers) | ||
2053 | return true | 2080 | return true |
2054 | end | 2081 | end |
2055 | 2082 | ||
@@ -2279,7 +2306,7 @@ function Adv:enemyDead(enemy, escape) | @@ -2279,7 +2306,7 @@ function Adv:enemyDead(enemy, escape) | ||
2279 | end | 2306 | end |
2280 | end | 2307 | end |
2281 | -- 这些奖励可能会有被动加成 | 2308 | -- 这些奖励可能会有被动加成 |
2282 | - self.battle.player:triggerPassive(Passive.BATTLE_WIN, {drops = drops}) | 2309 | + self.battle.player:triggerPassive(Passive.BATTLE_WIN, {drops = drops, trigger = enemy}) |
2283 | 2310 | ||
2284 | -- 自身带的掉落是不会被改变的 也不会被加成 | 2311 | -- 自身带的掉落是不会被改变的 也不会被加成 |
2285 | if block.event.item and block.event.item[1] ~= 0 then | 2312 | if block.event.item and block.event.item[1] ~= 0 then |
@@ -2319,6 +2346,8 @@ function Adv:enemyDead(enemy, escape) | @@ -2319,6 +2346,8 @@ function Adv:enemyDead(enemy, escape) | ||
2319 | self:checkAchievement(Adv.AchievType.Kill, 1, enemyId) | 2346 | self:checkAchievement(Adv.AchievType.Kill, 1, enemyId) |
2320 | self:checkAchievement(Adv.AchievType.KillHadBuff, 1, enemy) | 2347 | self:checkAchievement(Adv.AchievType.KillHadBuff, 1, enemy) |
2321 | 2348 | ||
2349 | + self.owner:checkTaskEnter("AdvKill", {chapterId = self.chapterId}) | ||
2350 | + | ||
2322 | self:checkAchievement(Adv.AchievType.KillWithBuff, 1) | 2351 | self:checkAchievement(Adv.AchievType.KillWithBuff, 1) |
2323 | self:checkAchievement(Adv.AchievType.KillNoBuff, 1) | 2352 | self:checkAchievement(Adv.AchievType.KillNoBuff, 1) |
2324 | self:checkAchievement(Adv.AchievType.KillWithMWeapon, 1) | 2353 | self:checkAchievement(Adv.AchievType.KillWithMWeapon, 1) |
src/adv/AdvBlock.lua
@@ -134,6 +134,9 @@ function Block:randomEvent() | @@ -134,6 +134,9 @@ function Block:randomEvent() | ||
134 | randomFunc[AdvEventType.Drop] = function() | 134 | randomFunc[AdvEventType.Drop] = function() |
135 | if not self.event.item then | 135 | if not self.event.item then |
136 | self.event.item = csvdb["event_dropCsv"][self.event.id]["range"]:randWeight(true) | 136 | self.event.item = csvdb["event_dropCsv"][self.event.id]["range"]:randWeight(true) |
137 | + if self.event.item[1] == 0 then | ||
138 | + self:clear() | ||
139 | + end | ||
137 | end | 140 | end |
138 | end | 141 | end |
139 | --交易 | 142 | --交易 |
src/adv/AdvBuff.lua
@@ -38,6 +38,7 @@ Buff.GET_PASSIVE = 34 -- 获得 passive -- 结束失效 | @@ -38,6 +38,7 @@ Buff.GET_PASSIVE = 34 -- 获得 passive -- 结束失效 | ||
38 | Buff.OBSTACLE_CHANGE = 35 -- 看守类型改变 -- 怪物使用 2 - 1 | 38 | Buff.OBSTACLE_CHANGE = 35 -- 看守类型改变 -- 怪物使用 2 - 1 |
39 | Buff.DISABLE_AURA = 36 -- 禁用光环 | 39 | Buff.DISABLE_AURA = 36 -- 禁用光环 |
40 | Buff.GET_AURA = 37 -- 获得光环 | 40 | Buff.GET_AURA = 37 -- 获得光环 |
41 | +Buff.OBSTACLE_PLUS = 38 -- 周围8格不能点击 | ||
41 | 42 | ||
42 | 43 | ||
43 | --角色一些属性的变化 | 44 | --角色一些属性的变化 |
src/adv/AdvMap.lua
@@ -383,6 +383,24 @@ function Map:getAroundBlocks(room, block) | @@ -383,6 +383,24 @@ function Map:getAroundBlocks(room, block) | ||
383 | return blocks | 383 | return blocks |
384 | end | 384 | end |
385 | 385 | ||
386 | +function Map:getAroundBlocksPlus(room, block) | ||
387 | + local blocks = {} | ||
388 | + local range = {1, 0, -1} | ||
389 | + local col, row = room:tranLtoG(block.col, block.row) | ||
390 | + for _, c in ipairs(range) do | ||
391 | + for _, r in ipairs(range) do | ||
392 | + if c == 0 and r == 0 then | ||
393 | + else | ||
394 | + local rroom, rblock = self:getRBByPos(col + c, row + r) | ||
395 | + if rroom then | ||
396 | + table.insert(blocks, {rroom, rblock}) | ||
397 | + end | ||
398 | + end | ||
399 | + end | ||
400 | + end | ||
401 | + return blocks | ||
402 | +end | ||
403 | + | ||
386 | function Map:getBlocksBySize(roomId, blockId, size) | 404 | function Map:getBlocksBySize(roomId, blockId, size) |
387 | local blocks = {} | 405 | local blocks = {} |
388 | local room = self.rooms[roomId] | 406 | local room = self.rooms[roomId] |
@@ -877,7 +895,7 @@ getEventLib = function(self, needEventType) -- needEventType 需要的事件 | @@ -877,7 +895,7 @@ getEventLib = function(self, needEventType) -- needEventType 需要的事件 | ||
877 | level = AdvCommon.getEndlessDataLv(chapterId, level) | 895 | level = AdvCommon.getEndlessDataLv(chapterId, level) |
878 | end | 896 | end |
879 | local libsToType = { | 897 | local libsToType = { |
880 | - ["event_monsterCsv"] = {AdvEventType.Monster, AdvEventType.BOSS, AdvEventType.Monster}, | 898 | + ["event_monsterCsv"] = {AdvEventType.Monster, AdvEventType.BOSS, AdvEventType.Monster, AdvEventType.Monster, AdvEventType.Monster}, |
881 | ["event_chooseCsv"] = AdvEventType.Choose, | 899 | ["event_chooseCsv"] = AdvEventType.Choose, |
882 | ["event_dropCsv"] = AdvEventType.Drop, | 900 | ["event_dropCsv"] = AdvEventType.Drop, |
883 | ["event_buildingCsv"] = AdvEventType.Build, | 901 | ["event_buildingCsv"] = AdvEventType.Build, |
src/adv/AdvPassive.lua
@@ -527,8 +527,9 @@ function Passive:effect8(dropId) | @@ -527,8 +527,9 @@ function Passive:effect8(dropId) | ||
527 | skynet.error(string.format("CSVDATA Error adv_map_passive %s effect 8 not id %s in event_drop", self.id, dropId)) | 527 | skynet.error(string.format("CSVDATA Error adv_map_passive %s effect 8 not id %s in event_drop", self.id, dropId)) |
528 | end | 528 | end |
529 | local item = dropData["range"]:randWeight(true) | 529 | local item = dropData["range"]:randWeight(true) |
530 | - self.owner.battle.adv:award({[item[1]] = item[2]}, {log = {desc = "passive", int1 = self.id}}, {roomId = self.owner.roomId, blockId = self.owner.blockId}) | ||
531 | - | 530 | + if item[1] ~= 0 then |
531 | + self.owner.battle.adv:award({[item[1]] = item[2]}, {log = {desc = "passive", int1 = self.id}}, {roomId = self.owner.roomId, blockId = self.owner.blockId}) | ||
532 | + end | ||
532 | end | 533 | end |
533 | 534 | ||
534 | --9=直接获得item(可在结算触发时使用) | 535 | --9=直接获得item(可在结算触发时使用) |
src/adv/AdvPlayer.lua
@@ -677,6 +677,10 @@ function Enemy:getClassify() | @@ -677,6 +677,10 @@ function Enemy:getClassify() | ||
677 | return csvdb["event_monsterCsv"][self.monsterId].classify | 677 | return csvdb["event_monsterCsv"][self.monsterId].classify |
678 | end | 678 | end |
679 | 679 | ||
680 | +function Enemy:getMonsterCsv() | ||
681 | + return csvdb["event_monsterCsv"][self.monsterId] | ||
682 | +end | ||
683 | + | ||
680 | -- 0=所有 1=怪物 2=玩家 | 684 | -- 0=所有 1=怪物 2=玩家 |
681 | function Enemy:checkAuraBuff(buffs) | 685 | function Enemy:checkAuraBuff(buffs) |
682 | local needBuffs = {} | 686 | local needBuffs = {} |
@@ -795,7 +799,7 @@ function Player:changeSp(value, cType) | @@ -795,7 +799,7 @@ function Player:changeSp(value, cType) | ||
795 | if cType == 0 then | 799 | if cType == 0 then |
796 | change = value | 800 | change = value |
797 | elseif cType == 1 then | 801 | elseif cType == 1 then |
798 | - change = self.sp * value / 100 | 802 | + change = self.spMax * value / 100 |
799 | end | 803 | end |
800 | local old = self.sp | 804 | local old = self.sp |
801 | self.sp = math.floor(math.min(self.spMax, math.max(0, self.sp + change))) | 805 | self.sp = math.floor(math.min(self.spMax, math.max(0, self.sp + change))) |
src/models/Activity.lua
@@ -1097,9 +1097,11 @@ activityFunc[Activity.ActivityType.NewSign] = { | @@ -1097,9 +1097,11 @@ activityFunc[Activity.ActivityType.NewSign] = { | ||
1097 | -- end, | 1097 | -- end, |
1098 | ["crossDay"] = function(self, actType, notify) | 1098 | ["crossDay"] = function(self, actType, notify) |
1099 | local curData = self:getActData(actType) | 1099 | local curData = self:getActData(actType) |
1100 | - curData[0] = (curData[0] or 0) + 1 | ||
1101 | - local actData = csvdb["activity_signInCsv"][48] or {} | ||
1102 | - if curData[0] > #actData then return end -- 满了就忽略了 | 1100 | + local isOpen, actId = self:isOpen(actType) |
1101 | + local actData = csvdb["activity_signInCsv"][actId] or {} | ||
1102 | + curData["0"] = curData["0"] or 0 | ||
1103 | + if curData["0"] >= #actData then return end -- 满了就忽略了 | ||
1104 | + curData["0"] = curData["0"] + 1 | ||
1103 | 1105 | ||
1104 | -- 没满更新一下 | 1106 | -- 没满更新一下 |
1105 | self:updateActData(actType, curData, not notify) | 1107 | self:updateActData(actType, curData, not notify) |
@@ -1146,7 +1148,6 @@ local function closeActAdvHang(role, chapterId) | @@ -1146,7 +1148,6 @@ local function closeActAdvHang(role, chapterId) | ||
1146 | end | 1148 | end |
1147 | reward, change = role:award(idleReward, {log = {desc = "advHang", int1 = chapterId}}) | 1149 | reward, change = role:award(idleReward, {log = {desc = "advHang", int1 = chapterId}}) |
1148 | end | 1150 | end |
1149 | - | ||
1150 | role:changeUpdates({{type = "advHang", field = chapterId, value = nil}}) | 1151 | role:changeUpdates({{type = "advHang", field = chapterId, value = nil}}) |
1151 | 1152 | ||
1152 | role:mylog("adv_action", {desc = "endHang", int1 = chapterId, short1 = 2}) | 1153 | role:mylog("adv_action", {desc = "endHang", int1 = chapterId, short1 = 2}) |
@@ -1163,13 +1164,17 @@ activityFunc[Activity.ActivityType.AdvLevel] = { | @@ -1163,13 +1164,17 @@ activityFunc[Activity.ActivityType.AdvLevel] = { | ||
1163 | ["close"] = function(self, actType, notify, actid) | 1164 | ["close"] = function(self, actType, notify, actid) |
1164 | local actCfg = csvdb["activity_adv_chapterCsv"][actid] | 1165 | local actCfg = csvdb["activity_adv_chapterCsv"][actid] |
1165 | if not actCfg then return end | 1166 | if not actCfg then return end |
1166 | - for chapterId, _ in ipairs(actCfg) do | 1167 | + for chapterId, _ in pairs(actCfg) do |
1167 | local advPass = self.owner:getProperty("advPass") | 1168 | local advPass = self.owner:getProperty("advPass") |
1168 | advPass[chapterId] = nil | 1169 | advPass[chapterId] = nil |
1169 | - self.owner:updateProperty({field="advPass", value=advPass}) | ||
1170 | - | 1170 | + local advRelay = self.owner:getProperty("advRelay") |
1171 | + advRelay[chapterId] = nil | ||
1172 | + self.owner:updateProperties({ | ||
1173 | + advPass = advPass, | ||
1174 | + advRelay = advRelay, | ||
1175 | + }, not notify) | ||
1171 | -- 关闭活动代理拾荒 | 1176 | -- 关闭活动代理拾荒 |
1172 | - closeActAdvHang(chapterId) | 1177 | + closeActAdvHang(self.owner, chapterId) |
1173 | end | 1178 | end |
1174 | -- 强制关闭活动拾荒关卡 | 1179 | -- 强制关闭活动拾荒关卡 |
1175 | local adv = self.owner:getAdvData() | 1180 | local adv = self.owner:getAdvData() |
src/models/Daily.lua
@@ -28,6 +28,7 @@ Daily.schema = { | @@ -28,6 +28,7 @@ Daily.schema = { | ||
28 | 28 | ||
29 | unlockPool = {"table", {}}, -- 解锁的属性卡池 | 29 | unlockPool = {"table", {}}, -- 解锁的属性卡池 |
30 | curPool = {"number", 0}, -- 属性卡池当前索引 | 30 | curPool = {"number", 0}, -- 属性卡池当前索引 |
31 | + drawHeroCnt = {"number", 0}, -- 每日抽卡次数 | ||
31 | } | 32 | } |
32 | 33 | ||
33 | function Daily:updateProperty(params) | 34 | function Daily:updateProperty(params) |
src/models/RoleTask.lua
@@ -16,6 +16,7 @@ local TaskType = { | @@ -16,6 +16,7 @@ local TaskType = { | ||
16 | HeroQualityCollect = 11, -- 英雄品质收集进度 | 16 | HeroQualityCollect = 11, -- 英雄品质收集进度 |
17 | HeroStarCollect = 12, -- 英雄星级收集进度 | 17 | HeroStarCollect = 12, -- 英雄星级收集进度 |
18 | DrawHeroNotFriend = 13, -- 非友情招募 -- count | 18 | DrawHeroNotFriend = 13, -- 非友情招募 -- count |
19 | + DrawHeroLimitPack = 14, -- 抽卡限时礼貌 -- count | ||
19 | 20 | ||
20 | --装备相关 | 21 | --装备相关 |
21 | AddEquip = 101, -- 获得装备 - equipId rarity | 22 | AddEquip = 101, -- 获得装备 - equipId rarity |
@@ -56,6 +57,9 @@ local TaskType = { | @@ -56,6 +57,9 @@ local TaskType = { | ||
56 | AdvHangHeroCnt = 416, -- 拾荒人数 | 57 | AdvHangHeroCnt = 416, -- 拾荒人数 |
57 | AdvCostPower = 417, -- 消耗体力 | 58 | AdvCostPower = 417, -- 消耗体力 |
58 | AdvPassFirst = 418, -- 冒险首次通关 - id | 59 | AdvPassFirst = 418, -- 冒险首次通关 - id |
60 | + AdvUseItem = 419, -- 使用道具 - itemId count | ||
61 | + AdvBuild = 420, -- 建筑交互 - buildId | ||
62 | + AdvKill = 421, -- 拾荒击败敌人 | ||
59 | 63 | ||
60 | --爬塔相关 | 64 | --爬塔相关 |
61 | TowerPass = 501, -- 爬塔通关 - level | 65 | TowerPass = 501, -- 爬塔通关 - level |
@@ -104,6 +108,7 @@ local TaskType = { | @@ -104,6 +108,7 @@ local TaskType = { | ||
104 | Login = 908, -- 登入 | 108 | Login = 908, -- 登入 |
105 | CostDiamond = 909, -- 消耗钻石 | 109 | CostDiamond = 909, -- 消耗钻石 |
106 | WeekTask = 910, -- 完成每周活跃任务 | 110 | WeekTask = 910, -- 完成每周活跃任务 |
111 | + ActBattlePass = 911, -- 活动关卡通关 -- chapterId | ||
107 | 112 | ||
108 | --功能未实现 todo | 113 | --功能未实现 todo |
109 | AdvShop = 1002, -- 冒险商城 | 114 | AdvShop = 1002, -- 冒险商城 |
@@ -257,6 +262,7 @@ local StoreListener = { | @@ -257,6 +262,7 @@ local StoreListener = { | ||
257 | [TaskType.TowerPass] = {{TriggerEventType.TowerPass, f("level")}}, | 262 | [TaskType.TowerPass] = {{TriggerEventType.TowerPass, f("level")}}, |
258 | [TaskType.AdvPassFirst] = {{TriggerEventType.AdvPass, f("id")}}, | 263 | [TaskType.AdvPassFirst] = {{TriggerEventType.AdvPass, f("id")}}, |
259 | [TaskType.AddHero] = {{TriggerEventType.AddNewHero, f("heroType")}, {TriggerEventType.SSRCount, f("ssrCount")}}, | 264 | [TaskType.AddHero] = {{TriggerEventType.AddNewHero, f("heroType")}, {TriggerEventType.SSRCount, f("ssrCount")}}, |
265 | + [TaskType.DrawHeroLimitPack] = {{TriggerEventType.DrawHeroCnt, f("count")}}, | ||
260 | } | 266 | } |
261 | } | 267 | } |
262 | 268 | ||
@@ -268,7 +274,7 @@ local CalendaTaskListener = { | @@ -268,7 +274,7 @@ local CalendaTaskListener = { | ||
268 | [TaskType.AdvStart]= {{3, 1}}, | 274 | [TaskType.AdvStart]= {{3, 1}}, |
269 | [TaskType.DinerLevelUp]= {{4, 2, f("level")}}, | 275 | [TaskType.DinerLevelUp]= {{4, 2, f("level")}}, |
270 | [TaskType.HeroLvlCollect]= {{5, 3}}, -- x名y级英雄 | 276 | [TaskType.HeroLvlCollect]= {{5, 3}}, -- x名y级英雄 |
271 | - [TaskType.AdvHang]= {{6, 1}}, ---- | 277 | + [TaskType.AdvHang]= {{6, 3, f("actid")}}, ---- |
272 | [TaskType.HeroQualityCollect]= {{7, 3}}, | 278 | [TaskType.HeroQualityCollect]= {{7, 3}}, |
273 | [TaskType.OverOderTask]= {{8, 1}}, | 279 | [TaskType.OverOderTask]= {{8, 1}}, |
274 | [TaskType.VillageApply]= {{9, 1}}, | 280 | [TaskType.VillageApply]= {{9, 1}}, |
@@ -294,10 +300,16 @@ local CalendaTaskListener = { | @@ -294,10 +300,16 @@ local CalendaTaskListener = { | ||
294 | [TaskType.DailyTask] = {{30, 2, f("cur")}}, | 300 | [TaskType.DailyTask] = {{30, 2, f("cur")}}, |
295 | [TaskType.WeekTask] = {{31, 2, f("cur")}}, | 301 | [TaskType.WeekTask] = {{31, 2, f("cur")}}, |
296 | [TaskType.MakeFood] = {{32, 1, f("count")}}, | 302 | [TaskType.MakeFood] = {{32, 1, f("count")}}, |
297 | - [TaskType.AddItem] = {{33, 3, f("type"), f("count")}}, | 303 | + [TaskType.AddItem] = {{33, 3, f("type"), f("count")}, {42, 3, f("id"), f("count")}}, |
298 | [TaskType.CostDiamond] = {{34, 1, f("count")}}, | 304 | [TaskType.CostDiamond] = {{34, 1, f("count")}}, |
299 | [TaskType.DrawHeroNotFriend] = {{35, 1, f("count")}}, | 305 | [TaskType.DrawHeroNotFriend] = {{35, 1, f("count")}}, |
300 | [TaskType.AdvCostPower] = {{36, 1, f("count")}}, | 306 | [TaskType.AdvCostPower] = {{36, 1, f("count")}}, |
307 | + | ||
308 | + [TaskType.AdvUseItem] = {{37, 3, f("itemId"), f("count")}}, | ||
309 | + [TaskType.AdvBuild] = {{38, 3, f("buildId")}}, | ||
310 | + [TaskType.AdvKill] = {{39, 1, f("chapterId")}}, | ||
311 | + [TaskType.ActBattlePass] = {{40, 3, f("chapterId")}}, | ||
312 | + [TaskType.AdvPass] = {{41, 3, f("id")}}, | ||
301 | } | 313 | } |
302 | } | 314 | } |
303 | 315 | ||
@@ -642,17 +654,7 @@ function RoleTask.bind(Role) | @@ -642,17 +654,7 @@ function RoleTask.bind(Role) | ||
642 | self.storeData:OnTriggerLimitTimePack(triggerType, param) | 654 | self.storeData:OnTriggerLimitTimePack(triggerType, param) |
643 | end | 655 | end |
644 | 656 | ||
645 | - function Role:checkCalendaTask(notNotify, mainType, subType, param1, param2) | ||
646 | - --print("check calenda task", mainType, subType, param1, param2) | ||
647 | - local actEnum = "CalendaTask" | ||
648 | - local keyName = "calTask" | ||
649 | - if not self.activity then return end | ||
650 | - local open, actId = self.activity:isOpen(actEnum) | ||
651 | - local actData = csvdb["activity_ctrlCsv"][actId] | ||
652 | - if not actData then return end | ||
653 | - if not open then return end | ||
654 | - | ||
655 | - local change = false | 657 | + function Role:checkActTask(notNotify, keyName, actData, mainType, subType, param1, param2) |
656 | local calTask = self:getProperty(keyName) or {} | 658 | local calTask = self:getProperty(keyName) or {} |
657 | param1 = param1 or 1 | 659 | param1 = param1 or 1 |
658 | 660 | ||
@@ -744,13 +746,49 @@ function RoleTask.bind(Role) | @@ -744,13 +746,49 @@ function RoleTask.bind(Role) | ||
744 | calTask[id] = (calTask[id] or 0) + (param1 or 0) | 746 | calTask[id] = (calTask[id] or 0) + (param1 or 0) |
745 | elseif cfg.type == 28 then -- 完成指定任务 | 747 | elseif cfg.type == 28 then -- 完成指定任务 |
746 | --print(actId,param2, cfg.condition2, param1) | 748 | --print(actId,param2, cfg.condition2, param1) |
747 | - if actId == param2 and cfg.condition2 == param1 then | 749 | + if actData.id == param2 and cfg.condition2 == param1 then |
748 | calTask[id] = (calTask[id] or 0) + 1 | 750 | calTask[id] = (calTask[id] or 0) + 1 |
749 | end | 751 | end |
750 | elseif cfg.type == 33 then -- 获得指定类型道具多少个 | 752 | elseif cfg.type == 33 then -- 获得指定类型道具多少个 |
751 | if cfg.condition2 == param1 then | 753 | if cfg.condition2 == param1 then |
752 | calTask[id] = (calTask[id] or 0) + (param2 or 0) | 754 | calTask[id] = (calTask[id] or 0) + (param2 or 0) |
753 | end | 755 | end |
756 | + elseif cfg.type == 42 then -- 获得指定id道具多少个 | ||
757 | + if cfg.condition2 == param1 then | ||
758 | + calTask[id] = (calTask[id] or 0) + (param2 or 0) | ||
759 | + end | ||
760 | + elseif cfg.type == 6 then -- 代理拾荒次数 | ||
761 | + if cfg.condition2 == 0 or (cfg.condition2 == 1 and param1) then | ||
762 | + calTask[id] = (calTask[id] or 0) + 1 | ||
763 | + end | ||
764 | + elseif cfg.type == 37 then -- 拾荒使用道具 | ||
765 | + if cfg.condition2 == param1 then | ||
766 | + calTask[id] = (calTask[id] or 0) + (param2 or 0) | ||
767 | + end | ||
768 | + elseif cfg.type == 38 then -- 和指定建筑交互 | ||
769 | + local condArr = cfg.condition3:toArray(true, "=") | ||
770 | + for i = 0, #condArr do | ||
771 | + if condArr[i] == param1 then | ||
772 | + calTask[id] = (calTask[id] or 0) + 1 | ||
773 | + break | ||
774 | + end | ||
775 | + end | ||
776 | + elseif cfg.type == 39 then -- 拾荒特定章节消灭敌人 | ||
777 | + local condArr = cfg.condition3:toArray(true, "=") | ||
778 | + for i = 0, #condArr do | ||
779 | + if condArr[i] == param1 then | ||
780 | + calTask[id] = (calTask[id] or 0) + 1 | ||
781 | + break | ||
782 | + end | ||
783 | + end | ||
784 | + elseif cfg.type == 40 then -- 指定活动关卡通关 | ||
785 | + if cfg.condition2 == param1 then | ||
786 | + calTask[id] = (calTask[id] or 0) + 1 | ||
787 | + end | ||
788 | + elseif cfg.type == 41 then -- 通关拾荒指定关卡 | ||
789 | + if cfg.condition2 == param1 then | ||
790 | + calTask[id] = (calTask[id] or 0) + 1 | ||
791 | + end | ||
754 | end | 792 | end |
755 | end | 793 | end |
756 | end | 794 | end |
@@ -758,7 +796,19 @@ function RoleTask.bind(Role) | @@ -758,7 +796,19 @@ function RoleTask.bind(Role) | ||
758 | end | 796 | end |
759 | end | 797 | end |
760 | self:updateProperty({field = keyName, value = calTask, notNotify = notNotify}) | 798 | self:updateProperty({field = keyName, value = calTask, notNotify = notNotify}) |
761 | - --dump(calTask) | 799 | + end |
800 | + | ||
801 | + function Role:checkCalendaTask(notNotify, mainType, subType, param1, param2) | ||
802 | + --print("check calenda task", mainType, subType, param1, param2) | ||
803 | + local actEnum = "CalendaTask" | ||
804 | + local keyName = "calTask" | ||
805 | + if not self.activity then return end | ||
806 | + local open, actId = self.activity:isOpen(actEnum) | ||
807 | + local actData = csvdb["activity_ctrlCsv"][actId] | ||
808 | + if not actData then return end | ||
809 | + if not open then return end | ||
810 | + | ||
811 | + self:checkActTask(notNotify, keyName, actData, mainType, subType, param1, param2) | ||
762 | end | 812 | end |
763 | 813 | ||
764 | function Role:checkBattleCommandTask(notNotify, mainType, subType, param1, param2) | 814 | function Role:checkBattleCommandTask(notNotify, mainType, subType, param1, param2) |
@@ -771,113 +821,7 @@ function RoleTask.bind(Role) | @@ -771,113 +821,7 @@ function RoleTask.bind(Role) | ||
771 | if not actData then return end | 821 | if not actData then return end |
772 | if not open then return end | 822 | if not open then return end |
773 | 823 | ||
774 | - local change = false | ||
775 | - local calTask = self:getProperty(keyName) or {} | ||
776 | - param1 = param1 or 1 | ||
777 | - | ||
778 | - local cid = actData.condition | ||
779 | - for k, taskList in pairs(csvdb["activity_taskCsv"]) do | ||
780 | - if k == cid then | ||
781 | - for id, cfg in pairs(taskList) do | ||
782 | - if cfg.type == mainType then | ||
783 | - if subType == 1 then -- 增加数值 | ||
784 | - calTask[id] = (calTask[id] or 0) + param1 | ||
785 | - elseif subType == 2 then -- 直接赋值 | ||
786 | - calTask[id] = param1 | ||
787 | - elseif subType == 3 then -- 自定义类型 | ||
788 | - if cfg.type == 7 then -- 英雄品质收集进度 | ||
789 | - local count = 0 | ||
790 | - for _, hero in pairs(self.heros) do | ||
791 | - local unitData = csvdb["unitCsv"][hero:getProperty("type")] | ||
792 | - if unitData then | ||
793 | - if cfg.condition2 <= unitData.rare then | ||
794 | - count = count + 1 | ||
795 | - end | ||
796 | - end | ||
797 | - end | ||
798 | - if (calTask[id] or 0) < count then | ||
799 | - calTask[id] = count | ||
800 | - end | ||
801 | - elseif cfg.type == 5 then -- 英雄等级收集进度 | ||
802 | - local count = 0 | ||
803 | - for _, hero in pairs(self.heros) do | ||
804 | - if cfg.condition2 <= hero:getProperty("level") then | ||
805 | - count = count + 1 | ||
806 | - end | ||
807 | - end | ||
808 | - if (calTask[id] or 0) < count then | ||
809 | - calTask[id] = count | ||
810 | - end | ||
811 | - elseif cfg.type == 16 then -- 英雄星级收集进度 | ||
812 | - local count = 0 | ||
813 | - for _, hero in pairs(self.heros) do | ||
814 | - if cfg.condition2 <= hero:getProperty("wakeL") then | ||
815 | - count = count + 1 | ||
816 | - end | ||
817 | - end | ||
818 | - if (calTask[id] or 0) < count then | ||
819 | - calTask[id] = count | ||
820 | - end | ||
821 | - elseif cfg.type == 18 then -- 挂机累计收获id,y个 | ||
822 | - for rid, v in pairs(param1) do | ||
823 | - if cfg.condition2 == rid then | ||
824 | - calTask[id] = (calTask[id] or 0) + v | ||
825 | - end | ||
826 | - end | ||
827 | - elseif cfg.type == 19 then -- x名英雄装备y品质以上符文套装 | ||
828 | - local count = 0 | ||
829 | - for _, hero in pairs(self.heros) do | ||
830 | - local rcount = 0 | ||
831 | - for _,uid in pairs(hero:getRunes()) do | ||
832 | - if uid > 0 then | ||
833 | - local runeData = self.runeBag[uid] | ||
834 | - if runeData then | ||
835 | - local csvData = csvdb["runeCsv"][runeData:getProperty("type")][runeData:getProperty("id")] | ||
836 | - | ||
837 | - if csvData and cfg.condition2 <= csvData.rarity then | ||
838 | - rcount = rcount + 1 | ||
839 | - end | ||
840 | - end | ||
841 | - end | ||
842 | - end | ||
843 | - if rcount == 6 then | ||
844 | - count = count + 1 | ||
845 | - end | ||
846 | - end | ||
847 | - calTask[id] = count | ||
848 | - elseif cfg.type == 20 then -- 开启x品质时钟箱子 | ||
849 | - if cfg.condition2 <= (param2 or 0) then | ||
850 | - calTask[id] = (calTask[id] or 0) + param1 | ||
851 | - end | ||
852 | - elseif cfg.type == 15 then -- 通关关卡 | ||
853 | - if (calTask[id] or 0) == 0 then | ||
854 | - local hangPass = self:getProperty("hangPass") | ||
855 | - local diff = math.floor(cfg.condition2 / 10000) | ||
856 | - if (hangPass[diff] or 0) >= cfg.condition1 then | ||
857 | - calTask[id] = 1 | ||
858 | - end | ||
859 | - end | ||
860 | - elseif cfg.type == 22 then -- 电台任务出勤人数 | ||
861 | - calTask[id] = (calTask[id] or 0) + (param1 or 0) | ||
862 | - elseif cfg.type == 24 then -- 代理拾荒出勤人数 | ||
863 | - calTask[id] = (calTask[id] or 0) + (param1 or 0) | ||
864 | - elseif cfg.type == 28 then -- 完成指定任务 | ||
865 | - --print(actId,param2, cfg.condition2, param1) | ||
866 | - if actId == param2 and cfg.condition2 == param1 then | ||
867 | - calTask[id] = (calTask[id] or 0) + 1 | ||
868 | - end | ||
869 | - elseif cfg.type == 33 then -- 获得指定类型道具多少个 | ||
870 | - if cfg.condition2 == param1 then | ||
871 | - calTask[id] = (calTask[id] or 0) + (param2 or 0) | ||
872 | - end | ||
873 | - end | ||
874 | - end | ||
875 | - end | ||
876 | - end | ||
877 | - end | ||
878 | - end | ||
879 | - self:updateProperty({field = keyName, value = calTask, notNotify = notNotify}) | ||
880 | - --dump(calTask) | 824 | + self:checkActTask(notNotify, keyName, actData, mainType, subType, param1, param2) |
881 | end | 825 | end |
882 | 826 | ||
883 | end | 827 | end |
src/models/Store.lua
@@ -375,6 +375,14 @@ function Store:OnTriggerLimitTimePack(eventType, param) | @@ -375,6 +375,14 @@ function Store:OnTriggerLimitTimePack(eventType, param) | ||
375 | gift_id = rechargeCfg.id, --礼包ID | 375 | gift_id = rechargeCfg.id, --礼包ID |
376 | gift_name = rechargeCfg.title, --礼包名称 | 376 | gift_name = rechargeCfg.title, --礼包名称 |
377 | }) | 377 | }) |
378 | + -- 每日抽卡限时礼包 触发重置 | ||
379 | + if eventType == TriggerEventType.DrawHeroCnt then | ||
380 | + local payR = self:getProperty("payR") | ||
381 | + if payR[rechargeCfg.id] then | ||
382 | + payR[rechargeCfg.id] = nil | ||
383 | + self:updateProperty({field = "payR", value = payR}) | ||
384 | + end | ||
385 | + end | ||
378 | self:updateProperty({field = "limitTPack", value = limitPack}) | 386 | self:updateProperty({field = "limitTPack", value = limitPack}) |
379 | end | 387 | end |
380 | end | 388 | end |