Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Burial update #859

Merged
merged 7 commits into from
Oct 14, 2023
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 28 additions & 22 deletions burial.lua
Original file line number Diff line number Diff line change
@@ -1,27 +1,33 @@
-- allows burial in unowned coffins
-- by Putnam https://gist.github.com/Putnam3145/e7031588f4d9b24b9dda
--[====[
-- Allows burial in unowned coffins.
-- Based on Putnam's work (https://gist.github.com/Putnam3145/e7031588f4d9b24b9dda)
local argparse = require('argparse')
local utils = require('utils')

burial
======
Sets all unowned coffins to allow burial. ``burial -pets`` also allows burial
of pets.
local args = argparse.processArgs({...}, utils.invert{'d', 'p'})

]====]

local utils=require('utils')

local validArgs = utils.invert({
'pets'
})

local args = utils.processArgs({...}, validArgs)

for k,v in ipairs(df.global.world.buildings.other.COFFIN) do --as:df.building_coffinst
if v.owner_id==-1 then
v.burial_mode.allow_burial=true
if not args.pets then
v.burial_mode.no_pets=true
for i, c in pairs(df.global.world.buildings.other.COFFIN) do
-- Check for existing tomb
for i, z in pairs(c.relations) do
if z.type == df.civzone_type.Tomb then
goto skip
end
end

dfhack.buildings.constructBuilding {
type = df.building_type.Civzone,
subtype = df.civzone_type.Tomb,
pos = xyz2pos(c.x1, c.y1, c.z),
abstract = true,
fields = {
is_active = 8,
zone_settings = {
tomb = {
no_pets = args.d and not args.p,
no_citizens = args.p and not args.d,
},
},
},
}
myk002 marked this conversation as resolved.
Show resolved Hide resolved

::skip::
end
1 change: 1 addition & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ Template for new versions:

## New Tools
- `add-recipe`: (reinstated) add reactions to your civ (e.g. for high boots if your civ didn't start with the ability to make high boots)
- `burial`: (reinstated) allows burial in unowned coffins (now creates tomb zones for all built coffins)

## New Features
- `drain-aquifer`: gained ability to drain just above or below a certain z-level
Expand Down
23 changes: 13 additions & 10 deletions docs/burial.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,23 @@ burial
======

.. dfhack-tool::
:summary: Configures all unowned coffins to allow burial.
:tags: unavailable fort productivity buildings
:summary: Allows burial in unowned coffins.
tmqCypher marked this conversation as resolved.
Show resolved Hide resolved
:tags: fort productivity buildings

Creates a 1x1 tomb zone for each built coffin that doesn't already have one.
myk002 marked this conversation as resolved.
Show resolved Hide resolved

Usage
-----

::

burial [--pets]
``burial [-d] [-p]``

if the ``--pets`` option is passed, coffins will also allow burial of pets.
Created tombs allow both dwarves and pets by default. By specifying ``-d`` or
``-p``, they can be restricted to dwarves or pets, respectively.

Examples
--------
Options
-------

``burial --pets``
Configures all unowned coffins to allow burial, including pets.
``-d``
Create dwarf-only tombs
``-p``
Create pet-only tombs
myk002 marked this conversation as resolved.
Show resolved Hide resolved