Autolabor: slabs, animal trainers

develop
Kelly Martin 2012-12-06 01:38:43 -06:00
parent f8d6b83088
commit 0df60a0b4f
1 changed files with 16 additions and 2 deletions

@ -57,6 +57,9 @@
#include <df/unit_health_flags.h> #include <df/unit_health_flags.h>
#include <df/building_design.h> #include <df/building_design.h>
#include <df/vehicle.h> #include <df/vehicle.h>
#include <df/units_other_id.h>
#include <df/ui.h>
#include <df/training_assignment.h>
#include <MiscUtils.h> #include <MiscUtils.h>
@ -761,6 +764,7 @@ private:
case df::building_type::Cage: case df::building_type::Cage:
case df::building_type::NestBox: case df::building_type::NestBox:
case df::building_type::TractionBench: case df::building_type::TractionBench:
case df::building_type::Slab:
return df::unit_labor::HAUL_FURNITURE; return df::unit_labor::HAUL_FURNITURE;
case df::building_type::Trap: case df::building_type::Trap:
return df::unit_labor::MECHANIC; return df::unit_labor::MECHANIC;
@ -1162,7 +1166,7 @@ public:
job_to_labor_table[df::job_type::ApplyCast] = jlf_const(df::unit_labor::BONE_SETTING); job_to_labor_table[df::job_type::ApplyCast] = jlf_const(df::unit_labor::BONE_SETTING);
job_to_labor_table[df::job_type::CustomReaction] = new jlfunc_custom(); job_to_labor_table[df::job_type::CustomReaction] = new jlfunc_custom();
job_to_labor_table[df::job_type::ConstructSlab] = jlf_make_furniture; job_to_labor_table[df::job_type::ConstructSlab] = jlf_make_furniture;
job_to_labor_table[df::job_type::EngraveSlab] = jlf_const(df::unit_labor::STONE_CRAFT); job_to_labor_table[df::job_type::EngraveSlab] = jlf_const(df::unit_labor::DETAIL);
job_to_labor_table[df::job_type::ShearCreature] = jlf_const(df::unit_labor::SHEARER); job_to_labor_table[df::job_type::ShearCreature] = jlf_const(df::unit_labor::SHEARER);
job_to_labor_table[df::job_type::SpinThread] = jlf_const(df::unit_labor::SPINNER); job_to_labor_table[df::job_type::SpinThread] = jlf_const(df::unit_labor::SPINNER);
job_to_labor_table[df::job_type::PenLargeAnimal] = jlf_no_labor; job_to_labor_table[df::job_type::PenLargeAnimal] = jlf_no_labor;
@ -1883,6 +1887,16 @@ public:
if (isOptionEnabled(CF_ALLOW_HUNTING) && has_butchers) if (isOptionEnabled(CF_ALLOW_HUNTING) && has_butchers)
labor_needed[df::unit_labor::HUNT] ++; labor_needed[df::unit_labor::HUNT] ++;
/* add animal trainers */
for (auto a = df::global::ui->equipment.training_assignments.begin();
a != df::global::ui->equipment.training_assignments.end();
a++)
{
labor_needed[df::unit_labor::ANIMALTRAIN]++;
// note: this doesn't test to see if the trainer is actually needed, and thus will overallocate trainers. bleah.
}
if (print_debug) if (print_debug)
{ {
for (auto i = labor_needed.begin(); i != labor_needed.end(); i++) for (auto i = labor_needed.begin(); i != labor_needed.end(); i++)