diff options
author | Jaromir Wysoglad | 2019-05-30 17:17:03 +0200 |
---|---|---|
committer | Thierry Crozat | 2019-07-28 15:09:14 +0100 |
commit | 800e41ddd21820aeb285988f47947eee9f4fd419 (patch) | |
tree | 765bcb2fe9fee10a7bc064bef4bbade4ea6130a4 /engines | |
parent | 43393fc29fbda09d5df0bbe58d76ecb854c87b74 (diff) | |
download | scummvm-rg350-800e41ddd21820aeb285988f47947eee9f4fd419.tar.gz scummvm-rg350-800e41ddd21820aeb285988f47947eee9f4fd419.tar.bz2 scummvm-rg350-800e41ddd21820aeb285988f47947eee9f4fd419.zip |
SUPERNOVA2: Finish taxistand, add taxi
Diffstat (limited to 'engines')
-rw-r--r-- | engines/supernova2/ms2_def.h | 6 | ||||
-rw-r--r-- | engines/supernova2/rooms.cpp | 2 | ||||
-rw-r--r-- | engines/supernova2/state.cpp | 62 | ||||
-rw-r--r-- | engines/supernova2/state.h | 5 |
4 files changed, 70 insertions, 5 deletions
diff --git a/engines/supernova2/ms2_def.h b/engines/supernova2/ms2_def.h index 0f404974b0..d5eddb3070 100644 --- a/engines/supernova2/ms2_def.h +++ b/engines/supernova2/ms2_def.h @@ -81,9 +81,9 @@ enum Action { enum RoomId { INTRO,AIRPORT,TAXISTAND,STREET,GAMES,CABIN,KIOSK, - KPALAST,CASHBOX,CITY1,CITY2,ELEVATOR,APARTMENT,SHIP, + CULTURE_PALACE,CASHBOX,CITY1,CITY2,ELEVATOR,APARTMENT,SHIP, - PYRAMID,PYRGANG,UPSTAIRS1,DOWNSTAIRS1, + PYRAMID,PYR_ENTRANCE,UPSTAIRS1,DOWNSTAIRS1, BOTTOM_RIGHT_DOOR,BOTTOM_LEFT_DOOR,UPSTAIRS2,DOWNSTAIRS2, UPPER_DOOR,PUZZLE_FRONT,PUZZLE_BEHIND, FORMULA1_F,FORMULA1_N,FORMULA2_F,FORMULA2_N,TOMATO_F,TOMATO_N, @@ -162,7 +162,7 @@ kString160, kString161, kString162, kString163, kString164, kString165, kString166, kString167, kString168, kString169, kString170, kString171, kString172, kString173, kString174, kString175, kString176, kString177, kStringDefaultDescription, kString179, -kString180, kString181, kString182, kString183, kString184, +kString180, kString181, kStringEmpty, kStringWalletOpen, kString184, kString185, kString186, kString187, kString188, kString189, kString190, kString191, kString192, kString193, kString194, kString195, kString196, kString197, kString198, kString199, diff --git a/engines/supernova2/rooms.cpp b/engines/supernova2/rooms.cpp index 7b96ee3bb6..dcda68dfbf 100644 --- a/engines/supernova2/rooms.cpp +++ b/engines/supernova2/rooms.cpp @@ -563,7 +563,7 @@ void TaxiStand::animation() { bool TaxiStand::interact(Action verb, Object &obj1, Object &obj2) { if (verb == ACTION_WALK && obj1._id == TAXI && isSectionVisible(6)) - ;//taxi + _gm->taxi(); else if ((verb == ACTION_WALK || verb == ACTION_OPEN) && obj1._id == DOOR) _vm->renderMessage(obj1._description); else diff --git a/engines/supernova2/state.cpp b/engines/supernova2/state.cpp index 204264e2c9..0a08d12ca4 100644 --- a/engines/supernova2/state.cpp +++ b/engines/supernova2/state.cpp @@ -180,6 +180,7 @@ void GameManager::initState() { _timePaused = false; _messageDuration = 0; _animationTimer = 0; + _taxi_possibility = 4; _currentSentence = -1; for (int i = 0 ; i < 6 ; ++i) { @@ -187,9 +188,12 @@ void GameManager::initState() { _texts[i] = kNoString; _rows[i] = 0; _rowsStart[i] = 0; + _dials[i] = 1; } _prevImgId = 0; + + _state._money = 20; } void GameManager::initRooms() { @@ -543,6 +547,11 @@ void GameManager::drawMapExits() { } } +void GameManager::takeMoney(int amount) { + _state._money += amount; + _vm->setGameString(kStringMoney, Common::String::format("%d Xa", _state._money)); +} + void GameManager::drawStatus() { int index = static_cast<int>(_inputVerb); _vm->renderBox(0, 140, 320, 9, kColorWhite25); @@ -835,7 +844,28 @@ int GameManager::invertSection(int section) { } bool GameManager::genericInteract(Action verb, Object &obj1, Object &obj2) { - return false; + if (verb == ACTION_OPEN && obj1._id == WALLET) { + if (_rooms[TAXISTAND]->getObject(4)->_type & CARRIED) + _vm->renderMessage(kStringEmpty); + else { + _vm->renderMessage(kStringWalletOpen); + takeObject(*_rooms[TAXISTAND]->getObject(4)); + takeObject(*_rooms[TAXISTAND]->getObject(5)); + takeMoney(1); + } + } else if (verb == ACTION_PRESS && obj1._id == TRANSMITTER) { + if (_currentRoom == _rooms[TAXISTAND]) { + if (_currentRoom->getObject(0)->_type != EXIT) { + _vm->renderImage(5); + wait(3); + _vm->renderImage(6); + _currentRoom->getObject(0)->_type = EXIT; + drawMapExits(); + } + } + } else + return false; + return true; } void GameManager::handleInput() { @@ -966,5 +996,35 @@ void GameManager::executeRoom() { _currentRoom->onEntrance(); } } +void GameManager::taxi() { + static StringId dest[] = { + kStringAirport, + kStringDowntown, + kStringCulturePalace, + kStringEarth, + kStringPrivateApartment, + kStringLeaveTaxi + }; + + static StringId answers[] = { + kStringPay, + kStringLeaveTaxi + }; + + Room *previousRoom = _currentRoom; + _currentRoom = _rooms[INTRO]; + _vm->setCurrentImage(4); + _vm->renderImage(0); + _vm->renderImage(1); + _vm->renderImage(2); + + int possibility = _taxi_possibility; + + if (previousRoom == _rooms[AIRPORT]) possibility += 1; + else if (previousRoom == _rooms[STREET]) possibility += 2; + else if (previousRoom == _rooms[CULTURE_PALACE]) possibility += 4; + debug("%d", dialog(6, _dials, dest, 1)); + +} } diff --git a/engines/supernova2/state.h b/engines/supernova2/state.h index 237298f24e..a3beb17518 100644 --- a/engines/supernova2/state.h +++ b/engines/supernova2/state.h @@ -34,6 +34,7 @@ namespace Supernova2 { const int32 kMaxTimerValue = 0x7FFFFFFF; struct GameState { + int16 _money; }; class Inventory { @@ -146,6 +147,8 @@ public: StringId _texts[6]; byte _rows[6]; byte _rowsStart[6]; + byte _dials[6]; + int _taxi_possibility; void takeObject(Object &obj); void setObjectNull(Object *&obj); @@ -179,6 +182,8 @@ public: void reply(StringId textId, int aus1, int aus2); void reply(const char *text, int aus1, int aus2); void mousePosDialog(int x, int y); + void takeMoney(int amount); + void taxi(); private: int _prevImgId; |