From 8c18b4432a350aa270ae7d833e3f4d3b49210c55 Mon Sep 17 00:00:00 2001 From: Joseph-Eugene Winzer Date: Fri, 25 Aug 2017 15:22:36 +0200 Subject: SUPERNOVA: Adds console command 'giveall' Adds crucial items to the inventory. It eases debugging while loading of savestates is not possible. --- engines/supernova/console.cpp | 16 ++++++++++++++++ engines/supernova/console.h | 1 + 2 files changed, 17 insertions(+) (limited to 'engines/supernova') diff --git a/engines/supernova/console.cpp b/engines/supernova/console.cpp index 838189fc53..328c46cd1b 100644 --- a/engines/supernova/console.cpp +++ b/engines/supernova/console.cpp @@ -23,6 +23,7 @@ #include "gui/debugger.h" #include "supernova/supernova.h" +#include "supernova/state.h" #include "supernova/console.h" namespace Supernova { @@ -34,6 +35,7 @@ Console::Console(SupernovaEngine *vm, GameManager *gm) registerCmd("music", WRAP_METHOD(Console, cmdMusic)); registerCmd("list", WRAP_METHOD(Console, cmdList)); registerCmd("inventory", WRAP_METHOD(Console, cmdInventory)); + registerCmd("giveall", WRAP_METHOD(Console, cmdGiveAll)); _vm = vm; _gm = gm; @@ -90,4 +92,18 @@ bool Console::cmdInventory(int argc, const char **argv) { return true; } +bool Console::cmdGiveAll(int argc, const char **argv) { + _gm->takeObject(*_gm->_rooms[INTRO]->getObject(0)); + _gm->takeObject(*_gm->_rooms[INTRO]->getObject(1)); + _gm->takeObject(*_gm->_rooms[INTRO]->getObject(2)); + _gm->takeObject(*_gm->_rooms[GENERATOR]->getObject(2)); // Commander Keycard + _gm->takeObject(*_gm->_rooms[GENERATOR]->getObject(0)); // Power Cord with Plug + _gm->takeObject(*_gm->_rooms[CABIN_L1]->getObject(5)); // Pen + _gm->takeObject(*_gm->_rooms[CABIN_R3]->getObject(0)); // Chess Board + _gm->takeObject(*_gm->_rooms[CABIN_R3]->getObject(9)); // Rope + _gm->takeObject(*_gm->_rooms[AIRLOCK]->getObject(4)); // Helmet + _gm->takeObject(*_gm->_rooms[AIRLOCK]->getObject(5)); // Space Suit + _gm->takeObject(*_gm->_rooms[AIRLOCK]->getObject(6)); // Supply +} + } diff --git a/engines/supernova/console.h b/engines/supernova/console.h index e78c3b556b..74b40c25f8 100644 --- a/engines/supernova/console.h +++ b/engines/supernova/console.h @@ -44,6 +44,7 @@ public: bool cmdMusic(int argc, const char **argv); bool cmdList(int argc, const char **argv); bool cmdInventory(int argc, const char **argv); + bool cmdGiveAll(int argc, const char **argv); private: SupernovaEngine *_vm; GameManager *_gm; -- cgit v1.2.3