Commit 7cbf1146567ed3e19f0426b8711163cd046d16c3
去除advmap monster类型
Showing
7 changed files
with
58 additions
and
31 deletions
Show diff stats
src/actions/ActivityAction.lua
... | ... | @@ -612,7 +612,10 @@ function _M.endBattleRpc(agent, data) |
612 | 612 | local isWin = msg.isWin |
613 | 613 | local heros = msg.heros |
614 | 614 | local support = msg.support |
615 | - if not role.activity:isOpenById(actid, "ChallengeLevel") then return 1 end | |
615 | + if not role.activity:isOpenById(actid, "ChallengeLevel") then | |
616 | + SendPacket(actionCodes.Activity_endBattleRpc, MsgPack.pack({})) | |
617 | + return true | |
618 | + end | |
616 | 619 | |
617 | 620 | if not role.__actBattleCache then return 2 end |
618 | 621 | |
... | ... | @@ -1179,14 +1182,13 @@ function _M.battleCommandRpc(agent, data) |
1179 | 1182 | local flag = string.char(string.getbit(record, i)) |
1180 | 1183 | if flag == "0" then |
1181 | 1184 | record = string.setbit(record, i) |
1185 | + local awd = cfg[rewardKey] | |
1186 | + for k, v in pairs(awd:toNumMap()) do | |
1187 | + award[k] = (award[k] or 0) + v | |
1188 | + end | |
1182 | 1189 | end |
1183 | - record = string.setbit(record, i) | |
1184 | 1190 | actData[typeKey] = record |
1185 | 1191 | |
1186 | - local awd = cfg[rewardKey] | |
1187 | - for k, v in pairs(awd:toNumMap()) do | |
1188 | - award[k] = (award[k] or 0) + v | |
1189 | - end | |
1190 | 1192 | end |
1191 | 1193 | end |
1192 | 1194 | else | ... | ... |
src/actions/AdvAction.lua
... | ... | @@ -57,6 +57,15 @@ local function checkFormat(role, format, checkAdvTeam) |
57 | 57 | end |
58 | 58 | end |
59 | 59 | |
60 | + -- 多队挂机 电台任务英雄也不能重用 | |
61 | + local radioTask = role:getProperty("radioTask") | |
62 | + for id, taskInfo in pairs(radioTask) do | |
63 | + local heros = taskInfo["heros"] or {} | |
64 | + for _, heroId in ipairs(heros) do | |
65 | + hadHero[heroId] = true | |
66 | + end | |
67 | + end | |
68 | + | |
60 | 69 | if not format.leader then return end |
61 | 70 | if format.leader2 == format.leader then return end |
62 | 71 | local hadLeader = false |
... | ... | @@ -158,7 +167,7 @@ function _M.startAdvRpc( agent, data ) |
158 | 167 | else -- 普通模式判断 |
159 | 168 | if layer >= chapterData.limitlevel then return 4 end |
160 | 169 | |
161 | - local relayData = role:getAdvData():isHaveRelay(layer, chapterId) | |
170 | + local relayData = role:getAdvData():isHaveRelay(layer, chapterId, true) | |
162 | 171 | if not relayData then return 6 end -- 不是中继层 |
163 | 172 | if layer ~= 1 then |
164 | 173 | if (advPass[chapterId] or 0) < relayData.floor then return 21 end |
... | ... | @@ -227,8 +236,10 @@ function _M.startHangRpc(agent, data) |
227 | 236 | actCfg = actCfg[chapterId] |
228 | 237 | if not actCfg then return 22 end |
229 | 238 | |
230 | - local st = toUnixtime(actCfg["unlockTime"]..string_format("%02x", RESET_TIME)) | |
231 | - if st > skynet.timex() then return 23 end | |
239 | + if actCfg["unlockTime"] ~= 0 then | |
240 | + local st = toUnixtime(actCfg["unlockTime"]..string_format("%02x", RESET_TIME)) | |
241 | + if st > skynet.timex() then return 23 end | |
242 | + end | |
232 | 243 | |
233 | 244 | if actCfg["prepose"] ~= "" then |
234 | 245 | local type, cid = actCfg["prepose"]:toArray(true, "=") |
... | ... | @@ -292,7 +303,8 @@ function _M.startHangRpc(agent, data) |
292 | 303 | + 0.226 * player["hit"] |
293 | 304 | + 0.26 * player["miss"] |
294 | 305 | |
295 | - if battleV < campSiteData.idleValue then return 9 end -- 战斗力是否满足 | |
306 | + --print(math.ceil(battleV), campSiteData.idleValue) | |
307 | + if math.ceil(battleV) < campSiteData.idleValue then return 9 end -- 战斗力是否满足 | |
296 | 308 | |
297 | 309 | local info = {} |
298 | 310 | info.format = {} | ... | ... |
src/actions/StoreAction.lua
... | ... | @@ -232,6 +232,13 @@ function _M.getFreeChestRpc(agent, data) |
232 | 232 | local config = csvdb["shop_rechargeCsv"][id] |
233 | 233 | if not config then return end |
234 | 234 | |
235 | + --判断是否是活动商品 | |
236 | + if config.activity_id ~= 0 then | |
237 | + local actCfg = csvdb["activity_ctrlCsv"][config.activity_id] | |
238 | + if not actCfg then return 2 end | |
239 | + if not role.activity:isOpenById(config.activity_id, "ActShopGoods") then return 3 end | |
240 | + end | |
241 | + | |
235 | 242 | local rechargeRecord = role.storeData:getProperty("payR") |
236 | 243 | local getCount = (rechargeRecord[id] or 0) |
237 | 244 | if getCount >= config.limit then | ... | ... |
src/adv/Adv.lua
... | ... | @@ -62,10 +62,10 @@ function Adv:initByInfo(advInfo) |
62 | 62 | self:initBattle(advInfo) |
63 | 63 | end |
64 | 64 | -- 找出level 是否存在中继层 |
65 | -function Adv:isHaveRelay(level, chapterId) | |
65 | +function Adv:isHaveRelay(level, chapterId, force) | |
66 | 66 | level = level or self.level |
67 | 67 | chapterId = chapterId or self.chapterId |
68 | - if level == 1 then return end | |
68 | + if level == 1 and not force then return end | |
69 | 69 | |
70 | 70 | local campsiteCsv = csvdb["adv_chapter_campsiteCsv"][chapterId] |
71 | 71 | for _, campsite in ipairs(campsiteCsv) do |
... | ... | @@ -815,7 +815,8 @@ function Adv:over(success, rewardRatio, overType) |
815 | 815 | if not actCfg then break end |
816 | 816 | actCfg = actCfg[self.chapterId] |
817 | 817 | if not actCfg then break end |
818 | - itemId, scoreCoef = actCfg["transform"]:toArray(true, "=") | |
818 | + local arr = actCfg["transform"]:toArray(true, "=") | |
819 | + itemId, scoreCoef = arr[1], arr[2] | |
819 | 820 | local actData = self.owner.activity:getActData("AdvLevel") |
820 | 821 | |
821 | 822 | -- 计算活动积分up |
... | ... | @@ -830,6 +831,7 @@ function Adv:over(success, rewardRatio, overType) |
830 | 831 | score = math.floor(score * (1 + upVal / 100)) |
831 | 832 | |
832 | 833 | local advInfo = actData[self.chapterId] or {} |
834 | + --print("upVal", upVal, score, advInfo["max"], itemId, scoreCoef) | |
833 | 835 | local maxScore = advInfo["max"] or 0 |
834 | 836 | local flag = false |
835 | 837 | if success then |
... | ... | @@ -955,6 +957,7 @@ function Adv:over(success, rewardRatio, overType) |
955 | 957 | }) |
956 | 958 | |
957 | 959 | local chapterId = self.chapterId |
960 | + local actid = self.actid | |
958 | 961 | self:clear() |
959 | 962 | self.owner:checkTaskEnter("AdvScore", {score = score}) |
960 | 963 | |
... | ... | @@ -973,7 +976,7 @@ function Adv:over(success, rewardRatio, overType) |
973 | 976 | scoreAward = scoreReward, |
974 | 977 | chapterId = chapterId, |
975 | 978 | backAdvCount = backAdvCount, |
976 | - actid = self.actid | |
979 | + actid = actid | |
977 | 980 | }) |
978 | 981 | end |
979 | 982 | ... | ... |
src/models/HeroPlugin.lua
... | ... | @@ -53,22 +53,25 @@ function HeroPlugin.bind(Hero) |
53 | 53 | local talentAttrS = {} |
54 | 54 | |
55 | 55 | -- 四个基础属性 |
56 | - local curData = csvdb["unit_talentCsv"][talent:getv(0, 1)] | |
57 | - local curTalentLvl = 0 | |
58 | - if not curData then -- 已经满阶段了 | |
59 | - local cfgName = "unit_talent_"..heroCfgId.."Csv" | |
60 | - curData = csvdb[cfgName][#csvdb[cfgName]] | |
61 | - else | |
62 | - curTalentLvl = talent:getv(1, 1) | |
63 | - end | |
64 | - for lvl, cfg in pairs(curData) do | |
65 | - if lvl < curTalentLvl or curTalentLvl == 0 then | |
66 | - if cfg.effect ~= 99 then | |
67 | - local curVal = talentAttrS[cfg.effect] or 0 | |
68 | - if curVal < cfg.strength then | |
69 | - talentAttrS[cfg.effect] = cfg.strength | |
56 | + local cfgName = "unit_talent_"..heroCfgId.."Csv" | |
57 | + local curRank = talent:getv(0, 1) | |
58 | + local curLv = talent:getv(1,1) - 1 | |
59 | + for i, value in ipairs(csvdb[cfgName]) do | |
60 | + if i <= curRank then | |
61 | + for lv, cfg in ipairs(value) do | |
62 | + if i < curRank or lv <= curLv then | |
63 | + if cfg.effect ~= 99 then | |
64 | + if not talentAttrS[cfg.effect] then | |
65 | + talentAttrS[AttsEnumEx[cfg.effect]] = 0 | |
66 | + end | |
67 | + talentAttrS[AttsEnumEx[cfg.effect]] = cfg.strength | |
68 | + end | |
69 | + else | |
70 | + break | |
70 | 71 | end |
71 | 72 | end |
73 | + else | |
74 | + break | |
72 | 75 | end |
73 | 76 | end |
74 | 77 | |
... | ... | @@ -85,7 +88,7 @@ function HeroPlugin.bind(Hero) |
85 | 88 | for lvl = 1, #faithConfig do |
86 | 89 | if faith >= faithConfig[lvl].exp then |
87 | 90 | local add = faithConfig[lvl]["position_"..unitData.position]:toArray(true, "=") |
88 | - faithAttr[add[1]] = (faithAttr[add[1]] or 0) + add[2] | |
91 | + faithAttr[AttsEnumEx[add[1]]] = (faithAttr[AttsEnumEx[add[1]]] or 0) + add[2] | |
89 | 92 | end |
90 | 93 | end |
91 | 94 | for _, attrName in pairs(AttsEnumEx) do | ... | ... |