Skip to content

Commit

Permalink
XEEN: Implemented remainder of World of Xeen ending
Browse files Browse the repository at this point in the history
  • Loading branch information
dreammaster committed Feb 2, 2018
1 parent 7f53a0c commit 39b2a2f
Show file tree
Hide file tree
Showing 10 changed files with 169 additions and 37 deletions.
4 changes: 4 additions & 0 deletions engines/xeen/music.cpp
Expand Up @@ -759,4 +759,8 @@ void Music::updateSoundSettings() {
stopSong();
}

bool Music::isMusicPlaying() const {
return _musicDriver->isPlaying();
}

} // End of namespace Xeen
10 changes: 10 additions & 0 deletions engines/xeen/music.h
Expand Up @@ -171,6 +171,11 @@ class MusicDriver {
* Executes special music command
*/
virtual int songCommand(uint commandId, byte volume = 0);

/**
* Returns whether music is currently playing
*/
bool isPlaying() const { return _musicPlaying; }
};

class AdlibMusicDriver : public MusicDriver {
Expand Down Expand Up @@ -370,6 +375,11 @@ class Music {
_musicDriver->playSong(data);
}

/**
* Returns true if music is playing
*/
bool isMusicPlaying() const;

/**
* Sets whether music is on
*/
Expand Down
27 changes: 25 additions & 2 deletions engines/xeen/resources.cpp
Expand Up @@ -1693,7 +1693,7 @@ const char *const Resources::NO_LOADING_IN_COMBAT =
"No Loading Allowed in Combat!";
const char *const Resources::NO_SAVING_IN_COMBAT =
"No Saving Allowed in Combat!";
const char *const Resources::WORLD_END_TEXT[8] = {
const char *const Resources::WORLD_END_TEXT[9] = {
"\n\n\n\n\n\n\n"
"Congratulations Adventurers!\n\n"
"Let the unification ceremony begin!",
Expand All @@ -1704,7 +1704,30 @@ const char *const Resources::WORLD_END_TEXT[8] = {
"\xB""026Queen Kalindra presented the Cube of Power.",
"\xB""026Prince Roland presented the Xeen Sceptre.",
"\xB""026Together, they placed the Cube of Power...",
"\xB""026and the Sceptre, onto the Altar of Joining."
"\xB""026and the Sceptre, onto the Altar of Joining.",
"With the prophecy complete, the two sides of Xeen were united as one",
};

const char *const Resources::WORLD_CONGRATULATIONS =
"\x3""cCongratulations\n\n"
"Your Final Score is:\n\n"
"%010lu\n"
"\x3l\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 Resources::WORLD_CONGRATULATIONS2 =
"\n\n\n\n\n\n"
"But wait... there's more!\n"
"\n\n"
"Include the message\n"
"\"%s\"\n"
"with your final score and receive a special bonus.";
const char *const Resources::GOOBER[3] = {
"", "I am a Goober!", "I am a Super Goober!"
};

} // End of namespace Xeen
5 changes: 4 additions & 1 deletion engines/xeen/resources.h
Expand Up @@ -361,7 +361,10 @@ class Resources {
static const char *const MR_WIZARD;
static const char *const NO_LOADING_IN_COMBAT;
static const char *const NO_SAVING_IN_COMBAT;
static const char *const WORLD_END_TEXT[8];
static const char *const WORLD_END_TEXT[9];
static const char *const WORLD_CONGRATULATIONS;
static const char *const WORLD_CONGRATULATIONS2;
static const char *const GOOBER[3];
public:
/**
* Initializes an instnace of the resources
Expand Down
3 changes: 2 additions & 1 deletion engines/xeen/scripts.cpp
Expand Up @@ -1456,7 +1456,8 @@ void Scripts::doEnding(const Common::String &endStr) {
}
}

g_vm->showCutscene(endStr);
// TODO: Pass proper score
g_vm->showCutscene(endStr, state, 42);
g_vm->_quitMode = QMODE_MENU;
}

Expand Down
4 changes: 2 additions & 2 deletions engines/xeen/worldofxeen/worldofxeen.cpp
Expand Up @@ -165,15 +165,15 @@ void WorldOfXeenEngine::death() {
w.update();
}

void WorldOfXeenEngine::showCutscene(const Common::String &name) {
void WorldOfXeenEngine::showCutscene(const Common::String &name, int status, uint score) {
_sound->stopAllAudio();

if (name == "ENDGAME")
showCloudsEnding();
else if (name == "ENDGAME2")
showDarkSideEnding();
else if (name == "WORLDEND")
showWorldOfXeenEnding();
showWorldOfXeenEnding((GooberState)status, score);
}

} // End of namespace WorldOfXeen
Expand Down
2 changes: 1 addition & 1 deletion engines/xeen/worldofxeen/worldofxeen.h
Expand Up @@ -61,7 +61,7 @@ class WorldOfXeenEngine: public XeenEngine, public WorldOfXeenCutscenes {
/**
* Show a cutscene
*/
virtual void showCutscene(const Common::String &name);
virtual void showCutscene(const Common::String &name, int status, uint score);

/**
* Set the next overall game action to do
Expand Down

0 comments on commit 39b2a2f

Please sign in to comment.