[Scummvm-git-logs] scummvm master -> a2eb11f464f33b4e2bff1b6c3c0a8d240921f5d2

dreammaster dreammaster at scummvm.org
Tue Dec 19 01:32:18 CET 2017


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
a2eb11f464 XEEN: Renamings of endgame methods for better clarity


Commit: a2eb11f464f33b4e2bff1b6c3c0a8d240921f5d2
    https://github.com/scummvm/scummvm/commit/a2eb11f464f33b4e2bff1b6c3c0a8d240921f5d2
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2017-12-18T19:32:08-05:00

Commit Message:
XEEN: Renamings of endgame methods for better clarity

Changed paths:
    engines/xeen/scripts.cpp
    engines/xeen/scripts.h


diff --git a/engines/xeen/scripts.cpp b/engines/xeen/scripts.cpp
index 1205408..d33c534 100644
--- a/engines/xeen/scripts.cpp
+++ b/engines/xeen/scripts.cpp
@@ -937,18 +937,18 @@ bool Scripts::cmdConfirmWord(ParamsIterator &params) {
 	_mirrorId = StringInput::show(_vm, inputType, msg1, msg2, _event->_opcode);
 	if (_mirrorId) {
 		if (_mirrorId == 33 && files._isDarkCc) {
-			doEndGame2();
+			doDarkSideEnding();
 		} else if (_mirrorId == 34 && files._isDarkCc) {
-			doWorldEnd();
+			doWorldEnding();
 		} else if (_mirrorId == 35 && files._isDarkCc &&
 				_vm->getGameID() == GType_WorldOfXeen) {
-			doEndGame();
+			doCloudsEnding();
 		} else if (_mirrorId == 40 && !files._isDarkCc) {
-			doEndGame();
+			doCloudsEnding();
 		} else if (_mirrorId == 60 && !files._isDarkCc) {
-			doEndGame2();
+			doDarkSideEnding();
 		} else if (_mirrorId == 61 && !files._isDarkCc) {
-			doWorldEnd();
+			doWorldEnding();
 		} else {
 			if (_mirrorId == 59 && !files._isDarkCc) {
 				for (int idx = 0; idx < MAX_TREASURE_ITEMS; ++idx) {
@@ -1386,7 +1386,7 @@ bool Scripts::cmdCutsceneEndDarkside(ParamsIterator &params) {
 	party._mazeDirection = DIR_NORTH;
 	party._mazePosition = Common::Point(25, 21);
 
-	doEndGame2();
+	doDarkSideEnding();
 	return false;
 }
 
@@ -1394,7 +1394,7 @@ bool Scripts::cmdCutsceneEndWorld(ParamsIterator &params) {
 	_vm->_saves->_wonWorld = true;
 	_vm->_party->_worldEnd = true;
 
-	doWorldEnd();
+	doWorldEnding();
 	return false;
 }
 
@@ -1405,36 +1405,35 @@ bool Scripts::cmdFlipWorld(ParamsIterator &params) {
 
 bool Scripts::cmdPlayCD(ParamsIterator &params) { error("TODO"); }
 
-void Scripts::doEndGame() {
-	doEnding("ENDGAME", 0);
+void Scripts::doCloudsEnding() {
+	doEnding("ENDGAME");
 }
 
-void Scripts::doEndGame2() {
+void Scripts::doDarkSideEnding() {
+	doEnding("ENDGAME2");
+}
+
+void Scripts::doWorldEnding() {
+	doEnding("WORLDEND");
+}
+
+void Scripts::doEnding(const Common::String &endStr) {
+	_vm->_saves->saveChars();
+
 	Party &party = *_vm->_party;
-	int v2 = 0;
 
+	int state = 0;
 	for (uint idx = 0; idx < party._activeParty.size(); ++idx) {
 		Character &player = party._activeParty[idx];
 		if (player.hasAward(77)) {
-			v2 = 2;
+			state = 2;
 			break;
-		}
-		else if (player.hasAward(76)) {
-			v2 = 1;
+		} else if (player.hasAward(76)) {
+			state = 1;
 			break;
 		}
 	}
 
-	doEnding("ENDGAME2", v2);
-}
-
-void Scripts::doWorldEnd() {
-	error("TODO: doWorldEnd");
-}
-
-void Scripts::doEnding(const Common::String &endStr, int v2) {
-	_vm->_saves->saveChars();
-
 	error("TODO: doEnding");
 }
 
diff --git a/engines/xeen/scripts.h b/engines/xeen/scripts.h
index 457d4b7..4c81185 100644
--- a/engines/xeen/scripts.h
+++ b/engines/xeen/scripts.h
@@ -505,13 +505,26 @@ private:
 
 	int whoWill(int v1, int v2, int v3);
 
-	void doEndGame();
+	/**
+	 * Do the Clouds of Xeen ending
+	 */
+	void doCloudsEnding();
 
-	void doEndGame2();
+	/**
+	 * Do the Dark Side of Xeen ending
+	 */
+	void doDarkSideEnding();
 
-	void doWorldEnd();
+	/**
+	 * Do the World of Xeen combined ending
 
-	void doEnding(const Common::String &endStr, int v2);
+	 */
+	void doWorldEnding();
+
+	/**
+	 * Triggers an ending sequence
+	 */
+	void doEnding(const Common::String &endStr);
 
 	/**
 	 * This monstrosity handles doing the various types of If checks on various data





More information about the Scummvm-git-logs mailing list