diff options
author | Paul Gilbert | 2014-04-06 16:32:18 -0400 |
---|---|---|
committer | Paul Gilbert | 2014-04-06 16:32:18 -0400 |
commit | 29789847a86a83cff14a57b12479229ce6ba7ac9 (patch) | |
tree | 7d021ee767ad90c665768f109bc906d93bd06ff2 | |
parent | 783f9a0b6ee002512cf8c6d03c4db46bbfc92d8c (diff) | |
download | scummvm-rg350-29789847a86a83cff14a57b12479229ce6ba7ac9.tar.gz scummvm-rg350-29789847a86a83cff14a57b12479229ce6ba7ac9.tar.bz2 scummvm-rg350-29789847a86a83cff14a57b12479229ce6ba7ac9.zip |
MADS: More implementation for looking at inventory items
-rw-r--r-- | engines/mads/inventory.cpp | 11 | ||||
-rw-r--r-- | engines/mads/nebular/game_nebular.cpp | 22 |
2 files changed, 28 insertions, 5 deletions
diff --git a/engines/mads/inventory.cpp b/engines/mads/inventory.cpp index ec5670b090..89ca9f84c2 100644 --- a/engines/mads/inventory.cpp +++ b/engines/mads/inventory.cpp @@ -167,9 +167,14 @@ void InventoryObjects::removeFromInventory(int objectId, int newScene) { } } -int InventoryObjects::getIdFromDesc(int objectId) { - warning("TODO: InventoryObjects::getIdFromDesc()"); - return objectId; +int InventoryObjects::getIdFromDesc(int descId) { + for (int i = 0; i < (int)size(); ++i) { + InventoryObject &obj = (*this)[i]; + if (obj._descId == descId) + return i; + } + + return -1; } } // End of namespace MADS diff --git a/engines/mads/nebular/game_nebular.cpp b/engines/mads/nebular/game_nebular.cpp index 6994e54243..69c896a1f8 100644 --- a/engines/mads/nebular/game_nebular.cpp +++ b/engines/mads/nebular/game_nebular.cpp @@ -379,7 +379,7 @@ void GameNebular::doObjectAction() { ((id = _objects.getIdFromDesc(action._activeAction._objectNameId)) != 0 || (action._activeAction._indirectObjectId > 0 && (id = _objects.getIdFromDesc(action._activeAction._indirectObjectId))))) { - if (id == 21) { + if (id == OBJ_REPAIR_LIST) { dialogs._indexList[0] = _globals[kTeleporterCode + 7]; dialogs._indexList[1] = _globals[kTeleporterCode + 8]; dialogs._indexList[2] = _globals[kTeleporterCode + 6]; @@ -392,7 +392,25 @@ void GameNebular::doObjectAction() { dialogs.showPicture(id, 402); } else { - error("TODO: Implement. See loc_29B48"); + int messageId = 800 + id; + if (id == OBJ_CHARGE_CASES) { + error("TODO: object_get_folder - loc_29B48"); + messageId = 860; + } + + if (id == OBJ_TAPE_PLAYER && _objects[OBJ_AUDIO_TAPE]._roomNumber == OBJ_TAPE_PLAYER) + messageId = 867; + + if (id == 32 && _objects[OBJ_FISHING_LINE]._roomNumber == 3) + messageId = 862; + + if (id == OBJ_BOTTLE && _globals[kBottleStatus] != 0) + messageId = 862 + _globals[kBottleStatus]; + + if (id == OBJ_PHONE_HANDSET && _globals[kHandsetCellStatus]) + messageId = 861; + + dialogs.showPicture(id, messageId); } } else if (action.isAction(VERB_PUT, NOUN_BURGER, NOUN_DEAD_FISH)) { if (_objects.isInInventory(OBJ_BURGER) || _objects.isInInventory(OBJ_DEAD_FISH)) { |