diff options
-rw-r--r-- | engines/draci/game.h | 3 | ||||
-rw-r--r-- | engines/draci/script.cpp | 36 | ||||
-rw-r--r-- | engines/draci/script.h | 2 |
3 files changed, 35 insertions, 6 deletions
diff --git a/engines/draci/game.h b/engines/draci/game.h index d4c9c256ee..2cee3e024d 100644 --- a/engines/draci/game.h +++ b/engines/draci/game.h @@ -134,9 +134,6 @@ struct Room { class Game { - // HACK: Remove this before committing; if anyone sees this, remind me :D - friend class Animation; - public: Game(DraciEngine *vm); diff --git a/engines/draci/script.cpp b/engines/draci/script.cpp index 7081d7f769..1d491b0efa 100644 --- a/engines/draci/script.cpp +++ b/engines/draci/script.cpp @@ -50,8 +50,8 @@ void Script::setupCommandList() { { 5, 3, "JustTalk", 0, { 0 }, NULL }, { 5, 4, "JustStay", 0, { 0 }, NULL }, { 6, 1, "Talk", 2, { 3, 2 }, NULL }, - { 7, 1, "ObjStat", 2, { 3, 3 }, NULL }, - { 7, 2, "ObjStat_On", 2, { 3, 3 }, NULL }, + { 7, 1, "ObjStat", 2, { 3, 3 }, &Script::objStat }, + { 7, 2, "ObjStat_On", 2, { 3, 3 }, &Script::objStatOn }, { 8, 1, "IcoStat", 2, { 3, 3 }, NULL }, { 9, 1, "Dialogue", 1, { 2 }, NULL }, { 9, 2, "ExitDialogue", 0, { 0 }, NULL }, @@ -249,7 +249,7 @@ int Script::funcIsObjOff(int objID) { GameObject *obj = _vm->_game->getObject(objID); // We index locations from 0 (as opposed to the original player where it was from 1) - // That's why the "invalid" location 0 from the data files is converted to -1 + // That's why the "away" location 0 from the data files is converted to -1 return !obj->_visible && obj->_location != -1; } @@ -331,6 +331,36 @@ void Script::release(Common::Queue<int> ¶ms) { _vm->_anims->deleteAfterIndex(markedIndex); } +void Script::objStatOn(Common::Queue<int> ¶ms) { + int objID = params.pop() - 1; + int roomID = params.pop() - 1; + + GameObject *obj = _vm->_game->getObject(objID); + + obj->_location = roomID; + obj->_visible = true; +} + +void Script::objStat(Common::Queue<int> ¶ms) { + int status = params.pop(); + int objID = params.pop() - 1; + + GameObject *obj = _vm->_game->getObject(objID); + + if (status == 1) { + return; + } else if (status == 2) { + obj->_visible = false; + } else { + obj->_visible = false; + obj->_location = -1; + } + + for (uint i = 0; i < obj->_anims.size(); ++i) { + _vm->_anims->stop(obj->_anims[i]); + } +} + /** * @brief Evaluates mathematical expressions * @param reader Stream reader set to the beginning of the expression diff --git a/engines/draci/script.h b/engines/draci/script.h index 0cbb0b49fc..4e1943ed8f 100644 --- a/engines/draci/script.h +++ b/engines/draci/script.h @@ -106,6 +106,8 @@ private: void start(Common::Queue<int> ¶ms); void mark(Common::Queue<int> ¶ms); void release(Common::Queue<int> ¶ms); + void objStat(Common::Queue<int> ¶ms); + void objStatOn(Common::Queue<int> ¶ms); int operAnd(int op1, int op2); int operOr(int op1, int op2); |