Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStijn Buys <ingar@osirion.org>2008-08-01 23:01:35 +0000
committerStijn Buys <ingar@osirion.org>2008-08-01 23:01:35 +0000
commite5a14a1e1a6d822b3b97df803c91727b16d770d2 (patch)
tree431f0a3611298c8c41750edaecf3b6f9c7a81407 /src/game/game.cc
parentf831477c2502b7a2b32cd1fe1b6678a9c87d3fda (diff)
the kinetic impulse drive
Diffstat (limited to 'src/game/game.cc')
-rw-r--r--src/game/game.cc34
1 files changed, 27 insertions, 7 deletions
diff --git a/src/game/game.cc b/src/game/game.cc
index f95a8ff..e469a31 100644
--- a/src/game/game.cc
+++ b/src/game/game.cc
@@ -137,7 +137,7 @@ void func_hail(core::Player *player, std::string const &args)
core::server()->send_sound(targetplayer, "com/hail");
}
-/// a player actives the jumpdrive on his ship
+/// a player actives the hyperspace jump drive on his ship
void func_jump(core::Player *player, std::string const &args)
{
if (!player->control())
@@ -148,6 +148,17 @@ void func_jump(core::Player *player, std::string const &args)
ship->jump(args);
}
+/// a player actives the kinetic impulse drive on his ship
+void func_impulse(core::Player *player, std::string const &args)
+{
+ if (!player->control())
+ return;
+ if (!player->control()->moduletype() == ship_enttype)
+ return;
+ Ship * ship = static_cast<Ship *>(player->control());
+ ship->impulse();
+}
+
/* ---- The Game class --------------------------------------------- */
Game *Game::game_instance = 0;
@@ -181,10 +192,7 @@ void Game::init()
// add engine game functions
core::Func *func = 0;
- func = core::Func::add("buy", (core::GameFuncPtr) func_buy);
- func->set_info("buy a ship");
- func = core::Func::add("jump", (core::GameFuncPtr) func_jump);
- func->set_info("make a hyperspace jump");
+
func = core::Func::add("join", (core::GameFuncPtr) func_join);
func->set_info("join the game");
func = core::Func::add("hail", (core::GameFuncPtr) func_hail);
@@ -192,13 +200,25 @@ void Game::init()
func = core::Func::add("spectate", (core::GameFuncPtr) func_spectate);
func->set_info("leave the game and spectate");
+ func = core::Func::add("buy", (core::GameFuncPtr) func_buy);
+ func->set_info("buy a ship");
+
+ func = core::Func::add("jump", (core::GameFuncPtr) func_jump);
+ func->set_info("[string] activate or deactivate hyperspace jump drive");
+
+ func = core::Func::add("impulse", (core::GameFuncPtr) func_impulse);
+ func->set_info("activate are deactive kinetic impulse drive");
+
// add engine core functions
func = core::Func::add("list_ship", (core::FuncPtr) func_list_ship);
func->set_info("list ship statistics");
g_impulsespeed = core::Cvar::get("g_impulsespeed", "15", core::Cvar::Game | core::Cvar::Archive);
- g_impulsespeed->set_info("[float] speed of the impulse drive");
-
+ g_impulsespeed->set_info("[float] standard speed of the impulse drive");
+
+ g_impulseacceleration = core::Cvar::get("g_impulseacceleration", "4", core::Cvar::Game | core::Cvar::Archive);
+ g_impulseacceleration->set_info("[float] standard acceleration of the impulse drive");
+
// indicate the module is ready to run frames
module_running = true;
}