Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'src/game/base')
-rw-r--r--src/game/base/game.cc46
1 files changed, 35 insertions, 11 deletions
diff --git a/src/game/base/game.cc b/src/game/base/game.cc
index fda1d70..da7e6db 100644
--- a/src/game/base/game.cc
+++ b/src/game/base/game.cc
@@ -616,9 +616,9 @@ void Game::func_give(core::Player *player, const std::string &args)
} else if (str.compare("reputation") == 0) {
std::string labelstr;
- Faction *faction= 0;
+ Faction *faction = 0;
if (!(is >> labelstr)) {
- player->send("Usage: give reputation [string] [int]");
+ player->send("Usage: give reputation [faction label] [value]");
return;
} else {
aux::to_label(labelstr);
@@ -652,7 +652,7 @@ void Game::func_give(core::Player *player, const std::string &args)
float reputation;
if (!(is >> reputation)) {
- player->send("Usage: give reputation [string] [int]");
+ player->send("Usage: give reputation [faction] [value]");
return;
}
@@ -665,16 +665,15 @@ void Game::func_give(core::Player *player, const std::string &args)
player->send(msgstr.str().c_str());
} else {
- player->send("Usage: give cargo [string] [int]");
- player->send(" give credits [int]");
- player->send(" give reputation [string] [int]");
- player->send(" give ship [string]");
- player->send(" give weapon [string] [int]");
+ player->send("Usage: give cargo [cargo label] [amount]");
+ player->send(" give credits [amount]");
+ player->send(" give reputation [faction label] [value]");
+ player->send(" give ship [ship label]");
+ player->send(" give weapon [weapon label] [amount]");
return;
}
}
-// cheats
void Game::func_wingmen(core::Player *player, const std::string &args)
{
if (!Game::g_devel->value()) {
@@ -697,9 +696,34 @@ void Game::func_wingmen(core::Player *player, const std::string &args)
aux::to_label(str);
if (str.compare("add") == 0) {
- if (NPC::add_wingman(ship)) {
- player->send("Wingman standing by!");
+ Faction *faction = 0;
+ int amount = 1;
+
+ if (is >> str) {
+ aux::to_label(str);
+ faction = Faction::find(str);
+ if (!faction) {
+ player->send("^WUnknown faction '" + str + "'");
+ return;
+ }
+ if ( !(is >> amount)) {
+ amount = 1;
+ }
}
+
+ for (int count = 0; count < amount; ++count) {
+ NPC *npc = NPC::add_wingman(ship);
+ if (npc) {
+ if (faction) {
+ faction->apply(npc);
+ player->send(faction->name() + " wingman standing by!");
+ } else {
+ player->send("Wingman standing by!");
+ }
+ }
+ }
+ } else {
+ player->send("Usage: wingmen add [faction label] [amount]");
}
}