Support milking and shearing in workflow.

develop
Alexander Gavrilov 2012-11-10 17:06:54 +04:00
parent a7bf526f41
commit eb936c4ce0
7 changed files with 26 additions and 10 deletions

@ -22,6 +22,7 @@ DFHack future
- code for deducing job outputs rewritten in lua for flexibility.
- logic fix: collecting webs produces silk, and ungathered webs are not thread.
- items assigned to squads are considered busy, even if not in inventory.
- shearing and milking jobs are supported, but only with generic MILK or YARN outputs.
New Fix Armory plugin:
Together with a couple of binary patches and the gui/assign-rack script,
this plugin makes weapon racks, armor stands, chests and cabinets in

@ -75,7 +75,7 @@ df::job *DFHack::Job::cloneJobStruct(df::job *job)
{
df::general_ref *ref = pnew->references[i];
if (virtual_cast<df::general_ref_unit_workerst>(ref))
if (virtual_cast<df::general_ref_unit>(ref))
vector_erase_at(pnew->references, i);
else
pnew->references[i] = ref->clone();

@ -425,6 +425,8 @@ bool MaterialInfo::matches(const df::dfhack_material_category &cat)
TEST(glass, IS_GLASS);
if (cat.bits.clay && linear_index(material->reaction_product.id, std::string("FIRED_MAT")) >= 0)
return true;
if (cat.bits.milk && linear_index(material->reaction_product.id, std::string("CHEESE_MAT")) >= 0)
return true;
return false;
}

@ -1 +1 @@
Subproject commit 4ab899319014d950214714a48cd3049a4beb5eb5
Subproject commit 02e0e0d7b9a7ef708a621ef5511a24bf8657b4a2

@ -301,16 +301,27 @@ function listWeakenedConstraints(outputs)
local mask = cons.mat_mask
if (cons.mat_type or -1) >= 0 then
cons.mat_mask = nil
local info = dfhack.matinfo.decode(cons)
if info then
for i,flag in ipairs(df.dfhack_material_category) do
if flag and flag ~= 'wood2' and info:matches{[flag]=true} then
mask = mask or {}
mask[flag] = true
end
end
end
end
register(cons)
if mask then
for k,v in pairs(mask) do
table.insert(generic, {
item_type = cons.item_type,
item_subtype = cons.item_subtype,
is_craft = cons.is_craft,
mat_mask = mask
mat_mask = { [k] = v }
})
end
end
table.insert(anymat, {
item_type = cons.item_type,
item_subtype = cons.item_subtype,

@ -377,7 +377,9 @@ static bool isSupportedJob(df::job *job)
Job::getHolder(job) &&
(!job->job_items.empty() ||
job->job_type == job_type::CollectClay ||
job->job_type == job_type::CollectSand);
job->job_type == job_type::CollectSand ||
job->job_type == job_type::MilkCreature ||
job->job_type == job_type::ShearCreature);
}
static bool isOptionEnabled(unsigned flag)

@ -306,7 +306,7 @@ function JobConstraints:onNewConstraint()
end
dlg.showListPrompt(
'Job Outputs',
'New limit',
'Select one of the possible outputs:',
COLOR_WHITE,
choices,