|
|
@ -71,7 +71,7 @@ static map<df::unit *, deque<activity_type>> work_history;
|
|
|
|
static int misery[] = { 0, 0, 0, 0, 0, 0, 0 };
|
|
|
|
static int misery[] = { 0, 0, 0, 0, 0, 0, 0 };
|
|
|
|
static bool misery_upto_date = false;
|
|
|
|
static bool misery_upto_date = false;
|
|
|
|
|
|
|
|
|
|
|
|
static color_value monitor_colors[] =
|
|
|
|
static color_value monitor_colors[] =
|
|
|
|
{
|
|
|
|
{
|
|
|
|
COLOR_LIGHTRED,
|
|
|
|
COLOR_LIGHTRED,
|
|
|
|
COLOR_RED,
|
|
|
|
COLOR_RED,
|
|
|
@ -84,20 +84,20 @@ static color_value monitor_colors[] =
|
|
|
|
|
|
|
|
|
|
|
|
static int get_happiness_cat(df::unit *unit)
|
|
|
|
static int get_happiness_cat(df::unit *unit)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
int happy = unit->status.happiness;
|
|
|
|
int stress = unit->status.current_soul->personality.stress_level;
|
|
|
|
if (happy == 0) // miserable
|
|
|
|
if (stress >= 500000)
|
|
|
|
return 0;
|
|
|
|
return 0;
|
|
|
|
else if (happy <= 25) // very unhappy
|
|
|
|
else if (stress >= 250000)
|
|
|
|
return 1;
|
|
|
|
return 1;
|
|
|
|
else if (happy <= 50) // unhappy
|
|
|
|
else if (stress >= 100000)
|
|
|
|
return 2;
|
|
|
|
return 2;
|
|
|
|
else if (happy <= 75) // fine
|
|
|
|
else if (stress >= 60000)
|
|
|
|
return 3;
|
|
|
|
return 3;
|
|
|
|
else if (happy <= 125) // quite content
|
|
|
|
else if (stress >= 30000)
|
|
|
|
return 4;
|
|
|
|
return 4;
|
|
|
|
else if (happy <= 150) // happy
|
|
|
|
else if (stress >= 0)
|
|
|
|
return 5;
|
|
|
|
return 5;
|
|
|
|
else // ecstatic
|
|
|
|
else
|
|
|
|
return 6;
|
|
|
|
return 6;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -688,7 +688,7 @@ public:
|
|
|
|
case job_type::FertilizeField:
|
|
|
|
case job_type::FertilizeField:
|
|
|
|
real_activity = JOB_AGRICULTURE;
|
|
|
|
real_activity = JOB_AGRICULTURE;
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
|
|
case job_type::ButcherAnimal:
|
|
|
|
case job_type::ButcherAnimal:
|
|
|
|
case job_type::PrepareRawFish:
|
|
|
|
case job_type::PrepareRawFish:
|
|
|
|
case job_type::MillPlants:
|
|
|
|
case job_type::MillPlants:
|
|
|
@ -913,7 +913,7 @@ public:
|
|
|
|
populateDwarfColumn();
|
|
|
|
populateDwarfColumn();
|
|
|
|
populateCategoryBreakdownColumn();
|
|
|
|
populateCategoryBreakdownColumn();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -1015,7 +1015,7 @@ private:
|
|
|
|
map<activity_type, map<df::unit *, size_t>> dwarf_activity_values;
|
|
|
|
map<activity_type, map<df::unit *, size_t>> dwarf_activity_values;
|
|
|
|
size_t fort_activity_count;
|
|
|
|
size_t fort_activity_count;
|
|
|
|
size_t window_days;
|
|
|
|
size_t window_days;
|
|
|
|
|
|
|
|
|
|
|
|
vector<activity_type> listed_activities;
|
|
|
|
vector<activity_type> listed_activities;
|
|
|
|
|
|
|
|
|
|
|
|
void validateColumn()
|
|
|
|
void validateColumn()
|
|
|
@ -1227,7 +1227,7 @@ public:
|
|
|
|
if (!unit->status.current_soul)
|
|
|
|
if (!unit->status.current_soul)
|
|
|
|
continue;
|
|
|
|
continue;
|
|
|
|
|
|
|
|
|
|
|
|
for (auto it = unit->status.current_soul->preferences.begin();
|
|
|
|
for (auto it = unit->status.current_soul->preferences.begin();
|
|
|
|
it != unit->status.current_soul->preferences.end();
|
|
|
|
it != unit->status.current_soul->preferences.end();
|
|
|
|
it++)
|
|
|
|
it++)
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -1639,7 +1639,7 @@ static void update_dwarf_stats(bool is_paused)
|
|
|
|
add_work_history(unit, JOB_LEISURE);
|
|
|
|
add_work_history(unit, JOB_LEISURE);
|
|
|
|
continue;
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
add_work_history(unit, unit->job.current_job->job_type);
|
|
|
|
add_work_history(unit, unit->job.current_job->job_type);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -1654,7 +1654,7 @@ DFhackCExport command_result plugin_onupdate (color_ostream &out)
|
|
|
|
return CR_OK;
|
|
|
|
return CR_OK;
|
|
|
|
|
|
|
|
|
|
|
|
static decltype(world->frame_counter) last_frame_count = 0;
|
|
|
|
static decltype(world->frame_counter) last_frame_count = 0;
|
|
|
|
|
|
|
|
|
|
|
|
bool is_paused = DFHack::World::ReadPauseState();
|
|
|
|
bool is_paused = DFHack::World::ReadPauseState();
|
|
|
|
if (is_paused)
|
|
|
|
if (is_paused)
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -1841,11 +1841,11 @@ DFhackCExport command_result plugin_init(color_ostream &out, std::vector <Plugin
|
|
|
|
activity_labels[JOB_MECHANICAL] = "Mechanics";
|
|
|
|
activity_labels[JOB_MECHANICAL] = "Mechanics";
|
|
|
|
activity_labels[JOB_ANIMALS] = "Animal Handling";
|
|
|
|
activity_labels[JOB_ANIMALS] = "Animal Handling";
|
|
|
|
activity_labels[JOB_PRODUCTIVE] = "Other Productive";
|
|
|
|
activity_labels[JOB_PRODUCTIVE] = "Other Productive";
|
|
|
|
|
|
|
|
|
|
|
|
commands.push_back(
|
|
|
|
commands.push_back(
|
|
|
|
PluginCommand(
|
|
|
|
PluginCommand(
|
|
|
|
"dwarfmonitor", "Records dwarf activity to measure fort efficiency",
|
|
|
|
"dwarfmonitor", "Records dwarf activity to measure fort efficiency",
|
|
|
|
dwarfmonitor_cmd, false,
|
|
|
|
dwarfmonitor_cmd, false,
|
|
|
|
"dwarfmonitor enable <mode>\n"
|
|
|
|
"dwarfmonitor enable <mode>\n"
|
|
|
|
" Start monitoring <mode>\n"
|
|
|
|
" Start monitoring <mode>\n"
|
|
|
|
" <mode> can be \"work\", \"misery\", or \"all\"\n"
|
|
|
|
" <mode> can be \"work\", \"misery\", or \"all\"\n"
|
|
|
|