Commit 7113ad0c39acbae6d565b225f1c8eded257256e3
1 parent
55fe5661
每日抽卡次数触发礼包
Showing
3 changed files
with
9 additions
and
8 deletions
Show diff stats
src/actions/HeroAction.lua
| @@ -915,6 +915,8 @@ function _M.drawHeroRpc(agent, data) | @@ -915,6 +915,8 @@ function _M.drawHeroRpc(agent, data) | ||
| 915 | local ssrCount = 0 | 915 | local ssrCount = 0 |
| 916 | local reward = {} | 916 | local reward = {} |
| 917 | local logReward = {} | 917 | local logReward = {} |
| 918 | + -- 限时礼包 | ||
| 919 | + local dailyDrawCnt = role.dailyData:getProperty("drawHeroCnt") or 0 | ||
| 918 | for i = 1, drawCount[drawType] do | 920 | for i = 1, drawCount[drawType] do |
| 919 | floorHeroCount = floorHeroCount + 1 | 921 | floorHeroCount = floorHeroCount + 1 |
| 920 | local isFloorBack = draw_floor_back_counts and floorHeroCount >= draw_floor_back_counts | 922 | local isFloorBack = draw_floor_back_counts and floorHeroCount >= draw_floor_back_counts |
| @@ -963,8 +965,13 @@ function _M.drawHeroRpc(agent, data) | @@ -963,8 +965,13 @@ function _M.drawHeroRpc(agent, data) | ||
| 963 | logReward[itemId] = (logReward[itemId] or 0) + 1 | 965 | logReward[itemId] = (logReward[itemId] or 0) + 1 |
| 964 | table.insert(reward, {id = itemId, count = 1}) | 966 | table.insert(reward, {id = itemId, count = 1}) |
| 965 | end | 967 | end |
| 968 | + | ||
| 969 | + dailyDrawCnt = dailyDrawCnt + 1 | ||
| 970 | + role:checkTaskEnter("DrawHeroLimitPack", {count = dailyDrawCnt}) | ||
| 966 | end | 971 | end |
| 967 | 972 | ||
| 973 | + role.dailyData:setProperty("drawHeroCnt", dailyDrawCnt) | ||
| 974 | + | ||
| 968 | if draw_floor_back_counts then | 975 | if draw_floor_back_counts then |
| 969 | local floorHero = role:getProperty("floorHero") | 976 | local floorHero = role:getProperty("floorHero") |
| 970 | floorHero[btype] = floorHeroCount | 977 | floorHero[btype] = floorHeroCount |
| @@ -976,12 +983,6 @@ function _M.drawHeroRpc(agent, data) | @@ -976,12 +983,6 @@ function _M.drawHeroRpc(agent, data) | ||
| 976 | role:updateProperty({field="newerDraw", value = newCount + drawCount[drawType]}) | 983 | role:updateProperty({field="newerDraw", value = newCount + drawCount[drawType]}) |
| 977 | end | 984 | end |
| 978 | 985 | ||
| 979 | - -- 限时礼包 | ||
| 980 | - local dailyDrawCnt = role.dailyData:getProperty("drawHeroCnt") or 0 | ||
| 981 | - dailyDrawCnt = dailyDrawCnt + drawCount[drawType] | ||
| 982 | - role.dailyData:setProperty("drawHeroCnt", dailyDrawCnt) | ||
| 983 | - role:checkTaskEnter("DrawHeroLimitPack", {count = dailyDrawCnt}) | ||
| 984 | - | ||
| 985 | role:checkTaskEnter("DrawHero", {pool = btype, count = drawCount[drawType]}) | 986 | role:checkTaskEnter("DrawHero", {pool = btype, count = drawCount[drawType]}) |
| 986 | if btype ~= 3 then | 987 | if btype ~= 3 then |
| 987 | role:checkTaskEnter("DrawHeroNotFriend", {pool = btype, count = drawCount[drawType]}) | 988 | role:checkTaskEnter("DrawHeroNotFriend", {pool = btype, count = drawCount[drawType]}) |
src/models/Daily.lua
| @@ -28,7 +28,7 @@ Daily.schema = { | @@ -28,7 +28,7 @@ Daily.schema = { | ||
| 28 | 28 | ||
| 29 | unlockPool = {"table", {}}, -- 解锁的属性卡池 | 29 | unlockPool = {"table", {}}, -- 解锁的属性卡池 |
| 30 | curPool = {"number", 0}, -- 属性卡池当前索引 | 30 | curPool = {"number", 0}, -- 属性卡池当前索引 |
| 31 | - drawCardCnt = {"number", 0}, -- 每日抽卡次数 | 31 | + drawHeroCnt = {"number", 0}, -- 每日抽卡次数 |
| 32 | } | 32 | } |
| 33 | 33 | ||
| 34 | function Daily:updateProperty(params) | 34 | function Daily:updateProperty(params) |
src/models/RoleTask.lua
| @@ -262,7 +262,7 @@ local StoreListener = { | @@ -262,7 +262,7 @@ local StoreListener = { | ||
| 262 | [TaskType.TowerPass] = {{TriggerEventType.TowerPass, f("level")}}, | 262 | [TaskType.TowerPass] = {{TriggerEventType.TowerPass, f("level")}}, |
| 263 | [TaskType.AdvPassFirst] = {{TriggerEventType.AdvPass, f("id")}}, | 263 | [TaskType.AdvPassFirst] = {{TriggerEventType.AdvPass, f("id")}}, |
| 264 | [TaskType.AddHero] = {{TriggerEventType.AddNewHero, f("heroType")}, {TriggerEventType.SSRCount, f("ssrCount")}}, | 264 | [TaskType.AddHero] = {{TriggerEventType.AddNewHero, f("heroType")}, {TriggerEventType.SSRCount, f("ssrCount")}}, |
| 265 | - [TaskType.DrawHeroLimitPack] = {{TriggerEventType.DrawHeroLimitPack, f("count")}}, | 265 | + [TaskType.DrawHeroLimitPack] = {{TriggerEventType.DrawHeroCnt, f("count")}}, |
| 266 | } | 266 | } |
| 267 | } | 267 | } |
| 268 | 268 |