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

[catsplosion] reconcile histfig pregnancy stats #887

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Changes from all 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
15 changes: 15 additions & 0 deletions catsplosion.lua
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
local datetime = require('datetime')

local world = df.global.world

if not dfhack.isWorldLoaded() then
Expand Down Expand Up @@ -68,6 +70,19 @@ for id in pairs(creatures) do
female.pregnancy_caste = female.caste -- To handle female only species
total_created = total_created + 1
end
local hf = df.historical_figure.find(female.histfig_id)
if not hf then goto continue end
if not hf.info then
hf.info = df.historical_figure_info:new()
end
if not hf.info.wounds then
hf.info.wounds = df.historical_figure_info.T_wounds:new()
end
local dt = datetime.DateTime.now()
dt:addTicks(female.pregnancy_timer)
local wounds = hf.info.wounds
wounds.childbirth_year, wounds.childbirth_ticks = dt:getYears()
::continue::
end
end

Expand Down