Commit 5f44b03d27849f86eea62556fd7b0c5b5f590e6a
Merge branch 'tr/bugfix' into tr/publish/preview
Showing
2 changed files
with
42 additions
and
5 deletions
Show diff stats
src/actions/GmAction.lua
@@ -588,6 +588,42 @@ function _M.notice(role, pms) | @@ -588,6 +588,42 @@ function _M.notice(role, pms) | ||
588 | return "成功" | 588 | return "成功" |
589 | end | 589 | end |
590 | 590 | ||
591 | +table.insert(helpDes, {"活动关卡", "actbp", "id", "actid"}) | ||
592 | +function _M.actbp(role, pms) | ||
593 | + local id = tonum(pms.pm1, 0) | ||
594 | + local actid = tonum(pms.pm2, 0) | ||
595 | + if not role.activity:isOpenById(actid, "ChallengeLevel") then return end | ||
596 | + local actData = role.activity:getActData("ChallengeLevel") or {} | ||
597 | + | ||
598 | + local actCfg = csvdb["activity_battleCsv"][actid] | ||
599 | + if not actCfg then return end | ||
600 | + for k, v in pairs(actCfg) do | ||
601 | + if k <= id then | ||
602 | + local bpInfo = actData[i] or {} | ||
603 | + bpInfo["star"] = 1 | ||
604 | + actData[k] = bpInfo | ||
605 | + end | ||
606 | + end | ||
607 | + role.activity:updateActData("ChallengeLevel", actData) | ||
608 | + | ||
609 | + return "成功" | ||
610 | +end | ||
611 | + | ||
612 | +table.insert(helpDes, {"活动拾荒", "actadv", "id", "actid"}) | ||
613 | +function _M.actadv(role, pms) | ||
614 | + local id = tonum(pms.pm1, 0) | ||
615 | + local actid = tonum(pms.pm2, 0) | ||
616 | + if not role.activity:isOpenById(actid, "AdvLevel") then return end | ||
617 | + local actData = role.activity:getActData("AdvLevel") or {} | ||
618 | + local advInfo = actData[id] | ||
619 | + advInfo["pass"] = 1 | ||
620 | + actData[id] = advInfo | ||
621 | + | ||
622 | + role.activity:updateActData("AdvLevel", actData) | ||
623 | + | ||
624 | + return "成功" | ||
625 | +end | ||
626 | + | ||
591 | function _M.helpRpc(agent, data) | 627 | function _M.helpRpc(agent, data) |
592 | SendPacket(actionCodes.Gm_helpRpc, MsgPack.pack({help = helpDes})) | 628 | SendPacket(actionCodes.Gm_helpRpc, MsgPack.pack({help = helpDes})) |
593 | return true | 629 | return true |
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,7 +1164,7 @@ activityFunc[Activity.ActivityType.AdvLevel] = { | @@ -1163,7 +1164,7 @@ 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 | local advRelay = self.owner:getProperty("advRelay") | 1170 | local advRelay = self.owner:getProperty("advRelay") |