diff options
author | Le Philousophe | 2019-05-13 23:55:30 +0200 |
---|---|---|
committer | Eugene Sandulenko | 2019-06-01 22:43:48 +0200 |
commit | cba0ee7296aa3543e90329fd1928e5f9cea8a2dd (patch) | |
tree | cd16239a7664e931f159b0a470aa9f5a30b04d0d /engines | |
parent | 93bc6cf02be9b2260863d105e0c047cb472e9ab7 (diff) | |
download | scummvm-rg350-cba0ee7296aa3543e90329fd1928e5f9cea8a2dd.tar.gz scummvm-rg350-cba0ee7296aa3543e90329fd1928e5f9cea8a2dd.tar.bz2 scummvm-rg350-cba0ee7296aa3543e90329fd1928e5f9cea8a2dd.zip |
CRYOMNI3D: Implement level 6
Diffstat (limited to 'engines')
-rw-r--r-- | engines/cryomni3d/versailles/data.cpp | 31 | ||||
-rw-r--r-- | engines/cryomni3d/versailles/engine.cpp | 2 | ||||
-rw-r--r-- | engines/cryomni3d/versailles/engine.h | 11 | ||||
-rw-r--r-- | engines/cryomni3d/versailles/logic.cpp | 158 |
4 files changed, 182 insertions, 20 deletions
diff --git a/engines/cryomni3d/versailles/data.cpp b/engines/cryomni3d/versailles/data.cpp index 25b22f0de8..d2e733f103 100644 --- a/engines/cryomni3d/versailles/data.cpp +++ b/engines/cryomni3d/versailles/data.cpp @@ -635,26 +635,25 @@ void CryOmni3DEngine_Versailles::initPlacesStates() { SET_PLACE_STATE(33, nullptr, FILTER_EVENT(5, 33), nullptr); SET_PLACE_STATE(34, nullptr, FILTER_EVENT(5, 34), nullptr); } else if (_currentLevel == 6) { - // TODO: implement functions - SET_PLACE_STATE(1, nullptr, nullptr, "VS34"); - SET_PLACE_STATE(2, nullptr, nullptr, "VS32"); - SET_PLACE_STATE(3, nullptr, nullptr, "VS32"); - SET_PLACE_STATE(4, nullptr, nullptr, "VS32"); - SET_PLACE_STATE(5, nullptr, nullptr, "VS32"); - SET_PLACE_STATE(6, nullptr, nullptr, "VS32"); - SET_PLACE_STATE(7, nullptr, nullptr, "VS32"); - SET_PLACE_STATE(8, nullptr, nullptr, "VS32"); - SET_PLACE_STATE(9, nullptr, nullptr, "VS32"); - SET_PLACE_STATE(10, nullptr, nullptr, "VS22"); - SET_PLACE_STATE(11, nullptr, nullptr, "VS12"); - SET_PLACE_STATE(12, nullptr, nullptr, "VS32"); + SET_PLACE_STATE(1, nullptr, FILTER_EVENT(6, 1), "VS34"); + SET_PLACE_STATE(2, nullptr, FILTER_EVENT(6, Orangery), "VS32"); + SET_PLACE_STATE(3, nullptr, FILTER_EVENT(6, 3), "VS32"); + SET_PLACE_STATE(4, nullptr, FILTER_EVENT(6, Orangery), "VS32"); + SET_PLACE_STATE(5, nullptr, FILTER_EVENT(6, Orangery), "VS32"); + SET_PLACE_STATE(6, nullptr, FILTER_EVENT(6, Orangery), "VS32"); + SET_PLACE_STATE(7, nullptr, FILTER_EVENT(6, Orangery), "VS32"); + SET_PLACE_STATE(8, nullptr, FILTER_EVENT(6, Orangery), "VS32"); + SET_PLACE_STATE(9, nullptr, FILTER_EVENT(6, Orangery), "VS32"); + SET_PLACE_STATE(10, nullptr, FILTER_EVENT(6, Orangery), "VS32"); + SET_PLACE_STATE(11, nullptr, FILTER_EVENT(6, Orangery), "VS32"); + SET_PLACE_STATE(12, nullptr, FILTER_EVENT(6, Orangery), "VS32"); SET_PLACE_STATE(13, nullptr, nullptr, "VS33"); - SET_PLACE_STATE(14, nullptr, nullptr, "VS33"); + SET_PLACE_STATE(14, nullptr, nullptr, "VS33"); // Filter is a leftover SET_PLACE_STATE(15, nullptr, nullptr, "VS33"); SET_PLACE_STATE(16, nullptr, nullptr, "VS33"); SET_PLACE_STATE(17, nullptr, nullptr, "VS33"); SET_PLACE_STATE(18, nullptr, nullptr, "VS33"); - SET_PLACE_STATE(19, nullptr, nullptr, "VS33"); + SET_PLACE_STATE(19, nullptr, FILTER_EVENT(6, 19), "VS33"); SET_PLACE_STATE(20, nullptr, nullptr, "VS33"); SET_PLACE_STATE(21, nullptr, nullptr, "VS33"); SET_PLACE_STATE(22, nullptr, nullptr, "VS33"); @@ -1016,7 +1015,7 @@ void CryOmni3DEngine_Versailles::initWhoSpeaksWhere() { SET_WHO(9, 16090, "61_LEN"); SET_WHO(19, 16190, "61_DUC"); SET_WHO(14, 16140, "61_BON"); - if (_gameVariables[GameVariables::kDiscussedLabyrOrder] == 1) { + if (_gameVariables[GameVariables::kMaineTalked] == 1) { SET_WHO(19, 16190, "62_DUC"); } } diff --git a/engines/cryomni3d/versailles/engine.cpp b/engines/cryomni3d/versailles/engine.cpp index 81d7f53000..124f638108 100644 --- a/engines/cryomni3d/versailles/engine.cpp +++ b/engines/cryomni3d/versailles/engine.cpp @@ -611,7 +611,7 @@ void CryOmni3DEngine_Versailles::changeLevel(int level) { } // TODO: countdown _inventory.clear(); - } else if (_currentLevel <= 5) { + } else if (_currentLevel <= 6) { // TODO: remove this when we implemented all levels } else { error("New level %d is not implemented (yet)", level); diff --git a/engines/cryomni3d/versailles/engine.h b/engines/cryomni3d/versailles/engine.h index 89111517c2..e958e3ccb5 100644 --- a/engines/cryomni3d/versailles/engine.h +++ b/engines/cryomni3d/versailles/engine.h @@ -137,8 +137,8 @@ struct GameVariables { kLadderState, // OK kOpenedCurtain, // OK kLoweredChandelier, // OK - kOrangerRatisse, - kDiscussedLabyrOrder, + kCombedOrangeTree, // OK + kMaineTalked, // OK kUsedBougieAllumee, kStateBombe, kInkSpilled, // OK @@ -408,6 +408,8 @@ private: void obj_125(); void obj_126(); void obj_126hk(Graphics::ManagedSurface &surface); + void obj_142(); + void obj_142hk(Graphics::ManagedSurface &surface); // Fixed image template<unsigned int ID> @@ -562,6 +564,11 @@ private: FILTER_EVENT(5, 33); FILTER_EVENT(5, 34); + FILTER_EVENT(6, 1); + FILTER_EVENT(6, 3); + FILTER_EVENT(6, Orangery); + FILTER_EVENT(6, 19); + #undef FILTER_EVENT #undef INIT_PLACE diff --git a/engines/cryomni3d/versailles/logic.cpp b/engines/cryomni3d/versailles/logic.cpp index f7e17088a6..e65d5a62dc 100644 --- a/engines/cryomni3d/versailles/logic.cpp +++ b/engines/cryomni3d/versailles/logic.cpp @@ -119,7 +119,7 @@ void CryOmni3DEngine_Versailles::setupObjects() { SET_OBJECT_GENERIC_CB(0, 139, 24); SET_OBJECT(31, 140); // 45 SET_OBJECT_GENERIC_CB(87, 141, 25); - SET_OBJECT(95, 142); // TODO: LABYR.gif + SET_OBJECT_CB(95, 142); SET_OBJECT(157, 143); SET_OBJECT(168, 144); SET_OBJECT(65, 145); // 50 @@ -194,6 +194,71 @@ void CryOmni3DEngine_Versailles::obj_126hk(Graphics::ManagedSurface &surface) { } } +void CryOmni3DEngine_Versailles::obj_142() { + // Display a marker only when in maze + if (_currentLevel == 6 && _currentPlaceId >= 14 && _currentPlaceId <= 44) { + displayObject(imagesObjects[26], &CryOmni3DEngine_Versailles::obj_142hk); + } else { + displayObject(imagesObjects[26]); + } +} + +void CryOmni3DEngine_Versailles::obj_142hk(Graphics::ManagedSurface &surface) { + const Common::Point markers[] = { + Common::Point(135, 403), // 14 + Common::Point(136, 321), // 15 + Common::Point(225, 109), + Common::Point(441, 88), + Common::Point(505, 78), + Common::Point(550, 82), + Common::Point(479, 242), // 20 + Common::Point(529, 333), + Common::Point(466, 407), + Common::Point(359, 411), + Common::Point(305, 415), + Common::Point(217, 405), // 25 + Common::Point(216, 325), + Common::Point(280, 378), + Common::Point(340, 313), + Common::Point(282, 313), + Common::Point(253, 285), // 30 + Common::Point(225, 258), + Common::Point(154, 255), + Common::Point(219, 188), + Common::Point(294, 251), + Common::Point(341, 242), // 35 + Common::Point(308, 206), + Common::Point(270, 172), + Common::Point(363, 161), + Common::Point(416, 201), + Common::Point(513, 195), // 40 + Common::Point(412, 311), + Common::Point(446, 280), + Common::Point(377, 347), + Common::Point(448, 356), + }; + + unsigned int id = _currentPlaceId - 14; + assert(id < ARRAYSIZE(markers)); + + /* + _fontManager.setSurface(&surface); + _fontManager.setCurrentFont(4); + _fontManager.setTransparentBackground(true); + _fontManager.setForeColor(241); + for(id = 0; id < ARRAYSIZE(markers); id++) { + */ + // Why - 20? Ask to game creators, it's like that in the code + unsigned int spriteX = markers[id].x - _sprites.getCursor(4).getWidth() / 2 - 20; + unsigned int spriteY = markers[id].y - _sprites.getCursor(4).getHeight() / 2; + surface.transBlitFrom(_sprites.getSurface(4), Common::Point(spriteX, spriteY), + _sprites.getKeyColor(4)); + /* + _fontManager.displayInt(markers[id].x - 10, markers[id].y, id + 14); + } + */ +} + // This array contains images for all paintings it must be kept in sync with _paintingsTitles static const char *imagesPaintings[] = { "10E_1.GIF", // 0: 41201 @@ -3926,6 +3991,97 @@ FILTER_EVENT(5, 34) { return true; } +FILTER_EVENT(6, 1) { + if (*event == 36010 && _placeStates[1].state == 0) { + collectObject(144); + setPlaceState(1, 1); + // Handled here + return false; + } + + return true; +} + +FILTER_EVENT(6, 3) { + if (!filterEventLevel6PlaceOrangery(event)) { + // Handled + return false; + } else if (*event == 36030 && _placeStates[3].state == 0) { + collectObject(143); + setPlaceState(3, 1); + // Handled here + return false; + } else if (*event == 1) { + // To apothecary + displayMessageBoxWarp(17); + } + + return true; +} + +FILTER_EVENT(6, Orangery) { + if (*event == 36000) { + if (_inventory.selectedObject() && + _inventory.selectedObject()->idOBJ() == 143) { + _gameVariables[GameVariables::kCombedOrangeTree]++; // Not used afterwards + displayMessageBoxWarp(5); + } + // Handled here + return false; + } else if (*event == 36001) { + if (_inventory.selectedObject() && + _inventory.selectedObject()->idOBJ() == 143) { + displayMessageBoxWarp(6); + } + // Handled here + return false; + } + + return true; +} + +FILTER_EVENT(6, 19) { + if (*event == 26190 && _inventory.selectedObject() && + _placeStates[19].state == 0) { + if (!_gameVariables[GameVariables::kMaineTalked]) { + if (_inventory.selectedObject()->idOBJ() == 144) { + _dialogsMan["{JOUEUR-DONNE-AUTRE-MEDICAMENT}"] = 'Y'; + } + + _dialogsMan.play("61_DUC"); + } else { + if (_inventory.selectedObject()->idOBJ() == 144) { + _dialogsMan["{JOUEUR-DONNE-SIROP-DE-ROSE}"] = 'Y'; + _dialogsMan.setIgnoreNoEndOfConversation(true); + } + + _dialogsMan.play("62_DUC"); + _dialogsMan.setIgnoreNoEndOfConversation(false); + } + + _forcePaletteUpdate = true; + // Force reload of the place + if (_nextPlaceId == -1u) { + _nextPlaceId = _currentPlaceId; + } + + _dialogsMan["{JOUEUR-DONNE-AUTRE-MEDICAMENT}"] = 'N'; + _dialogsMan["{JOUEUR-DONNE-SIROP-DE-ROSE}"] = 'N'; + + _inventory.deselectObject(); + } else if (*event > 0 && *event < 10000 && _dialogsMan["{DUC_MAIN_A_PARLE}"] == 'Y') { + _gameVariables[GameVariables::kMaineTalked] = 1; + _whoSpeaksWhere[PlaceActionKey(19, 16190)] = "62_DUC"; + } else if (*event == 36190 && _placeStates[19].state == 1) { + collectObject(142); + setGameTime(2, 6); + // Handled here + return false; + } + + return true; +} + #undef FILTER_EVENT #undef INIT_PLACE |