[Commands] Cleanup #randomizefeatures Command. (#2118)

- Cleanup messages and logic.
- Make #randomizefeatures function for Iksar and Vah Shir.
This commit is contained in:
Kinglykrab
2022-05-06 20:42:34 -04:00
committed by GitHub
parent 2f962c2c8a
commit 6e15fae6a0
2 changed files with 239 additions and 189 deletions
+26 -10
View File
@@ -2,17 +2,33 @@
void command_randomfeatures(Client *c, const Seperator *sep)
{
Mob *target = c->GetTarget();
if (!target) {
c->Message(Chat::White, "Error: This command requires a target");
if (!c->GetTarget()) {
c->Message(Chat::White, "You must have a target to use this command.");
return;
}
else {
if (target->RandomizeFeatures()) {
c->Message(Chat::White, "Features Randomized");
}
else {
c->Message(Chat::White, "This command requires a Playable Race as the target");
}
auto target = c->GetTarget();
if (target->RandomizeFeatures()) {
c->Message(
Chat::White,
fmt::format(
"{} ({}) has had their features randomized.",
target->GetCleanName(),
target->GetID()
).c_str()
);
} else {
c->Message(
Chat::White,
fmt::format(
"{} ({}) is not a player race, their race is {} ({}).",
target->GetCleanName(),
target->GetID(),
GetRaceIDName(target->GetRace()),
target->GetRace()
).c_str()
);
}
}