diff options
author | strangerke | 2011-04-17 11:20:08 +0200 |
---|---|---|
committer | strangerke | 2011-04-17 11:20:08 +0200 |
commit | 2fb7acb0009b3ac60bd6000bf398b743394626b8 (patch) | |
tree | 81cb06225b886f3489328fa70d3da5b41c1a48fd /engines/tsage | |
parent | e2f34d19c88a9a0b37c57afbaa07d44c85f1f205 (diff) | |
download | scummvm-rg350-2fb7acb0009b3ac60bd6000bf398b743394626b8.tar.gz scummvm-rg350-2fb7acb0009b3ac60bd6000bf398b743394626b8.tar.bz2 scummvm-rg350-2fb7acb0009b3ac60bd6000bf398b743394626b8.zip |
TSAGE: Add listobjects and moveobject commands to the debugger
Diffstat (limited to 'engines/tsage')
-rw-r--r-- | engines/tsage/debugger.cpp | 171 | ||||
-rw-r--r-- | engines/tsage/debugger.h | 4 |
2 files changed, 174 insertions, 1 deletions
diff --git a/engines/tsage/debugger.cpp b/engines/tsage/debugger.cpp index 730a8f2db1..bebf463f49 100644 --- a/engines/tsage/debugger.cpp +++ b/engines/tsage/debugger.cpp @@ -40,6 +40,8 @@ Debugger::Debugger() : GUI::Debugger() { DCmd_Register("setflag", WRAP_METHOD(Debugger, Cmd_SetFlag)); DCmd_Register("getflag", WRAP_METHOD(Debugger, Cmd_GetFlag)); DCmd_Register("clearflag", WRAP_METHOD(Debugger, Cmd_ClearFlag)); + DCmd_Register("listobjects", WRAP_METHOD(Debugger, Cmd_ListObjects)); + DCmd_Register("moveobject", WRAP_METHOD(Debugger, Cmd_MoveObject)); DCmd_Register("item", WRAP_METHOD(Debugger, Cmd_Item)); } @@ -210,6 +212,175 @@ bool Debugger::Cmd_ClearFlag(int argc, const char **argv) { return true; } +/* + * This command lists the objects available, and their ID + */ +bool Debugger::Cmd_ListObjects(int argc, const char **argv) { + if (argc != 1) { + DebugPrintf("Usage: %s\n", argv[0]); + return true; + } + + DebugPrintf("Available objects for this game are:\n"); + DebugPrintf("0 - Stunner\n"); + DebugPrintf("1 - Scanner\n"); + DebugPrintf("2 - Stasis Box\n"); + DebugPrintf("3 - Info Disk\n"); + DebugPrintf("4 - Stasis Negator\n"); + DebugPrintf("5 - Key Device\n"); + DebugPrintf("6 - Medkit\n"); + DebugPrintf("7 - Ladder\n"); + DebugPrintf("8 - Rope\n"); + DebugPrintf("9 - Key\n"); + DebugPrintf("10 - Translator\n"); + DebugPrintf("11 - Ale\n"); + DebugPrintf("12 - Paper\n"); + DebugPrintf("13 - Waldos\n"); + DebugPrintf("14 - Stasis Box 2\n"); + DebugPrintf("15 - Ring\n"); + DebugPrintf("16 - Cloak\n"); + DebugPrintf("17 - Tunic\n"); + DebugPrintf("18 - Candle\n"); + DebugPrintf("19 - Straw\n"); + DebugPrintf("20 - Scimitar\n"); + DebugPrintf("21 - Sword\n"); + DebugPrintf("22 - Helmet\n"); + DebugPrintf("23 - Items\n"); + DebugPrintf("24 - Concentrator\n"); + DebugPrintf("25 - Nullifier\n"); + DebugPrintf("26 - Peg\n"); + DebugPrintf("27 - Vial\n"); + DebugPrintf("28 - Jacket\n"); + DebugPrintf("29 - Tunic 2\n"); + DebugPrintf("30 - Bone\n"); + DebugPrintf("31 - Empty Jar\n"); + DebugPrintf("32 - Jar\n"); + return true; +} + +/* + * This command gets an item, or move it to a room + */ +bool Debugger::Cmd_MoveObject(int argc, const char **argv) { + // Check for a flag to clear + if ((argc < 2) || (argc > 3)){ + DebugPrintf("Usage: %s <object number> [<scene number>]\n", argv[0]); + DebugPrintf("If no scene is specified, the object will be added to inventory\n", argv[0]); + return true; + } + + int objNum = strToInt(argv[1]); + int sceneNum = 1; + if (argc == 3) + sceneNum = strToInt(argv[2]); + + switch (objNum) { + case OBJECT_STUNNER: + _globals->_inventory._stunner._sceneNumber = sceneNum; + break; + case OBJECT_SCANNER: + _globals->_inventory._scanner._sceneNumber = sceneNum; + break; + case OBJECT_STASIS_BOX: + _globals->_inventory._stasisBox._sceneNumber = sceneNum; + break; + case OBJECT_INFODISK: + _globals->_inventory._infoDisk._sceneNumber = sceneNum; + break; + case OBJECT_STASIS_NEGATOR: + _globals->_inventory._stasisNegator._sceneNumber = sceneNum; + break; + case OBJECT_KEY_DEVICE: + _globals->_inventory._keyDevice._sceneNumber = sceneNum; + break; + case OBJECT_MEDKIT: + _globals->_inventory._medkit._sceneNumber = sceneNum; + break; + case OBJECT_LADDER: + _globals->_inventory._ladder._sceneNumber = sceneNum; + break; + case OBJECT_ROPE: + _globals->_inventory._rope._sceneNumber = sceneNum; + break; + case OBJECT_KEY: + _globals->_inventory._key._sceneNumber = sceneNum; + break; + case OBJECT_TRANSLATOR: + _globals->_inventory._translator._sceneNumber = sceneNum; + break; + case OBJECT_ALE: + _globals->_inventory._ale._sceneNumber = sceneNum; + break; + case OBJECT_PAPER: + _globals->_inventory._paper._sceneNumber = sceneNum; + break; + case OBJECT_WALDOS: + _globals->_inventory._waldos._sceneNumber = sceneNum; + break; + case OBJECT_STASIS_BOX2: + _globals->_inventory._stasisBox2._sceneNumber = sceneNum; + break; + case OBJECT_RING: + _globals->_inventory._ring._sceneNumber = sceneNum; + break; + case OBJECT_CLOAK: + _globals->_inventory._cloak._sceneNumber = sceneNum; + break; + case OBJECT_TUNIC: + _globals->_inventory._tunic._sceneNumber = sceneNum; + break; + case OBJECT_CANDLE: + _globals->_inventory._candle._sceneNumber = sceneNum; + break; + case OBJECT_STRAW: + _globals->_inventory._straw._sceneNumber = sceneNum; + break; + case OBJECT_SCIMITAR: + _globals->_inventory._scimitar._sceneNumber = sceneNum; + break; + case OBJECT_SWORD: + _globals->_inventory._sword._sceneNumber = sceneNum; + break; + case OBJECT_HELMET: + _globals->_inventory._helmet._sceneNumber = sceneNum; + break; + case OBJECT_ITEMS: + _globals->_inventory._items._sceneNumber = sceneNum; + break; + case OBJECT_CONCENTRATOR: + _globals->_inventory._concentrator._sceneNumber = sceneNum; + break; + case OBJECT_NULLIFIER: + _globals->_inventory._nullifier._sceneNumber = sceneNum; + break; + case OBJECT_PEG: + _globals->_inventory._peg._sceneNumber = sceneNum; + break; + case OBJECT_VIAL: + _globals->_inventory._vial._sceneNumber = sceneNum; + break; + case OBJECT_JACKET: + _globals->_inventory._jacket._sceneNumber = sceneNum; + break; + case OBJECT_TUNIC2: + _globals->_inventory._tunic2._sceneNumber = sceneNum; + break; + case OBJECT_BONE: + _globals->_inventory._bone._sceneNumber = sceneNum; + break; + case OBJECT_EMPTY_JAR: + _globals->_inventory._emptyJar._sceneNumber = sceneNum; + break; + case OBJECT_JAR: + _globals->_inventory._jar._sceneNumber = sceneNum; + break; + default: + DebugPrintf("Invlid object Id %s\n", argv[1]); + } + + return true; +} + /** * Give a specified item to the player */ diff --git a/engines/tsage/debugger.h b/engines/tsage/debugger.h index ee097e17bf..a34bb1ef0a 100644 --- a/engines/tsage/debugger.h +++ b/engines/tsage/debugger.h @@ -40,11 +40,13 @@ protected: bool Cmd_Scene(int argc, const char **argv); bool Cmd_WalkRegions(int argc, const char **argv); bool Cmd_PriorityRegions(int argc, const char **argv); - bool Cmd_Item(int argc, const char **argv); bool Cmd_SetFlag(int argc, const char **argv); bool Cmd_GetFlag(int argc, const char **argv); bool Cmd_ClearFlag(int argc, const char **argv); + bool Cmd_ListObjects(int argc, const char **argv); + bool Cmd_MoveObject(int argc, const char **argv); + bool Cmd_Item(int argc, const char **argv); }; } // End of namespace tSage |