aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStrangerke2011-12-10 00:23:07 +0100
committerStrangerke2011-12-10 00:23:07 +0100
commitca51f1681b01cb2746b56ed143807b82a93ac708 (patch)
tree386da1154a2901c992f14c7e9d54771ab58d20a7
parentc8ff54d2cd321fd0547a2d4be3a34181d45cf3b2 (diff)
downloadscummvm-rg350-ca51f1681b01cb2746b56ed143807b82a93ac708.tar.gz
scummvm-rg350-ca51f1681b01cb2746b56ed143807b82a93ac708.tar.bz2
scummvm-rg350-ca51f1681b01cb2746b56ed143807b82a93ac708.zip
TSAGE: R2R - Implement scene 2435
-rw-r--r--engines/tsage/ringworld2/ringworld2_logic.cpp2
-rw-r--r--engines/tsage/ringworld2/ringworld2_scenes2.cpp158
-rw-r--r--engines/tsage/ringworld2/ringworld2_scenes2.h32
-rw-r--r--engines/tsage/ringworld2/ringworld2_speakers.cpp110
-rw-r--r--engines/tsage/ringworld2/ringworld2_speakers.h23
5 files changed, 325 insertions, 0 deletions
diff --git a/engines/tsage/ringworld2/ringworld2_logic.cpp b/engines/tsage/ringworld2/ringworld2_logic.cpp
index d976c5bd30..86e81786ea 100644
--- a/engines/tsage/ringworld2/ringworld2_logic.cpp
+++ b/engines/tsage/ringworld2/ringworld2_logic.cpp
@@ -110,6 +110,8 @@ Scene *Ringworld2Game::createScene(int sceneNumber) {
// Maze: Bedroom
return new Scene2430();
case 2435:
+ // Maze: Throne room
+ return new Scene2435();
case 2440:
case 2445:
case 2450:
diff --git a/engines/tsage/ringworld2/ringworld2_scenes2.cpp b/engines/tsage/ringworld2/ringworld2_scenes2.cpp
index 08deb5948d..a8decd365d 100644
--- a/engines/tsage/ringworld2/ringworld2_scenes2.cpp
+++ b/engines/tsage/ringworld2/ringworld2_scenes2.cpp
@@ -1637,5 +1637,163 @@ void Scene2430::signal() {
}
}
+/*--------------------------------------------------------------------------
+ * Scene 2435 - Maze: Throne room
+ *
+ *--------------------------------------------------------------------------*/
+bool Scene2435::Actor1::startAction(CursorType action, Event &event) {
+ return SceneActor::startAction(action, event);
+}
+
+bool Scene2435::Actor2::startAction(CursorType action, Event &event) {
+ Scene2435 *scene = (Scene2435 *)R2_GLOBALS._sceneManager._scene;
+
+ switch (action) {
+ case R2_34:
+ R2_GLOBALS._player.disableControl();
+ R2_GLOBALS._events.setCursor(R2_2);
+ R2_GLOBALS.setFlag(82);
+ scene->_stripManager.start(603, scene);
+ return true;
+ case R2_35:
+ R2_GLOBALS._player.disableControl();
+ R2_GLOBALS._events.setCursor(R2_2);
+ R2_GLOBALS.setFlag(82);
+ scene->_stripManager.start(602, scene);
+ R2_INVENTORY.setObjectScene(R2_35, 2000);
+ return true;
+ case CURSOR_TALK:
+ R2_GLOBALS._player.disableControl();
+ scene->_sceneMode = 20;
+ R2_GLOBALS._events.setCursor(R2_2);
+ if ((R2_GLOBALS._player._characterIndex == 1) || (R2_GLOBALS.getFlag(82))) {
+ scene->_stripManager.start(605, scene);
+ return true;
+ } else if (R2_INVENTORY.getObjectScene(R2_35) == 2) {
+ scene->_stripManager.start(601, scene);
+ return true;
+ } else {
+ R2_GLOBALS.setFlag(82);
+ scene->_stripManager.start(600, scene);
+ return true;
+ }
+ default:
+ return SceneActor::startAction(action, event);
+ }
+}
+
+void Scene2435::Exit1::changeScene() {
+ Scene2435 *scene = (Scene2435 *)R2_GLOBALS._sceneManager._scene;
+
+ _enabled = false;
+ R2_GLOBALS._events.setCursor(R2_NEGATOR_GUN);
+ R2_GLOBALS._player.disableControl();
+ scene->_sceneMode = 11;
+ Common::Point pt(175, 200);
+ NpcMover *mover = new NpcMover();
+ R2_GLOBALS._player.addMover(mover, &pt, scene);
+
+}
+
+void Scene2435::postInit(SceneObjectList *OwnerList) {
+ loadScene(2435);
+ SceneExt::postInit();
+ R2_GLOBALS._sound1.play(201);
+ _stripManager.addSpeaker(&_quinnSpeaker);
+ _stripManager.addSpeaker(&_seekerSpeaker);
+ _stripManager.addSpeaker(&_pharishaSpeaker);
+ _exit1.setDetails(Rect(142, 155, 207, 167), EXITCURSOR_S, 2000);
+ _exit1.setDest(Common::Point(175, 160));
+ _actor2.postInit();
+ _actor2.setup(2005, 3, 1);
+ _actor2.setPosition(Common::Point(219, 106));
+ _actor2.setDetails(2001, 25, 26, -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(715, 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(107, 145));
+ R2_GLOBALS._walkRegions.enableRegion(2);
+ }
+
+ _item2.setDetails(Rect(52, 44, 96, 82), 2430, 3, -1, 5, 1, NULL);
+ _item3.setDetails(Rect(117, 36, 161, 74), 2430, 3, -1, 5, 1, NULL);
+ _item1.setDetails(Rect(0, 0, 320, 200), 2430, 0, -1, -1, 1, NULL);
+ R2_GLOBALS._player.disableControl();
+ if (R2_GLOBALS._player._oldCharacterScene[R2_GLOBALS._player._characterIndex] == 2000) {
+ _sceneMode = 10;
+ Common::Point pt(175, 150);
+ NpcMover *mover = new NpcMover();
+ R2_GLOBALS._player.addMover(mover, &pt, this);
+ } else if (R2_GLOBALS._player._oldCharacterScene[R2_GLOBALS._player._characterIndex] == 2450) {
+ _sceneMode = 30;
+ Common::Point pt(175, 150);
+ NpcMover *mover = new NpcMover();
+ R2_GLOBALS._player.addMover(mover, &pt, this);
+ } else {
+ R2_GLOBALS._player.setPosition(Common::Point(210, 150));
+ R2_GLOBALS._player.setStrip(3);
+ R2_GLOBALS._player.enableControl();
+ }
+ R2_GLOBALS._player._oldCharacterScene[R2_GLOBALS._player._characterIndex] = 2435;
+ R2_GLOBALS._v56605[1 + R2_GLOBALS._player._characterIndex] = 12;
+}
+
+void Scene2435::remove() {
+ R2_GLOBALS._sound1.fadeOut2(NULL);
+ SceneExt::remove();
+}
+
+void Scene2435::signal() {
+ switch (_sceneMode) {
+ case 11:
+ g_globals->_sceneManager.changeScene(2000);
+ break;
+ case 20:
+ R2_GLOBALS._player.enableControl(R2_6);
+ break;
+ case 30:
+ R2_GLOBALS._player._characterScene[1] = 2435;
+ R2_GLOBALS._player._characterScene[2] = 2435;
+ R2_GLOBALS._player._oldCharacterScene[1] = 2435;
+ R2_GLOBALS._player._oldCharacterScene[2] = 2435;
+ R2_GLOBALS._v56605[1] = 12;
+ R2_GLOBALS._v56605[2] = 12;
+ R2_GLOBALS.setFlag(81);
+ _sceneMode = 2436;
+ R2_GLOBALS._player.setStrip(7);
+ _actor1.postInit();
+ if (R2_GLOBALS._player._characterIndex == 1)
+ _actor1.setVisage(20);
+ else
+ _actor1.setVisage(2008);
+ setAction(&_sequenceManager, this, 2436, &_actor1, NULL);
+ break;
+ case 2436:
+ R2_GLOBALS._walkRegions.enableRegion(2);
+ _sceneMode = 20;
+ R2_GLOBALS._events.setCursor(R2_2);
+ _stripManager.start(709, this);
+ 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 f2bb95568f..d3db8e1eb3 100644
--- a/engines/tsage/ringworld2/ringworld2_scenes2.h
+++ b/engines/tsage/ringworld2/ringworld2_scenes2.h
@@ -227,6 +227,38 @@ public:
virtual void postInit(SceneObjectList *OwnerList = NULL);
virtual void signal();
};
+
+class Scene2435 : public SceneExt {
+ class Actor1 : public SceneActor {
+ public:
+ bool startAction(CursorType action, Event &event);
+ };
+ class Actor2 : public SceneActor {
+ public:
+ bool startAction(CursorType action, Event &event);
+ };
+
+ class Exit1 : public SceneExit {
+ public:
+ virtual void changeScene();
+ };
+public:
+ SpeakerQuinn2435 _quinnSpeaker;
+ SpeakerSeeker2435 _seekerSpeaker;
+ SpeakerPharisha2435 _pharishaSpeaker;
+ NamedHotspot _item1;
+ NamedHotspot _item2;
+ NamedHotspot _item3;
+ Actor1 _actor1;
+ Actor2 _actor2;
+ Exit1 _exit1;
+ SequenceManager _sequenceManager;
+
+ virtual void postInit(SceneObjectList *OwnerList = NULL);
+ virtual void remove();
+ virtual void signal();
+};
+
} // End of namespace Ringworld2
} // End of namespace TsAGE
diff --git a/engines/tsage/ringworld2/ringworld2_speakers.cpp b/engines/tsage/ringworld2/ringworld2_speakers.cpp
index 2875652641..4fabc3643b 100644
--- a/engines/tsage/ringworld2/ringworld2_speakers.cpp
+++ b/engines/tsage/ringworld2/ringworld2_speakers.cpp
@@ -26,6 +26,7 @@
#include "tsage/graphics.h"
#include "tsage/staticres.h"
#include "tsage/ringworld2/ringworld2_scenes0.h"
+#include "tsage/ringworld2/ringworld2_scenes2.h"
namespace TsAGE {
@@ -482,6 +483,115 @@ SpeakerPharisha2350::SpeakerPharisha2350(): VisualSpeaker() {
_numFrames = 0;
}
+/*--------------------------------------------------------------------------*/
+
+SpeakerQuinn2435::SpeakerQuinn2435() {
+ _speakerName = "QUINN";
+ _color1 = 60;
+ _color2 = 0;
+ _fieldF6 = 0;
+ _textWidth = 300;
+ _hideObjects = false;
+ _object2 = NULL;
+ _displayMode = 1;
+ _numFrames = 0;
+}
+void SpeakerQuinn2435::proc15() {
+ int v = _fieldF6;
+
+ if (!_object2) {
+ if (R2_GLOBALS._player._characterIndex == 1) {
+ _object2 = &R2_GLOBALS._player;
+ } else {
+ Scene2435 *scene = (Scene2435 *)R2_GLOBALS._sceneManager._scene;
+ _object2 = &scene->_actor1;
+ }
+
+ _object2->hide();
+ _object1.postInit();
+ _object1.setPosition(_object2->_position);
+ }
+
+ if (v == 0) {
+ _object1.animate(ANIM_MODE_2, NULL);
+ } else {
+ ((SceneItem *)_action)->_sceneRegionId = 0;
+ _object2->setStrip(7);
+ _object1.setup(2020, 5, 1);
+ _object1.animate(ANIM_MODE_5, this);
+ }
+}
+
+SpeakerSeeker2435::SpeakerSeeker2435() {
+ _speakerName = "SEEKER";
+ _color1 = 35;
+ _color2 = 0;
+ _fieldF6 = 0;
+ _textWidth = 300;
+ _hideObjects = false;
+ _object2 = NULL;
+ _displayMode = 1;
+ _numFrames = 0;
+}
+
+void SpeakerSeeker2435::proc15() {
+ int v = _fieldF6;
+
+ if (!_object2) {
+ if (R2_GLOBALS._player._characterIndex == 2) {
+ _object2 = &R2_GLOBALS._player;
+ } else {
+ Scene2435 *scene = (Scene2435 *)R2_GLOBALS._sceneManager._scene;
+ _object2 = &scene->_actor1;
+ }
+
+ _object2->hide();
+ _object1.postInit();
+ _object1.setPosition(_object2->_position);
+ }
+
+ if (v == 0) {
+ _object1.animate(ANIM_MODE_2, NULL);
+ } else {
+ ((SceneItem *)_action)->_sceneRegionId = 0;
+ _object2->setStrip(7);
+ _object1.setup(4099, 1, 1);
+ _object1.animate(ANIM_MODE_5, this);
+ }
+}
+
+SpeakerPharisha2435::SpeakerPharisha2435() {
+ _speakerName = "PHARISHA";
+ _color1 = 151;
+ _color2 = 0;
+ _fieldF6 = 0;
+ _textWidth = 300;
+ _hideObjects = false;
+ _object2 = NULL;
+ _displayMode = 1;
+ _numFrames = 0;
+}
+
+void SpeakerPharisha2435::proc15() {
+ int v = _fieldF6;
+ Scene2435 *scene = (Scene2435 *)R2_GLOBALS._sceneManager._scene;
+
+ if (!_object2) {
+ _object2 = &scene->_actor2;
+ _object2->hide();
+ _object1.postInit();
+ _object1.setPosition(_object2->_position);
+ }
+
+ if (v == 0) {
+ _object1.animate(ANIM_MODE_2, NULL);
+ } else {
+ ((SceneItem *)_action)->_sceneRegionId = 0;
+ _object1.setup(4098, 5, 1);
+ _object1.animate(ANIM_MODE_5, this);
+ }
+}
+
} // End of namespace Ringworld2
} // End of namespace TsAGE
diff --git a/engines/tsage/ringworld2/ringworld2_speakers.h b/engines/tsage/ringworld2/ringworld2_speakers.h
index 5793f4377e..e788fb7f9c 100644
--- a/engines/tsage/ringworld2/ringworld2_speakers.h
+++ b/engines/tsage/ringworld2/ringworld2_speakers.h
@@ -129,6 +129,29 @@ public:
virtual Common::String getClassName() { return "SpeakerPharisha2350"; }
};
+class SpeakerQuinn2435 : public VisualSpeaker {
+public:
+ SpeakerQuinn2435();
+
+ virtual Common::String getClassName() { return "SpeakerQuinn2435"; }
+ virtual void proc15();
+};
+
+class SpeakerSeeker2435 : public VisualSpeaker {
+public:
+ SpeakerSeeker2435();
+
+ virtual Common::String getClassName() { return "SpeakerSeeker2435"; }
+ virtual void proc15();
+};
+
+class SpeakerPharisha2435 : public VisualSpeaker {
+public:
+ SpeakerPharisha2435();
+
+ virtual Common::String getClassName() { return "SpeakerPharisha2435"; }
+ virtual void proc15();
+};
} // End of namespace Ringworld2
} // End of namespace TsAGE