aboutsummaryrefslogtreecommitdiff
path: root/engines/titanic/game/nav_helmet.cpp
diff options
context:
space:
mode:
authorPaul Gilbert2016-08-25 22:55:34 -0400
committerPaul Gilbert2016-08-25 22:55:34 -0400
commitfde400c33267fcb7b48ba1508e6191008a1de4de (patch)
treec90201fa8eb41437f60219e6187acbcf2484fda7 /engines/titanic/game/nav_helmet.cpp
parent9a71c9166b1ef8c7d0e57cfdfac6eb25f5332c69 (diff)
downloadscummvm-rg350-fde400c33267fcb7b48ba1508e6191008a1de4de.tar.gz
scummvm-rg350-fde400c33267fcb7b48ba1508e6191008a1de4de.tar.bz2
scummvm-rg350-fde400c33267fcb7b48ba1508e6191008a1de4de.zip
TITANIC: Implemented nav helmet classes
Diffstat (limited to 'engines/titanic/game/nav_helmet.cpp')
-rw-r--r--engines/titanic/game/nav_helmet.cpp99
1 files changed, 97 insertions, 2 deletions
diff --git a/engines/titanic/game/nav_helmet.cpp b/engines/titanic/game/nav_helmet.cpp
index 770eb7375e..08ff073c26 100644
--- a/engines/titanic/game/nav_helmet.cpp
+++ b/engines/titanic/game/nav_helmet.cpp
@@ -21,19 +21,114 @@
*/
#include "titanic/game/nav_helmet.h"
+#include "titanic/pet_control/pet_control.h"
namespace Titanic {
+BEGIN_MESSAGE_MAP(CNavHelmet, CGameObject)
+ ON_MESSAGE(MovieEndMsg)
+ ON_MESSAGE(EnterViewMsg)
+ ON_MESSAGE(LeaveViewMsg)
+ ON_MESSAGE(PETHelmetOnOffMsg)
+ ON_MESSAGE(PETPhotoOnOffMsg)
+ ON_MESSAGE(PETStarFieldLockMsg)
+ ON_MESSAGE(PETSetStarDestinationMsg)
+END_MESSAGE_MAP()
+
void CNavHelmet::save(SimpleFile *file, int indent) {
file->writeNumberLine(1, indent);
- file->writeNumberLine(_value, indent);
+ file->writeNumberLine(_flag, indent);
CGameObject::save(file, indent);
}
void CNavHelmet::load(SimpleFile *file) {
file->readNumber();
- _value = file->readNumber();
+ _flag = file->readNumber();
CGameObject::load(file);
}
+bool CNavHelmet::MovieEndMsg(CMovieEndMsg *msg) {
+ if (_flag) {
+ setVisible(false);
+
+ CPetControl *pet = getPetControl();
+ if (pet) {
+ pet->setArea(PET_STARFIELD);
+ petDisplayMessage(1, "Now would be an excellent opportunity to adjust your viewing apparatus.");
+ pet->incAreaLocks();
+ }
+
+ starFn1(0);
+ starFn1(12);
+ }
+
+ return true;
+}
+
+bool CNavHelmet::EnterViewMsg(CEnterViewMsg *msg) {
+ petSetRemoteTarget();
+ return true;
+}
+
+bool CNavHelmet::LeaveViewMsg(CLeaveViewMsg *msg) {
+ petClear();
+ return true;
+}
+
+bool CNavHelmet::PETHelmetOnOffMsg(CPETHelmetOnOffMsg *msg) {
+ CPetControl *pet = getPetControl();
+
+ if (_flag) {
+ _flag = false;
+ setVisible(true);
+ starFn1(1);
+ playMovie(61, 120, MOVIE_NOTIFY_OBJECT);
+ playSound("a#47.wav");
+ playSound("a#48.wav");
+
+ if (pet) {
+ pet->decAreaLocks();
+ pet->setArea(PET_REMOTE);
+ }
+
+ dec54();
+ } else {
+ inc54();
+ _flag = true;
+ setVisible(true);
+ playMovie(0, 60, MOVIE_NOTIFY_OBJECT);
+ playSound("a#48.wav");
+ playSound("a#47.wav");
+ }
+
+ return true;
+}
+
+bool CNavHelmet::PETPhotoOnOffMsg(CPETPhotoOnOffMsg *msg) {
+ if (_flag)
+ starFn1(9);
+
+ return true;
+}
+
+bool CNavHelmet::PETStarFieldLockMsg(CPETStarFieldLockMsg *msg) {
+ if (_flag) {
+ if (msg->_value) {
+ playSound("a#6.wav");
+ starFn1(17);
+ } else {
+ playSound("a#5.wav");
+ starFn1(18);
+ }
+ }
+
+ return true;
+}
+
+bool CNavHelmet::PETSetStarDestinationMsg(CPETSetStarDestinationMsg *msg) {
+ CActMsg actMsg("SetDestin");
+ actMsg.execute("CaptainsWheel");
+ return true;
+}
+
} // End of namespace Titanic