MCPcopy Create free account
hub / github.com/DFHack/dfhack / isUnitMoodable

Function isUnitMoodable

plugins/strangemood.cpp:60–73  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

58Random::MersenneRNG rng;
59
60bool isUnitMoodable (df::unit *unit)
61{
62 if (!Units::isCitizen(unit))
63 return false;
64 if (!unit->status2.limbs_grasp_count)
65 return false;
66 if (unit->mood != mood_type::None)
67 return false;
68 if (!ENUM_ATTR(profession,moodable,unit->profession))
69 return false;
70 if (!Units::casteFlagSet(unit->race, unit->caste, caste_raw_flags::STRANGE_MOODS))
71 return false;
72 return true;
73}
74
75df::job_skill getMoodSkill (df::unit *unit)
76{

Callers 1

df_strangemoodFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected