Skip to content

Commit 18aa93f

Browse files
committed
Merge branch 'master' into myk_timestream_move
2 parents 3dbaa5f + 2ccf49f commit 18aa93f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+2152
-834
lines changed

armoks-blessing.lua

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,9 @@
11
-- Adjust all attributes of all dwarves to an ideal
22
-- by vjek
33

4+
local rejuvenate = reqscript('rejuvenate')
45
local utils = require('utils')
56

6-
function rejuvenate(unit)
7-
if unit==nil then
8-
print ("No unit available! Aborting with extreme prejudice.")
9-
return
10-
end
11-
12-
local current_year=df.global.cur_year
13-
local newbirthyear=current_year - 20
14-
if unit.birth_year < newbirthyear then
15-
unit.birth_year=newbirthyear
16-
end
17-
if unit.old_year < current_year+100 then
18-
unit.old_year=current_year+100
19-
end
20-
21-
end
227
-- ---------------------------------------------------------------------------
238
function brainwash_unit(unit)
249
if unit==nil then
@@ -251,7 +236,7 @@ function adjust_all_dwarves(skillname)
251236
print("Adjusting "..dfhack.df2console(dfhack.TranslateName(dfhack.units.getVisibleName(v))))
252237
brainwash_unit(v)
253238
elevate_attributes(v)
254-
rejuvenate(v)
239+
rejuvenate.rejuvenate(v, true)
255240
if skillname then
256241
if df.job_skill_class[skillname] then
257242
LegendaryByClass(skillname,v)

assign-minecarts.lua

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
--@ module = true
33

44
local argparse = require('argparse')
5+
local utils = require('utils')
56

67
function get_free_vehicles()
78
local free_vehicles = {}
@@ -13,16 +14,12 @@ function get_free_vehicles()
1314
return free_vehicles
1415
end
1516

16-
local function has_minecart(route)
17-
return #route.vehicle_ids > 0
18-
end
19-
2017
local function has_stops(route)
2118
return #route.stops > 0
2219
end
2320

2421
local function get_minecart(route)
25-
if not has_minecart(route) then return end
22+
if #route.vehicle_ids == 0 then return end
2623
local vehicle = utils.binsearch(df.global.world.vehicles.active, route.vehicle_ids[0], 'id')
2724
if not vehicle then return end
2825
return df.item.find(vehicle.item_id)
@@ -37,8 +34,9 @@ local function get_id_and_name(route)
3734
end
3835

3936
local function assign_minecart_to_route(route, quiet, minecart)
40-
if has_minecart(route) then
41-
return get_minecart(route)
37+
local assigned_minecart = get_minecart(route)
38+
if assigned_minecart then
39+
return assigned_minecart
4240
end
4341
if not has_stops(route) then
4442
if not quiet then
@@ -57,6 +55,12 @@ local function assign_minecart_to_route(route, quiet, minecart)
5755
return false
5856
end
5957
end
58+
for _,vehicle_id in ipairs(route.vehicle_ids) do
59+
local vehicle = utils.binsearch(df.global.world.vehicles.all, vehicle_id, 'id')
60+
if vehicle then vehicle.route_id = -1 end
61+
end
62+
route.vehicle_ids:resize(0)
63+
route.vehicle_stops:resize(0)
6064
route.vehicle_ids:insert('#', minecart.id)
6165
route.vehicle_stops:insert('#', 0)
6266
minecart.route_id = route.id
@@ -99,7 +103,7 @@ local function list()
99103
for _,route in ipairs(routes) do
100104
print(('%-8d %-9s %-9s %s')
101105
:format(route.id,
102-
has_minecart(route) and 'yes' or 'NO',
106+
get_minecart(route) and 'yes' or 'NO',
103107
has_stops(route) and 'yes' or 'NO',
104108
get_name(route)))
105109
end
@@ -113,7 +117,7 @@ local function all(quiet)
113117
local minecarts, idx = get_free_vehicles(), 1
114118
local routes = df.global.plotinfo.hauling.routes
115119
for _,route in ipairs(routes) do
116-
if has_minecart(route) then
120+
if get_minecart(route) then
117121
goto continue
118122
end
119123
if not assign_minecart_to_route(route, quiet, minecarts[idx]) then
@@ -148,7 +152,7 @@ local function main(args)
148152
local route = get_route_by_id(requested_route_id)
149153
if not route then
150154
dfhack.printerr('route id not found: '..requested_route_id)
151-
elseif has_minecart(route) then
155+
elseif get_minecart(route) then
152156
if not quiet then
153157
print(('Route %s already has a minecart assigned.')
154158
:format(get_id_and_name(route)))

changelog.txt

Lines changed: 39 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,33 +27,66 @@ Template for new versions:
2727
# Future
2828

2929
## New Tools
30-
- `embark-anyone`: allows you to embark as any civilization, including dead and non-dwarven ones
30+
- `fix/wildlife`: prevent wildlife from getting stuck when trying to exit the map. This fix needs to be enabled manually in `gui/control-panel` on the Bug Fixes tab since not all players want this bug to be fixed.
31+
32+
## New Features
33+
- `force`: support the ``Wildlife`` event to allow additional wildlife to enter the map
34+
35+
## Fixes
36+
- `gui/quickfort`: only print a help blueprint's text once even if the repeat setting is enabled
37+
- `makeown`: quell any active enemy relationships with the converted creature
38+
- `fix/loyaltycascade`: allow the fix to work on non-dwarven citizens
39+
- `control-panel`: fix setting numeric preferences from the commandline
40+
41+
## Misc Improvements
42+
- `control-panel`: Add realistic-melting tweak to control-panel registry
43+
- `idle-crafting`: also support making shell crafts for workshops with linked input stockpiles
44+
- `gui/gm-editor`: automatic display of semantic values for language_name fields
45+
- `fix/stuck-worship`: reduced console output by default. Added ``--verbose`` and ``--quiet`` options.
46+
47+
## Removed
48+
- `modtools/force`: merged into `force`
49+
50+
# 50.13-r5
51+
52+
## New Tools
53+
- `embark-anyone`: allows you to embark as any civilization, including dead and non-dwarven civs
3154
- `idle-crafting`: allow dwarves to independently satisfy their need to craft objects
3255
- `gui/family-affairs`: (reinstated) inspect or meddle with pregnancies, marriages, or lover relationships
56+
- `notes`: attach notes to locations on a fort map
3357

3458
## New Features
3559
- `caravan`: DFHack dialogs for trade screens (both ``Bring goods to depot`` and the ``Trade`` barter screen) can now filter by item origins (foreign vs. fort-made) and can filter bins by whether they have a mix of ethically acceptable and unacceptable items in them
3660
- `caravan`: If you have managed to select an item that is ethically unacceptable to the merchant, an "Ethics warning" badge will now appear next to the "Trade" button. Clicking on the badge will show you which items that you have selected are problematic. The dialog has a button that you can click to deselect the problematic items in the trade list.
3761
- `confirm`: If you have ethically unacceptable items selected for trade, the "Are you sure you want to trade" confirmation will warn you about them
3862
- `quickfort`: ``#zone`` blueprints now integrated with `preserve-rooms` so you can create a zone and automatically assign it to a noble or administrative role
39-
- `position`: option to copy cursor position to clipboard
63+
- `exportlegends`: option to filter by race on historical figures page
4064

4165
## Fixes
42-
- `timestream`: ensure child growth events (e.g. becoming an adult) are not skipped
66+
- `timestream`: ensure child growth events (that is, a child's transition to adulthood) are not skipped; existing "overage" children will be automatically fixed within a year
4367
- `empty-bin`: ``--liquids`` option now correctly empties containers filled with LIQUID_MISC (like lye)
4468
- `gui/design`: don't overcount "affected tiles" for Line & Freeform drawing tools
69+
- `deep-embark`: fix error when embarking where there is no land to stand on (e.g. when embarking in the ocean with `gui/embark-anywhere`)
70+
- `deep-embark`: fix failure to transport units and items when embarking where there is no room to spawn the starting wagon
71+
- `gui/create-item`, `modtools/create-item`: items of type "VERMIN", "PET", "REMANS", "FISH", "RAW FISH", and "EGG" no longer spawn creature item "nothing" and will now stack correctly
72+
- `rejuvenate`: don't set a lifespan limit for creatures that are immortal (e.g. elves, goblins)
73+
- `rejuvenate`: properly disconnect babies from mothers when aging babies up to adults
4574

4675
## Misc Improvements
4776
- `gui/sitemap`: show whether a unit is friendly, hostile, or wild
4877
- `gui/sitemap`: show whether a unit is caged
4978
- `gui/control-panel`: include option for turning off dumping of old clothes for `tailor`, for players who have magma pit dumps and want to save old clothes from being dumped into the magma
50-
- `position`: report current historical era (e.g., "Age of Myth")
79+
- `position`: report current historical era (e.g., "Age of Myth"), site/adventurer world coords, and mouse map tile coords
80+
- `position`: option to copy keyboard cursor position to the clipboard
81+
- `assign-minecarts`: reassign vehicles to routes where the vehicle has been destroyed (or has otherwise gone missing)
82+
- `fix/dry-buckets`: prompt DF to recheck requests for aid (e.g. "bring water" jobs) when a bucket is unclogged and becomes available for use
83+
- `exterminate`: show descriptive names for the listed races in addition to their IDs
84+
- `exterminate`: show actual names for unique creatures such as forgotten beasts and titans
85+
- `fix/ownership`: now also checks and fixes room ownership links
5186

5287
## Documentation
5388
- `gui/embark-anywhere`: add information about how the game determines world tile pathability and instructions for bridging two landmasses
5489

55-
## Removed
56-
5790
# 50.13-r4
5891

5992
## New Features

0 commit comments

Comments
 (0)