forked from DFHack/scripts
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlight-aquifers-only.lua
35 lines (30 loc) · 924 Bytes
/
light-aquifers-only.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
-- Changes heavy aquifers to light globally pre embark or locally post embark
local args = {...}
if args[1] == 'help' then
print(dfhack.script_help())
return
end
if not dfhack.isWorldLoaded() then
qerror("Error: This script requires a world to be loaded.")
end
if dfhack.isMapLoaded() then
for _, block in ipairs(df.global.world.map.map_blocks) do
if block.flags.has_aquifer then
for k = 0, 15 do
for l = 0, 15 do
block.occupancy[k][l].heavy_aquifer = false
end
end
end
end
return
end
-- pre-embark
for i = 0, df.global.world.world_data.world_width - 1 do
for k = 0, df.global.world.world_data.world_height - 1 do
local tile = df.global.world.world_data.region_map[i]:_displace(k)
if tile.drainage % 20 == 7 then
tile.drainage = tile.drainage + 1
end
end
end