aboutsummaryrefslogtreecommitdiff
path: root/engines/access
diff options
context:
space:
mode:
Diffstat (limited to 'engines/access')
-rw-r--r--engines/access/access.h1
-rw-r--r--engines/access/amazon/amazon_game.cpp14
-rw-r--r--engines/access/amazon/amazon_resources.cpp120
-rw-r--r--engines/access/amazon/amazon_resources.h6
-rw-r--r--engines/access/data.h10
-rw-r--r--engines/access/files.cpp7
-rw-r--r--engines/access/files.h1
-rw-r--r--engines/access/martian/martian_game.cpp4
-rw-r--r--engines/access/screen.cpp3
-rw-r--r--engines/access/screen.h1
-rw-r--r--engines/access/scripts.cpp70
-rw-r--r--engines/access/scripts.h2
-rw-r--r--engines/access/sound.cpp4
-rw-r--r--engines/access/sound.h2
14 files changed, 234 insertions, 11 deletions
diff --git a/engines/access/access.h b/engines/access/access.h
index 2f557df7f8..725e1fc87f 100644
--- a/engines/access/access.h
+++ b/engines/access/access.h
@@ -162,6 +162,7 @@ public:
int _establishCtrlTblOfs;
int _numAnimTimers;
TimerList _timers;
+ DeathList _deaths;
FontManager _fonts;
Common::Array<Common::Rect> _newRects;
Common::Array<Common::Rect> _oldRects;
diff --git a/engines/access/amazon/amazon_game.cpp b/engines/access/amazon/amazon_game.cpp
index ecd9922f78..712a25289d 100644
--- a/engines/access/amazon/amazon_game.cpp
+++ b/engines/access/amazon/amazon_game.cpp
@@ -133,7 +133,7 @@ void AmazonEngine::doTitle() {
_sound->queueSound(1, 98, 8);
_sound->_soundPriority[1] = 1;
- _screen->_loadPalFlag = false;
+ _files->_loadPalFlag = false;
_files->loadScreen(0, 3);
_buffer2.copyFrom(*_screen);
@@ -147,7 +147,7 @@ void AmazonEngine::doTitle() {
_sound->playSound(1);
- _screen->_loadPalFlag = false;
+ _files->_loadPalFlag = false;
_files->loadScreen(0, 4);
_sound->playSound(1);
@@ -192,6 +192,16 @@ void AmazonEngine::setupGame() {
_timers.push_back(te);
}
+ // 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];
+ }
+ _deaths._cells.resize(12);
+ for (int i = 0; i < 12; ++i)
+ _deaths._cells[i] = CellIdent(DEATH_CELLS[i][0], DEATH_CELLS[i][1], DEATH_CELLS[i][2]);
+
// Miscellaneous
_fonts._font1.load(FONT6x6_INDEX, FONT6x6_DATA);
_fonts._font2.load(FONT2_INDEX, FONT2_DATA);
diff --git a/engines/access/amazon/amazon_resources.cpp b/engines/access/amazon/amazon_resources.cpp
index 1f666e1abb..a51457522e 100644
--- a/engines/access/amazon/amazon_resources.cpp
+++ b/engines/access/amazon/amazon_resources.cpp
@@ -1194,6 +1194,126 @@ YOU CAN UNDERSTAND.";
const char *const NO_HINTS_MESSAGE =
"THE HELP SYSTEM HAS BEEN TURNED OFF FOR THIS GAME.";
+
+const byte DEATH_SCREENS[58] = {
+ 0, 1, 0, 0, 0, 0, 0, 0, 2, 0,
+ 0, 2, 4, 2, 1, 0, 0, 0, 0, 0,
+ 0, 2, 7, 7, 4, 6, 7, 10, 4, 2,
+ 0, 0, 0, 0, 5, 5, 3, 3, 3, 5,
+ 8, 8, 11, 9, 8, 12, 0, 1, 9, 8,
+ 8, 0, 5, 8, 0, 12, 12, 11
+};
+
+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.",
+ "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'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. ADDITIONAL AMMUNITION SHOULD "
+ "HAVE BEEN PURCHASED AT THE RIO BLANCO TRADING POST (CHAPTER 6).",
+ "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 HEART, THEN TOSSES YOUR LIFELESS BODY OUT THE DOOR.",
+ "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 TAKE THE WRONG BRANCH AND ACCIDENTALLY DISCOVER THE FOURTH TALLEST WATERFALL "
+ "IN SOUTH AMERICA.",
+ "YOU TAKE THE WRONG BRANCH AND DISCOVER A VERY HUNGRY TRIBE OF CANNIBALS.",
+ "YOU TAKE THE WRONG BRANCH AND BECOME LOST IN THE WINDING WATERWAYS. "
+ "YOU WANDER UNTIL YOU STARVE TO DEATH.",
+ "YOU TAKE THE WRONG BRANCH AND BECOME TRAPPED IN THE RAPIDS. "
+ "EVENTUALLY YOU AND MAYA 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.",
+
+ "YOU ARE STANDING SO CLOSE TO THE ENTRANCE WHEN SANCEZ AND HIS MEN BREAK THROUGH "
+ "THE WALL THAT YOU ARE QUICKLY SPOTTED AND SHOT",
+ "THE AMAZON SENTINELS SPOT YOU AND FILL YOU FULL OF ARROWS.",
+ "SAM MAY BE UGLY, BUT HE'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",
+ "THE BEAR WANDERS OFF INTO THE WOODS AND DISTURBS THE TWO LOVEBIRDS. "
+ "WHEN THEY COME OUT THEY FIND YOU AND PUT YOU IN THE BIG HOUSE FOR TWENTY YEARS.",
+ "WHEN YOU DO NOT LEAVE THE SECURITY AREA QUICKLY ENOUGH YOU ARE ARRESTED AND CONVICTED "
+ "AS A COMMIE SPY. YOU EMBARK ON A NEW CAREER STAMPING OUT LICENSE PLATES.",
+ "THE HUNGRY BEAR SPOTS YOU AND DECIDES YOU WILL MAKE A NICE APPETIZER.",
+ "YOU DISTURB THE BEAR'S LUNCH AND HE EATS YOU FOR DESSERT.",
+ "AFTER FAILING TO FIND ANY LUNCH AT THE GARBAGE CAN THE BEAR EATS YOU INSTEAD.",
+ "THE SUSPICIOUS LIBRARIAN CALLS SECURITY AND YOU ARE SENT TO JAIL.",
+
+ "YOU PLUMMET 10,000 FEET TO YOUR DEATH.",
+ "EL LOCO FLIES INTO AN INSANE RAGE AND BEATS YOU TO A BLOODY PULP.",
+ "THE WOMAN WALKS OUT THE DOOR AND NEVER RETURNS. YOU SPEND THE REST OF YOUR LIFE "
+ "IN A FUTILE ATTEMPT TO LOCATE ALLEN.",
+ "YOU SLIP OFF THE PLATFORM AND FALL TO YOUR DEATH.",
+ "YOU SLIP OFF THE PLATFORM AND FALL TO YOUR DEATH.",
+ "YOU COME TOO CLOSE TO THE POWERFUL JAWS OF THE ANT AND HE SNIPS YOU IN TWO BEFORE "
+ "DEVOURING YOU.",
+ "B.O.B. HAS A FLAW IN HIS PROGRAMMING THAT DIRECTS HIM TO SHOOT FIRST AND ASK QUESTIONS LATER.",
+ "THE PLANE SINKS AND THE PIRHANA ATTACK BEFORE YOU EVEN GET OUT THE DOOR.",
+ "MAYA FALLS OFF THE END OF THE BROKEN BRIDGE.",
+ "YOUR WEIGHT IS JUST ENOUGH TO CAUSE THE REMAINING SUPPORT CABLE TO SNAP AND YOU "
+ "FALL TO THE BOTTOM OF THE GORGE.",
+
+ "EVEN WITH REPAIRS THE BRIDGE IS NOT STRONG ENOUGH TO HOLD TWO PEOPLE.",
+ "SANCHEZ AND HIS MEN FIND YOU AND HOLD FIRING SQUAD PRACTICE.",
+ "THE TWO GUARDS ARE DISTURBED IN THEIR LOVE NEST AND COME LOOKING FOR ANYONE ACTING SUSPICIOUS. "
+ "THEY FIND YOU AND SEND YOU UP THE RIVER.",
+ "THE PARACHUTE IS NOT LARGE ENOUGH TO SUPPORT YOU, AND YOU HIT THE TREES AT 140 M.P.H.",
+ "SANCHEZ AND HIS MEN FOLLOW YOU ACROSS THE BRIDGE AND CUT YOU DOWN IN A HAIL OF GUNFIRE",
+ "YOU TRIED TO STAB THE ANT BUT HIS SHELL IS TOO DIFFICULT TO PENETRATE. "
+ "YOU NOTICE A SLIGHT CUT IN THE SHELL UNDERNEATH BUT YOU CAN'T GET TO IT "
+ "AND HE SNIPS YOU INTO DELICIOUS MEATY CHUNKS.",
+ "AFTER THE ANT FINISHES SUCKING ALL OF THE SAP OUT OF THE VINE HE TURNS HIS ATTENTION BACK TO YOU "
+ "AND BITES YOUR HEAD OFF.",
+ "THE CANTINA OWNER NOTICES YOU ARE TRYING TO STEAL OBJECTS FROM THE TABLES. "
+ "TWENTY YEARS LATER YOU ARE RELEASED FROM A SOUTH AMERICAN PRISON."
+};
+
+const int DEATH_CELLS[12][3] = {
+ { 0, 94, 3 },
+ { 0, 94, 4 },
+ { 0, 94, 5 },
+ { 0, 94, 6 },
+ { 0, 94, 7 },
+ { 0, 94, 8 },
+ { 0, 94, 9 },
+ { 0, 94, 10 },
+ { 0, 94, 11 },
+ { 0, 94, 12 },
+ { 0, 94, 13 },
+ { 0, 94, 14 }
+};
+
} // End of namespace Amazon
} // End of namespace Access
diff --git a/engines/access/amazon/amazon_resources.h b/engines/access/amazon/amazon_resources.h
index d618ca54c2..17cca2a0b4 100644
--- a/engines/access/amazon/amazon_resources.h
+++ b/engines/access/amazon/amazon_resources.h
@@ -52,6 +52,12 @@ extern const byte FONT6x6_DATA[];
extern const char *const NO_HELP_MESSAGE;
extern const char *const NO_HINTS_MESSAGE;
+extern const byte DEATH_SCREENS[58];
+
+extern const char *const DEATH_TEXT[58];
+
+extern const int DEATH_CELLS[12][3];
+
} // End of namespace Amazon
} // End of namespace Access
diff --git a/engines/access/data.h b/engines/access/data.h
index 3b3485e459..08fbb40d68 100644
--- a/engines/access/data.h
+++ b/engines/access/data.h
@@ -88,6 +88,16 @@ public:
FileIdent _vidSound;
};
+struct DeathEntry {
+ int _screenId;
+ Common::String _msg;
+};
+
+class DeathList : public Common::Array<DeathEntry> {
+public:
+ Common::Array<CellIdent> _cells;
+};
+
} // End of namespace Access
#endif /* ACCESS_DATA_H */
diff --git a/engines/access/files.cpp b/engines/access/files.cpp
index 4ab98a2060..c449d906cd 100644
--- a/engines/access/files.cpp
+++ b/engines/access/files.cpp
@@ -84,6 +84,7 @@ FileManager::FileManager(AccessEngine *vm): _vm(vm) {
}
_fileNumber = -1;
+ _loadPalFlag = true;
}
FileManager::~FileManager() {
@@ -135,7 +136,11 @@ void FileManager::loadScreen(Graphics::Surface *dest, int fileNum, int subfile)
}
void FileManager::handleScreen(Graphics::Surface *dest, Resource *res) {
- _vm->_screen->loadPalette(res->_stream);
+ if (_loadPalFlag) {
+ _vm->_screen->loadPalette(res->_stream);
+ } else {
+ res->_stream->skip(PALETTE_SIZE);
+ }
// The remainder of the file after the palette may be separately compressed,
// so call handleFile to handle it if it is
diff --git a/engines/access/files.h b/engines/access/files.h
index 0a934de8aa..a32ebbf88c 100644
--- a/engines/access/files.h
+++ b/engines/access/files.h
@@ -94,6 +94,7 @@ private:
public:
int _fileNumber;
Common::Array<uint32> _fileIndex;
+ bool _loadPalFlag;
public:
FileManager(AccessEngine *vm);
~FileManager();
diff --git a/engines/access/martian/martian_game.cpp b/engines/access/martian/martian_game.cpp
index 969267f719..2f11d8b858 100644
--- a/engines/access/martian/martian_game.cpp
+++ b/engines/access/martian/martian_game.cpp
@@ -98,7 +98,7 @@ void MartianEngine::doTitle() {
_sound->queueSound(0, 98, 30);
_sound->_soundPriority[0] = 1;
- _screen->_loadPalFlag = false;
+ _files->_loadPalFlag = false;
_files->loadScreen(0, 3);
_buffer2.copyFrom(*_screen);
@@ -112,7 +112,7 @@ void MartianEngine::doTitle() {
_sound->playSound(1);
- _screen->_loadPalFlag = false;
+ _files->_loadPalFlag = false;
_files->loadScreen(0, 4);
_sound->playSound(1);
diff --git a/engines/access/screen.cpp b/engines/access/screen.cpp
index 26dd2e93ae..227d9d7d0c 100644
--- a/engines/access/screen.cpp
+++ b/engines/access/screen.cpp
@@ -49,7 +49,6 @@ Screen::Screen(AccessEngine *vm) : _vm(vm) {
_vesaCurrentWin = 0;
_currentPanel = 0;
_hideFlag = true;
- _loadPalFlag = false;
_startColor = _numColors = 0;
_scrollCol = _scrollRow = 0;
_windowXAdd = _windowYAdd = 0;
@@ -100,7 +99,7 @@ void Screen::setInitialPalettte() {
void Screen::loadPalette(Common::SeekableReadStream *stream) {
loadRawPalette(stream);
setPalette();
- _loadPalFlag = true;
+ _vm->_files->_loadPalFlag = true;
}
void Screen::loadPalette(int fileNum, int subfile) {
diff --git a/engines/access/screen.h b/engines/access/screen.h
index 47e03de2b8..b278062d13 100644
--- a/engines/access/screen.h
+++ b/engines/access/screen.h
@@ -64,7 +64,6 @@ private:
void updatePalette();
public:
int _vesaMode;
- bool _loadPalFlag;
int _startColor, _numColors;
Common::Point _bufferStart;
int _scrollCol, _scrollRow;
diff --git a/engines/access/scripts.cpp b/engines/access/scripts.cpp
index e74b1853a0..8ac0de78fa 100644
--- a/engines/access/scripts.cpp
+++ b/engines/access/scripts.cpp
@@ -133,7 +133,7 @@ void Scripts::executeCommand(int commandIndex) {
&Scripts::cmdFreeSound, &Scripts::cmdSetVideoSound, &Scripts::cmdPlayVideoSound,
&Scripts::CMDPUSHLOCATION, &Scripts::CMDPUSHLOCATION, &Scripts::CMDPUSHLOCATION,
&Scripts::CMDPUSHLOCATION, &Scripts::CMDPUSHLOCATION, &Scripts::cmdPlayerOff,
- &Scripts::cmdPlayerOn, &Scripts::CMDDEAD, &Scripts::cmdFadeOut,
+ &Scripts::cmdPlayerOn, &Scripts::cmdDead, &Scripts::cmdFadeOut,
&Scripts::CMDENDVID
};
@@ -740,7 +740,73 @@ void Scripts::cmdPlayerOn() {
_vm->_player->_playerOff = false;
}
-void Scripts::CMDDEAD() { error("TODO CMDDEAD"); }
+void Scripts::cmdDead() {
+ int deathId = _data->readByte();
+ _vm->_events->hideCursor();
+ _vm->_screen->forceFadeOut();
+ cmdFreeSound();
+
+ _vm->_sound->_soundTable[0] = _vm->_files->loadFile(98, 44);
+ _vm->_sound->_soundPriority[1] = 1;
+
+ _vm->_screen->clearScreen();
+ _vm->_screen->setPanel(3);
+
+ if (deathId != 10) {
+ _vm->_sound->newMusic(62, 0);
+ _vm->_files->_loadPalFlag = false;
+ _vm->_files->loadScreen(94, 0);
+ _vm->_files->_loadPalFlag = true;
+ _vm->_buffer2.copyFrom(*_vm->_screen);
+
+ for (int i = 0; i < 3; ++i) {
+ _vm->_sound->playSound(0);
+ _vm->_screen->forceFadeIn();
+ _vm->_sound->playSound(0);
+ _vm->_screen->forceFadeOut();
+ }
+ _vm->freeCells();
+
+ // Load the cell list for the death screen
+ DeathEntry &de = _vm->_deaths[deathId];
+ Common::Array<CellIdent> cells;
+ cells.push_back(_vm->_deaths._cells[de._screenId]);
+ _vm->loadCells(cells);
+
+ _vm->_screen->setDisplayScan();
+ _vm->_files->_loadPalFlag = false;
+ _vm->_files->loadScreen(&_vm->_buffer2, 94, 1);
+ _vm->_screen->setIconPalette();
+
+ _vm->_buffer2.plotImage(_vm->_objectsTable[0], 0, Common::Point(105, 25));
+ _vm->_buffer2.copyTo(_vm->_screen);
+ _vm->_screen->forceFadeIn();
+
+ _vm->_fonts._charSet._hi = 10;
+ _vm->_fonts._charSet._lo = 1;
+ _vm->_fonts._charFor._lo = 55;
+ _vm->_fonts._charFor._hi = 255;
+ _vm->_screen->_maxChars = 46;
+ _vm->_screen->_printOrg = Common::Point(20, 155);
+ _vm->_screen->_printStart = Common::Point(20, 155);
+
+ Common::String &msg = de._msg;
+ _vm->_printEnd = 180;
+ _vm->_fonts._font2.printText(_vm->_screen, msg);
+ _vm->_screen->forceFadeOut();
+
+ _vm->_sound->newMusic(0, 1);
+ _vm->_events->showCursor();
+ _vm->_room->clearRoom();
+ _vm->freeChar();
+
+ warning("TODO: restart game");
+ _vm->quitGame();
+ }
+ else {
+ _vm->quitGame();
+ }
+}
void Scripts::cmdFadeOut() {
_vm->_screen->forceFadeOut();
diff --git a/engines/access/scripts.h b/engines/access/scripts.h
index 733c7f9dd7..003f441234 100644
--- a/engines/access/scripts.h
+++ b/engines/access/scripts.h
@@ -119,7 +119,7 @@ protected:
void CMDPUSHLOCATION();
void cmdPlayerOff();
void cmdPlayerOn();
- void CMDDEAD();
+ void cmdDead();
void cmdFadeOut();
void CMDENDVID();
public:
diff --git a/engines/access/sound.cpp b/engines/access/sound.cpp
index 91910f2917..0cdb380bb9 100644
--- a/engines/access/sound.cpp
+++ b/engines/access/sound.cpp
@@ -93,6 +93,10 @@ void SoundManager::freeSounds() {
// TODO
}
+void SoundManager::newMusic(int musicId, int mode) {
+ warning("TODO: newMusic");
+}
+
void SoundManager::freeMusic() {
delete _music;
_music = nullptr;
diff --git a/engines/access/sound.h b/engines/access/sound.h
index 1a94c46773..ad1688a5a9 100644
--- a/engines/access/sound.h
+++ b/engines/access/sound.h
@@ -67,6 +67,8 @@ public:
void freeSounds();
+ void newMusic(int musicId, int mode);
+
void freeMusic();
};