std::string Player::getDescription(int32_t lookDistance) const
{
std::stringstream s;
std::string str;
if(lookDistance == -1)
{
s << "yourself.";
if(accessLevel != 0)
s << " You are " << groupName << ".";
else if(vocation_id != 0)
s << " You are " << vocation->getVocDescription() << ".";
else
s << " You have no vocation.";
int32_t fragTime = g_config.getNumber(ConfigManager::FRAG_TIME);
int32_t frags = (player->redSkullTicks / fragTime) + 1;
(frags > 1 ? s << " You have " << frags << " unjustified frag." :
s << " You have " << frags << " unjustified frags.");
}
else
{
s << name;
if(accessLevel == 0)
s << " (Level " << level << ")";
s << ".";
if(sex == PLAYERSEX_FEMALE)
s << " She";
else
s << " He";
if(accessLevel >= 3)
s << " is " << groupName << ".";
else if(vocation_id != 0){
s << " is " << vocation->getVocDescription();
if(accessLevel != 0)
s << " (" << groupName << ").";
else
s << ".";
}
else
s << " has no vocation.";
}
if(guildId)
{
if(lookDistance == -1)
s << " You are ";
else
{
if(sex == PLAYERSEX_FEMALE)
s << " She is ";
else
s << " He is ";
}
if(guildRank.length())
s << guildRank;
else
s << "a member";
s << " of the " << guildName;
if(guildNick.length())
s << " (" << guildNick << ")";
s << ".";
}
str = s.str();
return str;
}