Skip to content

Commit

Permalink
Merge branch 'master' into myk_timestream_move
Browse files Browse the repository at this point in the history
  • Loading branch information
myk002 committed Oct 5, 2024
2 parents 3dbaa5f + 2ccf49f commit 18aa93f
Show file tree
Hide file tree
Showing 53 changed files with 2,152 additions and 834 deletions.
19 changes: 2 additions & 17 deletions armoks-blessing.lua
Original file line number Diff line number Diff line change
@@ -1,24 +1,9 @@
-- Adjust all attributes of all dwarves to an ideal
-- by vjek

local rejuvenate = reqscript('rejuvenate')
local utils = require('utils')

function rejuvenate(unit)
if unit==nil then
print ("No unit available! Aborting with extreme prejudice.")
return
end

local current_year=df.global.cur_year
local newbirthyear=current_year - 20
if unit.birth_year < newbirthyear then
unit.birth_year=newbirthyear
end
if unit.old_year < current_year+100 then
unit.old_year=current_year+100
end

end
-- ---------------------------------------------------------------------------
function brainwash_unit(unit)
if unit==nil then
Expand Down Expand Up @@ -251,7 +236,7 @@ function adjust_all_dwarves(skillname)
print("Adjusting "..dfhack.df2console(dfhack.TranslateName(dfhack.units.getVisibleName(v))))
brainwash_unit(v)
elevate_attributes(v)
rejuvenate(v)
rejuvenate.rejuvenate(v, true)
if skillname then
if df.job_skill_class[skillname] then
LegendaryByClass(skillname,v)
Expand Down
24 changes: 14 additions & 10 deletions assign-minecarts.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
--@ module = true

local argparse = require('argparse')
local utils = require('utils')

function get_free_vehicles()
local free_vehicles = {}
Expand All @@ -13,16 +14,12 @@ function get_free_vehicles()
return free_vehicles
end

local function has_minecart(route)
return #route.vehicle_ids > 0
end

local function has_stops(route)
return #route.stops > 0
end

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

local function assign_minecart_to_route(route, quiet, minecart)
if has_minecart(route) then
return get_minecart(route)
local assigned_minecart = get_minecart(route)
if assigned_minecart then
return assigned_minecart
end
if not has_stops(route) then
if not quiet then
Expand All @@ -57,6 +55,12 @@ local function assign_minecart_to_route(route, quiet, minecart)
return false
end
end
for _,vehicle_id in ipairs(route.vehicle_ids) do
local vehicle = utils.binsearch(df.global.world.vehicles.all, vehicle_id, 'id')
if vehicle then vehicle.route_id = -1 end
end
route.vehicle_ids:resize(0)
route.vehicle_stops:resize(0)
route.vehicle_ids:insert('#', minecart.id)
route.vehicle_stops:insert('#', 0)
minecart.route_id = route.id
Expand Down Expand Up @@ -99,7 +103,7 @@ local function list()
for _,route in ipairs(routes) do
print(('%-8d %-9s %-9s %s')
:format(route.id,
has_minecart(route) and 'yes' or 'NO',
get_minecart(route) and 'yes' or 'NO',
has_stops(route) and 'yes' or 'NO',
get_name(route)))
end
Expand All @@ -113,7 +117,7 @@ local function all(quiet)
local minecarts, idx = get_free_vehicles(), 1
local routes = df.global.plotinfo.hauling.routes
for _,route in ipairs(routes) do
if has_minecart(route) then
if get_minecart(route) then
goto continue
end
if not assign_minecart_to_route(route, quiet, minecarts[idx]) then
Expand Down Expand Up @@ -148,7 +152,7 @@ local function main(args)
local route = get_route_by_id(requested_route_id)
if not route then
dfhack.printerr('route id not found: '..requested_route_id)
elseif has_minecart(route) then
elseif get_minecart(route) then
if not quiet then
print(('Route %s already has a minecart assigned.')
:format(get_id_and_name(route)))
Expand Down
45 changes: 39 additions & 6 deletions changelog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,33 +27,66 @@ Template for new versions:
# Future

## New Tools
- `embark-anyone`: allows you to embark as any civilization, including dead and non-dwarven ones
- `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.

## New Features
- `force`: support the ``Wildlife`` event to allow additional wildlife to enter the map

## Fixes
- `gui/quickfort`: only print a help blueprint's text once even if the repeat setting is enabled
- `makeown`: quell any active enemy relationships with the converted creature
- `fix/loyaltycascade`: allow the fix to work on non-dwarven citizens
- `control-panel`: fix setting numeric preferences from the commandline

## Misc Improvements
- `control-panel`: Add realistic-melting tweak to control-panel registry
- `idle-crafting`: also support making shell crafts for workshops with linked input stockpiles
- `gui/gm-editor`: automatic display of semantic values for language_name fields
- `fix/stuck-worship`: reduced console output by default. Added ``--verbose`` and ``--quiet`` options.

## Removed
- `modtools/force`: merged into `force`

# 50.13-r5

## New Tools
- `embark-anyone`: allows you to embark as any civilization, including dead and non-dwarven civs
- `idle-crafting`: allow dwarves to independently satisfy their need to craft objects
- `gui/family-affairs`: (reinstated) inspect or meddle with pregnancies, marriages, or lover relationships
- `notes`: attach notes to locations on a fort map

## New Features
- `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
- `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.
- `confirm`: If you have ethically unacceptable items selected for trade, the "Are you sure you want to trade" confirmation will warn you about them
- `quickfort`: ``#zone`` blueprints now integrated with `preserve-rooms` so you can create a zone and automatically assign it to a noble or administrative role
- `position`: option to copy cursor position to clipboard
- `exportlegends`: option to filter by race on historical figures page

## Fixes
- `timestream`: ensure child growth events (e.g. becoming an adult) are not skipped
- `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
- `empty-bin`: ``--liquids`` option now correctly empties containers filled with LIQUID_MISC (like lye)
- `gui/design`: don't overcount "affected tiles" for Line & Freeform drawing tools
- `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`)
- `deep-embark`: fix failure to transport units and items when embarking where there is no room to spawn the starting wagon
- `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
- `rejuvenate`: don't set a lifespan limit for creatures that are immortal (e.g. elves, goblins)
- `rejuvenate`: properly disconnect babies from mothers when aging babies up to adults

## Misc Improvements
- `gui/sitemap`: show whether a unit is friendly, hostile, or wild
- `gui/sitemap`: show whether a unit is caged
- `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
- `position`: report current historical era (e.g., "Age of Myth")
- `position`: report current historical era (e.g., "Age of Myth"), site/adventurer world coords, and mouse map tile coords
- `position`: option to copy keyboard cursor position to the clipboard
- `assign-minecarts`: reassign vehicles to routes where the vehicle has been destroyed (or has otherwise gone missing)
- `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
- `exterminate`: show descriptive names for the listed races in addition to their IDs
- `exterminate`: show actual names for unique creatures such as forgotten beasts and titans
- `fix/ownership`: now also checks and fixes room ownership links

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

## Removed

# 50.13-r4

## New Features
Expand Down
Loading

0 comments on commit 18aa93f

Please sign in to comment.