diff --git a/src/GlobalVar.lua b/src/GlobalVar.lua index 516360f..1cebac7 100644 --- a/src/GlobalVar.lua +++ b/src/GlobalVar.lua @@ -290,6 +290,7 @@ CardType = { BattleCard = 5, --赛季卡 PaySignCard = 6, -- 付费签到卡 BattlePassCard = 7, -- 探索指令 + ActBattleCommandCard = 8, -- 战令活动卡 } ShopPackType = { diff --git a/src/actions/GmAction.lua b/src/actions/GmAction.lua index 00f3915..3b86de2 100644 --- a/src/actions/GmAction.lua +++ b/src/actions/GmAction.lua @@ -659,15 +659,18 @@ function _M.drawHero(role, t, act) elseif values[1] == HeroQuality.SSR then weight = unitPool["up_ssr_weight"] up_pool = unitPool["up_ssr_id"] + if btype == 5 then + weight = 3 * weight + end end --print(poolId, rand_v, weight, up_pool, values[1]) if rand_v < weight and up_pool then up_pool = up_pool:toArray(true, "=") if btype == 5 then -- 爱心卡池,使用玩家设置的备选池子 up_pool = role:getProperty("wishPool") - up_pool[1] = 606 - up_pool[2] = 607 - up_pool[3] = 608 + up_pool[1] = 408 + up_pool[2] = 409 + up_pool[3] = 410 end for k, v in ipairs(up_pool) do resultPool[v] = {1} @@ -688,6 +691,14 @@ function _M.drawHero(role, t, act) if heroData[field] ~= values[idx] then ok = false break end end end + if up_pool then + for k, v in ipairs(up_pool) do + if v == itemData.id then + ok = false + break + end + end + end if not ok then break end if oneData[pool_str] > 0 then resultPool[itemId] = {oneData[pool_str]} -- itemId, count, 概率 diff --git a/src/csvdata b/src/csvdata index 48214b3..aa011fc 160000 --- a/src/csvdata +++ b/src/csvdata @@ -1 +1 @@ -Subproject commit 48214b3ec01446368f92b6eb3123fe39c862c0fa +Subproject commit aa011fcf9fb290ff5a1d04e72fa1cd7f9598c9ea diff --git a/src/models/Activity.lua b/src/models/Activity.lua index 84a9350..eb2326c 100644 --- a/src/models/Activity.lua +++ b/src/models/Activity.lua @@ -33,6 +33,8 @@ Activity.ActivityType = { CommonSignIn = 28, --通用签到 FriendEnergy = 30, -- 好友互赠能量活动 + AdvLevel = 33, -- 拾荒关卡 + BattleCommand = 34, -- 战令活动 } local function checkActivityType(activityType) @@ -79,6 +81,8 @@ Activity.schema = { act28 = {"table", {}}, -- 每日活跃签到 {0=day, 1=1,2=1,3=1} act30 = {"table", {}}, -- {magic = 0, limit = 0, reward = {id = 1, id = 1}, giveAE = {}, getAE = {}} 奖励字段1表示领取过奖励 + + act34 = {"table", {}}, -- 战令记录{unlock = 1, freeR = "", payR = "", lvl = 10, sum = 100} } function Activity:data() @@ -102,6 +106,8 @@ function Activity:data() act28 = self:getProperty("act28"), act30 = self:getProperty("act30"), + + act34 = self:getProperty("act34"), } end @@ -890,4 +896,24 @@ activityFunc[Activity.ActivityType.CommonSignIn] = { end, } +activityFunc[Activity.ActivityType.BattleCommand] = { + ["init"] = function (self, actType, isCrossDay, notify, actId) + local data = {unlock = 0, freeR = "", payR = "", lvl = 0, sum = 0} + self:updateActData(actType, data, not notify) + end, + ["check"] = function(self, actType, notify, id, count) -- 检查 + local isOpen, actId = self:isOpen(actType) + local actData = self:getActData(actType) or {} + local actCfg = csvdb["activity_ctrlCsv"][actId] + if not actCfg then return end + if actCfg.condition1 == "" then return end + local itemId = tonumber(actCfg.condition2) + if itemId == id and count > 0 then + actData["sum"] = actData["sum"] + count + self:updateActData(actType, actData) + end + end, +} + + return Activity diff --git a/src/models/RolePlugin.lua b/src/models/RolePlugin.lua index a1a87db..da4e852 100644 --- a/src/models/RolePlugin.lua +++ b/src/models/RolePlugin.lua @@ -362,6 +362,9 @@ function RolePlugin.bind(Role) if not params.notNotify then SendPacket(actionCodes.Role_updateItems, MsgPack.pack({[params.itemId] = nums})) end + if params.count > 0 then + self:checkTaskEnter("AddItem", {id = params.itemId, count = params.count}) + end end function Role:checkItemEnough(itemCountT) diff --git a/src/models/RoleTask.lua b/src/models/RoleTask.lua index c4f0994..5bbf28e 100644 --- a/src/models/RoleTask.lua +++ b/src/models/RoleTask.lua @@ -97,6 +97,7 @@ local TaskType = { DailyTask = 904, -- 完成每日活跃任务 RadioTaskStart = 905, -- 电台任务开始 FinishSpeTask = 906, -- 指定任务完成 + AddItem = 907, -- 获得道具 --功能未实现 todo AdvShop = 1002, -- 冒险商城 @@ -238,6 +239,7 @@ local ActivityListener = { [TaskType.AdvMineKill] = {{Activity.ActivityType.Crisis, 1}}, [TaskType.AdvMineLayer] = {{Activity.ActivityType.Crisis, 2}}, [TaskType.DailyTask] = {{Activity.ActivityType.CommonSignIn, f("pre"), f("cur")}}, + [TaskType.AddItem] = {{Activity.ActivityType.BattleCommand, f("id"), f("count")}}, } } diff --git a/src/models/Store.lua b/src/models/Store.lua index 97564a8..b5466c7 100644 --- a/src/models/Store.lua +++ b/src/models/Store.lua @@ -186,7 +186,7 @@ end -- 购买通行证 -function Store:onBuyCard(type, duration, id) +function Store:onBuyCard(type, duration, id, actid) local timeNow = skynet.timex() if type == CardType.NormalMonthCard then if self:isMonthCardExpire() then @@ -221,6 +221,18 @@ function Store:onBuyCard(type, duration, id) info["flag"] = 1 bpInfo[index] = info self:updateProperty({field = "bpInfo", value = bpInfo}) + elseif type == CardType.ActBattleCommandCard then + if not self.owner.activity:isOpenById(actid, "BattleCommand") then + return + end + local actCfg = csvdb["activity_ctrlCsv"][actid] + if not actCfg then return end + local actData = self.owner.activity:getActData("BattleCommand") or {} + if actData["unlock"] == 1 then return end + actData["unlock"] = 1 + if actCfg.condition ~= 0 then + actData["lvl"] = (actData["lvl"] or 0) + actCfg.condition + end end end -- libgit2 0.21.2