|
发表于 2021-3-9 15:50:42
|
显示全部楼层
是room.lua,这里——
- function SjMap:getPath(from, to, try)
- --TraceOut("SjMap:getPath: from = " .. from .. " ,to = " .. to)
- local parents,distances = self:lookPath(from)
- local length = distances[to]
- local path = {""}
- local room = to
- repeat
- local parentInfo = parents[room]
- local fromRoom = map.rooms[from]
- local toRoom = map.rooms[to]
- if parentInfo == nil then
- if not try then
- --Note("从:" .. fromRoom .. " 至:" .. toRoom .. ",无法到达。")
- end
- return false
- end
- local parent = parentInfo.parent
- local route = parentInfo.route
- local parentRoom = map.rooms[parent]
- local precmds = parentRoom.precmds
- local precmd = precmds and precmds[route]
- local postcmds = parentRoom.postcmds
- local postcmd = postcmds and postcmds[route]
- local blocks = parentRoom.blocks
- local block = blocks and blocks[route]
- local lengths = parentRoom.lengths
- local len = lengths and lengths[route]
- if postcmd then
- table.insert(path,1,";")
- table.insert(path,1,postcmd)
- end
- table.insert(path,1,";")
- table.insert(path,1,route)
- if precmd then
- table.insert(path,1,";")
- table.insert(path,1,precmd)
- end
- if block then
- for _, b in pairs(block) do
- local sameParty = b.party and b.party == score.party
- local cond = b.cond and b.cond()
- if not sameParty and not cond then
- if hp.exp < b.exp then
- return false
- else
- table.insert(path,1,";")
- table.insert(path,1,"#wipe " .. b.id)
- end
- end
- end
- end
- if len then
- local isStr = len and type(len) == "string" or false
- if isStr then
- if not loadstring(len)() then return false end
- end
- end
- room = parent
- until room == from
- table.insert(path,1,";")
- table.insert(path,1,"halt")
- local p = table.concat(path)
- --print("length="..length)
- return p, length
- end
复制代码
table.insert(path,1,"halt") |
|