From 2f4c20a0b6fa0397d623d883ee48ba59563f1e2f Mon Sep 17 00:00:00 2001 From: Stijn Buys Date: Sun, 18 May 2008 19:22:39 +0000 Subject: standard hail --- src/game/game.cc | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) (limited to 'src/game') diff --git a/src/game/game.cc b/src/game/game.cc index aa78e41..ea72ce0 100644 --- a/src/game/game.cc +++ b/src/game/game.cc @@ -102,6 +102,15 @@ void func_buy(core::Player *player, std::string const &args) core::server()->send(player, "Usage: buy <" + helpstr + "^N>"); } } + +/// a player sends standard hails +void func_hail(core::Player *player, std::string const &args) +{ + core::server()->send(player, "You broadcast a standard standard hail."); + core::server()->broadcast("^B" + player->name() + " ^Bbroadcasts a standard hail!", player); + core::server()->broadcast_sound("com/hail"); +} + /*----- Game ------------------------------------------------------ */ Game::Game() : core::Module("Project::OSiRiON") @@ -253,16 +262,24 @@ void Game::init() if (!default_shipmodel) { con_error << "No default ship model in ini/ships.ini!\n"; + abort(); return; } // add engine game functions - core::Func::add("buy", (core::GameFuncPtr) func_buy); - core::Func::add("join", (core::GameFuncPtr) func_join); - core::Func::add("spectate", (core::GameFuncPtr) func_spectate); + core::Func *func = 0; + func = core::Func::add("buy", (core::GameFuncPtr) func_buy); + func->set_info("buy a ship"); + func = core::Func::add("join", (core::GameFuncPtr) func_join); + func->set_info("join the game"); + func = core::Func::add("hail", (core::GameFuncPtr) func_hail); + func->set_info("send a standard hail"); + func = core::Func::add("spectate", (core::GameFuncPtr) func_spectate); + func->set_info("leave the game and spectate"); // add engine core functions - core::Func::add("list_ship", (core::FuncPtr) func_list_ship); + func = core::Func::add("list_ship", (core::FuncPtr) func_list_ship); + func->set_info("list ship statistics"); // add engine game variables core::Cvar::set("g_testgamevariable", "1", core::Cvar::Game); -- cgit v1.2.3