diff options
author | Paul Gilbert | 2014-05-16 18:30:41 -0400 |
---|---|---|
committer | Paul Gilbert | 2014-05-16 18:30:41 -0400 |
commit | d590ca39d139136cf616d80beb525ff3a07acca2 (patch) | |
tree | 1aa1a6263e04b28e21a440f856154aa5479da023 /engines/mads/nebular | |
parent | 3af6bbb397ae94bfbfceeaeab9979613d1047cbb (diff) | |
download | scummvm-rg350-d590ca39d139136cf616d80beb525ff3a07acca2.tar.gz scummvm-rg350-d590ca39d139136cf616d80beb525ff3a07acca2.tar.bz2 scummvm-rg350-d590ca39d139136cf616d80beb525ff3a07acca2.zip |
MADS: Properly implemented object quality code
Diffstat (limited to 'engines/mads/nebular')
-rw-r--r-- | engines/mads/nebular/game_nebular.cpp | 14 | ||||
-rw-r--r-- | engines/mads/nebular/nebular_scenes4.cpp | 29 | ||||
-rw-r--r-- | engines/mads/nebular/nebular_scenes7.cpp | 5 |
3 files changed, 23 insertions, 25 deletions
diff --git a/engines/mads/nebular/game_nebular.cpp b/engines/mads/nebular/game_nebular.cpp index 600c153088..1ec025c8e1 100644 --- a/engines/mads/nebular/game_nebular.cpp +++ b/engines/mads/nebular/game_nebular.cpp @@ -98,7 +98,7 @@ void GameNebular::initialiseGlobals() { /* Section #4 variables */ _globals[kBadFirstIngredient] = -1; - _objects.setQuality(OBJ_CHARGE_CASES, EXPLOSIVES_INSIDE, nullptr); + _objects[OBJ_CHARGE_CASES].setQuality(EXPLOSIVES_INSIDE, 0); _globals[kHasPurchased] = false; _globals[kBeenThruHelgaScene] = false; _globals[kNextIngredient] = 0; @@ -394,8 +394,7 @@ void GameNebular::doObjectAction() { dialogs.showItem(id, 402); } else { int messageId = 800 + id; - if (id == OBJ_CHARGE_CASES) { - error("TODO: object_get_folder - loc_29B48"); + if ((id == OBJ_CHARGE_CASES) && _objects[OBJ_CHARGE_CASES].getQuality(3) != 0) { messageId = 860; } @@ -435,7 +434,14 @@ void GameNebular::doObjectAction() { dialogs.show(_globals[kTopButtonPushed] ? 502 : 501); } else if ((action.isAction(25, 106, 72) || action.isAction(VERB_PUT, 106, 72)) && _objects.isInInventory(OBJ_DETONATORS) && _objects.isInInventory(OBJ_CHARGE_CASES)) { - error("TODO: loc_29DBA"); + if (_objects[OBJ_CHARGE_CASES].getQuality(3)) { + _objects.setRoom(OBJ_CHARGE_CASES, 1); + _objects.setRoom(OBJ_DETONATORS, 1); + _objects.addToInventory(OBJ_BOMBS); + dialogs.showItem(OBJ_BOMBS, 403); + } else { + dialogs.show(405); + } } else if (action.isAction(25, 106)) { dialogs.show(470); } else if ((action.isAction(25, 371, 43) || action.isAction(7, 371, 43) || action.isAction(25, 371, 42) diff --git a/engines/mads/nebular/nebular_scenes4.cpp b/engines/mads/nebular/nebular_scenes4.cpp index 91c522cd25..e8e9596e9d 100644 --- a/engines/mads/nebular/nebular_scenes4.cpp +++ b/engines/mads/nebular/nebular_scenes4.cpp @@ -3513,8 +3513,7 @@ void Scene411::enter() { _dialog3.setup(0x5D, 0x254, 0x260, 0x25C, 0x258, 0x262, -1); _dialog4.setup(0x5E, 0x255, 0x261, 0x25D, 0x259, 0x262, -1); - warning("TODO: Replace the next line by: if ((_globals[kNextIngredient] >= 4) && (!object_get_folder(OBJ_CHARGE_CASES, 3))) {"); - if (_globals[kNextIngredient] >= 4) { + if (_globals[kNextIngredient] >= 4 && _game._objects[OBJ_CHARGE_CASES].getQuality(3)) { _scene->_hotspots.activate(0x3AB, false); _scene->_hotspots.activate(0x30D, true); } else { @@ -3522,11 +3521,9 @@ void Scene411::enter() { _scene->_hotspots.activate(0x3AB, true); } - warning("TODO: Replace the next line by: if ((!_globals[kNextIngredient] >= 4) && (object_get_folder(OBJ_CHARGE_CASES, 3))) {"); - if (!(_globals[kNextIngredient] >= 4)) + if (_globals[kNextIngredient] >= 4 && _game._objects[OBJ_CHARGE_CASES].getQuality(3)) { _globals._sequenceIndexes[4] = _scene->_sequences.startCycle(_globals._spriteIndexes[4], true, 6); - else if (true) { - warning("TODO: The previous if was: else if (!object_get_folder(OBJ_CHARGE_CASES, 3)) {"); + } else if (!_game._objects[OBJ_CHARGE_CASES].getQuality(3)) { switch (_globals[kNextIngredient]) { case 1: _vm->_sound->command(53); @@ -3559,8 +3556,7 @@ void Scene411::enter() { } } - warning("TODO: Replace the next if by: if ((_globals[kNextIngredient] >= 4) && (object_get_folder(OBJ_CHARGE_CASES, 3))) {"); - if (_globals[kNextIngredient] >= 4) { + if (_globals[kNextIngredient] >= 4 && _game._objects[OBJ_CHARGE_CASES].getQuality(3)) { _globals._sequenceIndexes[4] = _scene->_sequences.startCycle(_globals._spriteIndexes[4], true, 6); _scene->_sequences.setDepth(_globals._sequenceIndexes[4], 1); } @@ -3722,9 +3718,9 @@ void Scene411::actions() { return; } - warning("TODO: add the following condition to the if statement: (!object_get_folder(OBJ_CHARGE_CASES, 3)) &&"); - if ((_globals[kNextIngredient] >= 4) && (_action.isAction(VERB_TAKE, 0x3AB) || _action.isAction(VERB_PUT, 0x48, 0x3AB)) && - (_game._objects.isInInventory(OBJ_CHARGE_CASES))) { + if ((_globals[kNextIngredient] >= 4) && (_action.isAction(VERB_TAKE, 0x3AB) || _action.isAction(VERB_PUT, 0x48, 0x3AB)) + && !_game._objects[OBJ_CHARGE_CASES].getQuality(3) + && _game._objects.isInInventory(OBJ_CHARGE_CASES)) { switch (_game._trigger) { case 0: _vm->_sound->command(10); @@ -3764,7 +3760,7 @@ void Scene411::actions() { _game._player._priorTimer = _scene->_frameStartTime - _game._player._ticksAmount; _game._player._visible = true; _game._player._stepEnabled = true; - warning("TODO: InventoryObjects_setData(OBJ_CHARGE_CASES, 3, true);"); + _game._objects[OBJ_CHARGE_CASES].setQuality(3, 1); _vm->_dialogs->showItem(OBJ_CHARGE_CASES, 41142); break; } @@ -3927,15 +3923,12 @@ void Scene411::actions() { else if ((_action.isAction(VERB_LOOK, 0x3A9)) && (_game._objects.isInRoom(OBJ_LECITHIN))) _vm->_dialogs->show(41123); else if (_action.isAction(VERB_LOOK, 0x30D)) { - if (_globals[kNextIngredient] > 0) { - warning("TODO: the if statement should be: if ((_globals[kNextIngredient] > 0) && !object_get_folder(OBJ_CHARGE_CASES, 3))"); + if (_globals[kNextIngredient] > 0 && !_game._objects[OBJ_CHARGE_CASES].getQuality(3)) { _vm->_dialogs->show(41126); - } else if (_globals[kNextIngredient] == 0) { - warning("TODO: the if statement should be: else if ((_globals[kNextIngredient] == 0) || object_get_folder(OBJ_CHARGE_CASES, 3)) {"); + } else if (_globals[kNextIngredient] == 0 || _game._objects[OBJ_CHARGE_CASES].getQuality(3)) { _vm->_dialogs->show(41125); } - } else if (_action.isAction(VERB_LOOK, 0x3AB)) { - warning("TODO: The if statement should be if (_action.isAction(VERB_LOOK, 0x3AB) && !object_get_folder(OBJ_CHARGE_CASES, 3)) {"); + } else if (_action.isAction(VERB_LOOK, 0x3AB) && _game._objects[OBJ_CHARGE_CASES].getQuality(3) == 0) { _vm->_dialogs->show(41127); } else if (_action.isAction(VERB_TAKE, 0x30D)) _vm->_dialogs->show(41128); diff --git a/engines/mads/nebular/nebular_scenes7.cpp b/engines/mads/nebular/nebular_scenes7.cpp index 94bb7b66b2..385141d318 100644 --- a/engines/mads/nebular/nebular_scenes7.cpp +++ b/engines/mads/nebular/nebular_scenes7.cpp @@ -1785,9 +1785,8 @@ void Scene706::actions() { } if (_action.isAction(VERB_PUT, 0x344) && _game._objects.isInInventory(_game._objects.getIdFromDesc(_action._activeAction._objectNameId))) { - warning("Replace the next if when the function is implemented"); - warning("if (sub_13D46(_game._objects.getIdFromDesc(_action._activeAction._objectNameId), 0xA))"); - if (true) + int objectId = _game._objects.getIdFromDesc(_action._activeAction._objectNameId); + if (_game._objects[objectId].hasQuality(10)) _vm->_dialogs->show(70626); else _vm->_dialogs->show(70627); |