|
|
|
@ -1024,10 +1024,13 @@ df::unit_misc_trait *Units::getMiscTrait(df::unit *unit, df::misc_trait_type typ
|
|
|
|
|
|
|
|
|
|
// get race name by id or unit pointer
|
|
|
|
|
string Units::getRaceNameById(int32_t id)
|
|
|
|
|
{
|
|
|
|
|
if (id >= 0 && id < world->raws.creatures.all.size())
|
|
|
|
|
{
|
|
|
|
|
df::creature_raw* raw = world->raws.creatures.all[id];
|
|
|
|
|
if (raw)
|
|
|
|
|
return raw->creature_id;
|
|
|
|
|
}
|
|
|
|
|
return "";
|
|
|
|
|
}
|
|
|
|
|
string Units::getRaceName(df::unit* unit)
|
|
|
|
@ -1038,10 +1041,13 @@ string Units::getRaceName(df::unit* unit)
|
|
|
|
|
|
|
|
|
|
// get human-readable race name by id or unit pointer
|
|
|
|
|
string Units::getRaceReadableNameById(int32_t id)
|
|
|
|
|
{
|
|
|
|
|
if (id >= 0 && id < world->raws.creatures.all.size())
|
|
|
|
|
{
|
|
|
|
|
df::creature_raw* raw = world->raws.creatures.all[id];
|
|
|
|
|
if (raw)
|
|
|
|
|
return raw->name[0];
|
|
|
|
|
}
|
|
|
|
|
return "";
|
|
|
|
|
}
|
|
|
|
|
string Units::getRaceReadableName(df::unit* unit)
|
|
|
|
@ -1071,10 +1077,13 @@ string Units::getPhysicalDescription(df::unit* unit)
|
|
|
|
|
|
|
|
|
|
// get plural of race name (used for display in autobutcher UI and for sorting the watchlist)
|
|
|
|
|
string Units::getRaceNamePluralById(int32_t id)
|
|
|
|
|
{
|
|
|
|
|
if (id >= 0 && id < world->raws.creatures.all.size())
|
|
|
|
|
{
|
|
|
|
|
df::creature_raw* raw = world->raws.creatures.all[id];
|
|
|
|
|
if (raw)
|
|
|
|
|
return raw->name[1]; // second field is plural of race name
|
|
|
|
|
}
|
|
|
|
|
return "";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -1085,10 +1094,13 @@ string Units::getRaceNamePlural(df::unit* unit)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
string Units::getRaceBabyNameById(int32_t id)
|
|
|
|
|
{
|
|
|
|
|
if (id >= 0 && id < world->raws.creatures.all.size())
|
|
|
|
|
{
|
|
|
|
|
df::creature_raw* raw = world->raws.creatures.all[id];
|
|
|
|
|
if (raw)
|
|
|
|
|
return raw->general_baby_name[0];
|
|
|
|
|
}
|
|
|
|
|
return "";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -1099,10 +1111,13 @@ string Units::getRaceBabyName(df::unit* unit)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
string Units::getRaceChildNameById(int32_t id)
|
|
|
|
|
{
|
|
|
|
|
if (id >= 0 && id < world->raws.creatures.all.size())
|
|
|
|
|
{
|
|
|
|
|
df::creature_raw* raw = world->raws.creatures.all[id];
|
|
|
|
|
if (raw)
|
|
|
|
|
return raw->general_child_name[0];
|
|
|
|
|
}
|
|
|
|
|
return "";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|