Commit c756d4dfe5e61748b0a5fa288c2fe9e36f1a650b

Authored by liuzujun
1 parent e6e49b45

新年将军令活动

@@ -290,6 +290,7 @@ CardType = { @@ -290,6 +290,7 @@ CardType = {
290 BattleCard = 5, --赛季卡 290 BattleCard = 5, --赛季卡
291 PaySignCard = 6, -- 付费签到卡 291 PaySignCard = 6, -- 付费签到卡
292 BattlePassCard = 7, -- 探索指令 292 BattlePassCard = 7, -- 探索指令
  293 + ActBattleCommandCard = 8, -- 战令活动卡
293 } 294 }
294 295
295 ShopPackType = { 296 ShopPackType = {
src/actions/GmAction.lua
@@ -659,15 +659,18 @@ function _M.drawHero(role, t, act) @@ -659,15 +659,18 @@ function _M.drawHero(role, t, act)
659 elseif values[1] == HeroQuality.SSR then 659 elseif values[1] == HeroQuality.SSR then
660 weight = unitPool["up_ssr_weight"] 660 weight = unitPool["up_ssr_weight"]
661 up_pool = unitPool["up_ssr_id"] 661 up_pool = unitPool["up_ssr_id"]
  662 + if btype == 5 then
  663 + weight = 3 * weight
  664 + end
662 end 665 end
663 --print(poolId, rand_v, weight, up_pool, values[1]) 666 --print(poolId, rand_v, weight, up_pool, values[1])
664 if rand_v < weight and up_pool then 667 if rand_v < weight and up_pool then
665 up_pool = up_pool:toArray(true, "=") 668 up_pool = up_pool:toArray(true, "=")
666 if btype == 5 then -- 爱心卡池,使用玩家设置的备选池子 669 if btype == 5 then -- 爱心卡池,使用玩家设置的备选池子
667 up_pool = role:getProperty("wishPool") 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 end 674 end
672 for k, v in ipairs(up_pool) do 675 for k, v in ipairs(up_pool) do
673 resultPool[v] = {1} 676 resultPool[v] = {1}
@@ -688,6 +691,14 @@ function _M.drawHero(role, t, act) @@ -688,6 +691,14 @@ function _M.drawHero(role, t, act)
688 if heroData[field] ~= values[idx] then ok = false break end 691 if heroData[field] ~= values[idx] then ok = false break end
689 end 692 end
690 end 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 if not ok then break end 702 if not ok then break end
692 if oneData[pool_str] > 0 then 703 if oneData[pool_str] > 0 then
693 resultPool[itemId] = {oneData[pool_str]} -- itemId, count, 概率 704 resultPool[itemId] = {oneData[pool_str]} -- itemId, count, 概率
1 -Subproject commit 48214b3ec01446368f92b6eb3123fe39c862c0fa 1 +Subproject commit aa011fcf9fb290ff5a1d04e72fa1cd7f9598c9ea
src/models/Activity.lua
@@ -33,6 +33,8 @@ Activity.ActivityType = { @@ -33,6 +33,8 @@ Activity.ActivityType = {
33 33
34 CommonSignIn = 28, --通用签到 34 CommonSignIn = 28, --通用签到
35 FriendEnergy = 30, -- 好友互赠能量活动 35 FriendEnergy = 30, -- 好友互赠能量活动
  36 + AdvLevel = 33, -- 拾荒关卡
  37 + BattleCommand = 34, -- 战令活动
36 } 38 }
37 39
38 local function checkActivityType(activityType) 40 local function checkActivityType(activityType)
@@ -79,6 +81,8 @@ Activity.schema = { @@ -79,6 +81,8 @@ Activity.schema = {
79 81
80 act28 = {"table", {}}, -- 每日活跃签到 {0=day, 1=1,2=1,3=1} 82 act28 = {"table", {}}, -- 每日活跃签到 {0=day, 1=1,2=1,3=1}
81 act30 = {"table", {}}, -- {magic = 0, limit = 0, reward = {id = 1, id = 1}, giveAE = {}, getAE = {}} 奖励字段1表示领取过奖励 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 function Activity:data() 88 function Activity:data()
@@ -102,6 +106,8 @@ function Activity:data() @@ -102,6 +106,8 @@ function Activity:data()
102 106
103 act28 = self:getProperty("act28"), 107 act28 = self:getProperty("act28"),
104 act30 = self:getProperty("act30"), 108 act30 = self:getProperty("act30"),
  109 +
  110 + act34 = self:getProperty("act34"),
105 } 111 }
106 end 112 end
107 113
@@ -890,4 +896,24 @@ activityFunc[Activity.ActivityType.CommonSignIn] = { @@ -890,4 +896,24 @@ activityFunc[Activity.ActivityType.CommonSignIn] = {
890 end, 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 return Activity 919 return Activity
src/models/RolePlugin.lua
@@ -362,6 +362,9 @@ function RolePlugin.bind(Role) @@ -362,6 +362,9 @@ function RolePlugin.bind(Role)
362 if not params.notNotify then 362 if not params.notNotify then
363 SendPacket(actionCodes.Role_updateItems, MsgPack.pack({[params.itemId] = nums})) 363 SendPacket(actionCodes.Role_updateItems, MsgPack.pack({[params.itemId] = nums}))
364 end 364 end
  365 + if params.count > 0 then
  366 + self:checkTaskEnter("AddItem", {id = params.itemId, count = params.count})
  367 + end
365 end 368 end
366 369
367 function Role:checkItemEnough(itemCountT) 370 function Role:checkItemEnough(itemCountT)
src/models/RoleTask.lua
@@ -97,6 +97,7 @@ local TaskType = { @@ -97,6 +97,7 @@ local TaskType = {
97 DailyTask = 904, -- 完成每日活跃任务 97 DailyTask = 904, -- 完成每日活跃任务
98 RadioTaskStart = 905, -- 电台任务开始 98 RadioTaskStart = 905, -- 电台任务开始
99 FinishSpeTask = 906, -- 指定任务完成 99 FinishSpeTask = 906, -- 指定任务完成
  100 + AddItem = 907, -- 获得道具
100 101
101 --功能未实现 todo 102 --功能未实现 todo
102 AdvShop = 1002, -- 冒险商城 103 AdvShop = 1002, -- 冒险商城
@@ -238,6 +239,7 @@ local ActivityListener = { @@ -238,6 +239,7 @@ local ActivityListener = {
238 [TaskType.AdvMineKill] = {{Activity.ActivityType.Crisis, 1}}, 239 [TaskType.AdvMineKill] = {{Activity.ActivityType.Crisis, 1}},
239 [TaskType.AdvMineLayer] = {{Activity.ActivityType.Crisis, 2}}, 240 [TaskType.AdvMineLayer] = {{Activity.ActivityType.Crisis, 2}},
240 [TaskType.DailyTask] = {{Activity.ActivityType.CommonSignIn, f("pre"), f("cur")}}, 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,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 local timeNow = skynet.timex() 190 local timeNow = skynet.timex()
191 if type == CardType.NormalMonthCard then 191 if type == CardType.NormalMonthCard then
192 if self:isMonthCardExpire() then 192 if self:isMonthCardExpire() then
@@ -221,6 +221,18 @@ function Store:onBuyCard(type, duration, id) @@ -221,6 +221,18 @@ function Store:onBuyCard(type, duration, id)
221 info["flag"] = 1 221 info["flag"] = 1
222 bpInfo[index] = info 222 bpInfo[index] = info
223 self:updateProperty({field = "bpInfo", value = bpInfo}) 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 end 236 end
225 end 237 end
226 238