From 59099a72057ff2e242679955a80e29d425219c8a Mon Sep 17 00:00:00 2001 From: Strangerke Date: Fri, 5 Dec 2014 10:27:44 +0100 Subject: ACCESS: Fix cmdDead for the demo --- engines/access/amazon/amazon_game.cpp | 111 +++++++++++++++++++---------- engines/access/amazon/amazon_resources.cpp | 44 ++++++++++++ engines/access/amazon/amazon_resources.h | 2 + 3 files changed, 120 insertions(+), 37 deletions(-) (limited to 'engines') diff --git a/engines/access/amazon/amazon_game.cpp b/engines/access/amazon/amazon_game.cpp index 79fca87b3f..3252754239 100644 --- a/engines/access/amazon/amazon_game.cpp +++ b/engines/access/amazon/amazon_game.cpp @@ -124,9 +124,16 @@ void AmazonEngine::setupGame() { // Load death list _deaths.resize(58); - for (int i = 0; i < 58; ++i) { - _deaths[i]._screenId = DEATH_SCREENS[i]; - _deaths[i]._msg = DEATH_TEXT[i]; + if (isDemo()) { + for (int i = 0; i < 34; ++i) { + _deaths[i]._screenId = DEATH_SCREENS_DEMO[i]; + _deaths[i]._msg = DEATH_TEXT_DEMO[i]; + } + } else { + for (int i = 0; i < 58; ++i) { + _deaths[i]._screenId = DEATH_SCREENS[i]; + _deaths[i]._msg = DEATH_TEXT[i]; + } } _deaths._cells.resize(12); for (int i = 0; i < 12; ++i) @@ -616,7 +623,8 @@ void AmazonEngine::dead(int deathId) { _screen->setPanel(3); if (deathId != 10) { - _midi->newMusic(62, 0); + if (!isDemo()) + _midi->newMusic(62, 0); _files->_setPaletteFlag = false; _files->loadScreen(94, 0); _files->_setPaletteFlag = true; @@ -631,43 +639,72 @@ void AmazonEngine::dead(int deathId) { if (shouldQuit()) return; } - freeCells(); - // Load the cell list for the death screen - DeathEntry &de = _deaths[deathId]; - Common::Array cells; - cells.push_back(_deaths._cells[de._screenId]); - loadCells(cells); + if (!isDemo()) { + freeCells(); - _screen->setDisplayScan(); - _files->_setPaletteFlag = false; - _files->loadScreen(&_buffer2, 94, 1); - _screen->setIconPalette(); - - _buffer2.plotImage(_objectsTable[0], 0, Common::Point(105, 25)); - _buffer2.copyTo(_screen); - _screen->forceFadeIn(); - - _fonts._charSet._hi = 10; - _fonts._charSet._lo = 1; - _fonts._charFor._lo = 55; - _fonts._charFor._hi = 255; - _screen->_maxChars = 46; - _screen->_printOrg = Common::Point(20, 155); - _screen->_printStart = Common::Point(20, 155); - - Common::String &msg = de._msg; - _printEnd = 180; - printText(_screen, msg); - _screen->forceFadeOut(); + // Load the cell list for the death screen + DeathEntry &de = _deaths[deathId]; + Common::Array cells; + cells.push_back(_deaths._cells[de._screenId]); + loadCells(cells); - _midi->newMusic(0, 1); - _events->showCursor(); - _room->clearRoom(); - freeChar(); + _screen->setDisplayScan(); + _files->_setPaletteFlag = false; + _files->loadScreen(&_buffer2, 94, 1); + _screen->setIconPalette(); + + _buffer2.plotImage(_objectsTable[0], 0, Common::Point(105, 25)); + _buffer2.copyTo(_screen); + _screen->forceFadeIn(); + + _fonts._charSet._hi = 10; + _fonts._charSet._lo = 1; + _fonts._charFor._lo = 55; + _fonts._charFor._hi = 255; + _screen->_maxChars = 46; + _screen->_printOrg = Common::Point(20, 155); + _screen->_printStart = Common::Point(20, 155); - _currentManOld = 1; - _player->removeSprite1(); + Common::String &msg = de._msg; + _printEnd = 180; + + printText(_screen, msg); + _screen->forceFadeOut(); + + _midi->newMusic(0, 1); + _events->showCursor(); + _room->clearRoom(); + freeChar(); + + _currentManOld = 1; + _player->removeSprite1(); + + } else { + _files->loadScreen(_screen, 94, _deaths[deathId]._screenId); + _screen->forceFadeIn(); + + _fonts._charSet._hi = 10; + _fonts._charSet._lo = 1; + _fonts._charFor._lo = 55; + _fonts._charFor._hi = 255; + _screen->_maxChars = 49; + _screen->_printOrg = Common::Point(15, 165); + _screen->_printStart = Common::Point(15, 165); + + Common::String msg = Common::String(_deaths[deathId]._msg); + _printEnd = 200; + + printText(_screen, msg); + _screen->fadeOut(); + + _events->showCursor(); + _room->clearRoom(); + freeChar(); + + _currentManOld = 1; + _player->removeSprite1(); + } warning("TODO: restart game"); quitGame(); diff --git a/engines/access/amazon/amazon_resources.cpp b/engines/access/amazon/amazon_resources.cpp index 509c8bcac4..ed4a012bd1 100644 --- a/engines/access/amazon/amazon_resources.cpp +++ b/engines/access/amazon/amazon_resources.cpp @@ -1660,6 +1660,13 @@ const byte DEATH_SCREENS[58] = { 8, 0, 5, 8, 0, 12, 12, 11 }; +const byte DEATH_SCREENS_DEMO[34] = { + 1, 2, 1, 1, 1, 1, 1, 1, 4, 1, + 3, 4, 2, 4, 2, 1, 1, 1, 1, 1, + 1, 4, 2, 4, 2, 4, 2, 4, 4, 4, + 1, 1, 1, 1 +}; + const char *const DEATH_TEXT[58] = { "SAM SALVADOR SPOTS YOU AND LETS YOU HAVE IT.", "WHILE TAKING A MOONLIGHT SWIM YOU DISCOVER THAT PIRANHA REALLY CAN STRIP FLESH TO THE BONE.", @@ -1755,6 +1762,43 @@ const char *const DEATH_TEXT[58] = { "TWENTY YEARS LATER YOU ARE RELEASED FROM A SOUTH AMERICAN PRISON." }; +const char *const DEATH_TEXT_DEMO[34] = { + "SAM SALVADOR SPOTS YOU AND LETS YOU HAVE IT.", + "WHILE TAKING A MOONLIGHT SWIM YOU DISCOVER THAT PIRANHA REALLY CAN STRIP FLESH TO THE BONE.", + "THE GUARD FILLS YOU FULL OF HOLES BEFORE TOSSING YOU TO THE PIRANHA.", + "YOU'RE ONLY ABLE TO SWIM HALFWAY ACROSS THE RIVER BEFORE RUNNING OUT OF AIR. YOU MAKE SO MUCH NOISE GASPING FOR BREATH THAT SAM EASILY FINDS YOU AND LEAVES YOU IN THE RIVER PERMANENTLY.", + "SAM SALVADOR NOTICES SOMEONE HAS BEEN PLAYING WITH THE CARGO. HE TRACKS YOU DOWN AND LETS YOU HAVE IT.", + "THE GUARD COMES AROUND THE CORNER. HE DECIDES THAT THREE LEAD SLUGS WILL TEACH YOU TO BE MORE POLITE.", + "THE CAPTAIN IS WAITING OUTSIDE THE DOOR.", + "THE CAPTAIN',27h,'S RANDOM SHOOTING FINALLY FINDS ITS TARGET.", + "THE CRATE OUTSIDE THE WINDOW EXPLODES, DESTROYING THE SHIP. UNFORTUNATELY, YOU'RE STILL ABOARD.", + "THE DOOR WAS NOT BARRED AND THE CAPTAIN WALKS RIGHT IN AND PARTS YOUR HAIR.", + "", + "YOU RUN OUT ON DECK, THEN REALIZE THAT MAYA IS STILL TIED UP. AS YOU TURN TO GO BACK THE BOAT BLOWS UP.", + "AFTER YOU FAIL TO PROVE YOUR DIVINITY THE NATIVES EAT YOU FOR LUNCH.", + "THIS IS THE GENERIC DEATH SCENE", + "YOU ONLY MAKE IT HALFWAY ACROSS THE RIVER BEFORE THE PIRANHA STRIKE.", + "WITH NOTHING TO PROTECT HIM FROM THE HAIL OF BULLETS ALLEN IS QUICKLY GUNNED DOWN. JASON AND MAYA SOON FOLLOW...", + "THE COMBINATION OF THE WIND AND GUNFIRE KNOCK THE CORRUGATED IRON OVER, LEAVING YOU WITHOUT PROTECTION.", + "WITHOUT SUFFICIENT AMMUNITION, ALLEN IS UNABLE TO HOLD OFF THE ATTACKERS FOR LONG. THIS RESULTS IN A SERIOUS CASE OF LEAD POISONING.", + "ALLEN IS A MARVELOUS SHOT, BUT HIS AMMUNITION IS NOT UNLIMITED. SOON IT IS ALL OVER.", + "THE PILOT FEELS YOU ARE TOO CLOSE AND PULLS THE TRIGGER.", + "THE PILOT SHOOTS YOU IN THE HEAD, THEN TOSSES YOUR LIFELESS", + "THE PLANE CRASHES INTO THE JUNGLE CANOPY AT 200 MPH.", + "THE CANOE HITS THE ROCKS AND CAPSIZES, AND THE PIRANHA MAKE YOU THEIR LUNCH GUESTS.", + "YOU ACCIDENTALLY DISCOVER THE FOURTH TALLEST WATERFALL IN SOUTH AMERICA.", + "YOU DISCOVER A VERY HUNGRY TRIBE OF CANNIBALS.", + "YOU BECOME LOST IN THE WINDING WATERWAYS AND WANDER UNTIL YOU STARVE TO DEATH.", + "YOU BECOME TRAPPED IN THE RAPIDS AND ARE CRUSHED BETWEEN THE ROCKS.", + "YOU WAIT AROUND FOR SOME TIME, BUT HANS STROHEIM NEVER SPEAKS TO YOU AGAIN. FINALLY YOU RETURN HOME KNOWING YOU HAVE FAILED.", + "DECIDING THAT YOU THREATEN HIM AND HIS WORK, HANS STROHEIM HAS THE NATIVES IN THE VILLAGE KILL YOU.", + "YOU DO NOT GET FAR ENOUGH AWAY BEFORE THE DYNAMITE EXPLODES AND YOU ARE BLOWN INTO A THOUSAND PIECES.", + "STANDING OUT IN THE OPEN YOU ARE EXPOSED TO THE HAIL OF BULLETS FROM SANCHEZ' MEN.", + "THE AMAZON SENTINELS SPOT YOU AND FILL YOU FULL OF ARROWS.", + "SAM MAY BE UGLY, BUT HE',27h,'S NOT DEAF. HE HEARS ALL THE NOISE YOU ARE MAKING AND CANCELS YOUR BOARDING PASS.", + "WITH THE BAR OFF THE DOOR THE CAPTAIN WALTZES IN AND BLOWS YOU AWAY" +}; + const int DEATH_CELLS[12][3] = { { 0, 94, 3 }, { 0, 94, 4 }, diff --git a/engines/access/amazon/amazon_resources.h b/engines/access/amazon/amazon_resources.h index 6e35ca0361..92e0cecf68 100644 --- a/engines/access/amazon/amazon_resources.h +++ b/engines/access/amazon/amazon_resources.h @@ -84,8 +84,10 @@ extern const char *const BAR_MESSAGE; extern const char *const HELPLVLTXT[3]; extern const char *const IQLABELS[9]; extern const byte DEATH_SCREENS[58]; +extern const byte DEATH_SCREENS_DEMO[34]; extern const char *const DEATH_TEXT[58]; +extern const char *const DEATH_TEXT_DEMO[34]; extern const int DEATH_CELLS[12][3]; -- cgit v1.2.3