Commit f4d0af83e13d429d487b25df93afbfdf82f77d16
1 parent
722bce59
Revert "主动效果"
This reverts commit 722bce59cb4f05b6e0c958b83141d91b6b2d31ed.
Showing
2 changed files
with
11 additions
and
42 deletions
Show diff stats
src/adv/Adv.lua
| ... | ... | @@ -2127,32 +2127,6 @@ 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 | |
| 2156 | 2130 | |
| 2157 | 2131 | for _, effect in ipairs(activeData.effect:toArray()) do |
| 2158 | 2132 | local cur = effect:toArray(true, "=") | ... | ... |
src/adv/AdvMap.lua
| ... | ... | @@ -97,28 +97,23 @@ 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 | - | |
| 114 | 100 | --随机一个空的位置生成怪, 如果没有就没有 |
| 115 | 101 | function Map:addNewMonsterRand(monsterId, where) |
| 116 | 102 | local room, block |
| 117 | 103 | if where then |
| 118 | 104 | room, block = where[1], where[2] |
| 119 | 105 | else |
| 120 | - room, block = self:randEmptyBlock() | |
| 121 | - if not room then return end | |
| 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] | |
| 122 | 117 | end |
| 123 | 118 | |
| 124 | 119 | if not monsterId then | ... | ... |