Commit c756d4dfe5e61748b0a5fa288c2fe9e36f1a650b
1 parent
e6e49b45
新年将军令活动
Showing
7 changed files
with
60 additions
and
5 deletions
Show diff stats
src/GlobalVar.lua
src/actions/GmAction.lua
... | ... | @@ -659,15 +659,18 @@ function _M.drawHero(role, t, act) |
659 | 659 | elseif values[1] == HeroQuality.SSR then |
660 | 660 | weight = unitPool["up_ssr_weight"] |
661 | 661 | up_pool = unitPool["up_ssr_id"] |
662 | + if btype == 5 then | |
663 | + weight = 3 * weight | |
664 | + end | |
662 | 665 | end |
663 | 666 | --print(poolId, rand_v, weight, up_pool, values[1]) |
664 | 667 | if rand_v < weight and up_pool then |
665 | 668 | up_pool = up_pool:toArray(true, "=") |
666 | 669 | if btype == 5 then -- 爱心卡池,使用玩家设置的备选池子 |
667 | 670 | up_pool = role:getProperty("wishPool") |
668 | - up_pool[1] = 606 | |
669 | - up_pool[2] = 607 | |
670 | - up_pool[3] = 608 | |
671 | + up_pool[1] = 408 | |
672 | + up_pool[2] = 409 | |
673 | + up_pool[3] = 410 | |
671 | 674 | end |
672 | 675 | for k, v in ipairs(up_pool) do |
673 | 676 | resultPool[v] = {1} |
... | ... | @@ -688,6 +691,14 @@ function _M.drawHero(role, t, act) |
688 | 691 | if heroData[field] ~= values[idx] then ok = false break end |
689 | 692 | end |
690 | 693 | end |
694 | + if up_pool then | |
695 | + for k, v in ipairs(up_pool) do | |
696 | + if v == itemData.id then | |
697 | + ok = false | |
698 | + break | |
699 | + end | |
700 | + end | |
701 | + end | |
691 | 702 | if not ok then break end |
692 | 703 | if oneData[pool_str] > 0 then |
693 | 704 | resultPool[itemId] = {oneData[pool_str]} -- itemId, count, 概率 | ... | ... |
src/models/Activity.lua
... | ... | @@ -33,6 +33,8 @@ Activity.ActivityType = { |
33 | 33 | |
34 | 34 | CommonSignIn = 28, --通用签到 |
35 | 35 | FriendEnergy = 30, -- 好友互赠能量活动 |
36 | + AdvLevel = 33, -- 拾荒关卡 | |
37 | + BattleCommand = 34, -- 战令活动 | |
36 | 38 | } |
37 | 39 | |
38 | 40 | local function checkActivityType(activityType) |
... | ... | @@ -79,6 +81,8 @@ Activity.schema = { |
79 | 81 | |
80 | 82 | act28 = {"table", {}}, -- 每日活跃签到 {0=day, 1=1,2=1,3=1} |
81 | 83 | act30 = {"table", {}}, -- {magic = 0, limit = 0, reward = {id = 1, id = 1}, giveAE = {}, getAE = {}} 奖励字段1表示领取过奖励 |
84 | + | |
85 | + act34 = {"table", {}}, -- 战令记录{unlock = 1, freeR = "", payR = "", lvl = 10, sum = 100} | |
82 | 86 | } |
83 | 87 | |
84 | 88 | function Activity:data() |
... | ... | @@ -102,6 +106,8 @@ function Activity:data() |
102 | 106 | |
103 | 107 | act28 = self:getProperty("act28"), |
104 | 108 | act30 = self:getProperty("act30"), |
109 | + | |
110 | + act34 = self:getProperty("act34"), | |
105 | 111 | } |
106 | 112 | end |
107 | 113 | |
... | ... | @@ -890,4 +896,24 @@ activityFunc[Activity.ActivityType.CommonSignIn] = { |
890 | 896 | end, |
891 | 897 | } |
892 | 898 | |
899 | +activityFunc[Activity.ActivityType.BattleCommand] = { | |
900 | + ["init"] = function (self, actType, isCrossDay, notify, actId) | |
901 | + local data = {unlock = 0, freeR = "", payR = "", lvl = 0, sum = 0} | |
902 | + self:updateActData(actType, data, not notify) | |
903 | + end, | |
904 | + ["check"] = function(self, actType, notify, id, count) -- 检查 | |
905 | + local isOpen, actId = self:isOpen(actType) | |
906 | + local actData = self:getActData(actType) or {} | |
907 | + local actCfg = csvdb["activity_ctrlCsv"][actId] | |
908 | + if not actCfg then return end | |
909 | + if actCfg.condition1 == "" then return end | |
910 | + local itemId = tonumber(actCfg.condition2) | |
911 | + if itemId == id and count > 0 then | |
912 | + actData["sum"] = actData["sum"] + count | |
913 | + self:updateActData(actType, actData) | |
914 | + end | |
915 | + end, | |
916 | +} | |
917 | + | |
918 | + | |
893 | 919 | return Activity | ... | ... |
src/models/RolePlugin.lua
... | ... | @@ -362,6 +362,9 @@ function RolePlugin.bind(Role) |
362 | 362 | if not params.notNotify then |
363 | 363 | SendPacket(actionCodes.Role_updateItems, MsgPack.pack({[params.itemId] = nums})) |
364 | 364 | end |
365 | + if params.count > 0 then | |
366 | + self:checkTaskEnter("AddItem", {id = params.itemId, count = params.count}) | |
367 | + end | |
365 | 368 | end |
366 | 369 | |
367 | 370 | function Role:checkItemEnough(itemCountT) | ... | ... |
src/models/RoleTask.lua
... | ... | @@ -97,6 +97,7 @@ local TaskType = { |
97 | 97 | DailyTask = 904, -- 完成每日活跃任务 |
98 | 98 | RadioTaskStart = 905, -- 电台任务开始 |
99 | 99 | FinishSpeTask = 906, -- 指定任务完成 |
100 | + AddItem = 907, -- 获得道具 | |
100 | 101 | |
101 | 102 | --功能未实现 todo |
102 | 103 | AdvShop = 1002, -- 冒险商城 |
... | ... | @@ -238,6 +239,7 @@ local ActivityListener = { |
238 | 239 | [TaskType.AdvMineKill] = {{Activity.ActivityType.Crisis, 1}}, |
239 | 240 | [TaskType.AdvMineLayer] = {{Activity.ActivityType.Crisis, 2}}, |
240 | 241 | [TaskType.DailyTask] = {{Activity.ActivityType.CommonSignIn, f("pre"), f("cur")}}, |
242 | + [TaskType.AddItem] = {{Activity.ActivityType.BattleCommand, f("id"), f("count")}}, | |
241 | 243 | } |
242 | 244 | } |
243 | 245 | ... | ... |
src/models/Store.lua
... | ... | @@ -186,7 +186,7 @@ end |
186 | 186 | |
187 | 187 | |
188 | 188 | -- 购买通行证 |
189 | -function Store:onBuyCard(type, duration, id) | |
189 | +function Store:onBuyCard(type, duration, id, actid) | |
190 | 190 | local timeNow = skynet.timex() |
191 | 191 | if type == CardType.NormalMonthCard then |
192 | 192 | if self:isMonthCardExpire() then |
... | ... | @@ -221,6 +221,18 @@ function Store:onBuyCard(type, duration, id) |
221 | 221 | info["flag"] = 1 |
222 | 222 | bpInfo[index] = info |
223 | 223 | self:updateProperty({field = "bpInfo", value = bpInfo}) |
224 | + elseif type == CardType.ActBattleCommandCard then | |
225 | + if not self.owner.activity:isOpenById(actid, "BattleCommand") then | |
226 | + return | |
227 | + end | |
228 | + local actCfg = csvdb["activity_ctrlCsv"][actid] | |
229 | + if not actCfg then return end | |
230 | + local actData = self.owner.activity:getActData("BattleCommand") or {} | |
231 | + if actData["unlock"] == 1 then return end | |
232 | + actData["unlock"] = 1 | |
233 | + if actCfg.condition ~= 0 then | |
234 | + actData["lvl"] = (actData["lvl"] or 0) + actCfg.condition | |
235 | + end | |
224 | 236 | end |
225 | 237 | end |
226 | 238 | ... | ... |