aboutsummaryrefslogtreecommitdiff
path: root/engines/xeen/worldofxeen/worldofxeen.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'engines/xeen/worldofxeen/worldofxeen.cpp')
-rw-r--r--engines/xeen/worldofxeen/worldofxeen.cpp81
1 files changed, 81 insertions, 0 deletions
diff --git a/engines/xeen/worldofxeen/worldofxeen.cpp b/engines/xeen/worldofxeen/worldofxeen.cpp
index a15bc401ba..cc797d77ff 100644
--- a/engines/xeen/worldofxeen/worldofxeen.cpp
+++ b/engines/xeen/worldofxeen/worldofxeen.cpp
@@ -86,5 +86,86 @@ void WorldOfXeenEngine::outerGameLoop() {
}
}
+void WorldOfXeenEngine::death() {
+ Window &w = (*_windows)[0];
+ _sound->stopAllAudio();
+ SpriteResource fireSprites[4] = {
+ SpriteResource("fire1.vga"),
+ SpriteResource("fire2.vga"),
+ SpriteResource("fire3.vga"),
+ SpriteResource("fire4.vga")
+ };
+ SpriteResource deathSprites("death.vga"), death1Sprites("death1.vga");
+ const int Y_LIST[] = {
+ 196, 187, 179, 169, 159, 147, 138, 127, 113, 101, 86,
+ 73, 60, 48, 36, 23, 10, 0, 0
+ };
+
+ Graphics::ManagedSurface savedBg;
+ savedBg.copyFrom(*_screen);
+
+ fireSprites[0].draw(0, 0, Common::Point(0, 0));
+ fireSprites[0].draw(0, 1, Common::Point(160, 0));
+ w.update();
+ _sound->playSound("fire.voc");
+
+ // Fire will vertically consume the screen
+ for (int idx = 2; idx < 36; idx += 2) {
+ _events->updateGameCounter();
+ _screen->blitFrom(savedBg);
+
+ fireSprites[idx / 10].draw(0, idx % 10, Common::Point(0, 0));
+ fireSprites[idx / 10].draw(0, (idx % 10) + 1, Common::Point(160, 0));
+
+ for (int yCtr = 0, frame = 0; yCtr < (idx / 2); ++yCtr, frame += 2) {
+ deathSprites.draw(0, frame, Common::Point(0, Y_LIST[yCtr]));
+ deathSprites.draw(0, frame + 1, Common::Point(160, Y_LIST[yCtr]));
+ }
+
+ w.update();
+ _events->wait(1);
+ }
+
+ deathSprites.draw(0, 34, Common::Point(0, 0));
+ deathSprites.draw(0, 35, Common::Point(160, 0));
+ w.update();
+ savedBg.blitFrom(*_screen);
+
+ _sound->playSong(_files->_isDarkCc ? "laff1.voc" : "xeenlaff.voc");
+
+ // Animation of Xeen or Alamar laughing
+ for (int idx = 0, idx2 = 0; idx < (_files->_isDarkCc ? 10 : 23); ++idx) {
+ _events->updateGameCounter();
+ _screen->blitFrom(savedBg);
+
+ if (idx != 0)
+ death1Sprites.draw(0, idx - 1);
+ w.update();
+
+ if (_files->_isDarkCc) {
+ _events->wait(2);
+ } else {
+ if (idx == 1 || idx == 11)
+ _sound->playFX(33);
+ _events->wait(2);
+ if (idx == 15)
+ _sound->playFX(34);
+ }
+
+ if (idx == (_files->_isDarkCc ? 9 : 10)) {
+ if (idx2 < (_files->_isDarkCc ? 2 : 1)) {
+ idx = -1;
+ ++idx2;
+ }
+ }
+
+ if (!_sound->isPlaying())
+ idx = 23;
+ }
+
+ _screen->blitFrom(savedBg);
+ w.update();
+}
+
} // End of namespace WorldOfXeen
} // End of namespace Xeen