Commit 370202a59cc31a3e7c79b675c0b2fa9552dd76af
Merge branch 'tr/bugfix' into tr/publish/release
* tr/bugfix: 主动效果 Revert "主动效果" 主动效果 修改gm添加满级英雄指令,开启特权时,加速道具效果未受影响 # Conflicts: # src/csvdata
Showing
4 changed files
with
58 additions
and
15 deletions
Show diff stats
src/actions/GmAction.lua
... | ... | @@ -297,14 +297,15 @@ function _M.get(role, pms) |
297 | 297 | end |
298 | 298 | elseif pms.pm1 == "MAXHERO" then |
299 | 299 | -- 给英雄 |
300 | - for itemId = 400 , 700 do | |
301 | - if csvdb["itemCsv"][itemId] then | |
302 | - role:award({[itemId] = 1}, {log = {desc = "gm"}}) | |
300 | + for heroId = 100, 500 do | |
301 | + local heroCfg = csvdb["unitCsv"][heroId] | |
302 | + if heroCfg and heroCfg.open == 1 then | |
303 | + role:award({[heroId + 300] = 1}, {log = {desc = "gm"}}) | |
303 | 304 | end |
304 | 305 | end |
305 | 306 | -- 升满级 |
306 | 307 | for _, hero in ipairs(role.heros) do |
307 | - hero:updateProperty({field = "level", value = 140}) | |
308 | + _M.herol(role, {pm1 = hero:getProperty("type"), pm2 = 130}) | |
308 | 309 | hero:updateProperty({field = "wakeL", value = #csvdb["unit_wakeCsv"]}) |
309 | 310 | end |
310 | 311 | ... | ... |
src/actions/RoleAction.lua
... | ... | @@ -754,6 +754,17 @@ function _M.openSpeedUpBoxRpc(agent, data) |
754 | 754 | role:costItems({[id] = count}, {log = {desc = "speedUpBox"}}) |
755 | 755 | end |
756 | 756 | |
757 | + local doubleCoef = role.activity:isOpen("DoubleDrop") and 2 or 1 | |
758 | + -- 特权卡获取加速获得额外道具 | |
759 | + local coef = role.storeData:getProduceItemSpeedCoef() | |
760 | + if coef > 1 or doubleCoef > 1 then | |
761 | + for k, cnt in pairs(reward) do | |
762 | + if k == ItemId.Gold or k == ItemId.Exp then | |
763 | + reward[k] = math.floor(cnt * coef * doubleCoef) | |
764 | + end | |
765 | + end | |
766 | + end | |
767 | + | |
757 | 768 | local change |
758 | 769 | reward, change = role:award(reward, {log = {desc = "speedUpBox"}}) |
759 | 770 | ... | ... |
src/adv/Adv.lua
... | ... | @@ -2127,6 +2127,32 @@ function Adv:doActive(activeId, target) |
2127 | 2127 | self.battle.player:addBaseAttr(attr, value, vtype) |
2128 | 2128 | return true |
2129 | 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 | 2157 | for _, effect in ipairs(activeData.effect:toArray()) do |
2132 | 2158 | local cur = effect:toArray(true, "=") | ... | ... |
src/adv/AdvMap.lua
... | ... | @@ -97,23 +97,28 @@ function Map:checkOver() |
97 | 97 | end |
98 | 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 | 115 | function Map:addNewMonsterRand(monsterId, where) |
102 | 116 | local room, block |
103 | 117 | if where then |
104 | 118 | room, block = where[1], where[2] |
105 | 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 | 122 | end |
118 | 123 | |
119 | 124 | if not monsterId then | ... | ... |