|
|
@ -1825,7 +1825,7 @@ private:
|
|
|
|
// (except for farms and trade depots)
|
|
|
|
// (except for farms and trade depots)
|
|
|
|
|
|
|
|
|
|
|
|
if (b->getType() != df::building_type::FarmPlot &&
|
|
|
|
if (b->getType() != df::building_type::FarmPlot &&
|
|
|
|
b->getType() != df::building_type::TradeDepot)
|
|
|
|
b->getType() != df::building_type::TradeDepot)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
int fjid = -1;
|
|
|
|
int fjid = -1;
|
|
|
|
for (int jn = 0; jn < b->jobs.size(); jn++)
|
|
|
|
for (int jn = 0; jn < b->jobs.size(); jn++)
|
|
|
@ -2300,10 +2300,10 @@ private:
|
|
|
|
skill_level = Units::getEffectiveSkill(d->dwarf, skill);
|
|
|
|
skill_level = Units::getEffectiveSkill(d->dwarf, skill);
|
|
|
|
xp = Units::getExperience(d->dwarf, skill, false);
|
|
|
|
xp = Units::getExperience(d->dwarf, skill, false);
|
|
|
|
|
|
|
|
|
|
|
|
for (int pa = 0; pa < 6; pa++)
|
|
|
|
for (int pa = 0; pa < 6; pa++)
|
|
|
|
attr_weight += (skill_attr_weights[skill].phys_attr_weights[pa]) * (d->dwarf->body.physical_attrs[pa].value - 1000);
|
|
|
|
attr_weight += (skill_attr_weights[skill].phys_attr_weights[pa]) * (d->dwarf->body.physical_attrs[pa].value - 1000);
|
|
|
|
|
|
|
|
|
|
|
|
for (int ma = 0; ma < 13; ma++)
|
|
|
|
for (int ma = 0; ma < 13; ma++)
|
|
|
|
attr_weight += (skill_attr_weights[skill].mental_attr_weights[ma]) * (d->dwarf->status.current_soul->mental_attrs[ma].value - 1000);
|
|
|
|
attr_weight += (skill_attr_weights[skill].mental_attr_weights[ma]) * (d->dwarf->status.current_soul->mental_attrs[ma].value - 1000);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -2540,10 +2540,10 @@ public:
|
|
|
|
i->second = labor_infos[l].maximum_dwarfs();
|
|
|
|
i->second = labor_infos[l].maximum_dwarfs();
|
|
|
|
|
|
|
|
|
|
|
|
int priority = labor_infos[l].priority();
|
|
|
|
int priority = labor_infos[l].priority();
|
|
|
|
|
|
|
|
|
|
|
|
priority += labor_infos[l].time_since_last_assigned()/12;
|
|
|
|
priority += labor_infos[l].time_since_last_assigned()/12;
|
|
|
|
priority -= labor_infos[l].busy_dwarfs;
|
|
|
|
priority -= labor_infos[l].busy_dwarfs;
|
|
|
|
|
|
|
|
|
|
|
|
base_priority[l] = priority;
|
|
|
|
base_priority[l] = priority;
|
|
|
|
|
|
|
|
|
|
|
|
if (i->second > 0)
|
|
|
|
if (i->second > 0)
|
|
|
@ -2578,8 +2578,8 @@ public:
|
|
|
|
pq2.push(make_pair(priority, labor));
|
|
|
|
pq2.push(make_pair(priority, labor));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (pq.empty())
|
|
|
|
if (pq.empty())
|
|
|
|
while(!pq2.empty())
|
|
|
|
while(!pq2.empty())
|
|
|
|
{
|
|
|
|
{
|
|
|
|
pq.push(pq2.top());
|
|
|
|
pq.push(pq2.top());
|
|
|
|
pq2.pop();
|
|
|
|
pq2.pop();
|
|
|
@ -2706,8 +2706,8 @@ public:
|
|
|
|
{
|
|
|
|
{
|
|
|
|
set_labor(*d, l, true);
|
|
|
|
set_labor(*d, l, true);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if ((*d)->using_labor != df::unit_labor::NONE &&
|
|
|
|
if ((*d)->using_labor != df::unit_labor::NONE &&
|
|
|
|
(score > current_score + 5000 || base_priority[(*d)->using_labor] < base_priority[l]) &&
|
|
|
|
(score > current_score + 5000 || base_priority[(*d)->using_labor] < base_priority[l]) &&
|
|
|
|
default_labor_infos[(*d)->using_labor].tool == TOOL_NONE)
|
|
|
|
default_labor_infos[(*d)->using_labor].tool == TOOL_NONE)
|
|
|
|
set_labor(*d, (*d)->using_labor, false);
|
|
|
|
set_labor(*d, (*d)->using_labor, false);
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -2759,10 +2759,10 @@ public:
|
|
|
|
if (l == df::unit_labor::NONE)
|
|
|
|
if (l == df::unit_labor::NONE)
|
|
|
|
continue;
|
|
|
|
continue;
|
|
|
|
|
|
|
|
|
|
|
|
set_labor(*d, l,
|
|
|
|
set_labor(*d, l,
|
|
|
|
(l >= df::unit_labor::HAUL_STONE && l <= df::unit_labor::HAUL_ANIMALS) ||
|
|
|
|
(l >= df::unit_labor::HAUL_STONE && l <= df::unit_labor::HAUL_ANIMALS) ||
|
|
|
|
l == df::unit_labor::CLEAN ||
|
|
|
|
l == df::unit_labor::CLEAN ||
|
|
|
|
l == df::unit_labor::REMOVE_CONSTRUCTION ||
|
|
|
|
l == df::unit_labor::REMOVE_CONSTRUCTION ||
|
|
|
|
l == df::unit_labor::PULL_LEVER ||
|
|
|
|
l == df::unit_labor::PULL_LEVER ||
|
|
|
|
l == df::unit_labor::HAUL_TRADE);
|
|
|
|
l == df::unit_labor::HAUL_TRADE);
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -2892,7 +2892,7 @@ DFhackCExport command_result plugin_onupdate ( color_ostream &out )
|
|
|
|
// if (++step_count < 60)
|
|
|
|
// if (++step_count < 60)
|
|
|
|
// return CR_OK;
|
|
|
|
// return CR_OK;
|
|
|
|
|
|
|
|
|
|
|
|
if (*df::global::process_jobs)
|
|
|
|
if (*df::global::process_jobs)
|
|
|
|
return CR_OK;
|
|
|
|
return CR_OK;
|
|
|
|
|
|
|
|
|
|
|
|
step_count = 0;
|
|
|
|
step_count = 0;
|
|
|
|