Commit e130015dbbac084bf432d78bbf4c457c75083f3a
Merge branch 'tr/bugfix' into cn/develop
Showing
10 changed files
with
163 additions
and
21 deletions
Show diff stats
src/GlobalVar.lua
@@ -83,6 +83,7 @@ ItemType = { | @@ -83,6 +83,7 @@ ItemType = { | ||
83 | SpeedBox = 16, -- 加速箱子 | 83 | SpeedBox = 16, -- 加速箱子 |
84 | SelectItemBox = 17, -- 自选箱子 | 84 | SelectItemBox = 17, -- 自选箱子 |
85 | CommonPaster = 18, -- 万能贴纸 | 85 | CommonPaster = 18, -- 万能贴纸 |
86 | + BossTicket = 20, -- boss挑战门票 | ||
86 | } | 87 | } |
87 | 88 | ||
88 | --在这个里面的会记录的是功能开放 对应类型open 而不是 ID | 89 | --在这个里面的会记录的是功能开放 对应类型open 而不是 ID |
@@ -313,6 +314,8 @@ CardType = { | @@ -313,6 +314,8 @@ CardType = { | ||
313 | PaySignCard = 6, -- 付费签到卡 | 314 | PaySignCard = 6, -- 付费签到卡 |
314 | BattlePassCard = 7, -- 探索指令 | 315 | BattlePassCard = 7, -- 探索指令 |
315 | ActBattleCommandCard = 8, -- 战令活动卡 | 316 | ActBattleCommandCard = 8, -- 战令活动卡 |
317 | + NormalMonthCardLevelUp = 9, -- 月卡升级 | ||
318 | + SuperMonthCardLevelUp = 10, -- 超级月卡升级 | ||
316 | } | 319 | } |
317 | 320 | ||
318 | ShopPackType = { | 321 | ShopPackType = { |
src/adv/Adv.lua
@@ -2127,6 +2127,32 @@ function Adv:doActive(activeId, target) | @@ -2127,6 +2127,32 @@ function Adv:doActive(activeId, target) | ||
2127 | self.battle.player:addBaseAttr(attr, value, vtype) | 2127 | self.battle.player:addBaseAttr(attr, value, vtype) |
2128 | return true | 2128 | return true |
2129 | end | 2129 | end |
2130 | + -- 13=将目标移动至地图随机点,可以移动至未翻开的空格 | ||
2131 | + doActiveEffect[13] = function(_) | ||
2132 | + for _, target in ipairs(targers) do | ||
2133 | + end | ||
2134 | + return true | ||
2135 | + end | ||
2136 | + -- 14=获得drop,在有坐标时需要道具飞入背包的展现。 | ||
2137 | + doActiveEffect[14] = function(_, dropId) | ||
2138 | + local gift = nil | ||
2139 | + local dropData = csvdb["event_dropCsv"][dropId] | ||
2140 | + if dropData then | ||
2141 | + local item = dropData["range"]:randWeight(true) | ||
2142 | + if item[1] ~= 0 then | ||
2143 | + gift = {} | ||
2144 | + gift[item[1]] = (gift[item[1]] or 0) + item[2] | ||
2145 | + end | ||
2146 | + end | ||
2147 | + local roomId, blockId | ||
2148 | + if not target or not target.roomId or not target.blockId then | ||
2149 | + roomId, blockId = target.roomId, target.blockId | ||
2150 | + end | ||
2151 | + if gift then | ||
2152 | + self:award(gift, {log = {desc = "doActive", int1 = activeId}}, {roomId = roomId, blockId = blockId}) | ||
2153 | + end | ||
2154 | + return true | ||
2155 | + end | ||
2130 | 2156 | ||
2131 | for _, effect in ipairs(activeData.effect:toArray()) do | 2157 | for _, effect in ipairs(activeData.effect:toArray()) do |
2132 | local cur = effect:toArray(true, "=") | 2158 | local cur = effect:toArray(true, "=") |
src/adv/AdvBlock.lua
@@ -215,7 +215,9 @@ function Block:randomEvent() | @@ -215,7 +215,9 @@ function Block:randomEvent() | ||
215 | randomFunc[AdvEventType.Trap] = function() | 215 | randomFunc[AdvEventType.Trap] = function() |
216 | local data = csvdb["event_trapCsv"][self.event.id] | 216 | local data = csvdb["event_trapCsv"][self.event.id] |
217 | -- 因为一些神器效果 提前触发被动 | 217 | -- 因为一些神器效果 提前触发被动 |
218 | - adv.battle.player:triggerPassive(Passive.CLICK_TRAP) | 218 | + if not data.classify:sismember(1, " ") then |
219 | + adv.battle.player:triggerPassive(Passive.CLICK_TRAP) | ||
220 | + end | ||
219 | 221 | ||
220 | local buffs = data.effect:toArray(true, "=") | 222 | local buffs = data.effect:toArray(true, "=") |
221 | 223 |
src/adv/AdvBuff.lua
@@ -704,11 +704,13 @@ function Buff:overlay(releaser, data, layer) | @@ -704,11 +704,13 @@ function Buff:overlay(releaser, data, layer) | ||
704 | 704 | ||
705 | self.release = releaser or self.release | 705 | self.release = releaser or self.release |
706 | -- 叠加层数 | 706 | -- 叠加层数 |
707 | + local oldLayer = self.layer | ||
707 | self.layer = self.layer + layer | 708 | self.layer = self.layer + layer |
708 | if maxLayer ~= 0 then | 709 | if maxLayer ~= 0 then |
709 | self.layer = math.min(maxLayer, self.layer) | 710 | self.layer = math.min(maxLayer, self.layer) |
710 | end | 711 | end |
711 | - if self._overlay then | 712 | + |
713 | + if oldLayer ~= self.layer and self._overlay then | ||
712 | self:_overlay() | 714 | self:_overlay() |
713 | end | 715 | end |
714 | 716 |
src/adv/AdvMap.lua
@@ -97,23 +97,28 @@ function Map:checkOver() | @@ -97,23 +97,28 @@ function Map:checkOver() | ||
97 | end | 97 | end |
98 | end | 98 | end |
99 | 99 | ||
100 | +function Map:randEmptyBlock() | ||
101 | + local pool = {} | ||
102 | + for _, room_ in pairs(self.rooms) do | ||
103 | + for _, block_ in pairs(room_.blocks) do | ||
104 | + if block_.isOpen and not block_.event then | ||
105 | + table.insert(pool, {room_, block_}) | ||
106 | + end | ||
107 | + end | ||
108 | + end | ||
109 | + if not next(pool) then return end | ||
110 | + local idx = math.randomInt(1, #pool) | ||
111 | + return pool[idx][1], pool[idx][2] | ||
112 | +end | ||
113 | + | ||
100 | --随机一个空的位置生成怪, 如果没有就没有 | 114 | --随机一个空的位置生成怪, 如果没有就没有 |
101 | function Map:addNewMonsterRand(monsterId, where) | 115 | function Map:addNewMonsterRand(monsterId, where) |
102 | local room, block | 116 | local room, block |
103 | if where then | 117 | if where then |
104 | room, block = where[1], where[2] | 118 | room, block = where[1], where[2] |
105 | else | 119 | else |
106 | - local pool = {} | ||
107 | - for _, room_ in pairs(self.rooms) do | ||
108 | - for _, block_ in pairs(room_.blocks) do | ||
109 | - if block_.isOpen and not block_.event then | ||
110 | - table.insert(pool, {room_, block_}) | ||
111 | - end | ||
112 | - end | ||
113 | - end | ||
114 | - if not next(pool) then return end | ||
115 | - local idx = math.randomInt(1, #pool) | ||
116 | - room, block = pool[idx][1], pool[idx][2] | 120 | + room, block = self:randEmptyBlock() |
121 | + if not room then return end | ||
117 | end | 122 | end |
118 | 123 | ||
119 | if not monsterId then | 124 | if not monsterId then |
src/adv/AdvPassive.lua
@@ -565,6 +565,16 @@ end | @@ -565,6 +565,16 @@ end | ||
565 | 565 | ||
566 | -- 在指定地点召唤event项目 | 566 | -- 在指定地点召唤event项目 |
567 | function Passive:effect12(eventType, triggerPms, eventId, count, stage) | 567 | function Passive:effect12(eventType, triggerPms, eventId, count, stage) |
568 | + if eventType == AdvEventType.Monster then | ||
569 | + for _, buff in ipairs(self.owner.battle.player.buffs) do | ||
570 | + if not buff.isDel and buff:getType() == buff.Buff_NO_PASSIVE_MONSTER then | ||
571 | + local effect = buff:effect() | ||
572 | + if effect == 0 or effect == eventId then | ||
573 | + return | ||
574 | + end | ||
575 | + end | ||
576 | + end | ||
577 | + end | ||
568 | local change = self.owner.battle.adv:getCurMap():layEventToStage(eventType, eventId, count, stage) | 578 | local change = self.owner.battle.adv:getCurMap():layEventToStage(eventType, eventId, count, stage) |
569 | for _, one in ipairs(change) do | 579 | for _, one in ipairs(change) do |
570 | self.owner.battle.adv:backBlockChange(one[1].roomId, one[2].blockId) | 580 | self.owner.battle.adv:backBlockChange(one[1].roomId, one[2].blockId) |
src/models/Activity.lua
@@ -1039,6 +1039,14 @@ activityFunc[Activity.ActivityType.BattleCommand] = { | @@ -1039,6 +1039,14 @@ activityFunc[Activity.ActivityType.BattleCommand] = { | ||
1039 | ["init"] = function (self, actType, isCrossDay, notify, actId) | 1039 | ["init"] = function (self, actType, isCrossDay, notify, actId) |
1040 | local data = {unlock = 0, freeR = "", payR = "", lvl = 0, sum = 0, week = 0} | 1040 | local data = {unlock = 0, freeR = "", payR = "", lvl = 0, sum = 0, week = 0} |
1041 | self:updateActData(actType, data, not notify) | 1041 | self:updateActData(actType, data, not notify) |
1042 | + | ||
1043 | + local rechargeRecord = self.owner.storeData:getProperty("payR") | ||
1044 | + for id, cfg in pairs(csvdb["shop_rechargeCsv"]) do | ||
1045 | + if cfg.shop == 2 and cfg.type == CardType.ActBattleCommandCard then | ||
1046 | + rechargeRecord[id] = nil | ||
1047 | + end | ||
1048 | + end | ||
1049 | + self.owner.storeData:updateProperty({field="payR", value=rechargeRecord}) | ||
1042 | end, | 1050 | end, |
1043 | ["check"] = function(self, actType, notify, id, count) -- 检查 itemid, count | 1051 | ["check"] = function(self, actType, notify, id, count) -- 检查 itemid, count |
1044 | local isOpen, actId = self:isOpen(actType) | 1052 | local isOpen, actId = self:isOpen(actType) |
@@ -1082,6 +1090,15 @@ activityFunc[Activity.ActivityType.BattleCommand] = { | @@ -1082,6 +1090,15 @@ activityFunc[Activity.ActivityType.BattleCommand] = { | ||
1082 | actData["week"] = 0 | 1090 | actData["week"] = 0 |
1083 | self:updateActData(actType, actData, true) | 1091 | self:updateActData(actType, actData, true) |
1084 | end, | 1092 | end, |
1093 | + ["close"] = function (self, actType, notify, actId) | ||
1094 | + local rechargeRecord = self.owner.storeData:getProperty("payR") | ||
1095 | + for id, cfg in pairs(csvdb["shop_rechargeCsv"]) do | ||
1096 | + if cfg.shop == 2 and cfg.type == CardType.ActBattleCommandCard then | ||
1097 | + rechargeRecord[id] = nil | ||
1098 | + end | ||
1099 | + end | ||
1100 | + self.owner.storeData:updateProperty({field="payR", value=rechargeRecord}) | ||
1101 | + end, | ||
1085 | } | 1102 | } |
1086 | 1103 | ||
1087 | 1104 |
src/models/RolePlugin.lua
@@ -137,6 +137,12 @@ function RolePlugin.bind(Role) | @@ -137,6 +137,12 @@ function RolePlugin.bind(Role) | ||
137 | [ItemType.Potion] = function () | 137 | [ItemType.Potion] = function () |
138 | self:addPotion({id = itemId, count = count, notNotify = pms.notNotify, log = pms.log}) | 138 | self:addPotion({id = itemId, count = count, notNotify = pms.notNotify, log = pms.log}) |
139 | end, | 139 | end, |
140 | + [ItemType.BossTicket] = function () | ||
141 | + if not self.activity:isOpen("ChallengeLevel") then return end | ||
142 | + local actData = self.activity:getActData("ChallengeLevel") | ||
143 | + actData["ticket"] = (actData["ticket"] or 0) + count | ||
144 | + self.activity:updateActData("ChallengeLevel", actData) | ||
145 | + end, | ||
140 | } | 146 | } |
141 | 147 | ||
142 | if count > 0 then | 148 | if count > 0 then |
src/models/Store.lua
@@ -3,7 +3,29 @@ | @@ -3,7 +3,29 @@ | ||
3 | local Store = class("Store", require("shared.ModelBase")) | 3 | local Store = class("Store", require("shared.ModelBase")) |
4 | 4 | ||
5 | function Store:ctor(properties) | 5 | function Store:ctor(properties) |
6 | - Store.super.ctor(self, properties) | 6 | + Store.super.ctor(self, properties) |
7 | +end | ||
8 | + | ||
9 | +function Store:onLoad() | ||
10 | + local monEx = self:getProperty("monthCardEx") | ||
11 | + local smonEx = self:getProperty("smonthCardEx") | ||
12 | + local monId = self:getProperty("monthCardId") | ||
13 | + local smonId = self:getProperty("smonthCardId") | ||
14 | + local timeNow = skynet.timex() | ||
15 | + local flag = false | ||
16 | + if monEx > timeNow and monId == 0 then | ||
17 | + self:updateProperty({field = "monthCardId", value = 101}) | ||
18 | + self:updateProperty({field = "getMailT1", value = 0}) | ||
19 | + flag = true | ||
20 | + end | ||
21 | + if smonEx > timeNow and smonId == 0 then | ||
22 | + self:updateProperty({field = "smonthCardId", value = 102}) | ||
23 | + self:updateProperty({field = "getMailT2", value = 0}) | ||
24 | + flag = true | ||
25 | + end | ||
26 | + if flag then | ||
27 | + self:sendMonthCardEmail() | ||
28 | + end | ||
7 | end | 29 | end |
8 | 30 | ||
9 | ActGoodsType = { | 31 | ActGoodsType = { |
@@ -17,7 +39,9 @@ Store.schema = { | @@ -17,7 +39,9 @@ Store.schema = { | ||
17 | growFundR = {"string", ""}, -- 成长基金领取记录 | 39 | growFundR = {"string", ""}, -- 成长基金领取记录 |
18 | 40 | ||
19 | monthCardEx = {"number", 0}, -- 月卡过期时间戳 | 41 | monthCardEx = {"number", 0}, -- 月卡过期时间戳 |
42 | + monthCardId = {"number", 0}, -- 月卡id | ||
20 | smonthCardEx = {"number", 0}, -- 超级月卡过期时间戳 | 43 | smonthCardEx = {"number", 0}, -- 超级月卡过期时间戳 |
44 | + smonthCardId = {"number", 0}, -- 超级月卡id | ||
21 | 45 | ||
22 | battleCard = {"number", 0}, -- 赛季卡 | 46 | battleCard = {"number", 0}, -- 赛季卡 |
23 | battleFR = {"string", ""}, -- 免费赛季卡领取记录 | 47 | battleFR = {"string", ""}, -- 免费赛季卡领取记录 |
@@ -51,7 +75,7 @@ function Store:updateProperty(params) | @@ -51,7 +75,7 @@ function Store:updateProperty(params) | ||
51 | return | 75 | return |
52 | end | 76 | end |
53 | local newValue = self:getProperty(params.field) | 77 | local newValue = self:getProperty(params.field) |
54 | - if not params.notNotify then | 78 | + if not params.notNotify then |
55 | self:notifyUpdateProperty(params.field, newValue, oldValue) | 79 | self:notifyUpdateProperty(params.field, newValue, oldValue) |
56 | end | 80 | end |
57 | end | 81 | end |
@@ -77,13 +101,16 @@ end | @@ -77,13 +101,16 @@ end | ||
77 | -- 发送月卡邮件 | 101 | -- 发送月卡邮件 |
78 | function Store:sendMonthCardEmail() | 102 | function Store:sendMonthCardEmail() |
79 | local timeNow = skynet.timex() | 103 | local timeNow = skynet.timex() |
80 | - local tabs = {{ex="monthCardEx", t="getMailT1", mail=MailId.MonthCard, alert=MailId.MonthCardEx}, | ||
81 | - {ex="smonthCardEx", t="getMailT2", mail=MailId.SuperMonthCard, alert=MailId.SuperMonthCardEx}} | 104 | + |
105 | + local tabs = {{ex="monthCardEx", t="getMailT1", id= self:getProperty("monthCardId")}, | ||
106 | + {ex="smonthCardEx", t="getMailT2", id=self:getProperty("smonthCardId")}} | ||
82 | for _, v in ipairs(tabs) do | 107 | for _, v in ipairs(tabs) do |
83 | local ex = self:getProperty(v.ex) | 108 | local ex = self:getProperty(v.ex) |
84 | local ts = self:getProperty(v.t) or 0 | 109 | local ts = self:getProperty(v.t) or 0 |
85 | - local mailId = v.mail | ||
86 | - local alertId = v.alert | 110 | + local cfg = csvdb["shop_cardCsv"][v.id] or {} |
111 | + | ||
112 | + local mailId = cfg.email | ||
113 | + local alertId = cfg.email_2 | ||
87 | local alertTs = dayLater(ex) - DAY_SEC | 114 | local alertTs = dayLater(ex) - DAY_SEC |
88 | if ex > timeNow then | 115 | if ex > timeNow then |
89 | local cnt = 0 | 116 | local cnt = 0 |
@@ -184,24 +211,66 @@ function Store:getHangDropCoef() | @@ -184,24 +211,66 @@ function Store:getHangDropCoef() | ||
184 | return (1 + globalCsv.hang_drop_exp_coef) or 1, (1 + globalCsv.hang_drop_item_coef) or 1 | 211 | return (1 + globalCsv.hang_drop_exp_coef) or 1, (1 + globalCsv.hang_drop_item_coef) or 1 |
185 | end | 212 | end |
186 | 213 | ||
214 | +function Store:getCurMonthCardLvl(isSuper) | ||
215 | + local id = 0 | ||
216 | + if isSuper then | ||
217 | + id = self:getProperty("smonthCardId") or 0 | ||
218 | + else | ||
219 | + id = self:getProperty("monthCardId") or 0 | ||
220 | + end | ||
221 | + local cfg = csvdb["shop_cardCsv"][id] | ||
222 | + if not cfg then return 0 end | ||
223 | + | ||
224 | + return cfg.level or 0 | ||
225 | +end | ||
187 | 226 | ||
188 | -- 购买通行证 | 227 | -- 购买通行证 |
189 | function Store:onBuyCard(type, duration, id, actid) | 228 | function Store:onBuyCard(type, duration, id, actid) |
190 | local timeNow = skynet.timex() | 229 | local timeNow = skynet.timex() |
191 | if type == CardType.NormalMonthCard then | 230 | if type == CardType.NormalMonthCard then |
192 | if self:isMonthCardExpire() then | 231 | if self:isMonthCardExpire() then |
232 | + self:updateProperty({field = "monthCardId", value = id}) | ||
193 | self:updateProperty({field = "monthCardEx", value = timeNow + duration}) | 233 | self:updateProperty({field = "monthCardEx", value = timeNow + duration}) |
194 | else | 234 | else |
195 | self:updateProperty({field = "monthCardEx", value = self:getProperty("monthCardEx") + duration}) | 235 | self:updateProperty({field = "monthCardEx", value = self:getProperty("monthCardEx") + duration}) |
196 | end | 236 | end |
197 | self:sendMonthCardEmail() | 237 | self:sendMonthCardEmail() |
238 | + elseif type == CardType.NormalMonthCardLevelUp then | ||
239 | + if self:isMonthCardExpire() then | ||
240 | + skynet.error(string.format("month card expired, can not level up,%d,%d",self.owner:getProperty("id"), id)) | ||
241 | + else | ||
242 | + local cfg = csvdb["shop_cardCsv"][id] | ||
243 | + if not cfg then return end | ||
244 | + local dif = cfg.level - self:getCurMonthCardLvl(false) | ||
245 | + if dif > 1 and dif < 0 then | ||
246 | + return | ||
247 | + end | ||
248 | + self:updateProperty({field = "monthCardId", value = id}) | ||
249 | + self:updateProperty({field = "monthCardEx", value = self:getProperty("monthCardEx") + duration}) | ||
250 | + end | ||
251 | + self:sendMonthCardEmail() | ||
198 | elseif type == CardType.SuperMonthCard then | 252 | elseif type == CardType.SuperMonthCard then |
199 | if self:isSuperMonthCardExpire() then | 253 | if self:isSuperMonthCardExpire() then |
254 | + self:updateProperty({field = "smonthCardId", value = id}) | ||
200 | self:updateProperty({field = "smonthCardEx", value = timeNow + duration}) | 255 | self:updateProperty({field = "smonthCardEx", value = timeNow + duration}) |
201 | else | 256 | else |
202 | self:updateProperty({field = "smonthCardEx", value = self:getProperty("smonthCardEx") + duration}) | 257 | self:updateProperty({field = "smonthCardEx", value = self:getProperty("smonthCardEx") + duration}) |
203 | end | 258 | end |
204 | self:sendMonthCardEmail() | 259 | self:sendMonthCardEmail() |
260 | + elseif type == CardType.SuperMonthCardLevelUp then | ||
261 | + if self:isSuperMonthCardExpire() then | ||
262 | + skynet.error(string.format("super month card expired, can not level up,%d,%d",self.owner:getProperty("id"), id)) | ||
263 | + else | ||
264 | + local cfg = csvdb["shop_cardCsv"][id] | ||
265 | + if not cfg then return end | ||
266 | + local dif = cfg.level - self:getCurMonthCardLvl(true) | ||
267 | + if dif > 1 and dif < 0 then | ||
268 | + return | ||
269 | + end | ||
270 | + self:updateProperty({field = "smonthCardId", value = id}) | ||
271 | + self:updateProperty({field = "smonthCardEx", value = self:getProperty("smonthCardEx") + duration}) | ||
272 | + end | ||
273 | + self:sendMonthCardEmail() | ||
205 | elseif type == CardType.PrivilegeCard then | 274 | elseif type == CardType.PrivilegeCard then |
206 | if self:isPrivCardExpire() then | 275 | if self:isPrivCardExpire() then |
207 | self:updateProperty({field = "privCardEx", value = timeNow + duration}) | 276 | self:updateProperty({field = "privCardEx", value = timeNow + duration}) |
@@ -253,7 +322,7 @@ function Store:notifyUpdateProperty(field, newValue, oldValue) | @@ -253,7 +322,7 @@ function Store:notifyUpdateProperty(field, newValue, oldValue) | ||
253 | key = field, | 322 | key = field, |
254 | newValue = newValue, | 323 | newValue = newValue, |
255 | oldValue = oldValue, | 324 | oldValue = oldValue, |
256 | - } | 325 | + } |
257 | SendPacket(actionCodes.Store_updateproperty, MsgPack.pack(datas)) | 326 | SendPacket(actionCodes.Store_updateproperty, MsgPack.pack(datas)) |
258 | end | 327 | end |
259 | 328 | ||
@@ -494,6 +563,8 @@ function Store:data() | @@ -494,6 +563,8 @@ function Store:data() | ||
494 | actGoodsFlag = self:getProperty("actGoodsFlag"), | 563 | actGoodsFlag = self:getProperty("actGoodsFlag"), |
495 | bpInfo = self:getProperty("bpInfo"), | 564 | bpInfo = self:getProperty("bpInfo"), |
496 | totalRR = self:getProperty("totalRR"), | 565 | totalRR = self:getProperty("totalRR"), |
566 | + monthCardId = self:getProperty("monthCardId"), | ||
567 | + smonthCardId = self:getProperty("smonthCardId"), | ||
497 | } | 568 | } |
498 | end | 569 | end |
499 | 570 |