[Scummvm-cvs-logs] scummvm master -> 8a9eaa58dfc163da4e1588dcf45faae5f1e62f15

Strangerke Strangerke at scummvm.org
Tue Dec 13 01:29:58 CET 2011


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:
8a9eaa58df TSAGE: R2R - Implement scene 2530


Commit: 8a9eaa58dfc163da4e1588dcf45faae5f1e62f15
    https://github.com/scummvm/scummvm/commit/8a9eaa58dfc163da4e1588dcf45faae5f1e62f15
Author: Strangerke (strangerke at scummvm.org)
Date: 2011-12-12T16:29:05-08:00

Commit Message:
TSAGE: R2R - Implement scene 2530

Changed paths:
    engines/tsage/ringworld2/ringworld2_logic.cpp
    engines/tsage/ringworld2/ringworld2_scenes2.cpp
    engines/tsage/ringworld2/ringworld2_scenes2.h



diff --git a/engines/tsage/ringworld2/ringworld2_logic.cpp b/engines/tsage/ringworld2/ringworld2_logic.cpp
index 8f85bbd..296da52 100644
--- a/engines/tsage/ringworld2/ringworld2_logic.cpp
+++ b/engines/tsage/ringworld2/ringworld2_logic.cpp
@@ -131,6 +131,8 @@ Scene *Ringworld2Game::createScene(int sceneNumber) {
 		// Maze: Furnace room
 		return new Scene2525();
 	case 2530:
+		// Maze: Well
+		return new Scene2530();
 	case 2535:
 	case 2600:
 	case 2700:
diff --git a/engines/tsage/ringworld2/ringworld2_scenes2.cpp b/engines/tsage/ringworld2/ringworld2_scenes2.cpp
index d15763f..cbb6dbc 100644
--- a/engines/tsage/ringworld2/ringworld2_scenes2.cpp
+++ b/engines/tsage/ringworld2/ringworld2_scenes2.cpp
@@ -2643,5 +2643,162 @@ void Scene2525::signal() {
 	}
 }
 
+/*--------------------------------------------------------------------------
+ * Scene 2530 - Maze: Well
+ *
+ *--------------------------------------------------------------------------*/
+bool Scene2530::Actor2::startAction(CursorType action, Event &event) {
+	Scene2530 *scene = (Scene2530 *)R2_GLOBALS._sceneManager._scene;
+
+	if (action != CURSOR_USE)
+		return SceneActor::startAction(action, event);
+
+	if (R2_GLOBALS._player._characterIndex == 2) {
+		R2_GLOBALS._player.disableControl();
+		scene->_sceneMode = 2530;
+		scene->setAction(&scene->_sequenceManager, scene, 2530, &R2_GLOBALS._player, &scene->_actor2, NULL);
+	} else {
+		SceneItem::display(2530, 33, 0, 280, 1, 160, 9, 1, 2, 20, 7, 7, -999);
+	}
+
+	return true;
+}
+
+bool Scene2530::Actor3::startAction(CursorType action, Event &event) {
+	Scene2530 *scene = (Scene2530 *)R2_GLOBALS._sceneManager._scene;
+
+	if (action != CURSOR_USE)
+		return SceneActor::startAction(action, event);
+
+	if (R2_GLOBALS._player._characterIndex == 1) {
+		if (R2_GLOBALS.getFlag(73))
+			SceneItem::display(2530, 35, 0, 280, 1, 160, 9, 1, 2, 20, 7, 7, -999);
+		else {
+			R2_GLOBALS._player.disableControl();
+			scene->_sceneMode = 2532;
+			scene->setAction(&scene->_sequenceManager, scene, 2532, &R2_GLOBALS._player, &scene->_actor3, NULL);
+		}
+	} else {
+		if (R2_GLOBALS.getFlag(73)) {
+			R2_GLOBALS._player.disableControl();
+			scene->_sceneMode = 2533;
+			scene->setAction(&scene->_sequenceManager, scene, 2533, &R2_GLOBALS._player, &scene->_actor3, NULL);
+		} else {
+			R2_GLOBALS._player.disableControl();
+			scene->_sceneMode = 2531;
+			scene->setAction(&scene->_sequenceManager, scene, 2531, &R2_GLOBALS._player, &scene->_actor3, NULL);
+		}
+	}
+
+	return true;
+}
+
+void Scene2530::Exit1::changeScene() {
+	Scene2530 *scene = (Scene2530 *)R2_GLOBALS._sceneManager._scene;
+
+	_enabled = false;
+	R2_GLOBALS._events.setCursor(CURSOR_ARROW);
+	R2_GLOBALS._player.disableControl();
+	scene->_sceneMode = 11;
+
+	Common::Point pt(108, 200);
+	NpcMover *mover = new NpcMover();
+	R2_GLOBALS._player.addMover(mover, &pt, scene);
+}
+
+void Scene2530::postInit(SceneObjectList *OwnerList) {
+	loadScene(2530);
+	SceneExt::postInit();
+
+	_exit1.setDetails(Rect(68, 155, 147, 168), EXITCURSOR_S, 2000);
+	_exit1.setDest(Common::Point(108, 160));
+
+	if (R2_INVENTORY.getObjectScene(33) == 2530) {
+		_actor2.postInit();
+		_actor2.setup(2435, 1, 3);
+		_actor2.setPosition(Common::Point(299, 80));
+		_actor2.fixPriority(80);
+		_actor2.setDetails(2530, 28, -1, -1, 1, NULL);
+	}
+
+	_actor3.postInit();
+	if (R2_GLOBALS.getFlag(73)) {
+		_actor3.setup(2531, 4, 2);
+		_actor3.setPosition(Common::Point(154, 130));
+	} else {
+		_actor3.setup(2531, 4, 1);
+		_actor3.setPosition(Common::Point(173, 131));
+	}
+	_actor3.setDetails(2530, 22, -1, -1, 1, NULL);
+
+	R2_GLOBALS._player.postInit();
+	R2_GLOBALS._player.animate(ANIM_MODE_1, NULL);
+
+	if (R2_GLOBALS._player._characterIndex == 1) {
+		R2_GLOBALS._player.setVisage(2008);
+		R2_GLOBALS._player._moveDiff = Common::Point(3, 2);
+	} else {
+		R2_GLOBALS._player.setVisage(20);
+		R2_GLOBALS._player._moveDiff = Common::Point(5, 3);
+	}
+	R2_GLOBALS._player.setPosition(Common::Point(100, 200));
+
+	if (R2_GLOBALS._player._characterScene[1] == R2_GLOBALS._player._characterScene[2]) {
+		_actor1.postInit();
+		if (R2_GLOBALS._player._characterIndex == 1) {
+			_actor1.setup(20, 5, 1);
+			_actor1.setDetails(9002, 0, 4, 3, 1, NULL);
+		} else {
+			_actor1.setup(2008, 5, 1);
+			_actor1.setDetails(9001, 0, 5, 3, 1, NULL);
+		}
+		_actor1.setPosition(Common::Point(20, 130));
+		R2_GLOBALS._walkRegions.enableRegion(1);
+	}
+
+	_item2.setDetails(Rect(108, 90, 135, 205), 2530, 22, -1, -1, 1, NULL);
+	_item5.setDetails(Rect(115, 112, 206, 130), 2530, 25, -1, 27, 1, NULL);
+	_item3.setDetails(Rect(256, 64, 311, 85), 2530, 31, -1, 33, 1, NULL);
+	_item1.setDetails(Rect(0, 0, 320, 200), 2530, 0, 1, -1, 1, NULL);
+
+	R2_GLOBALS._player.disableControl();
+
+	if (R2_GLOBALS._player._oldCharacterScene[R2_GLOBALS._player._characterIndex] == 2000) {
+		R2_GLOBALS._player._oldCharacterScene[R2_GLOBALS._player._characterIndex] = 2530;
+		Common::Point pt(108, 150);
+		NpcMover *mover = new NpcMover();
+		R2_GLOBALS._player.addMover(mover, &pt, this);
+	} else {
+		R2_GLOBALS._player.setPosition(Common::Point(105, 145));
+		R2_GLOBALS._player.setStrip(3);
+		R2_GLOBALS._player.enableControl();
+	}
+}
+
+void Scene2530::signal() {
+	switch (_sceneMode) {
+	case 11:
+		g_globals->_sceneManager.changeScene(2000);
+		break;
+	case 2530:
+		R2_INVENTORY.setObjectScene(33, 2);
+		_actor2.remove();
+		break;
+	case 2531:
+	// No break on purpose
+	case 2532:
+		R2_GLOBALS.setFlag(73);
+		R2_GLOBALS._player.enableControl();
+		break;
+	case 2533:
+		R2_GLOBALS.clearFlag(73);
+		R2_GLOBALS._player.enableControl();
+		break;
+	default:
+		R2_GLOBALS._player.enableControl();
+		break;
+	}
+}
+
 } // End of namespace Ringworld2
 } // End of namespace TsAGE
diff --git a/engines/tsage/ringworld2/ringworld2_scenes2.h b/engines/tsage/ringworld2/ringworld2_scenes2.h
index b906921..bef1fc9 100644
--- a/engines/tsage/ringworld2/ringworld2_scenes2.h
+++ b/engines/tsage/ringworld2/ringworld2_scenes2.h
@@ -414,6 +414,36 @@ public:
 	virtual void remove();
 	virtual void signal();
 };
+
+class Scene2530 : public SceneExt {
+	class Actor2 : public SceneActor {
+	public:
+		bool startAction(CursorType action, Event &event);
+	};
+	class Actor3 : public SceneActor {
+	public:
+		bool startAction(CursorType action, Event &event);
+	};
+
+	class Exit1 : public SceneExit {
+	public:
+		virtual void changeScene();
+	};
+public:
+	NamedHotspot _item1;
+	NamedHotspot _item2;
+	NamedHotspot _item3;
+	NamedHotspot _item4;
+	NamedHotspot _item5;
+	SceneActor _actor1;
+	Actor2 _actor2;
+	Actor3 _actor3;
+	Exit1 _exit1;
+	SequenceManager _sequenceManager;
+
+	virtual void postInit(SceneObjectList *OwnerList = NULL);
+	virtual void signal();
+};
 } // End of namespace Ringworld2
 } // End of namespace TsAGE
 






More information about the Scummvm-git-logs mailing list