Untitled diff

Created Diff never expires
0 removals
Lines
Total
Removed
Words
Total
Removed
To continue using this feature, upgrade to
Diffchecker logo
Diffchecker Pro
85 lines
18 additions
Lines
Total
Added
Words
Total
Added
To continue using this feature, upgrade to
Diffchecker logo
Diffchecker Pro
103 lines
std::string Player::getDescription(int32_t lookDistance) const
std::string Player::getDescription(int32_t lookDistance) const
{
{
std::ostringstream s;
std::ostringstream s;


if (lookDistance == -1) {
if (lookDistance == -1) {
s << "yourself.";
s << "yourself.";


if (group->access) {
if (group->access) {
s << " You are " << group->name << '.';
s << " You are " << group->name << '.';
} else if (vocation->getId() != VOCATION_NONE) {
} else if (vocation->getId() != VOCATION_NONE) {
s << " You are " << vocation->getVocDescription() << '.';
s << " You are " << vocation->getVocDescription() << '.';
} else {
} else {
s << " You have no vocation.";
s << " You have no vocation.";
}
}

//custom edit: passive damage bonus
if (passiveDamageBonus > 0)
{
s << " Your passive damage bonus is " << passiveDamageBonus << "%.";
}
} else {
} else {
s << name;
s << name;
if (!group->access) {
if (!group->access) {
s << " (Level " << level << ')';
s << " (Level " << level << ')';
}
}
s << '.';
s << '.';


if (sex == PLAYERSEX_FEMALE) {
if (sex == PLAYERSEX_FEMALE) {
s << " She";
s << " She";
} else {
} else {
s << " He";
s << " He";
}
}


if (group->access) {
if (group->access) {
s << " is " << group->name << '.';
s << " is " << group->name << '.';
} else if (vocation->getId() != VOCATION_NONE) {
} else if (vocation->getId() != VOCATION_NONE) {
s << " is " << vocation->getVocDescription() << '.';
s << " is " << vocation->getVocDescription() << '.';
} else {
} else {
s << " has no vocation.";
s << " has no vocation.";
}
}

//custom edit: passive damage bonus
if (passiveDamageBonus > 0)
{
if (sex == PLAYERSEX_FEMALE) {
s << " Her";
}
else {
s << " His";
}
s << " passive damage bonus is " << passiveDamageBonus << "%.";
}
}
}


if (party) {
if (party) {
if (lookDistance == -1) {
if (lookDistance == -1) {
s << " Your party has ";
s << " Your party has ";
} else if (sex == PLAYERSEX_FEMALE) {
} else if (sex == PLAYERSEX_FEMALE) {
s << " She is in a party with ";
s << " She is in a party with ";
} else {
} else {
s << " He is in a party with ";
s << " He is in a party with ";
}
}


size_t memberCount = party->getMemberCount() + 1;
size_t memberCount = party->getMemberCount() + 1;
if (memberCount == 1) {
if (memberCount == 1) {
s << "1 member and ";
s << "1 member and ";
} else {
} else {
s << memberCount << " members and ";
s << memberCount << " members and ";
}
}


size_t invitationCount = party->getInvitationCount();
size_t invitationCount = party->getInvitationCount();
if (invitationCount == 1) {
if (invitationCount == 1) {
s << "1 pending invitation.";
s << "1 pending invitation.";
} else {
} else {
s << invitationCount << " pending invitations.";
s << invitationCount << " pending invitations.";
}
}
}
}


if (!guild || !guildRank) {
if (!guild || !guildRank) {
return s.str();
return s.str();
}
}


if (lookDistance == -1) {
if (lookDistance == -1) {
s << " You are ";
s << " You are ";
} else if (sex == PLAYERSEX_FEMALE) {
} else if (sex == PLAYERSEX_FEMALE) {
s << " She is ";
s << " She is ";
} else {
} else {
s << " He is ";
s << " He is ";
}
}


s << guildRank->name << " of the " << guild->getName();
s << guildRank->name << " of the " << guild->getName();
if (!guildNick.empty()) {
if (!guildNick.empty()) {
s << " (" << guildNick << ')';
s << " (" << guildNick << ')';
}
}


size_t memberCount = guild->getMemberCount();
size_t memberCount = guild->getMemberCount();
if (memberCount == 1) {
if (memberCount == 1) {
s << ", which has 1 member, " << guild->getMembersOnline().size() << " of them online.";
s << ", which has 1 member, " << guild->getMembersOnline().size() << " of them online.";
} else {
} else {
s << ", which has " << memberCount << " members, " << guild->getMembersOnline().size() << " of them online.";
s << ", which has " << memberCount << " members, " << guild->getMembersOnline().size() << " of them online.";
}
}
return s.str();
return s.str();
}
}