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 | 242 | BuffEffect = 27, -- buff 效果 |
243 | 243 | PassiveEffect = 28, -- 被动 效果 |
244 | 244 | ChooseDice = 29, -- 选择点随机效果 |
245 | + NoEffect = 30, -- 没有效果 | |
245 | 246 | } |
246 | 247 | |
247 | 248 | AdvScoreType = { |
... | ... | @@ -355,6 +356,7 @@ TriggerEventType = { |
355 | 356 | AddNewHero = 5, |
356 | 357 | SSRCount = 6, |
357 | 358 | AfterTs = 7, -- 某时间以后 |
359 | + DrawHeroCnt = 8, -- 每日抽卡次数 | |
358 | 360 | } |
359 | 361 | |
360 | 362 | DrawCardType = { | ... | ... |
src/actions/ActivityAction.lua
... | ... | @@ -723,7 +723,9 @@ function _M.endBattleRpc(agent, data) |
723 | 723 | if check[cond[1]] and check[cond[1]](table.unpack(cond)) then |
724 | 724 | curStar = curStar + (1 << (i - 1)) |
725 | 725 | end |
726 | - end | |
726 | + end | |
727 | + | |
728 | + role:checkTaskEnter("ActBattlePass", {chapterId = id}) | |
727 | 729 | else |
728 | 730 | curStar = 0 |
729 | 731 | if battleCfg.rank ~= 0 then |
... | ... | @@ -1302,21 +1304,21 @@ function _M.newSignRpc(agent, data) |
1302 | 1304 | if not open then return 1 end |
1303 | 1305 | |
1304 | 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 | 1308 | return 2 |
1307 | 1309 | end |
1308 | 1310 | |
1309 | 1311 | local actCfg = csvdb["activity_signInCsv"][actId] |
1310 | 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 | 1315 | local award = {} |
1314 | 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 | 1318 | for id, value in pairs(data.reward:toNumMap()) do |
1317 | 1319 | award[id] = (award[id] or 0) + value |
1318 | 1320 | end |
1319 | - actData[data.day] = 1 | |
1321 | + actData[tostring(data.day)] = 1 | |
1320 | 1322 | end |
1321 | 1323 | end |
1322 | 1324 | ... | ... |
src/actions/AdvAction.lua
... | ... | @@ -334,7 +334,7 @@ function _M.startHangRpc(agent, data) |
334 | 334 | role:changeUpdates({{type = "advHang", field = chapterId, value = info}}) |
335 | 335 | |
336 | 336 | role:changeAdvCount(adv_idle_energy) |
337 | - role:checkTaskEnter("AdvStart", {id = chapterId}) | |
337 | + role:checkTaskEnter("AdvStart", {id = chapterId, actid = actid}) | |
338 | 338 | role:mylog("adv_action", {desc = "startHang", int1 = chapterId}) |
339 | 339 | |
340 | 340 | SendPacket(actionCodes.Adv_startHangRpc, '') | ... | ... |
src/actions/GmAction.lua
... | ... | @@ -80,6 +80,10 @@ function _M.pvp_cross_head(role, pms) |
80 | 80 | return "成功" |
81 | 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 | 88 | local helpDes = {{"描述", "指令", "参数1", "参数2" ,"参数3"}} |
85 | 89 | |
... | ... | @@ -580,6 +584,50 @@ function _M.clearbag(role, pms) |
580 | 584 | return "成功" |
581 | 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 | 631 | function _M.helpRpc(agent, data) |
584 | 632 | SendPacket(actionCodes.Gm_helpRpc, MsgPack.pack({help = helpDes})) |
585 | 633 | return true | ... | ... |
src/actions/HeroAction.lua
... | ... | @@ -72,6 +72,7 @@ function _M.breakRpc( agent, data ) |
72 | 72 | if hero:getProperty("level") < hero:getMaxLevel() then return 2 end |
73 | 73 | if hero:getProperty("breakL") >= #csvdb["unit_breakCsv"] then return 3 end |
74 | 74 | local curData = csvdb["unit_breakCsv"][hero:getProperty("breakL")] |
75 | + if hero:getProperty("wakeL") < curData["starLimit"] then return 4 end | |
75 | 76 | local cost = {[ItemId.BreakCost] = curData.cost, [ItemId.Gold] = curData.gold} |
76 | 77 | if not role:checkItemEnough(cost) then return 4 end |
77 | 78 | role:costItems(cost, {log = {desc = "heroBreak", int1 = msg.id, int2 = hero:getProperty("type")}}) |
... | ... | @@ -914,6 +915,8 @@ function _M.drawHeroRpc(agent, data) |
914 | 915 | local ssrCount = 0 |
915 | 916 | local reward = {} |
916 | 917 | local logReward = {} |
918 | + -- 限时礼包 | |
919 | + local dailyDrawCnt = role.dailyData:getProperty("drawHeroCnt") or 0 | |
917 | 920 | for i = 1, drawCount[drawType] do |
918 | 921 | floorHeroCount = floorHeroCount + 1 |
919 | 922 | local isFloorBack = draw_floor_back_counts and floorHeroCount >= draw_floor_back_counts |
... | ... | @@ -962,8 +965,13 @@ function _M.drawHeroRpc(agent, data) |
962 | 965 | logReward[itemId] = (logReward[itemId] or 0) + 1 |
963 | 966 | table.insert(reward, {id = itemId, count = 1}) |
964 | 967 | end |
968 | + | |
969 | + dailyDrawCnt = dailyDrawCnt + 1 | |
970 | + role:checkTaskEnter("DrawHeroLimitPack", {count = dailyDrawCnt}) | |
965 | 971 | end |
966 | 972 | |
973 | + role.dailyData:setProperty("drawHeroCnt", dailyDrawCnt) | |
974 | + | |
967 | 975 | if draw_floor_back_counts then |
968 | 976 | local floorHero = role:getProperty("floorHero") |
969 | 977 | floorHero[btype] = floorHeroCount |
... | ... | @@ -1126,7 +1134,7 @@ function _M.changeCrown(agent, data) |
1126 | 1134 | |
1127 | 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 | 1138 | role:setProperty("crown", heroType) |
1131 | 1139 | |
1132 | 1140 | role:log("hero_show", { | ... | ... |
src/adv/Adv.lua
... | ... | @@ -160,8 +160,11 @@ function Adv:initByChapter(params) |
160 | 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 | 168 | end |
166 | 169 | |
167 | 170 | if not notNotify then |
... | ... | @@ -240,7 +243,6 @@ end |
240 | 243 | |
241 | 244 | function Adv:awardRelay(relayData, notNotify) |
242 | 245 | local gift = {} |
243 | - | |
244 | 246 | if relayData.artifact > 0 then |
245 | 247 | local pool = {} |
246 | 248 | for id, temp in pairs(csvdb["adv_artifactCsv"]) do |
... | ... | @@ -265,7 +267,9 @@ function Adv:awardRelay(relayData, notNotify) |
265 | 267 | local dropData = csvdb["event_dropCsv"][dropId] |
266 | 268 | if dropData then |
267 | 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 | 273 | else |
270 | 274 | skynet.error(string.format("[ERROR]: event_dropCsv no id %s, adv_chapter_campsite", dropId)) |
271 | 275 | end |
... | ... | @@ -827,7 +831,7 @@ function Adv:over(success, rewardRatio, overType) |
827 | 831 | local actData = self.owner.activity:getActData("AdvLevel") |
828 | 832 | |
829 | 833 | -- 计算活动积分up |
830 | - local upMap = actCfg["upCharacter"] | |
834 | + local upMap = actCfg["upCharacter"]:toNumMap() | |
831 | 835 | local team = self.owner:getProperty("advTeam") |
832 | 836 | local format = self.owner:getTeamHerosInfo(team).heros |
833 | 837 | local upVal = 0 |
... | ... | @@ -1131,6 +1135,7 @@ function Adv:useItem(itemId, count, target) |
1131 | 1135 | end |
1132 | 1136 | |
1133 | 1137 | self:checkAchievement(self.AchievType.UseItem, count, itemId) |
1138 | + self.owner:checkTaskEnter("AdvUseItem", {itemId = itemId, count = count}) | |
1134 | 1139 | self:mylog({desc = "useItem", int1 = itemId, int2 = count}) |
1135 | 1140 | |
1136 | 1141 | self.owner:log("mission_pick_use", { |
... | ... | @@ -1191,7 +1196,8 @@ function Adv:supplyPotion() |
1191 | 1196 | local old = advItems:getv(potionId,0) |
1192 | 1197 | local need = max - old |
1193 | 1198 | |
1194 | - if need < count then | |
1199 | + if need < 0 then | |
1200 | + elseif need < count then | |
1195 | 1201 | advItems = advItems:setv(potionId,max) |
1196 | 1202 | potionBag[potionId] = count - need |
1197 | 1203 | else |
... | ... | @@ -1376,7 +1382,7 @@ local function checkChooseCondFunc(self, condStr, room, block, tag, chooseData) |
1376 | 1382 | for _, room in pairs(self:getCurMap().rooms) do |
1377 | 1383 | for _, block in pairs(room.blocks) do |
1378 | 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 | 1386 | if block.event.id == monsterId then |
1381 | 1387 | return false |
1382 | 1388 | end |
... | ... | @@ -1386,7 +1392,7 @@ local function checkChooseCondFunc(self, condStr, room, block, tag, chooseData) |
1386 | 1392 | else |
1387 | 1393 | for _, cblock in ipairs(self:getCurMap():getBlocksBySize(room.roomId, block.blockId, size)) do |
1388 | 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 | 1396 | if cblock.event.id == monsterId then |
1391 | 1397 | return false |
1392 | 1398 | end |
... | ... | @@ -1401,7 +1407,7 @@ local function checkChooseCondFunc(self, condStr, room, block, tag, chooseData) |
1401 | 1407 | for _, room in pairs(self:getCurMap().rooms) do |
1402 | 1408 | for _, block in pairs(room.blocks) do |
1403 | 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 | 1411 | if block.event.id == buildId then |
1406 | 1412 | return false |
1407 | 1413 | end |
... | ... | @@ -1411,7 +1417,7 @@ local function checkChooseCondFunc(self, condStr, room, block, tag, chooseData) |
1411 | 1417 | else |
1412 | 1418 | for _, cblock in ipairs(self:getCurMap():getBlocksBySize(room.roomId, block.blockId, size)) do |
1413 | 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 | 1421 | if cblock.event.id == buildId then |
1416 | 1422 | return false |
1417 | 1423 | end |
... | ... | @@ -1426,7 +1432,7 @@ local function checkChooseCondFunc(self, condStr, room, block, tag, chooseData) |
1426 | 1432 | for _, room in pairs(self:getCurMap().rooms) do |
1427 | 1433 | for _, block in pairs(room.blocks) do |
1428 | 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 | 1436 | if block.event.id == chooseId then |
1431 | 1437 | return false |
1432 | 1438 | end |
... | ... | @@ -1436,7 +1442,7 @@ local function checkChooseCondFunc(self, condStr, room, block, tag, chooseData) |
1436 | 1442 | else |
1437 | 1443 | for _, cblock in ipairs(self:getCurMap():getBlocksBySize(room.roomId, block.blockId, size)) do |
1438 | 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 | 1446 | if cblock.event.id == chooseId then |
1441 | 1447 | return false |
1442 | 1448 | end |
... | ... | @@ -1470,7 +1476,9 @@ local function doChooseEffect(self, effectStr, room, block, tag, chooseData) |
1470 | 1476 | local dropData = csvdb["event_dropCsv"][dropId] |
1471 | 1477 | if dropData then |
1472 | 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 | 1482 | else |
1475 | 1483 | skynet.error(string.format("[ERROR]: event_dropCsv no id %s in %s id: %s", dropId, tag, chooseData.id)) |
1476 | 1484 | end |
... | ... | @@ -1755,6 +1763,7 @@ local function clickBuild(self, room, block, params) |
1755 | 1763 | self:checkTask(Adv.TaskType.Build, 1, oldId) |
1756 | 1764 | self:checkAchievement(Adv.AchievType.Build, 1, oldId) |
1757 | 1765 | self:checkAchievement(Adv.AchievType.BuildBySelect, 1, oldId, choose) |
1766 | + self.owner:checkTaskEnter("AdvBuild", {buildId = oldId}) | |
1758 | 1767 | |
1759 | 1768 | if clearBlock then |
1760 | 1769 | block:clear() |
... | ... | @@ -1777,7 +1786,9 @@ local function clickClick(self, room, block, params) |
1777 | 1786 | local reward = {} |
1778 | 1787 | for _, dropId in ipairs(clickData.effect:toArray(true, "=")) do |
1779 | 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 | 1792 | end |
1782 | 1793 | self:award(reward, {log = {desc = "clickClick", int1 = block.event.id}}, {roomId = room.roomId, blockId = block.blockId}) |
1783 | 1794 | end, |
... | ... | @@ -1878,6 +1889,18 @@ function Adv:clickBlock(roomId, blockId, params) |
1878 | 1889 | return |
1879 | 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 | 1904 | if block:isHinder() then |
1882 | 1905 | if not checkAroundBlocks(true) then return end |
1883 | 1906 | end |
... | ... | @@ -2012,9 +2035,18 @@ function Adv:doActive(activeId, target) |
2012 | 2035 | -- 5:放逐目标 |
2013 | 2036 | doActiveEffect[5] = function(_) |
2014 | 2037 | for _, target in ipairs(targers) do |
2038 | + local had = false | |
2015 | 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 | 2050 | end |
2019 | 2051 | end |
2020 | 2052 | return true |
... | ... | @@ -2043,13 +2075,8 @@ function Adv:doActive(activeId, target) |
2043 | 2075 | end |
2044 | 2076 | |
2045 | 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 | 2080 | return true |
2054 | 2081 | end |
2055 | 2082 | |
... | ... | @@ -2279,7 +2306,7 @@ function Adv:enemyDead(enemy, escape) |
2279 | 2306 | end |
2280 | 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 | 2312 | if block.event.item and block.event.item[1] ~= 0 then |
... | ... | @@ -2319,6 +2346,8 @@ function Adv:enemyDead(enemy, escape) |
2319 | 2346 | self:checkAchievement(Adv.AchievType.Kill, 1, enemyId) |
2320 | 2347 | self:checkAchievement(Adv.AchievType.KillHadBuff, 1, enemy) |
2321 | 2348 | |
2349 | + self.owner:checkTaskEnter("AdvKill", {chapterId = self.chapterId}) | |
2350 | + | |
2322 | 2351 | self:checkAchievement(Adv.AchievType.KillWithBuff, 1) |
2323 | 2352 | self:checkAchievement(Adv.AchievType.KillNoBuff, 1) |
2324 | 2353 | self:checkAchievement(Adv.AchievType.KillWithMWeapon, 1) | ... | ... |
src/adv/AdvBlock.lua
... | ... | @@ -134,6 +134,9 @@ function Block:randomEvent() |
134 | 134 | randomFunc[AdvEventType.Drop] = function() |
135 | 135 | if not self.event.item then |
136 | 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 | 140 | end |
138 | 141 | end |
139 | 142 | --交易 | ... | ... |
src/adv/AdvBuff.lua
src/adv/AdvMap.lua
... | ... | @@ -383,6 +383,24 @@ function Map:getAroundBlocks(room, block) |
383 | 383 | return blocks |
384 | 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 | 404 | function Map:getBlocksBySize(roomId, blockId, size) |
387 | 405 | local blocks = {} |
388 | 406 | local room = self.rooms[roomId] |
... | ... | @@ -877,7 +895,7 @@ getEventLib = function(self, needEventType) -- needEventType 需要的事件 |
877 | 895 | level = AdvCommon.getEndlessDataLv(chapterId, level) |
878 | 896 | end |
879 | 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 | 899 | ["event_chooseCsv"] = AdvEventType.Choose, |
882 | 900 | ["event_dropCsv"] = AdvEventType.Drop, |
883 | 901 | ["event_buildingCsv"] = AdvEventType.Build, | ... | ... |
src/adv/AdvPassive.lua
... | ... | @@ -527,8 +527,9 @@ function Passive:effect8(dropId) |
527 | 527 | skynet.error(string.format("CSVDATA Error adv_map_passive %s effect 8 not id %s in event_drop", self.id, dropId)) |
528 | 528 | end |
529 | 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 | 533 | end |
533 | 534 | |
534 | 535 | --9=直接获得item(可在结算触发时使用) | ... | ... |
src/adv/AdvPlayer.lua
... | ... | @@ -677,6 +677,10 @@ function Enemy:getClassify() |
677 | 677 | return csvdb["event_monsterCsv"][self.monsterId].classify |
678 | 678 | end |
679 | 679 | |
680 | +function Enemy:getMonsterCsv() | |
681 | + return csvdb["event_monsterCsv"][self.monsterId] | |
682 | +end | |
683 | + | |
680 | 684 | -- 0=所有 1=怪物 2=玩家 |
681 | 685 | function Enemy:checkAuraBuff(buffs) |
682 | 686 | local needBuffs = {} |
... | ... | @@ -795,7 +799,7 @@ function Player:changeSp(value, cType) |
795 | 799 | if cType == 0 then |
796 | 800 | change = value |
797 | 801 | elseif cType == 1 then |
798 | - change = self.sp * value / 100 | |
802 | + change = self.spMax * value / 100 | |
799 | 803 | end |
800 | 804 | local old = self.sp |
801 | 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 | 1097 | -- end, |
1098 | 1098 | ["crossDay"] = function(self, actType, notify) |
1099 | 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 | 1107 | self:updateActData(actType, curData, not notify) |
... | ... | @@ -1146,7 +1148,6 @@ local function closeActAdvHang(role, chapterId) |
1146 | 1148 | end |
1147 | 1149 | reward, change = role:award(idleReward, {log = {desc = "advHang", int1 = chapterId}}) |
1148 | 1150 | end |
1149 | - | |
1150 | 1151 | role:changeUpdates({{type = "advHang", field = chapterId, value = nil}}) |
1151 | 1152 | |
1152 | 1153 | role:mylog("adv_action", {desc = "endHang", int1 = chapterId, short1 = 2}) |
... | ... | @@ -1163,13 +1164,17 @@ activityFunc[Activity.ActivityType.AdvLevel] = { |
1163 | 1164 | ["close"] = function(self, actType, notify, actid) |
1164 | 1165 | local actCfg = csvdb["activity_adv_chapterCsv"][actid] |
1165 | 1166 | if not actCfg then return end |
1166 | - for chapterId, _ in ipairs(actCfg) do | |
1167 | + for chapterId, _ in pairs(actCfg) do | |
1167 | 1168 | local advPass = self.owner:getProperty("advPass") |
1168 | 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 | 1178 | end |
1174 | 1179 | -- 强制关闭活动拾荒关卡 |
1175 | 1180 | local adv = self.owner:getAdvData() | ... | ... |
src/models/Daily.lua
src/models/RoleTask.lua
... | ... | @@ -16,6 +16,7 @@ local TaskType = { |
16 | 16 | HeroQualityCollect = 11, -- 英雄品质收集进度 |
17 | 17 | HeroStarCollect = 12, -- 英雄星级收集进度 |
18 | 18 | DrawHeroNotFriend = 13, -- 非友情招募 -- count |
19 | + DrawHeroLimitPack = 14, -- 抽卡限时礼貌 -- count | |
19 | 20 | |
20 | 21 | --装备相关 |
21 | 22 | AddEquip = 101, -- 获得装备 - equipId rarity |
... | ... | @@ -56,6 +57,9 @@ local TaskType = { |
56 | 57 | AdvHangHeroCnt = 416, -- 拾荒人数 |
57 | 58 | AdvCostPower = 417, -- 消耗体力 |
58 | 59 | AdvPassFirst = 418, -- 冒险首次通关 - id |
60 | + AdvUseItem = 419, -- 使用道具 - itemId count | |
61 | + AdvBuild = 420, -- 建筑交互 - buildId | |
62 | + AdvKill = 421, -- 拾荒击败敌人 | |
59 | 63 | |
60 | 64 | --爬塔相关 |
61 | 65 | TowerPass = 501, -- 爬塔通关 - level |
... | ... | @@ -104,6 +108,7 @@ local TaskType = { |
104 | 108 | Login = 908, -- 登入 |
105 | 109 | CostDiamond = 909, -- 消耗钻石 |
106 | 110 | WeekTask = 910, -- 完成每周活跃任务 |
111 | + ActBattlePass = 911, -- 活动关卡通关 -- chapterId | |
107 | 112 | |
108 | 113 | --功能未实现 todo |
109 | 114 | AdvShop = 1002, -- 冒险商城 |
... | ... | @@ -257,6 +262,7 @@ local StoreListener = { |
257 | 262 | [TaskType.TowerPass] = {{TriggerEventType.TowerPass, f("level")}}, |
258 | 263 | [TaskType.AdvPassFirst] = {{TriggerEventType.AdvPass, f("id")}}, |
259 | 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 | 274 | [TaskType.AdvStart]= {{3, 1}}, |
269 | 275 | [TaskType.DinerLevelUp]= {{4, 2, f("level")}}, |
270 | 276 | [TaskType.HeroLvlCollect]= {{5, 3}}, -- x名y级英雄 |
271 | - [TaskType.AdvHang]= {{6, 1}}, ---- | |
277 | + [TaskType.AdvHang]= {{6, 3, f("actid")}}, ---- | |
272 | 278 | [TaskType.HeroQualityCollect]= {{7, 3}}, |
273 | 279 | [TaskType.OverOderTask]= {{8, 1}}, |
274 | 280 | [TaskType.VillageApply]= {{9, 1}}, |
... | ... | @@ -294,10 +300,16 @@ local CalendaTaskListener = { |
294 | 300 | [TaskType.DailyTask] = {{30, 2, f("cur")}}, |
295 | 301 | [TaskType.WeekTask] = {{31, 2, f("cur")}}, |
296 | 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 | 304 | [TaskType.CostDiamond] = {{34, 1, f("count")}}, |
299 | 305 | [TaskType.DrawHeroNotFriend] = {{35, 1, f("count")}}, |
300 | 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 | 654 | self.storeData:OnTriggerLimitTimePack(triggerType, param) |
643 | 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 | 658 | local calTask = self:getProperty(keyName) or {} |
657 | 659 | param1 = param1 or 1 |
658 | 660 | |
... | ... | @@ -744,13 +746,49 @@ function RoleTask.bind(Role) |
744 | 746 | calTask[id] = (calTask[id] or 0) + (param1 or 0) |
745 | 747 | elseif cfg.type == 28 then -- 完成指定任务 |
746 | 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 | 750 | calTask[id] = (calTask[id] or 0) + 1 |
749 | 751 | end |
750 | 752 | elseif cfg.type == 33 then -- 获得指定类型道具多少个 |
751 | 753 | if cfg.condition2 == param1 then |
752 | 754 | calTask[id] = (calTask[id] or 0) + (param2 or 0) |
753 | 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 | 792 | end |
755 | 793 | end |
756 | 794 | end |
... | ... | @@ -758,7 +796,19 @@ function RoleTask.bind(Role) |
758 | 796 | end |
759 | 797 | end |
760 | 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 | 812 | end |
763 | 813 | |
764 | 814 | function Role:checkBattleCommandTask(notNotify, mainType, subType, param1, param2) |
... | ... | @@ -771,113 +821,7 @@ function RoleTask.bind(Role) |
771 | 821 | if not actData then return end |
772 | 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 | 825 | end |
882 | 826 | |
883 | 827 | end | ... | ... |
src/models/Store.lua
... | ... | @@ -375,6 +375,14 @@ function Store:OnTriggerLimitTimePack(eventType, param) |
375 | 375 | gift_id = rechargeCfg.id, --礼包ID |
376 | 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 | 386 | self:updateProperty({field = "limitTPack", value = limitPack}) |
379 | 387 | end |
380 | 388 | end | ... | ... |