aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engines/xeen/resources.cpp29
-rw-r--r--engines/xeen/resources.h6
-rw-r--r--engines/xeen/worldofxeen/darkside_cutscenes.cpp83
-rw-r--r--engines/xeen/worldofxeen/darkside_cutscenes.h10
-rw-r--r--engines/xeen/xeen.cpp1
-rw-r--r--engines/xeen/xeen.h1
6 files changed, 130 insertions, 0 deletions
diff --git a/engines/xeen/resources.cpp b/engines/xeen/resources.cpp
index c171a1717b..794e47c308 100644
--- a/engines/xeen/resources.cpp
+++ b/engines/xeen/resources.cpp
@@ -1587,4 +1587,33 @@ const char *const EVENT_SAMPLES[6] = {
"ahh.voc", "whereto.voc", "gulp.voc", "null.voc", "scream.voc", "laff1.voc"
};
+const char *const DARKSIDE_ENDING1 = "\n\x3" "cCongratulations\n"
+ "\n"
+ "Your Final Score is:\n"
+ "\n"
+ "%010lu\n"
+ "\x3" "l\n"
+ "Please send this score to the Ancient's Headquarters "
+ "where you'll be added to the Hall of Legends!\n"
+ "\n"
+ "Ancient's Headquarters\n"
+ "New World Computing, Inc.\n"
+ "P.O. Box 4302\n"
+ "Hollywood, CA 90078";
+
+const char *const DARKSIDE_ENDING2 = "\n"
+ "Adventurers,\n"
+ "\n"
+ "I have saved your game in Castleview.\n"
+ "\n"
+ "The World of Xeen still needs you!\n"
+ "\n"
+ "Load your game and come visit me in the Great Pyramid "
+ "for further instructions";
+
+const char *const PHAROAH_ENDING_TEXT1 = "\xC" "d\xB"
+ "001\x9" "001%s\x3" "c\x9" "000\xB" "180Press a Key!\x3" "l";
+const char *const PHAROAH_ENDING_TEXT2 = "\xC" "04\xB"
+ "000\x9" "000%s\x3" "c\x9" "000\xB" "180Press a Key!\x3" "l\xC" "d";
+
} // End of namespace Xeen
diff --git a/engines/xeen/resources.h b/engines/xeen/resources.h
index 6e9ce6ce39..2439a76667 100644
--- a/engines/xeen/resources.h
+++ b/engines/xeen/resources.h
@@ -564,6 +564,12 @@ extern const char *const IDENTIFY_MONSTERS;
extern const char *const EVENT_SAMPLES[6];
+extern const char *const DARKSIDE_ENDING1;
+extern const char *const DARKSIDE_ENDING2;
+
+extern const char *const PHAROAH_ENDING_TEXT1;
+extern const char *const PHAROAH_ENDING_TEXT2;
+
} // End of namespace Xeen
#endif /* XEEN_RESOURCES_H */
diff --git a/engines/xeen/worldofxeen/darkside_cutscenes.cpp b/engines/xeen/worldofxeen/darkside_cutscenes.cpp
index ce462f9383..05175158ac 100644
--- a/engines/xeen/worldofxeen/darkside_cutscenes.cpp
+++ b/engines/xeen/worldofxeen/darkside_cutscenes.cpp
@@ -22,11 +22,21 @@
#include "xeen/worldofxeen/darkside_cutscenes.h"
#include "xeen/worldofxeen/worldofxeen.h"
+#include "xeen/resources.h"
#include "xeen/sound.h"
#include "xeen/xeen.h"
namespace Xeen {
+static const int CUTSCENES_XLIST[32] = {
+ 146, 145, 143, 141, 141, 141, 141, 141, 141, 141, 141, 142, 143, 144, 145, 146,
+ 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146
+};
+static const int CUTSCENES_YLIST[32] = {
+ 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143,
+ 143, 143, 144, 145, 145, 145, 145, 145, 145, 145, 145, 144, 143, 143, 143, 143
+};
+
bool DarkSideCutscenes::showDarkSideTitle() {
EventsManager &events = *_vm->_events;
Screen &screen = *_vm->_screen;
@@ -1070,6 +1080,8 @@ bool DarkSideCutscenes::showDarkSideEnding() {
}
}
+ screen.fadeOut();
+ sound.stopSong();
for (int idx = 0; idx < 6; ++idx)
sc29[idx].clear();
@@ -1077,4 +1089,75 @@ bool DarkSideCutscenes::showDarkSideEnding() {
return true;
}
+void DarkSideCutscenes::showDarkSideScore() {
+ Common::String str = Common::String::format(DARKSIDE_ENDING1, _vm->_endingScore);
+ showPharaohEndText(str.c_str(), DARKSIDE_ENDING2);
+}
+
+void DarkSideCutscenes::showPharaohEndText(const char *msg1, const char *msg2, const char *msg3) {
+ const int YLIST[32] = {
+ -3, -3, -3, -3, -3, -3, -3, -3, -1, 0, 0, 0, 0, 0, 0, 0,
+ -1, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3
+ };
+ const int FRAMES[32] = {
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 3, 3, 2, 1,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
+ };
+ const int XLIST2[32] = {
+ 223, 222, 220, 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, 219,
+ 219, 219, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 221
+ };
+ const int YLIST2[32] = {
+ 116, 116, 116, 117, 117, 117, 117, 117, 118, 118, 118, 118, 118, 118, 118, 118,
+ 118, 118, 118, 118, 118, 118, 118, 118, 118, 118, 118, 118, 118, 118, 118, 118
+ };
+ Screen &screen = *_vm->_screen;
+ EventsManager &events = *_vm->_events;
+ SpriteResource claw("claw.int");
+ SpriteResource dragon1("dragon1.int");
+ int numPages = 0 + (msg1 ? 1 : 0) + (msg2 ? 1 : 0) + (msg3 ? 1 : 0);
+ const char *const text[3] = { msg1, msg2, msg3 };
+
+ screen.loadBackground("3room.raw");
+ screen.saveBackground();
+ screen.loadPalette("dark.pal");
+ claw.draw(screen, 5, Common::Point(CUTSCENES_XLIST[0], CUTSCENES_YLIST[0]), SPRFLAG_800);
+ claw.draw(screen, 6, Common::Point(149, 184));
+ dragon1.draw(screen, FRAMES[0], Common::Point(139, YLIST[0]), SPRFLAG_800);
+ claw.draw(screen, 0, Common::Point(XLIST2[0], YLIST2[0]), SPRFLAG_800);
+ screen.update();
+ screen.fadeIn();
+ events.clearEvents();
+
+ // Iterate through showing the pages
+ int idx = 1;
+ for (int pageNum = 0; !_vm->shouldQuit() && pageNum < numPages; ++pageNum) {
+ // Show each page until a key is pressed
+ do {
+ // Draw the dragon pharoah
+ screen.restoreBackground();
+ claw.draw(screen, 5, Common::Point(CUTSCENES_XLIST[idx], CUTSCENES_YLIST[idx]), SPRFLAG_800);
+ claw.draw(screen, 6, Common::Point(145, 185));
+ dragon1.draw(screen, FRAMES[idx], Common::Point(139, YLIST[idx]), SPRFLAG_800);
+ claw.draw(screen, idx % 5, Common::Point(XLIST2[idx], YLIST2[idx]), SPRFLAG_800);
+
+ // Form the text string to display the text
+ Common::String str1 = Common::String::format(PHAROAH_ENDING_TEXT1,
+ text[pageNum]);
+ screen._windows[39].writeString(str1);
+
+ Common::String str2 = Common::String::format(PHAROAH_ENDING_TEXT2,
+ text[pageNum]);
+ screen._windows[39].writeString(str2);
+
+ idx = (idx + 1) % 32;
+ screen.update();
+
+ events.pollEventsAndWait();
+ } while (!_vm->shouldQuit() && !events.isKeyMousePressed());
+
+ events.clearEvents();
+ }
+}
+
} // End of namespace Xeen
diff --git a/engines/xeen/worldofxeen/darkside_cutscenes.h b/engines/xeen/worldofxeen/darkside_cutscenes.h
index 567b70e05f..cbd961069f 100644
--- a/engines/xeen/worldofxeen/darkside_cutscenes.h
+++ b/engines/xeen/worldofxeen/darkside_cutscenes.h
@@ -30,6 +30,11 @@ namespace Xeen {
class XeenEngine;
class DarkSideCutscenes : public Cutscenes {
+protected:
+ /**
+ * Shows the Pharaoh ending screen where score text is shown
+ */
+ void showPharaohEndText(const char *msg1, const char *msg2 = nullptr, const char *msg3 = nullptr);
public:
DarkSideCutscenes(XeenEngine *vm) : Cutscenes(vm) {}
@@ -47,6 +52,11 @@ public:
* Shows the Dark Side of Xeen ending sequence
*/
bool showDarkSideEnding();
+
+ /**
+ * Show the ending score
+ */
+ void showDarkSideScore();
};
} // End of namespace Xeen
diff --git a/engines/xeen/xeen.cpp b/engines/xeen/xeen.cpp
index bc18ec09c9..a04ab80f84 100644
--- a/engines/xeen/xeen.cpp
+++ b/engines/xeen/xeen.cpp
@@ -62,6 +62,7 @@ XeenEngine::XeenEngine(OSystem *syst, const XeenGameDescription *gameDesc)
_quitMode = 0;
_noDirectionSense = false;
_mode = MODE_0;
+ _endingScore = 0;
_startupWindowActive = false;
g_vm = this;
}
diff --git a/engines/xeen/xeen.h b/engines/xeen/xeen.h
index 8f641a8343..3c8084b2bd 100644
--- a/engines/xeen/xeen.h
+++ b/engines/xeen/xeen.h
@@ -156,6 +156,7 @@ public:
int _quitMode;
bool _noDirectionSense;
bool _startupWindowActive;
+ uint _endingScore;
public:
XeenEngine(OSystem *syst, const XeenGameDescription *gameDesc);
virtual ~XeenEngine();