Initial commit

This commit is contained in:
2026-02-02 04:50:13 +01:00
commit 5b11698731
22592 changed files with 7677434 additions and 0 deletions

View File

@@ -0,0 +1,155 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#include "titanic/game/announce.h"
#include "titanic/translation.h"
namespace Titanic {
BEGIN_MESSAGE_MAP(CAnnounce, CGameObject)
ON_MESSAGE(TimerMsg)
ON_MESSAGE(LeaveRoomMsg)
ON_MESSAGE(ActMsg)
END_MESSAGE_MAP()
CAnnounce::CAnnounce() : _nameIndex(0), _soundHandle(0), _notActivatedFlag(true), _enabled(false) {
}
void CAnnounce::save(SimpleFile *file, int indent) {
file->writeNumberLine(1, indent);
file->writeNumberLine(_nameIndex, indent);
file->writeNumberLine(_soundHandle, indent);
file->writeNumberLine(_notActivatedFlag, indent);
file->writeNumberLine(_enabled, indent);
CGameObject::save(file, indent);
}
void CAnnounce::load(SimpleFile *file) {
file->readNumber();
_nameIndex = file->readNumber();
_soundHandle = file->readNumber();
_notActivatedFlag = file->readNumber();
_enabled = file->readNumber();
CGameObject::load(file);
}
bool CAnnounce::TimerMsg(CTimerMsg *msg) {
if (!_enabled)
return false;
if (msg->_actionVal == 1) {
CString numStr = "0";
const char *const WAVE_NAMES1_EN[18] = {
"z#181.wav", "z#211.wav", "z#203.wav", "z#202.wav", "z#201.wav",
"z#200.wav", "z#199.wav", "z#198.wav", "z#197.wav", "z#196.wav",
"z#210.wav", "z#209.wav", "z#208.wav", "z#207.wav", "z#206.wav",
"z#205.wav", "z#204.wav", "z#145.wav"
};
const char *const WAVE_NAMES2_EN[30] = {
"z#154.wav", "z#153.wav", "z#152.wav", "z#151.wav", "z#150.wav",
"z#149.wav", "z#148.wav", "z#169.wav", "z#171.wav", "z#178.wav",
"z#176.wav", "z#177.wav", "z#165.wav", "z#170.wav", "z#180.wav",
"z#156.wav", "z#172.wav", "z#173.wav", "z#160.wav", "z#158.wav",
"z#161.wav", "z#179.wav", "z#163.wav", "z#164.wav", "z#162.wav",
"z#159.wav", "z#175.wav", "z#166.wav", "z#174.wav", "z#157.wav"
};
const char *const WAVE_NAMES1_DE[18] = {
"z#712.wav", "z#741.wav", "z#733.wav", "z#732.wav", "z#731.wav",
"z#730.wav", "z#729.wav", "z#728.wav", "z#727.wav", "z#726.wav",
"z#740.wav", "z#739.wav", "z#738.wav", "z#737.wav", "z#736.wav",
"z#735.wav", "z#734.wav", "z#701.wav"
};
const char *const WAVE_NAMES2_DE[31] = {
"z#711.wav", "z#710.wav", "z#709.wav", "z#708.wav", "z#707.wav",
"z#706.wav", "z#705.wav", "z#704.wav", "z#688.wav", "z#690.wav",
"z#697.wav", "z#695.wav", "z#696.wav", "z#684.wav", "z#689.wav",
"z#699.wav", "z#675.wav", "z#691.wav", "z#692.wav", "z#679.wav",
"z#677.wav", "z#680.wav", "z#698.wav", "z#682.wav", "z#683.wav",
"z#681.wav", "z#678.wav", "z#694.wav", "z#685.wav", "z#693.wav",
"z#676.wav"
};
CProximity prox;
prox._soundType = Audio::Mixer::kSpeechSoundType;
int randVal = _nameIndex ? getRandomNumber(2) : 0;
switch (randVal) {
case 0:
case 1:
_soundHandle = playSound(TRANSLATE("z#189.wav", "z#719.wav"), prox);
if (_nameIndex < 18) {
queueSound(TRANSLATE(WAVE_NAMES1_EN[_nameIndex], WAVE_NAMES1_DE[_nameIndex]),
_soundHandle, 100, 0, false, Audio::Mixer::kSpeechSoundType);
++_nameIndex;
} else {
queueSound(TRANSLATE(WAVE_NAMES1_EN[getRandomNumber(17)], WAVE_NAMES1_DE[getRandomNumber(17)]),
_soundHandle, 100, 0, false, Audio::Mixer::kSpeechSoundType);
}
break;
case 2:
_soundHandle = playSound(TRANSLATE("z#189.wav", "z#719.wav"), prox);
queueSound(TRANSLATE(WAVE_NAMES2_EN[getRandomNumber(29)], WAVE_NAMES2_DE[getRandomNumber(30)]),
_soundHandle, 100, 0, false, Audio::Mixer::kSpeechSoundType);
break;
default:
break;
}
// Schedule another announcement for a random future time
addTimer(1, 300000 + getRandomNumber(30000), 0);
if (getRandomNumber(3) == 0)
addTimer(2, 4000, 0);
} else if (msg->_actionVal == 2) {
CParrotSpeakMsg speakMsg;
speakMsg._target = "Announcements";
speakMsg.execute("PerchedParrot");
}
return true;
}
bool CAnnounce::LeaveRoomMsg(CLeaveRoomMsg *msg) {
// The very first time the player leaves the Embarklation Lobby, start announcements
if (_notActivatedFlag) {
addTimer(1, 1000, 0);
_notActivatedFlag = false;
_enabled = true;
}
return true;
}
bool CAnnounce::ActMsg(CActMsg *msg) {
// Handle enabling or disabling announcements
if (msg->_action == "Enable")
_enabled = true;
else if (msg->_action == "Disable")
_enabled = false;
return true;
}
} // End of namespace Titanic

View File

@@ -0,0 +1,56 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#ifndef TITANIC_ANNOUNCE_H
#define TITANIC_ANNOUNCE_H
#include "titanic/core/game_object.h"
namespace Titanic {
class CAnnounce : public CGameObject {
DECLARE_MESSAGE_MAP;
bool TimerMsg(CTimerMsg *msg);
bool LeaveRoomMsg(CLeaveRoomMsg *msg);
bool ActMsg(CActMsg *msg);
private:
int _nameIndex;
int _soundHandle;
bool _notActivatedFlag;
bool _enabled;
public:
CLASSDEF;
CAnnounce();
/**
* Save the data for the class to file
*/
void save(SimpleFile *file, int indent) override;
/**
* Load the data for the class from file
*/
void load(SimpleFile *file) override;
};
} // End of namespace Titanic
#endif /* TITANIC_ROOM_ITEM_H */

View File

@@ -0,0 +1,53 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#include "titanic/game/annoy_barbot.h"
namespace Titanic {
int CAnnoyBarbot::_v1;
BEGIN_MESSAGE_MAP(CAnnoyBarbot, CGameObject)
ON_MESSAGE(MouseButtonDownMsg)
END_MESSAGE_MAP()
void CAnnoyBarbot::save(SimpleFile *file, int indent) {
file->writeNumberLine(1, indent);
file->writeNumberLine(_v1, indent);
CGameObject::save(file, indent);
}
void CAnnoyBarbot::load(SimpleFile *file) {
file->readNumber();
_v1 = file->readNumber();
CGameObject::load(file);
}
bool CAnnoyBarbot::MouseButtonDownMsg(CMouseButtonDownMsg *msg) {
if ((++_v1 % 3) == 1) {
CActMsg actMsg("GoRingBell");
actMsg.execute("Barbot");
}
return true;
}
} // End of namespace Titanic

View File

@@ -0,0 +1,50 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#ifndef TITANIC_ANNOY_BARBOT_H
#define TITANIC_ANNOY_BARBOT_H
#include "titanic/core/game_object.h"
namespace Titanic {
class CAnnoyBarbot : public CGameObject {
DECLARE_MESSAGE_MAP;
bool MouseButtonDownMsg(CMouseButtonDownMsg *msg);
private:
static int _v1;
public:
CLASSDEF;
/**
* Save the data for the class to file
*/
void save(SimpleFile *file, int indent) override;
/**
* Load the data for the class from file
*/
void load(SimpleFile *file) override;
};
} // End of namespace Titanic
#endif /* TITANIC_ANNOY_BARBOT_H */

View File

@@ -0,0 +1,52 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#include "titanic/game/arb_background.h"
namespace Titanic {
EMPTY_MESSAGE_MAP(CArbBackground, CBackground);
CArbBackground::CArbBackground() : CBackground(),
_fieldE0(0), _fieldE4(61), _fieldE8(62), _fieldEC(118) {
}
void CArbBackground::save(SimpleFile *file, int indent) {
file->writeNumberLine(1, indent);
file->writeNumberLine(_fieldE0, indent);
file->writeNumberLine(_fieldE4, indent);
file->writeNumberLine(_fieldE8, indent);
file->writeNumberLine(_fieldEC, indent);
CBackground::save(file, indent);
}
void CArbBackground::load(SimpleFile *file) {
file->readNumber();
_fieldE0 = file->readNumber();
_fieldE4 = file->readNumber();
_fieldE8 = file->readNumber();
_fieldEC = file->readNumber();
CBackground::load(file);
}
} // End of namespace Titanic

View File

@@ -0,0 +1,53 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#ifndef TITANIC_ARB_BACKGROUND_H
#define TITANIC_ARB_BACKGROUND_H
#include "titanic/core/background.h"
namespace Titanic {
class CArbBackground : public CBackground {
DECLARE_MESSAGE_MAP;
public:
int _fieldE0;
int _fieldE4;
int _fieldE8;
int _fieldEC;
public:
CLASSDEF;
CArbBackground();
/**
* Save the data for the class to file
*/
void save(SimpleFile *file, int indent) override;
/**
* Load the data for the class from file
*/
void load(SimpleFile *file) override;
};
} // End of namespace Titanic
#endif /* TITANIC_ARB_BACKGROUND_H */

View File

@@ -0,0 +1,391 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#include "titanic/game/arboretum_gate.h"
#include "titanic/translation.h"
namespace Titanic {
BEGIN_MESSAGE_MAP(CArboretumGate, CBackground)
ON_MESSAGE(ChangeSeasonMsg)
ON_MESSAGE(ActMsg)
ON_MESSAGE(MovieEndMsg)
ON_MESSAGE(LeaveViewMsg)
ON_MESSAGE(TurnOff)
ON_MESSAGE(MouseButtonDownMsg)
ON_MESSAGE(EnterViewMsg)
ON_MESSAGE(TurnOn)
END_MESSAGE_MAP()
bool CArboretumGate::_gotSpeechCentre;
bool CArboretumGate::_disabled;
int CArboretumGate::_initialFrame;
CArboretumGate::CArboretumGate() : CBackground() {
_arboretumViewName = "NULL";
_exitViewName = "NULL";
_seasonNum = SEASON_SUMMER;
_unused1 = 0;
_startFrameSpringOff = 244;
_endFrameSpringOff = 304;
_startFrameSummerOff = 122;
_endFrameSummerOff = 182;
_startFrameAutumnOff1 = 183;
_endFrameAutumnOff1 = 243;
_startFrameAutumnOff2 = 665;
_endFrameAutumnOff2 = 724;
_startFrameWinterOff1 = 61;
_endFrameWinterOff1 = 121;
_startFrameWinterOff2 = 0;
_endFrameWinterOff2 = 60;
_startFrameSpringOn = 485;
_endFrameSpringOn = 544;
_startFrameSummerOn = 425;
_endFrameSummerOn = 484;
_startFrameAutumnOn1 = 545;
_endFrameAutumnOn1 = 604;
_startFrameAutumnOn2 = 605;
_endFrameAutumnOn2 = 664;
_startFrameWinterOn1 = 305;
_endFrameWinterOn1 = 364;
_startFrameWinterOn2 = 365;
_endFrameWinterOn2 = 424;
}
void CArboretumGate::save(SimpleFile *file, int indent) {
file->writeNumberLine(1, indent);
file->writeNumberLine(_seasonNum, indent);
file->writeNumberLine(_gotSpeechCentre, indent);
file->writeNumberLine(_initialFrame, indent);
file->writeNumberLine(_disabled, indent);
file->writeQuotedLine(_arboretumViewName, indent);
file->writeNumberLine(_unused1, indent);
file->writeNumberLine(_startFrameSpringOff, indent);
file->writeNumberLine(_endFrameSpringOff, indent);
file->writeNumberLine(_startFrameSummerOff, indent);
file->writeNumberLine(_endFrameSummerOff, indent);
file->writeNumberLine(_startFrameAutumnOff1, indent);
file->writeNumberLine(_endFrameAutumnOff1, indent);
file->writeNumberLine(_startFrameAutumnOff2, indent);
file->writeNumberLine(_endFrameAutumnOff2, indent);
file->writeNumberLine(_startFrameWinterOff1, indent);
file->writeNumberLine(_endFrameWinterOff1, indent);
file->writeNumberLine(_startFrameWinterOff2, indent);
file->writeNumberLine(_endFrameWinterOff2, indent);
file->writeNumberLine(_startFrameSpringOn, indent);
file->writeNumberLine(_endFrameSpringOn, indent);
file->writeNumberLine(_startFrameSummerOn, indent);
file->writeNumberLine(_endFrameSummerOn, indent);
file->writeNumberLine(_startFrameAutumnOn1, indent);
file->writeNumberLine(_endFrameAutumnOn1, indent);
file->writeNumberLine(_startFrameAutumnOn2, indent);
file->writeNumberLine(_endFrameAutumnOn2, indent);
file->writeNumberLine(_startFrameWinterOn1, indent);
file->writeNumberLine(_endFrameWinterOn1, indent);
file->writeNumberLine(_startFrameWinterOn2, indent);
file->writeNumberLine(_endFrameWinterOn2, indent);
file->writeQuotedLine(_exitViewName, indent);
if (g_language == Common::DE_DEU) {
// German version replicated all the frame fields for some reason
file->writeNumberLine(_startFrameSpringOff, indent);
file->writeNumberLine(_endFrameSpringOff, indent);
file->writeNumberLine(_startFrameSpringOn, indent);
file->writeNumberLine(_endFrameSpringOn, indent);
file->writeNumberLine(_startFrameAutumnOff2, indent);
file->writeNumberLine(_endFrameAutumnOff2, indent);
file->writeNumberLine(_endFrameAutumnOn2, indent);
file->writeNumberLine(_startFrameAutumnOn2, indent);
file->writeNumberLine(_startFrameAutumnOff1, indent);
file->writeNumberLine(_endFrameAutumnOff1, indent);
file->writeNumberLine(_startFrameAutumnOn1, indent);
file->writeNumberLine(_endFrameAutumnOn1, indent);
file->writeNumberLine(_startFrameSummerOff, indent);
file->writeNumberLine(_endFrameSummerOff, indent);
file->writeNumberLine(_startFrameSummerOn, indent);
file->writeNumberLine(_endFrameSummerOn, indent);
file->writeNumberLine(_startFrameWinterOff2, indent);
file->writeNumberLine(_endFrameWinterOff2, indent);
file->writeNumberLine(_startFrameWinterOn2, indent);
file->writeNumberLine(_endFrameWinterOn2, indent);
file->writeNumberLine(_startFrameWinterOff1, indent);
file->writeNumberLine(_endFrameWinterOff1, indent);
file->writeNumberLine(_startFrameWinterOn1, indent);
file->writeNumberLine(_endFrameWinterOn1, indent);
}
CBackground::save(file, indent);
}
void CArboretumGate::load(SimpleFile *file) {
file->readNumber();
_seasonNum = (Season)file->readNumber();
_gotSpeechCentre = file->readNumber();
_initialFrame = file->readNumber();
_disabled = file->readNumber();
_arboretumViewName = file->readString();
_unused1 = file->readNumber();
_startFrameSpringOff = file->readNumber();
_endFrameSpringOff = file->readNumber();
_startFrameSummerOff = file->readNumber();
_endFrameSummerOff = file->readNumber();
_startFrameAutumnOff1 = file->readNumber();
_endFrameAutumnOff1 = file->readNumber();
_startFrameAutumnOff2 = file->readNumber();
_endFrameAutumnOff2 = file->readNumber();
_startFrameWinterOff1 = file->readNumber();
_endFrameWinterOff1 = file->readNumber();
_startFrameWinterOff2 = file->readNumber();
_endFrameWinterOff2 = file->readNumber();
_startFrameSpringOn = file->readNumber();
_endFrameSpringOn = file->readNumber();
_startFrameSummerOn = file->readNumber();
_endFrameSummerOn = file->readNumber();
_startFrameAutumnOn1 = file->readNumber();
_endFrameAutumnOn1 = file->readNumber();
_startFrameAutumnOn2 = file->readNumber();
_endFrameAutumnOn2 = file->readNumber();
_startFrameWinterOn1 = file->readNumber();
_endFrameWinterOn1 = file->readNumber();
_startFrameWinterOn2 = file->readNumber();
_endFrameWinterOn2 = file->readNumber();
_exitViewName = file->readString();
if (g_language == Common::DE_DEU) {
// German version replicated all the frame fields for some reason
_startFrameSpringOff = file->readNumber();
_endFrameSpringOff = file->readNumber();
_startFrameSpringOn = file->readNumber();
_endFrameSpringOn = file->readNumber();
_startFrameAutumnOff2 = file->readNumber();
_endFrameAutumnOff2 = file->readNumber();
_endFrameAutumnOn2 = file->readNumber();
_startFrameAutumnOn2 = file->readNumber();
_startFrameAutumnOff1 = file->readNumber();
_endFrameAutumnOff1 = file->readNumber();
_startFrameAutumnOn1 = file->readNumber();
_endFrameAutumnOn1 = file->readNumber();
_startFrameSummerOff = file->readNumber();
_endFrameSummerOff = file->readNumber();
_startFrameSummerOn = file->readNumber();
_endFrameSummerOn = file->readNumber();
_startFrameWinterOff2 = file->readNumber();
_endFrameWinterOff2 = file->readNumber();
_startFrameWinterOn2 = file->readNumber();
_endFrameWinterOn2 = file->readNumber();
_startFrameWinterOff1 = file->readNumber();
_endFrameWinterOff1 = file->readNumber();
_startFrameWinterOn1 = file->readNumber();
_endFrameWinterOn1 = file->readNumber();
}
CBackground::load(file);
}
bool CArboretumGate::ChangeSeasonMsg(CChangeSeasonMsg *msg) {
_seasonNum = (Season)((_seasonNum + 1) % 4);
return true;
}
bool CArboretumGate::ActMsg(CActMsg *msg) {
if (msg->_action == "PlayerGetsSpeechCentre") {
_gotSpeechCentre = true;
CVisibleMsg visibleMsg(true);
visibleMsg.execute("SpCtrOverlay");
} else if (msg->_action == "ExitLFrozen") {
if (_disabled) {
_exitViewName = "FrozenArboretum.Node 2.W";
CTurnOn onMsg;
onMsg.execute(this);
} else {
changeView("FrozenArboretum.Node 2.W");
}
} else if (msg->_action == "ExitRFrozen") {
if (_disabled) {
_exitViewName = "FrozenArboretum.Node 2.E";
CTurnOn onMsg;
onMsg.execute(this);
} else {
changeView("FrozenArboretum.Node 2.E");
}
} else if (msg->_action == "ExitLNormal") {
if (_disabled) {
_exitViewName = "Arboretum.Node 2.W";
CTurnOn onMsg;
onMsg.execute(this);
} else {
changeView("Arboretum.Node 2.W");
}
} else if (msg->_action == "ExitRNormal") {
if (_disabled) {
_exitViewName = "Arboretum.Node 2.E";
CTurnOn onMsg;
onMsg.execute(this);
} else {
changeView("Arboretum.Node 2.E");
}
}
return true;
}
bool CArboretumGate::MovieEndMsg(CMovieEndMsg *msg) {
setVisible(!_disabled);
if (_arboretumViewName != "NULL") {
changeView(_arboretumViewName);
} else if (_exitViewName != "NULL") {
changeView(_exitViewName);
_exitViewName = "NULL";
}
return true;
}
bool CArboretumGate::LeaveViewMsg(CLeaveViewMsg *msg) {
return false;
}
bool CArboretumGate::TurnOff(CTurnOff *msg) {
if (!_disabled) {
switch (_seasonNum) {
case SEASON_SUMMER:
playMovie(_startFrameSummerOff, _endFrameSummerOff, MOVIE_WAIT_FOR_FINISH | MOVIE_NOTIFY_OBJECT);
break;
case SEASON_AUTUMN:
if (_gotSpeechCentre) {
playMovie(_startFrameAutumnOff2, _endFrameAutumnOff2, MOVIE_WAIT_FOR_FINISH | MOVIE_NOTIFY_OBJECT);
} else {
playMovie(_startFrameAutumnOff1, _endFrameAutumnOff1, MOVIE_WAIT_FOR_FINISH | MOVIE_NOTIFY_OBJECT);
}
break;
case SEASON_WINTER:
if (_gotSpeechCentre) {
playMovie(_startFrameWinterOff2, _endFrameWinterOff2, MOVIE_WAIT_FOR_FINISH | MOVIE_NOTIFY_OBJECT);
} else {
playMovie(_startFrameWinterOff1, _endFrameWinterOff1, MOVIE_WAIT_FOR_FINISH | MOVIE_NOTIFY_OBJECT);
}
break;
case SEASON_SPRING:
playMovie(_startFrameSpringOff, _endFrameSpringOff, MOVIE_WAIT_FOR_FINISH | MOVIE_NOTIFY_OBJECT);
break;
default:
break;
}
_disabled = true;
CArboretumGateMsg gateMsg(1);
gateMsg.execute("Arboretum", nullptr, MSGFLAG_SCAN);
}
return true;
}
bool CArboretumGate::TurnOn(CTurnOn *msg) {
if (_disabled) {
CArboretumGateMsg gateMsg(0);
gateMsg.execute("Arboretum");
setVisible(true);
switch (_seasonNum) {
case SEASON_SUMMER:
playMovie(_startFrameSummerOn, _endFrameSummerOn, MOVIE_WAIT_FOR_FINISH | MOVIE_NOTIFY_OBJECT);
break;
case SEASON_AUTUMN:
if (_gotSpeechCentre) {
playMovie(_startFrameAutumnOn2, _endFrameAutumnOn2, MOVIE_WAIT_FOR_FINISH | MOVIE_NOTIFY_OBJECT);
} else {
playMovie(_startFrameAutumnOn1, _endFrameAutumnOn1, MOVIE_WAIT_FOR_FINISH | MOVIE_NOTIFY_OBJECT);
}
break;
case SEASON_WINTER:
if (_gotSpeechCentre) {
playMovie(_startFrameWinterOn2, _endFrameWinterOn2, MOVIE_WAIT_FOR_FINISH | MOVIE_NOTIFY_OBJECT);
} else {
playMovie(_startFrameWinterOn1, _endFrameWinterOn1, MOVIE_WAIT_FOR_FINISH | MOVIE_NOTIFY_OBJECT);
}
break;
case SEASON_SPRING:
playMovie(_startFrameSpringOn, _endFrameSpringOn, MOVIE_WAIT_FOR_FINISH | MOVIE_NOTIFY_OBJECT);
break;
default:
break;
}
_disabled = false;
}
return true;
}
bool CArboretumGate::MouseButtonDownMsg(CMouseButtonDownMsg *msg) {
if (!_disabled) {
CTurnOff offMsg;
offMsg.execute(this);
}
return true;
}
bool CArboretumGate::EnterViewMsg(CEnterViewMsg *msg) {
setVisible(!_disabled);
if (!_disabled) {
// Only entered when we enter the Arboretum Gate view when in non-winter.
// When in winter, the landing dock by the Arboretum has a different
// "frozen water" view, and when the door is open, it changes to the
// standard Arboretum.2.N view for the Arboretum, skipping this block
switch (_seasonNum) {
case SEASON_SUMMER:
_initialFrame = _startFrameSummerOff;
break;
case SEASON_AUTUMN:
_initialFrame = _gotSpeechCentre ? _startFrameAutumnOff2 : _startFrameAutumnOff1;
break;
case SEASON_WINTER:
_initialFrame = _gotSpeechCentre ? _startFrameWinterOff2 : _startFrameWinterOff1;
break;
case SEASON_SPRING:
_initialFrame = _startFrameSpringOff;
break;
default:
break;
}
loadFrame(_initialFrame);
}
return true;
}
} // End of namespace Titanic

View File

@@ -0,0 +1,91 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#ifndef TITANIC_ARBORETUM_GATE_H
#define TITANIC_ARBORETUM_GATE_H
#include "titanic/core/background.h"
#include "titanic/messages/messages.h"
#include "titanic/messages/mouse_messages.h"
namespace Titanic {
class CArboretumGate : public CBackground {
DECLARE_MESSAGE_MAP;
bool ChangeSeasonMsg(CChangeSeasonMsg *msg);
bool ActMsg(CActMsg *msg);
bool MovieEndMsg(CMovieEndMsg *msg);
bool LeaveViewMsg(CLeaveViewMsg *msg);
bool TurnOff(CTurnOff *msg);
bool MouseButtonDownMsg(CMouseButtonDownMsg *msg);
bool EnterViewMsg(CEnterViewMsg *msg);
bool TurnOn(CTurnOn *msg);
private:
static bool _gotSpeechCentre;
static bool _disabled;
static int _initialFrame;
private:
Season _seasonNum;
CString _arboretumViewName;
int _unused1;
int _startFrameSpringOff;
int _endFrameSpringOff;
int _startFrameSummerOff;
int _endFrameSummerOff;
int _startFrameAutumnOff2;
int _endFrameAutumnOff2;
int _startFrameAutumnOff1;
int _endFrameAutumnOff1;
int _startFrameWinterOff2;
int _endFrameWinterOff2;
int _startFrameWinterOff1;
int _endFrameWinterOff1;
int _startFrameSpringOn;
int _endFrameSpringOn;
int _startFrameSummerOn;
int _endFrameSummerOn;
int _startFrameAutumnOn1;
int _endFrameAutumnOn1;
int _startFrameAutumnOn2;
int _endFrameAutumnOn2;
int _startFrameWinterOn1;
int _endFrameWinterOn1;
int _startFrameWinterOn2;
int _endFrameWinterOn2;
CString _exitViewName;
public:
CLASSDEF;
CArboretumGate();
/**
* Save the data for the class to file
*/
void save(SimpleFile *file, int indent) override;
/**
* Load the data for the class from file
*/
void load(SimpleFile *file) override;
};
} // End of namespace Titanic
#endif /* TITANIC_ARBORETUM_GATE_H */

View File

@@ -0,0 +1,67 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#include "titanic/game/auto_animate.h"
namespace Titanic {
BEGIN_MESSAGE_MAP(CAutoAnimate, CBackground)
ON_MESSAGE(EnterViewMsg)
ON_MESSAGE(InitializeAnimMsg)
END_MESSAGE_MAP()
void CAutoAnimate::save(SimpleFile *file, int indent) {
file->writeNumberLine(1, indent);
file->writeNumberLine(_enabled, indent);
file->writeNumberLine(_redo, indent);
file->writeNumberLine(_repeat, indent);
CBackground::save(file, indent);
}
void CAutoAnimate::load(SimpleFile *file) {
file->readNumber();
_enabled = file->readNumber();
_redo = file->readNumber();
_repeat = file->readNumber();
CBackground::load(file);
}
bool CAutoAnimate::EnterViewMsg(CEnterViewMsg *msg) {
if (_enabled) {
uint flags = _repeat ? MOVIE_REPEAT : 0;
if (_startFrame != _endFrame)
playMovie(_startFrame, _endFrame, flags);
else
playMovie(flags);
if (!_redo)
_enabled = false;
}
return true;
}
bool CAutoAnimate::InitializeAnimMsg(CInitializeAnimMsg *msg) {
_enabled = true;
return true;
}
} // End of namespace Titanic

View File

@@ -0,0 +1,55 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#ifndef TITANIC_AUTO_ANIMATE_H
#define TITANIC_AUTO_ANIMATE_H
#include "titanic/core/background.h"
#include "titanic/messages/messages.h"
namespace Titanic {
class CAutoAnimate : public CBackground {
DECLARE_MESSAGE_MAP;
bool EnterViewMsg(CEnterViewMsg *msg);
bool InitializeAnimMsg(CInitializeAnimMsg *msg);
private:
bool _enabled;
bool _redo;
bool _repeat;
public:
CLASSDEF;
CAutoAnimate() : CBackground(), _enabled(true), _redo(true), _repeat(false) {}
/**
* Save the data for the class to file
*/
void save(SimpleFile *file, int indent) override;
/**
* Load the data for the class from file
*/
void load(SimpleFile *file) override;
};
} // End of namespace Titanic
#endif /* TITANIC_AUTO_ANIMATE_H */

View File

@@ -0,0 +1,131 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#include "titanic/game/bar_bell.h"
#include "titanic/translation.h"
namespace Titanic {
BEGIN_MESSAGE_MAP(CBarBell, CGameObject)
ON_MESSAGE(EnterRoomMsg)
ON_MESSAGE(MouseButtonDownMsg)
ON_MESSAGE(MouseButtonUpMsg)
ON_MESSAGE(ActMsg)
END_MESSAGE_MAP()
CBarBell::CBarBell() : CGameObject(), _fieldBC(0),
_volume(65), _soundVal3(0), _fieldC8(0), _fieldCC(0) {
}
void CBarBell::save(SimpleFile *file, int indent) {
file->writeNumberLine(1, indent);
file->writeNumberLine(_fieldBC, indent);
file->writeNumberLine(_volume, indent);
file->writeNumberLine(_soundVal3, indent);
file->writeNumberLine(_fieldC8, indent);
file->writeNumberLine(_fieldCC, indent);
CGameObject::save(file, indent);
}
void CBarBell::load(SimpleFile *file) {
file->readNumber();
_fieldBC = file->readNumber();
_volume = file->readNumber();
_soundVal3 = file->readNumber();
_fieldC8 = file->readNumber();
_fieldCC = file->readNumber();
CGameObject::load(file);
}
bool CBarBell::EnterRoomMsg(CEnterRoomMsg *msg) {
_fieldBC = 0;
return true;
}
bool CBarBell::MouseButtonDownMsg(CMouseButtonDownMsg *msg) {
if ((_fieldC8 % 3) == 2) {
switch (_fieldBC) {
case 0:
case 1:
case 5:
playSound(TRANSLATE("c#54.wav", "c#38.wav"), _volume, _soundVal3);
break;
case 2:
playSound(TRANSLATE("c#52.wav", "c#36.wav"), _volume, _soundVal3);
break;
case 3:
playSound(TRANSLATE("c#53.wav", "c#37.wav"), _volume, _soundVal3);
break;
case 4:
playSound(TRANSLATE("c#55.wav", "c#39.wav"), _volume, _soundVal3);
break;
default:
playSound(TRANSLATE("c#51.wav", "c#35.wav"), _volume, _soundVal3);
break;
}
} else if (_fieldBC >= 5) {
if (_fieldBC == 6) {
CActMsg actMsg("BellRing3");
actMsg.execute("Barbot");
}
playSound(TRANSLATE("c#51.wav", "c#35.wav"), _volume, _soundVal3);
} else {
if (_fieldBC == 3) {
CActMsg actMsg("BellRing1");
actMsg.execute("Barbot");
} else if (_fieldBC == 4) {
CActMsg actMsg("BellRing2");
actMsg.execute("Barbot");
}
playSound(TRANSLATE("c#54.wav", "c#38.wav"), _volume, _soundVal3);
}
return true;
}
bool CBarBell::MouseButtonUpMsg(CMouseButtonUpMsg *msg) {
if (!_fieldBC) {
CTurnOn onMsg;
onMsg.execute("Barbot");
}
++_fieldBC;
return true;
}
bool CBarBell::ActMsg(CActMsg *msg) {
if (msg->_action == "ResetCount") {
_fieldBC = 0;
++_fieldC8;
}
return true;
}
} // End of namespace Titanic

View File

@@ -0,0 +1,59 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#ifndef TITANIC_BAR_BELL_H
#define TITANIC_BAR_BELL_H
#include "titanic/core/game_object.h"
#include "titanic/messages/messages.h"
namespace Titanic {
class CBarBell : public CGameObject {
DECLARE_MESSAGE_MAP;
bool EnterRoomMsg(CEnterRoomMsg *msg);
bool MouseButtonDownMsg(CMouseButtonDownMsg *msg);
bool MouseButtonUpMsg(CMouseButtonUpMsg *msg);
bool ActMsg(CActMsg *msg);
public:
int _fieldBC;
int _volume;
int _soundVal3;
int _fieldC8;
int _fieldCC;
public:
CLASSDEF;
CBarBell();
/**
* Save the data for the class to file
*/
void save(SimpleFile *file, int indent) override;
/**
* Load the data for the class from file
*/
void load(SimpleFile *file) override;
};
} // End of namespace Titanic
#endif /* TITANIC_BAR_BELL_H */

View File

@@ -0,0 +1,103 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#include "titanic/game/bar_menu.h"
namespace Titanic {
BEGIN_MESSAGE_MAP(CBarMenu, CGameObject)
ON_MESSAGE(PETActivateMsg)
ON_MESSAGE(PETDownMsg)
ON_MESSAGE(PETUpMsg)
ON_MESSAGE(EnterViewMsg)
ON_MESSAGE(LeaveViewMsg)
END_MESSAGE_MAP()
CBarMenu::CBarMenu() : CGameObject(), _barFrameNumber(0), _visibleFlag(false), _numFrames(6) {
}
void CBarMenu::save(SimpleFile *file, int indent) {
file->writeNumberLine(1, indent);
file->writeNumberLine(_barFrameNumber, indent);
file->writeNumberLine(_visibleFlag, indent);
file->writeNumberLine(_numFrames, indent);
CGameObject::save(file, indent);
}
void CBarMenu::load(SimpleFile *file) {
file->readNumber();
_barFrameNumber = file->readNumber();
_visibleFlag = file->readNumber();
_numFrames = file->readNumber();
CGameObject::load(file);
}
bool CBarMenu::PETActivateMsg(CPETActivateMsg *msg) {
if (msg->_name == "Television") {
_visibleFlag = !_visibleFlag;
setVisible(_visibleFlag);
loadFrame(_barFrameNumber);
}
return true;
}
bool CBarMenu::PETDownMsg(CPETDownMsg *msg) {
if (_visibleFlag) {
if (--_barFrameNumber < 0)
_barFrameNumber = _numFrames - 1;
loadFrame(_barFrameNumber);
}
return true;
}
bool CBarMenu::PETUpMsg(CPETUpMsg *msg) {
if (_visibleFlag) {
_barFrameNumber = (_barFrameNumber + 1) % _numFrames;
loadFrame(_barFrameNumber);
}
return true;
}
bool CBarMenu::EnterViewMsg(CEnterViewMsg *msg) {
petSetArea(PET_REMOTE);
petHighlightGlyph(2);
petSetRemoteTarget();
setVisible(_visibleFlag);
loadFrame(_barFrameNumber);
return true;
}
bool CBarMenu::LeaveViewMsg(CLeaveViewMsg *msg) {
petClear();
_visibleFlag = false;
setVisible(false);
return true;
}
} // End of namespace Titanic

View File

@@ -0,0 +1,58 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#ifndef TITANIC_BAR_MENU_H
#define TITANIC_BAR_MENU_H
#include "titanic/core/game_object.h"
#include "titanic/messages/pet_messages.h"
namespace Titanic {
class CBarMenu : public CGameObject {
DECLARE_MESSAGE_MAP;
bool PETActivateMsg(CPETActivateMsg *msg);
bool PETDownMsg(CPETDownMsg *msg);
bool PETUpMsg(CPETUpMsg *msg);
bool EnterViewMsg(CEnterViewMsg *msg);
bool LeaveViewMsg(CLeaveViewMsg *msg);
public:
int _barFrameNumber;
bool _visibleFlag;
int _numFrames;
public:
CLASSDEF;
CBarMenu();
/**
* Save the data for the class to file
*/
void save(SimpleFile *file, int indent) override;
/**
* Load the data for the class from file
*/
void load(SimpleFile *file) override;
};
} // End of namespace Titanic
#endif /* TITANIC_BAR_MENU_H */

View File

@@ -0,0 +1,60 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#include "titanic/game/bar_menu_button.h"
#include "titanic/messages/pet_messages.h"
namespace Titanic {
BEGIN_MESSAGE_MAP(CBarMenuButton, CGameObject)
ON_MESSAGE(MouseButtonDownMsg)
ON_MESSAGE(MouseButtonUpMsg)
END_MESSAGE_MAP()
void CBarMenuButton::save(SimpleFile *file, int indent) {
file->writeNumberLine(1, indent);
file->writeNumberLine(_value, indent);
CGameObject::save(file, indent);
}
void CBarMenuButton::load(SimpleFile *file) {
file->readNumber();
_value = file->readNumber();
CGameObject::load(file);
}
bool CBarMenuButton::MouseButtonDownMsg(CMouseButtonDownMsg *msg) {
return true;
}
bool CBarMenuButton::MouseButtonUpMsg(CMouseButtonUpMsg *msg) {
if (_value) {
CPETUpMsg upMsg("", -1);
upMsg.execute("BarTelevision");
} else {
CPETDownMsg downMsg("", -1);
downMsg.execute("BarTelevision");
}
return true;
}
} // End of namespace Titanic

View File

@@ -0,0 +1,52 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#ifndef TITANIC_BAR_MENU_BUTTON_H
#define TITANIC_BAR_MENU_BUTTON_H
#include "titanic/core/game_object.h"
namespace Titanic {
class CBarMenuButton : public CGameObject {
DECLARE_MESSAGE_MAP;
bool MouseButtonDownMsg(CMouseButtonDownMsg *msg);
bool MouseButtonUpMsg(CMouseButtonUpMsg *msg);
public:
int _value;
public:
CLASSDEF;
CBarMenuButton() : CGameObject(), _value(1) {}
/**
* Save the data for the class to file
*/
void save(SimpleFile *file, int indent) override;
/**
* Load the data for the class from file
*/
void load(SimpleFile *file) override;
};
} // End of namespace Titanic
#endif /* TITANIC_BAR_MENU_BUTTON_H */

View File

@@ -0,0 +1,77 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#include "titanic/game/belbot_get_light.h"
namespace Titanic {
BEGIN_MESSAGE_MAP(CBelbotGetLight, CGameObject)
ON_MESSAGE(ActMsg)
ON_MESSAGE(MovieEndMsg)
ON_MESSAGE(MovieFrameMsg)
ON_MESSAGE(EnterViewMsg)
END_MESSAGE_MAP()
void CBelbotGetLight::save(SimpleFile *file, int indent) {
file->writeNumberLine(1, indent);
file->writeQuotedLine(_value, indent);
CGameObject::save(file, indent);
}
void CBelbotGetLight::load(SimpleFile *file) {
file->readNumber();
_value = file->readString();
CGameObject::load(file);
}
bool CBelbotGetLight::ActMsg(CActMsg *msg) {
if (msg->_action == "BellbotGetLight") {
_value = getFullViewName();
lockMouse();
changeView("1stClassState.Node 11.N", "");
}
return true;
}
bool CBelbotGetLight::MovieEndMsg(CMovieEndMsg *msg) {
sleep(1000);
changeView(_value, "");
unlockMouse();
return true;
}
bool CBelbotGetLight::MovieFrameMsg(CMovieFrameMsg *msg) {
if (msg->_frameNumber == 37) {
CActMsg actMsg("BellbotGetLight");
actMsg.execute("Eye1");
}
return true;
}
bool CBelbotGetLight::EnterViewMsg(CEnterViewMsg *msg) {
playMovie(MOVIE_NOTIFY_OBJECT);
movieEvent(37);
return true;
}
} // End of namespace Titanic

View File

@@ -0,0 +1,53 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#ifndef TITANIC_BELBOT_GET_LIGHT_H
#define TITANIC_BELBOT_GET_LIGHT_H
#include "titanic/core/game_object.h"
namespace Titanic {
class CBelbotGetLight : public CGameObject {
DECLARE_MESSAGE_MAP;
bool ActMsg(CActMsg *msg);
bool MovieEndMsg(CMovieEndMsg *msg);
bool MovieFrameMsg(CMovieFrameMsg *msg);
bool EnterViewMsg(CEnterViewMsg *msg);
private:
CString _value;
public:
CLASSDEF;
/**
* Save the data for the class to file
*/
void save(SimpleFile *file, int indent) override;
/**
* Load the data for the class from file
*/
void load(SimpleFile *file) override;
};
} // End of namespace Titanic
#endif /* TITANIC_LIGHT_H */

View File

@@ -0,0 +1,477 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#include "titanic/game/bomb.h"
#include "titanic/game/code_wheel.h"
#include "titanic/translation.h"
namespace Titanic {
BEGIN_MESSAGE_MAP(CBomb, CBackground)
ON_MESSAGE(StatusChangeMsg)
ON_MESSAGE(EnterViewMsg)
ON_MESSAGE(MouseButtonDownMsg)
ON_MESSAGE(EnterRoomMsg)
ON_MESSAGE(ActMsg)
ON_MESSAGE(TurnOn)
ON_MESSAGE(TimerMsg)
ON_MESSAGE(TrueTalkGetStateValueMsg)
ON_MESSAGE(SetFrameMsg)
END_MESSAGE_MAP()
const int CORRECT_WHEELS = 23;
static const char *const HUNDREDS_WAVS_EN[] = {
"", "z#353.wav", "z#339.wav", "z#325.wav", "z#311.wav", "z#297.wav",
"z#283.wav", "z#269.wav", "z#255.wav", "z#241.wav"
};
static const char *const HUNDREDS_AND_WAVS_EN[] = {
"", "z#352.wav", "z#338.wav", "z#324.wav", "z#310.wav", "z#296.wav",
"z#281.wav", "z#268.wav", "z#254.wav", "z#240.wav"
};
static const char *const COUNTDOWN_WAVS_EN[100] = {
"bombcountdown_c0.wav", "z#355.wav", "z#341.wav", "z#327.wav", "z#313.wav",
"z#299.wav", "z#285.wav", "z#271.wav", "z#257.wav", "z#243.wav",
"z#354.wav", "z#350.wav", "z#349.wav", "z#348.wav", "z#347.wav",
"z#346.wav", "z#345.wav", "z#344.wav", "z#343.wav", "z#342.wav",
"z#340.wav", "z#336.wav", "z#335.wav", "z#334.wav", "z#333.wav",
"z#332.wav", "z#331.wav", "z#330.wav", "z#329.wav", "z#328.wav",
"z#326.wav", "z#322.wav", "z#321.wav", "z#320.wav", "z#319.wav",
"z#318.wav", "z#317.wav", "z#316.wav", "z#315.wav", "z#314.wav",
"z#312.wav", "z#308.wav", "z#307.wav", "z#306.wav", "z#305.wav",
"z#304.wav", "z#303.wav", "z#302.wav", "z#301.wav", "z#300.wav",
"z#298.wav", "z#294.wav", "z#293.wav", "z#292.wav", "z#291.wav",
"z#290.wav", "z#289.wav", "z#288.wav", "z#287.wav", "z#286.wav",
"z#284.wav", "z#280.wav", "z#279.wav", "z#278.wav", "z#277.wav",
"z#276.wav", "z#275.wav", "z#274.wav", "z#273.wav", "z#272.wav",
"z#270.wav", "z#266.wav", "z#265.wav", "z#264.wav", "z#263.wav",
"z#262.wav", "z#261.wav", "z#260.wav", "z#259.wav", "z#258.wav",
"z#256.wav", "z#252.wav", "z#251.wav", "z#250.wav", "z#249.wav",
"z#248.wav", "z#247.wav", "z#246.wav", "z#245.wav", "z#244.wav",
"z#242.wav", "z#238.wav", "z#237.wav", "z#236.wav", "z#235.wav",
"z#234.wav", "z#233.wav", "z#232.wav", "z#231.wav", "z#230.wav",
};
const char *const HUNDREDS_WAVS_DE[10] = {
"z#56.wav", "z#54.wav", "z#53.wav", "z#52.wav", "z#51.wav",
"z#50.wav", "z#49.wav", "z#48.wav", "z#47.wav", "z#55.wav"
};
const char *const ONE_TO_NINETEEN_WAVS_DE[19] = {
"z#15.wav", "z#97.wav", "z#95.wav", "z#86.wav", "z#84.wav",
"z#82.wav", "z#80.wav", "z#78.wav", "z#76.wav", "z#74.wav",
"z#73.wav", "z#72.wav", "z#71.wav", "z#70.wav", "z#69.wav",
"z#68.wav", "z#67.wav", "z#66.wav", "z#65.wav"
};
const char *const TENS_WAVS_DE[9] = {
"z#98.wav", "z#96.wav", "z#92.wav", "z#85.wav", "z#83.wav",
"z#81.wav", "z#79.wav", "z#77.wav", "z#75.wav"
};
const char *const DIGITS_WAVS_DE[9] = {
"z#74.wav", "z#64.wav", "z#63.wav", "z#62.wav", "z#61.wav",
"z#60.wav", "z#59.wav", "z#58.wav", "z#57.wav"
};
const char *const WAVES_970_DE[30] = {
"z#46.wav", "z#45.wav", "z#44.wav", "z#43.wav", "z#42.wav",
"z#41.wav", "z#40.wav", "z#39.wav", "z#38.wav", "z#37.wav",
"z#36.wav", "z#35.wav", "z#34.wav", "z#33.wav", "z#32.wav",
"z#31.wav", "z#30.wav", "z#29.wav", "z#28.wav", "z#27.wav",
"z#26.wav", "z#25.wav", "z#24.wav", "z#23.wav", "z#22.wav",
"z#21.wav", "z#20.wav", "z#19.wav", "z#18.wav", "z#17.wav"
};
CBomb::CBomb() : CBackground() {
_active = false;
_numCorrectWheels = 0;
_tappedCtr = 17;
_hammerCtr = 9;
_commentCtr = 0;
_countdown = 999;
_soundHandle = 0;
_unusedHandle = 0;
_startingTicks = 0;
_volume = 60;
}
void CBomb::save(SimpleFile *file, int indent) {
file->writeNumberLine(1, indent);
file->writeNumberLine(_active, indent);
file->writeNumberLine(_numCorrectWheels, indent);
file->writeNumberLine(_tappedCtr, indent);
file->writeNumberLine(_hammerCtr, indent);
file->writeNumberLine(_commentCtr, indent);
file->writeNumberLine(_countdown, indent);
file->writeNumberLine(_soundHandle, indent);
file->writeNumberLine(_unusedHandle, indent);
file->writeNumberLine(_startingTicks, indent);
file->writeNumberLine(_volume, indent);
CBackground::save(file, indent);
}
void CBomb::load(SimpleFile *file) {
file->readNumber();
_active = file->readNumber();
_numCorrectWheels = file->readNumber();
_tappedCtr = file->readNumber();
_hammerCtr = file->readNumber();
_commentCtr = file->readNumber();
_countdown = file->readNumber();
_soundHandle = file->readNumber();
_unusedHandle = file->readNumber();
_startingTicks = file->readNumber();
_volume = file->readNumber();
CBackground::load(file);
}
bool CBomb::StatusChangeMsg(CStatusChangeMsg *msg) {
// Check whether the wheels are corect
CCheckCodeWheelsMsg checkMsg;
checkMsg.execute(findRoom(), nullptr, MSGFLAG_SCAN);
_numCorrectWheels = checkMsg._isCorrect ? CORRECT_WHEELS : 0;
if (_numCorrectWheels == CORRECT_WHEELS) {
// Nobody likes a smartass
startAnimTimer("Disarmed", 2000);
lockMouse();
}
_commentCtr = (_commentCtr % 1000) + 1;
if (!(_commentCtr % 20) && _countdown < 995) {
int val = getRandomNumber(5) + 25;
if (_commentCtr < 20 || _commentCtr > 80)
val = 28;
CString name;
switch (val) {
case 25:
name = TRANSLATE("z#372.wav", "z#115.wav");
break;
case 26:
name = TRANSLATE("z#371.wav", "z#114.wav");
break;
case 27:
name = TRANSLATE("z#370.wav", "z#113.wav");
break;
case 28:
name = TRANSLATE("z#369.wav", "z#112.wav");
break;
case 29:
name = TRANSLATE("z#368.wav", "z#111.wav");
break;
default:
name = TRANSLATE("z#366.wav", "z#109.wav");
break;
}
_soundHandle = queueSound(name, _soundHandle, _volume, 0, false, Audio::Mixer::kSpeechSoundType);
}
return true;
}
bool CBomb::EnterViewMsg(CEnterViewMsg *msg) {
// WORKAROUND: Don't keep resetting wheels
return true;
}
bool CBomb::MouseButtonDownMsg(CMouseButtonDownMsg *msg) {
playSound(TRANSLATE("z#62.wav", "z#593.wav"));
if (_active) {
stopSound(_soundHandle);
if (_numCorrectWheels < CORRECT_WHEELS) {
_tappedCtr = MIN(_tappedCtr + 1, 23);
CString name;
switch (_tappedCtr) {
case 18:
name = TRANSLATE("z#380.wav", "z#122.wav");
break;
case 19:
name = TRANSLATE("z#379.wav", "z#121.wav");
break;
case 20:
name = TRANSLATE("z#377.wav", "z#119.wav");
break;
case 21:
name = TRANSLATE("z#376.wav", "z#118.wav");
break;
case 22:
name = TRANSLATE("z#375.wav", "z#117.wav");
break;
default:
name = TRANSLATE("z#374.wav", "z#116.wav");
break;
}
_soundHandle = queueSound(name, _soundHandle, _volume, 0, false, Audio::Mixer::kSpeechSoundType);
_countdown = 999;
}
} else {
_soundHandle = playSound(TRANSLATE("z#389.wav", "z#131.wav"), _volume);
_active = true;
CActMsg actMsg("Arm Bomb");
actMsg.execute("EndExplodeShip");
}
return true;
}
bool CBomb::EnterRoomMsg(CEnterRoomMsg *msg) {
_tappedCtr = 17;
_hammerCtr = 9;
_commentCtr = 0;
_startingTicks = getTicksCount();
return true;
}
bool CBomb::ActMsg(CActMsg *msg) {
if (msg->_action == "Hit") {
playSound(TRANSLATE("z#63.wav", "z#594.wav"));
stopSound(_soundHandle);
if (_hammerCtr < 17)
++_hammerCtr;
CString name;
switch (_hammerCtr) {
case 10:
name = TRANSLATE("z#388.wav", "z#130.wav");
break;
case 11:
name = TRANSLATE("z#387.wav", "z#129.wav");
break;
case 12:
name = TRANSLATE("z#386.wav", "z#128.wav");
break;
case 13:
name = TRANSLATE("z#385.wav", "z#127.wav");
break;
case 14:
name = TRANSLATE("z#384.wav", "z#126.wav");
break;
case 15:
name = TRANSLATE("z#383.wav", "z#125.wav");
break;
case 16:
name = TRANSLATE("z#382.wav", "z#124.wav");
break;
default:
name = TRANSLATE("z#381.wav", "z#123.wav");
break;
}
_soundHandle = queueSound(name, _soundHandle, _volume, 0, false, Audio::Mixer::kSpeechSoundType);
_countdown = 999;
}
return true;
}
bool CBomb::TurnOn(CTurnOn *msg) {
if (!_active) {
CProximity prox(Audio::Mixer::kSpeechSoundType, _volume);
_soundHandle = playSound(TRANSLATE("z#389.wav", "z#131.wav"), prox);
_active = true;
// WORKAROUND: Only reset the code wheels back to 'O' value
// when first arming the bomb, not whenever the bomb view is entered
_numCorrectWheels = 2;
CRoomItem *room = findRoom();
for (CTreeItem *treeItem = room; treeItem; treeItem = treeItem->scan(room)) {
CodeWheel *codeWheel = dynamic_cast<CodeWheel *>(treeItem);
if (codeWheel)
codeWheel->reset();
}
CActMsg actMsg("Arm Bomb");
actMsg.execute("EndExplodeShip");
addTimer(0);
}
changeView("Titania.Node 8.W", "");
CActMsg actMsg("Titania.Node 8.N");
actMsg.execute("BombNav");
actMsg.execute("EnterBombRoom");
return true;
}
bool CBomb::TimerMsg(CTimerMsg *msg) {
if (msg->_action == "Disarmed") {
CProximity prox(Audio::Mixer::kSpeechSoundType, _volume);
stopSound(_soundHandle);
playSound(TRANSLATE("z#364.wav", "z#107.wav"), prox);
CActMsg actMsg1("Disarm Bomb");
actMsg1.execute("EndExplodeShip");
_active = false;
CActMsg actMsg2("Titania.Node 5.N");
actMsg2.execute("BombNav");
actMsg2.execute("EnterBombNav");
changeView("Titania.Node 8.W", "");
changeView("Titania.Node 13.N", "");
unlockMouse();
}
if (!compareRoomNameTo("Titania")) {
// In rooms other than the bomb room
if (_active) {
--_countdown;
addTimer(6000);
if (_countdown < 11)
_countdown = getRandomNumber(900) + 50;
}
return true;
}
if (msg->_actionVal == 1 && getRandomNumber(9) == 0) {
if (!_active)
return true;
CParrotSpeakMsg speakMsg("Bomb", "BombCountdown");
speakMsg.execute("PerchedParrot");
}
// Don't execute if the bomb isn't actually active
if (!_active)
return true;
if (isSoundActive(_soundHandle)) {
// Bomb speech currently active, so schedule the method
// to re-trigger after 100ms to check if speech is finished
addTimer(0, 100, 0);
return true;
}
if (msg->_actionVal == 0) {
addTimer(1, 1000, 0);
} else {
_soundHandle = 0;
int hundreds = _countdown / 100;
int remainder = _countdown % 100;
if (g_language == Common::DE_DEU) {
if (_countdown <= 10) {
// Reset countdown back to 1000
CProximity prox(Audio::Mixer::kSpeechSoundType, _volume);
_soundHandle = playSound("z#14.wav", prox);
_countdown = 999;
} else {
if (_countdown >= 970) {
// Sounds for numbers 970 to 999
CProximity prox(Audio::Mixer::kSpeechSoundType, _volume);
_soundHandle = playSound(WAVES_970_DE[_countdown - 970], prox);
} else {
if (hundreds >= 1) {
CProximity prox(Audio::Mixer::kSpeechSoundType, _volume);
_soundHandle = playSound(HUNDREDS_WAVS_DE[hundreds - 1], prox);
}
if (remainder >= 20) {
int tens = remainder / 10;
int digit = remainder % 10;
// Tens
const char *tensStr = TENS_WAVS_DE[tens - 1];
if (_soundHandle) {
_soundHandle = queueSound(tensStr, _soundHandle,
_volume, 0, false, Audio::Mixer::kSpeechSoundType);
} else {
CProximity prox(Audio::Mixer::kSpeechSoundType, _volume);
_soundHandle = playSound(tensStr, prox);
}
// Digit
if (digit != 0) {
const char *digitStr = DIGITS_WAVS_DE[digit - 1];
_soundHandle = queueSound(digitStr, _soundHandle,
_volume, 0, false, Audio::Mixer::kSpeechSoundType);
}
} else if (remainder != 0) {
// One to nineteen
const char *name = ONE_TO_NINETEEN_WAVS_DE[remainder - 1];
if (_soundHandle) {
_soundHandle = queueSound(name, _soundHandle,
_volume, 0, false, Audio::Mixer::kSpeechSoundType);
} else {
CProximity prox(Audio::Mixer::kSpeechSoundType, _volume);
_soundHandle = playSound(name, prox);
}
}
}
}
} else {
if (_countdown >= 100) {
// Play "x hundred and" or just "x hundred"
CProximity prox(Audio::Mixer::kSpeechSoundType, _volume);
CString hName = remainder ? HUNDREDS_AND_WAVS_EN[hundreds] : HUNDREDS_WAVS_EN[hundreds];
_soundHandle = playSound(hName, prox);
}
CString ctrName = COUNTDOWN_WAVS_EN[remainder];
if (_countdown == 10) {
ctrName = "z#229.wav";
_countdown = 998;
}
// Play the sub-hundred portion of the countdown amount
if (_soundHandle > 0) {
_soundHandle = queueSound(ctrName, _soundHandle, _volume, 0, false, Audio::Mixer::kSpeechSoundType);
} else {
CProximity prox(Audio::Mixer::kSpeechSoundType, _volume);
_soundHandle = playSound(ctrName, prox);
}
}
// Reduce countdown and schedule another timer
--_countdown;
addTimer(0, 1000, 0);
}
return true;
}
bool CBomb::TrueTalkGetStateValueMsg(CTrueTalkGetStateValueMsg *msg) {
if (msg->_stateNum == 10)
msg->_stateVal = _active ? 1 : 0;
return true;
}
bool CBomb::SetFrameMsg(CSetFrameMsg *msg) {
_volume = msg->_frameNumber;
return true;
}
} // End of namespace Titanic

View File

@@ -0,0 +1,69 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#ifndef TITANIC_BOMB_H
#define TITANIC_BOMB_H
#include "titanic/core/background.h"
#include "titanic/messages/messages.h"
namespace Titanic {
class CBomb : public CBackground {
bool StatusChangeMsg(CStatusChangeMsg *msg);
bool EnterViewMsg(CEnterViewMsg *msg);
bool MouseButtonDownMsg(CMouseButtonDownMsg *msg);
bool EnterRoomMsg(CEnterRoomMsg *msg);
bool ActMsg(CActMsg *msg);
bool TurnOn(CTurnOn *msg);
bool TimerMsg(CTimerMsg *msg);
bool TrueTalkGetStateValueMsg(CTrueTalkGetStateValueMsg *msg);
bool SetFrameMsg(CSetFrameMsg *msg);
DECLARE_MESSAGE_MAP;
private:
bool _active;
int _numCorrectWheels;
int _tappedCtr;
int _hammerCtr;
int _commentCtr;
int _countdown;
int _soundHandle;
int _unusedHandle;
int _startingTicks;
int _volume;
public:
CLASSDEF;
CBomb();
/**
* Save the data for the class to file
*/
void save(SimpleFile *file, int indent) override;
/**
* Load the data for the class from file
*/
void load(SimpleFile *file) override;
};
} // End of namespace Titanic
#endif /* TITANIC_BOMB_H */

View File

@@ -0,0 +1,113 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#include "titanic/game/bottom_of_well_monitor.h"
namespace Titanic {
BEGIN_MESSAGE_MAP(CBottomOfWellMonitor, CGameObject)
ON_MESSAGE(ActMsg)
ON_MESSAGE(MouseButtonDownMsg)
ON_MESSAGE(EnterViewMsg)
ON_MESSAGE(LeaveViewMsg)
END_MESSAGE_MAP()
bool CBottomOfWellMonitor::_tvPresent;
bool CBottomOfWellMonitor::_headPresent;
void CBottomOfWellMonitor::save(SimpleFile *file, int indent) {
file->writeNumberLine(1, indent);
file->writeNumberLine(_tvPresent, indent);
file->writeNumberLine(_headPresent, indent);
file->writeNumberLine(_flag, indent);
CGameObject::save(file, indent);
}
void CBottomOfWellMonitor::load(SimpleFile *file) {
file->readNumber();
_tvPresent = file->readNumber();
_headPresent = file->readNumber();
_flag = file->readNumber();
CGameObject::load(file);
}
bool CBottomOfWellMonitor::ActMsg(CActMsg *msg) {
if (msg->_action == "ThrownTVDownWell") {
_tvPresent = true;
CVisibleMsg visibleMsg;
visibleMsg.execute("CrushedTV2NE");
visibleMsg.execute("CrushedTV4SW");
_cursorId = CURSOR_LOOK_DOWN;
} else if (msg->_action == "TelevisionTaken") {
_tvPresent = false;
_cursorId = CURSOR_ARROW;
CVisibleMsg visibleMsg;
visibleMsg.execute("CrushedTV2NE");
visibleMsg.execute("CrushedTV4SW");
_cursorId = CURSOR_ARROW;
} else if (msg->_action == "LiftbotHeadTaken") {
_headPresent = false;
_cursorId = CURSOR_ARROW;
CVisibleMsg visibleMsg;
visibleMsg.execute("LiftbotHead2NE");
visibleMsg.execute("LiftbotHead4SW");
_cursorId = CURSOR_ARROW;
}
return true;
}
bool CBottomOfWellMonitor::MouseButtonDownMsg(CMouseButtonDownMsg *msg) {
if (isEquals("BOWTelevisionMonitor")) {
if (_tvPresent)
changeView("BottomOfWell.Node 7.N", "");
} else {
if (_headPresent)
changeView("BottomOfWell.Node 8.N", "");
}
return true;
}
bool CBottomOfWellMonitor::EnterViewMsg(CEnterViewMsg *msg) {
if (_flag) {
if (isEquals("BOWTelevisionMonitor")) {
if (_tvPresent) {
changeView("BottomOfWell.Node 7.N", "");
_flag = false;
}
} else {
if (_headPresent) {
changeView("BottomOfWell.Node 8.N", "");
_flag = false;
}
}
}
return true;
}
bool CBottomOfWellMonitor::LeaveViewMsg(CLeaveViewMsg *msg) {
_flag = true;
return true;
}
} // End of namespace Titanic

View File

@@ -0,0 +1,56 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#ifndef TITANIC_BOTTOM_OF_WELL_MONITOR_H
#define TITANIC_BOTTOM_OF_WELL_MONITOR_H
#include "titanic/core/game_object.h"
namespace Titanic {
class CBottomOfWellMonitor : public CGameObject {
DECLARE_MESSAGE_MAP;
bool ActMsg(CActMsg *msg);
bool MouseButtonDownMsg(CMouseButtonDownMsg *msg);
bool EnterViewMsg(CEnterViewMsg *msg);
bool LeaveViewMsg(CLeaveViewMsg *msg);
public:
static bool _tvPresent;
static bool _headPresent;
bool _flag;
public:
CLASSDEF;
CBottomOfWellMonitor() : _flag(true) {}
/**
* Save the data for the class to file
*/
void save(SimpleFile *file, int indent) override;
/**
* Load the data for the class from file
*/
void load(SimpleFile *file) override;
};
} // End of namespace Titanic
#endif /* TITANIC_BOTTOM_OF_WELL_MONITOR_H */

View File

@@ -0,0 +1,78 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#include "titanic/game/bowl_unlocker.h"
#include "titanic/core/room_item.h"
#include "titanic/translation.h"
namespace Titanic {
BEGIN_MESSAGE_MAP(CBowlUnlocker, CGameObject)
ON_MESSAGE(NutPuzzleMsg)
ON_MESSAGE(MovieEndMsg)
ON_MESSAGE(MouseButtonDownMsg)
ON_MESSAGE(LeaveViewMsg)
END_MESSAGE_MAP()
void CBowlUnlocker::save(SimpleFile *file, int indent) {
file->writeNumberLine(1, indent);
file->writeNumberLine(_bowlUnlocked, indent);
CGameObject::save(file, indent);
}
void CBowlUnlocker::load(SimpleFile *file) {
file->readNumber();
_bowlUnlocked = file->readNumber();
CGameObject::load(file);
}
bool CBowlUnlocker::NutPuzzleMsg(CNutPuzzleMsg *msg) {
if (msg->_action == "UnlockBowl") {
setVisible(true);
playMovie(MOVIE_NOTIFY_OBJECT);
}
return true;
}
bool CBowlUnlocker::MovieEndMsg(CMovieEndMsg *msg) {
setVisible(false);
_bowlUnlocked = true;
CNutPuzzleMsg puzzleMsg("BowlUnlocked");
puzzleMsg.execute(getRoom(), nullptr, MSGFLAG_SCAN);
playSound(TRANSLATE("z#47.wav", "z#578.wav"));
return true;
}
bool CBowlUnlocker::MouseButtonDownMsg(CMouseButtonDownMsg *msg) {
if (_bowlUnlocked)
msg->execute("Ear1");
return true;
}
bool CBowlUnlocker::LeaveViewMsg(CLeaveViewMsg *msg) {
_bowlUnlocked = false;
return true;
}
} // End of namespace Titanic

View File

@@ -0,0 +1,54 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#ifndef TITANIC_BOWL_UNLOCKER_H
#define TITANIC_BOWL_UNLOCKER_H
#include "titanic/core/game_object.h"
namespace Titanic {
class CBowlUnlocker : public CGameObject {
DECLARE_MESSAGE_MAP;
bool NutPuzzleMsg(CNutPuzzleMsg *msg);
bool MovieEndMsg(CMovieEndMsg *msg);
bool MouseButtonDownMsg(CMouseButtonDownMsg *msg);
bool LeaveViewMsg(CLeaveViewMsg *msg);
public:
bool _bowlUnlocked;
public:
CLASSDEF;
CBowlUnlocker() : CGameObject(), _bowlUnlocked(false) {}
/**
* Save the data for the class to file
*/
void save(SimpleFile *file, int indent) override;
/**
* Load the data for the class from file
*/
void load(SimpleFile *file) override;
};
} // End of namespace Titanic
#endif /* TITANIC_BOWL_UNLOCKER_H */

View File

@@ -0,0 +1,148 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#include "titanic/game/brain_slot.h"
#include "titanic/core/project_item.h"
namespace Titanic {
BEGIN_MESSAGE_MAP(CBrainSlot, CGameObject)
ON_MESSAGE(SetFrameMsg)
ON_MESSAGE(AddHeadPieceMsg)
ON_MESSAGE(EnterViewMsg)
ON_MESSAGE(ActMsg)
ON_MESSAGE(MouseDragStartMsg)
END_MESSAGE_MAP()
int CBrainSlot::_numAdded;
bool CBrainSlot::_woken;
void CBrainSlot::save(SimpleFile *file, int indent) {
file->writeNumberLine(1, indent);
file->writeNumberLine(_occupied, indent);
file->writeQuotedLine(_target, indent);
file->writeNumberLine(_numAdded, indent);
file->writeNumberLine(_woken, indent);
CGameObject::save(file, indent);
}
void CBrainSlot::load(SimpleFile *file) {
file->readNumber();
_occupied = file->readNumber();
_target = file->readString();
_numAdded = file->readNumber();
_woken = file->readNumber();
CGameObject::load(file);
}
bool CBrainSlot::SetFrameMsg(CSetFrameMsg *msg) {
loadFrame(msg->_frameNumber);
_occupied = true;
return true;
}
bool CBrainSlot::AddHeadPieceMsg(CAddHeadPieceMsg *msg) {
_numAdded++;
_cursorId = CURSOR_HAND;
CAddHeadPieceMsg addMsg("NULL");
if (isEquals("AuditoryCentreSlot")) {
if (msg->_value == "AuditoryCentre")
addMsg._value = "AuditoryCentre";
} else if (isEquals("SpeechCentreSlot")) {
if (msg->_value == "SpeechCentre")
addMsg._value = "SpeechCentre";
} else if (isEquals("OlfactoryCentreSlot")) {
if (msg->_value == "OlfactoryCentre")
addMsg._value = "OlfactoryCentre";
} else if (isEquals("VisionCentreSlot")) {
if (msg->_value == "VisionCentre")
addMsg._value = "VisionCentre";
} else if (isEquals("CentralCoreSlot")) {
if (msg->_value == "CentralCore")
addMsg._value = "CentralCore";
}
if (addMsg._value != "NULL")
addMsg.execute("TitaniaControl");
if (msg->_value == "OlfactoryCentre")
loadFrame(2);
else if (msg->_value == "AuditoryCentre")
loadFrame(1);
else if (msg->_value == "SpeechCentre")
loadFrame(3);
else if (msg->_value == "VisionCentre")
loadFrame(4);
else if (msg->_value == "CentralCore") {
CActMsg actMsg("Insert Central Core");
actMsg.execute("CentralCoreSlot");
}
_target = msg->_value;
_occupied = true;
return true;
}
bool CBrainSlot::EnterViewMsg(CEnterViewMsg *msg) {
if (getName() == "CentralCoreSlot")
loadFrame(21);
if (_woken)
_cursorId = CURSOR_ARROW;
return true;
}
bool CBrainSlot::ActMsg(CActMsg *msg) {
if (msg->_action == "Insert Central Core")
playMovie(0, 21, 0);
else if (msg->_action == "Woken")
_woken = true;
return true;
}
bool CBrainSlot::MouseDragStartMsg(CMouseDragStartMsg *msg) {
if (!_occupied || _woken || !checkPoint(msg->_mousePos, false, true))
return false;
_cursorId = CURSOR_ARROW;
CVisibleMsg visibleMsg(true);
visibleMsg.execute(_target);
CTakeHeadPieceMsg takeMsg(_target);
takeMsg.execute("TitaniaControl");
loadFrame(isEquals("CentralCoreSlot") ? 21 : 0);
_occupied = false;
CPassOnDragStartMsg passMsg;
passMsg._mousePos = msg->_mousePos;
passMsg.execute(_target);
msg->_dragItem = getRoot()->findByName(_target);
_numAdded--;
return true;
}
} // End of namespace Titanic

View File

@@ -0,0 +1,59 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#ifndef TITANIC_BRAIN_SLOT_H
#define TITANIC_BRAIN_SLOT_H
#include "titanic/core/game_object.h"
namespace Titanic {
class CBrainSlot : public CGameObject {
DECLARE_MESSAGE_MAP;
bool SetFrameMsg(CSetFrameMsg *msg);
bool AddHeadPieceMsg(CAddHeadPieceMsg *msg);
bool EnterViewMsg(CEnterViewMsg *msg);
bool ActMsg(CActMsg *msg);
bool MouseDragStartMsg(CMouseDragStartMsg *msg);
public:
static int _numAdded;
static bool _woken;
public:
bool _occupied;
CString _target;
public:
CLASSDEF;
CBrainSlot() : CGameObject(), _occupied(false) {}
/**
* Save the data for the class to file
*/
void save(SimpleFile *file, int indent) override;
/**
* Load the data for the class from file
*/
void load(SimpleFile *file) override;
};
} // End of namespace Titanic
#endif /* TITANIC_BRAIN_SLOT_H */

View File

@@ -0,0 +1,61 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#include "titanic/game/bridge_door.h"
namespace Titanic {
BEGIN_MESSAGE_MAP(CBridgeDoor, CGameObject)
ON_MESSAGE(MouseButtonDownMsg)
ON_MESSAGE(StatusChangeMsg)
ON_MESSAGE(MovieEndMsg)
END_MESSAGE_MAP()
void CBridgeDoor::save(SimpleFile *file, int indent) {
file->writeNumberLine(1, indent);
CGameObject::save(file, indent);
}
void CBridgeDoor::load(SimpleFile *file) {
file->readNumber();
CGameObject::load(file);
}
bool CBridgeDoor::MouseButtonDownMsg(CMouseButtonDownMsg *msg) {
setVisible(true);
playMovie(0, 6, 0);
changeView("Titania.Node 12.N");
return true;
}
bool CBridgeDoor::StatusChangeMsg(CStatusChangeMsg *msg) {
setVisible(true);
playMovie(7, 0, MOVIE_NOTIFY_OBJECT);
return true;
}
bool CBridgeDoor::MovieEndMsg(CMovieEndMsg *msg) {
setVisible(false);
return true;
}
} // End of namespace Titanic

View File

@@ -0,0 +1,50 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#ifndef TITANIC_BRIDGE_DOOR_H
#define TITANIC_BRIDGE_DOOR_H
#include "titanic/core/game_object.h"
namespace Titanic {
class CBridgeDoor : public CGameObject {
DECLARE_MESSAGE_MAP;
bool MouseButtonDownMsg(CMouseButtonDownMsg *msg);
bool StatusChangeMsg(CStatusChangeMsg *msg);
bool MovieEndMsg(CMovieEndMsg *msg);
public:
CLASSDEF;
/**
* Save the data for the class to file
*/
void save(SimpleFile *file, int indent) override;
/**
* Load the data for the class from file
*/
void load(SimpleFile *file) override;
};
} // End of namespace Titanic
#endif /* TITANIC_BRIDGE_DOOR_H */

View File

@@ -0,0 +1,120 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#include "titanic/game/bridge_view.h"
#include "titanic/translation.h"
namespace Titanic {
BEGIN_MESSAGE_MAP(CBridgeView, CBackground)
ON_MESSAGE(ActMsg)
ON_MESSAGE(MovieEndMsg)
END_MESSAGE_MAP()
void CBridgeView::save(SimpleFile *file, int indent) {
file->writeNumberLine(1, indent);
file->writeNumberLine(_action, indent);
CBackground::save(file, indent);
}
void CBridgeView::load(SimpleFile *file) {
file->readNumber();
_action = (BridgeAction)file->readNumber();
CBackground::load(file);
}
bool CBridgeView::ActMsg(CActMsg *msg) {
CTurnOn onMsg;
CSetVolumeMsg volumeMsg;
volumeMsg._secondsTransition = 1;
if (msg->_action == "End") {
_action = BA_ENDING2;
petLockInput();
petHide();
setVisible(true);
playMovie(MOVIE_NOTIFY_OBJECT);
} else if (msg->_action == "Go") {
_action = BA_GO;
setVisible(true);
hideMouse();
volumeMsg._volume = 100;
volumeMsg.execute("EngineSounds");
onMsg.execute("EngineSounds");
playMovie(MOVIE_NOTIFY_OBJECT);
} else {
volumeMsg._volume = 50;
volumeMsg.execute("EngineSounds");
onMsg.execute("EngineSounds");
if (msg->_action == "Cruise") {
_action = BA_CRUISE;
setVisible(true);
hideMouse();
playMovie(MOVIE_NOTIFY_OBJECT);
} else if (msg->_action == "GoEnd") {
_action = BA_ENDING1;
setVisible(true);
hideMouse();
CChangeMusicMsg musicMsg;
musicMsg._action = MUSIC_STOP;
musicMsg.execute("BridgeAutoMusicPlayer");
playSound(TRANSLATE("a#42.wav", "a#35.wav"));
playMovie(MOVIE_NOTIFY_OBJECT);
}
}
return true;
}
bool CBridgeView::MovieEndMsg(CMovieEndMsg *msg) {
CTurnOff offMsg;
offMsg.execute("EngineSounds");
switch (_action) {
case BA_GO:
case BA_CRUISE:
setVisible(false);
showMouse();
decTransitions();
break;
case BA_ENDING1: {
setVisible(false);
CActMsg actMsg("End");
actMsg.execute("HomeSequence");
break;
}
case BA_ENDING2:
setVisible(false);
changeView("TheEnd.Node 3.N");
break;
default:
break;
}
return true;
}
} // End of namespace Titanic

View File

@@ -0,0 +1,56 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#ifndef TITANIC_BRIDGE_VIEW_H
#define TITANIC_BRIDGE_VIEW_H
#include "titanic/core/background.h"
namespace Titanic {
enum BridgeAction {
BA_NONE = 0, BA_GO = 1, BA_CRUISE = 2, BA_ENDING1 = 3, BA_ENDING2 = 4
};
class CBridgeView : public CBackground {
DECLARE_MESSAGE_MAP;
bool ActMsg(CActMsg *msg);
bool MovieEndMsg(CMovieEndMsg *msg);
public:
BridgeAction _action;
public:
CLASSDEF;
CBridgeView() : CBackground(), _action(BA_NONE) {}
/**
* Save the data for the class to file
*/
void save(SimpleFile *file, int indent) override;
/**
* Load the data for the class from file
*/
void load(SimpleFile *file) override;
};
} // End of namespace Titanic
#endif /* TITANIC_BRIDGE_VIEW_H */

View File

@@ -0,0 +1,47 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#include "titanic/game/broken_pell_base.h"
namespace Titanic {
EMPTY_MESSAGE_MAP(CBrokenPellBase, CBackground);
bool CBrokenPellBase::_pelleratorOpen;
bool CBrokenPellBase::_gottenHose;
void CBrokenPellBase::save(SimpleFile *file, int indent) {
file->writeNumberLine(1, indent);
file->writeNumberLine(_pelleratorOpen, indent);
file->writeNumberLine(_gottenHose, indent);
file->writeNumberLine(_closeAction, indent);
CBackground::save(file, indent);
}
void CBrokenPellBase::load(SimpleFile *file) {
file->readNumber();
_pelleratorOpen = file->readNumber();
_gottenHose = file->readNumber();
_closeAction = (CloseAction)file->readNumber();
CBackground::load(file);
}
} // End of namespace Titanic

View File

@@ -0,0 +1,55 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#ifndef TITANIC_BROKEN_PELL_BASE_H
#define TITANIC_BROKEN_PELL_BASE_H
#include "titanic/core/background.h"
namespace Titanic {
enum CloseAction { CLOSE_NONE = 0, CLOSE_LEFT = 1, CLOSE_RIGHT = 2 };
class CBrokenPellBase : public CBackground {
DECLARE_MESSAGE_MAP;
protected:
static bool _pelleratorOpen;
static bool _gottenHose;
CloseAction _closeAction;
public:
CLASSDEF;
CBrokenPellBase() : CBackground(), _closeAction(CLOSE_NONE) {}
/**
* Save the data for the class to file
*/
void save(SimpleFile *file, int indent) override;
/**
* Load the data for the class from file
*/
void load(SimpleFile *file) override;
};
} // End of namespace Titanic
#endif /* TITANIC_BROKEN_PELL_BASE_H */

View File

@@ -0,0 +1,157 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#include "titanic/game/broken_pellerator.h"
#include "titanic/core/view_item.h"
namespace Titanic {
BEGIN_MESSAGE_MAP(CBrokenPellerator, CBrokenPellBase)
ON_MESSAGE(MouseButtonDownMsg)
ON_MESSAGE(LeaveViewMsg)
ON_MESSAGE(ActMsg)
ON_MESSAGE(MovieEndMsg)
END_MESSAGE_MAP()
void CBrokenPellerator::save(SimpleFile *file, int indent) {
file->writeNumberLine(1, indent);
file->writeQuotedLine(_exitLeftView, indent);
file->writeQuotedLine(_exitRightView, indent);
file->writeQuotedLine(_string4, indent);
file->writeQuotedLine(_string5, indent);
CBrokenPellBase::save(file, indent);
}
void CBrokenPellerator::load(SimpleFile *file) {
file->readNumber();
_exitLeftView = file->readString();
_exitRightView = file->readString();
_string4 = file->readString();
_string5 = file->readString();
CBrokenPellBase::load(file);
}
bool CBrokenPellerator::MouseButtonDownMsg(CMouseButtonDownMsg *msg) {
if (_pelleratorOpen) {
changeView(_gottenHose ? _string5 : _string4);
} else {
if (_gottenHose) {
playMovie(28, 43, 0);
} else {
playMovie(0, 14, MOVIE_NOTIFY_OBJECT);
}
_pelleratorOpen = true;
}
return true;
}
bool CBrokenPellerator::LeaveViewMsg(CLeaveViewMsg *msg) {
CString name = msg->_newView->getNodeViewName();
if (name == "Node 3.S" || name == "Node 3.N") {
_pelleratorOpen = false;
loadFrame(0);
}
return true;
}
bool CBrokenPellerator::ActMsg(CActMsg *msg) {
if (msg->_action == "PlayerGetsHose") {
_gottenHose = true;
loadFrame(43);
CStatusChangeMsg statusMsg;
statusMsg.execute("PickupHose");
} else {
_closeAction = CLOSE_NONE;
bool closeFlag = msg->_action == "Close";
if (msg->_action == "CloseLeft") {
closeFlag = true;
_closeAction = CLOSE_LEFT;
}
if (msg->_action == "CloseRight") {
closeFlag = true;
_closeAction = CLOSE_RIGHT;
}
if (closeFlag) {
if (_pelleratorOpen) {
_pelleratorOpen = false;
if (_gottenHose)
playMovie(43, 57, MOVIE_NOTIFY_OBJECT);
else
playMovie(14, 28, MOVIE_NOTIFY_OBJECT);
} else {
switch (_closeAction) {
case 1:
changeView(_exitLeftView);
break;
case 2:
changeView(_exitRightView);
break;
default:
break;
}
_closeAction = CLOSE_NONE;
}
}
}
return true;
}
bool CBrokenPellerator::MovieEndMsg(CMovieEndMsg *msg) {
if (msg->_endFrame == 14) {
// Pellerator has been opened, so let the hose be picked up (if it's still there)
CStatusChangeMsg statusMsg;
statusMsg._newStatus = 1;
statusMsg.execute("PickUpHose");
}
if (msg->_endFrame == 28) {
// Pellerator has been closed, so disable the hose (if it's still there)
CStatusChangeMsg statusMsg;
statusMsg._newStatus = 0;
statusMsg.execute("PickUpHose");
}
switch (_closeAction) {
case 1:
changeView(_exitLeftView);
_closeAction = CLOSE_NONE;
break;
case 2:
changeView(_exitRightView);
_closeAction = CLOSE_NONE;
break;
default:
break;
}
return true;
}
} // End of namespace Titanic

View File

@@ -0,0 +1,56 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#ifndef TITANIC_BROKEN_PELLERATOR_H
#define TITANIC_BROKEN_PELLERATOR_H
#include "titanic/game/broken_pell_base.h"
namespace Titanic {
class CBrokenPellerator : public CBrokenPellBase {
DECLARE_MESSAGE_MAP;
bool MouseButtonDownMsg(CMouseButtonDownMsg *msg);
bool LeaveViewMsg(CLeaveViewMsg *msg);
bool ActMsg(CActMsg *msg);
bool MovieEndMsg(CMovieEndMsg *msg);
private:
CString _exitLeftView;
CString _exitRightView;
CString _string4;
CString _string5;
public:
CLASSDEF;
/**
* Save the data for the class to file
*/
void save(SimpleFile *file, int indent) override;
/**
* Load the data for the class from file
*/
void load(SimpleFile *file) override;
};
} // End of namespace Titanic
#endif /* TITANIC_BROKEN_PELLERATOR_H */

View File

@@ -0,0 +1,150 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#include "titanic/game/broken_pellerator_froz.h"
#include "titanic/core/view_item.h"
namespace Titanic {
BEGIN_MESSAGE_MAP(CBrokenPelleratorFroz, CBrokenPellBase)
ON_MESSAGE(MouseButtonDownMsg)
ON_MESSAGE(LeaveViewMsg)
ON_MESSAGE(ActMsg)
ON_MESSAGE(MovieEndMsg)
END_MESSAGE_MAP()
void CBrokenPelleratorFroz::save(SimpleFile *file, int indent) {
file->writeNumberLine(1, indent);
file->writeQuotedLine(_exitLeft, indent);
file->writeQuotedLine(_exitRight, indent);
file->writeQuotedLine(_closeUpWithoutHose, indent);
file->writeQuotedLine(_closeUpWithHose, indent);
CBrokenPellBase::save(file, indent);
}
void CBrokenPelleratorFroz::load(SimpleFile *file) {
file->readNumber();
_exitLeft = file->readString();
_exitRight = file->readString();
_closeUpWithoutHose = file->readString();
_closeUpWithHose = file->readString();
CBrokenPellBase::load(file);
}
bool CBrokenPelleratorFroz::MouseButtonDownMsg(CMouseButtonDownMsg *msg) {
if (_pelleratorOpen) {
changeView(_gottenHose ? _closeUpWithHose : _closeUpWithoutHose);
} else {
_pelleratorOpen = true;
if (_gottenHose) {
playMovie(0, 13, 0);
} else {
playMovie(43, 55, MOVIE_NOTIFY_OBJECT);
}
}
return true;
}
bool CBrokenPelleratorFroz::LeaveViewMsg(CLeaveViewMsg *msg) {
CString name = msg->_newView->getNodeViewName();
if (name == "Node 3.S" || name == "Node 3.E") {
_pelleratorOpen = false;
loadFrame(0);
}
return true;
}
bool CBrokenPelleratorFroz::ActMsg(CActMsg *msg) {
if (msg->_action == "PlayerGetsHose") {
_gottenHose = true;
loadFrame(29);
CStatusChangeMsg statusMsg;
statusMsg._newStatus = 0;
statusMsg.execute("FPickUpHose");
} else {
_closeAction = CLOSE_NONE;
bool closeFlag = msg->_action == "Close";
if (msg->_action == "CloseLeft") {
closeFlag = true;
_closeAction = CLOSE_LEFT;
}
if (msg->_action == "CloseRight") {
closeFlag = true;
_closeAction = CLOSE_RIGHT;
}
if (closeFlag) {
if (_pelleratorOpen) {
_pelleratorOpen = false;
if (_gottenHose)
playMovie(29, 42, MOVIE_NOTIFY_OBJECT);
else
playMovie(72, 84, MOVIE_NOTIFY_OBJECT);
} else {
switch (_closeAction) {
case CLOSE_LEFT:
changeView(_exitLeft);
break;
case CLOSE_RIGHT:
changeView(_exitRight);
break;
default:
break;
}
_closeAction = CLOSE_NONE;
}
}
}
return true;
}
bool CBrokenPelleratorFroz::MovieEndMsg(CMovieEndMsg *msg) {
if (msg->_endFrame == 55) {
CStatusChangeMsg statusMsg;
statusMsg._newStatus = 1;
statusMsg.execute("FPickUpHose");
}
if (msg->_endFrame == 84) {
CStatusChangeMsg statusMsg;
statusMsg._newStatus = 0;
statusMsg.execute("FPickUpHose");
}
if (_closeAction == CLOSE_LEFT) {
changeView(_exitLeft);
_closeAction = CLOSE_NONE;
} else if (_closeAction == CLOSE_RIGHT) {
changeView(_exitRight);
_closeAction = CLOSE_NONE;
}
return true;
}
} // End of namespace Titanic

View File

@@ -0,0 +1,56 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#ifndef TITANIC_BROKEN_PELLERATOR_FROZ_H
#define TITANIC_BROKEN_PELLERATOR_FROZ_H
#include "titanic/game/broken_pell_base.h"
namespace Titanic {
class CBrokenPelleratorFroz : public CBrokenPellBase {
DECLARE_MESSAGE_MAP;
bool MouseButtonDownMsg(CMouseButtonDownMsg *msg);
bool LeaveViewMsg(CLeaveViewMsg *msg);
bool ActMsg(CActMsg *msg);
bool MovieEndMsg(CMovieEndMsg *msg);
private:
CString _exitLeft;
CString _exitRight;
CString _closeUpWithoutHose;
CString _closeUpWithHose;
public:
CLASSDEF;
/**
* Save the data for the class to file
*/
void save(SimpleFile *file, int indent) override;
/**
* Load the data for the class from file
*/
void load(SimpleFile *file) override;
};
} // End of namespace Titanic
#endif /* TITANIC_BROKEN_PELLERATOR_FROZ_H */

View File

@@ -0,0 +1,109 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#include "titanic/game/cage.h"
#include "titanic/npcs/parrot.h"
namespace Titanic {
BEGIN_MESSAGE_MAP(CCage, CBackground)
ON_MESSAGE(MouseButtonDownMsg)
ON_MESSAGE(ActMsg)
ON_MESSAGE(MovieEndMsg)
ON_MESSAGE(PreEnterViewMsg)
ON_MESSAGE(MouseMoveMsg)
END_MESSAGE_MAP()
int CCage::_v1;
bool CCage::_open;
void CCage::save(SimpleFile *file, int indent) {
file->writeNumberLine(1, indent);
file->writeNumberLine(_v1, indent);
file->writeNumberLine(_open, indent);
CBackground::save(file, indent);
}
void CCage::load(SimpleFile *file) {
file->readNumber();
_v1 = file->readNumber();
_open = file->readNumber();
CBackground::load(file);
}
bool CCage::MouseButtonDownMsg(CMouseButtonDownMsg *msg) {
if (CParrot::_state != PARROT_IN_CAGE && !CParrot::_coreReplaced) {
CActMsg actMsg(_open ? "Open" : "Shut");
actMsg.execute(this);
}
return true;
}
bool CCage::ActMsg(CActMsg *msg) {
if (msg->_action == "Shut") {
if (!_open) {
playClip("Shut", MOVIE_STOP_PREVIOUS | MOVIE_NOTIFY_OBJECT);
disableMouse();
}
} else if (msg->_action == "Open") {
if (_open) {
playClip("Open", MOVIE_STOP_PREVIOUS | MOVIE_NOTIFY_OBJECT);
disableMouse();
}
} else if (msg->_action == "CoreReplaced") {
CActMsg actMsg("Shut");
actMsg.execute(this);
} else if (msg->_action == "OpenNow") {
loadFrame(0);
_open = false;
}
return true;
}
bool CCage::MovieEndMsg(CMovieEndMsg *msg) {
enableMouse();
_open = clipExistsByEnd("Shut", msg->_endFrame);
CStatusChangeMsg statusMsg;
statusMsg._newStatus = _open ? 1 : (CParrot::_state == PARROT_IN_CAGE ? 1 : 0);
statusMsg.execute("PerchCoreHolder");
return true;
}
bool CCage::PreEnterViewMsg(CPreEnterViewMsg *msg) {
loadSurface();
_open = CParrot::_state != PARROT_IN_CAGE;
loadFrame(_open ? 8 : 0);
return true;
}
bool CCage::MouseMoveMsg(CMouseMoveMsg *msg) {
_cursorId = CParrot::_state != PARROT_IN_CAGE && !CParrot::_coreReplaced ? CURSOR_ACTIVATE : CURSOR_ARROW;
return true;
}
} // End of namespace Titanic

View File

@@ -0,0 +1,55 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#ifndef TITANIC_CAGE_H
#define TITANIC_CAGE_H
#include "titanic/core/background.h"
namespace Titanic {
class CCage : public CBackground {
DECLARE_MESSAGE_MAP;
bool MouseButtonDownMsg(CMouseButtonDownMsg *msg);
bool ActMsg(CActMsg *msg);
bool MovieEndMsg(CMovieEndMsg *msg);
bool PreEnterViewMsg(CPreEnterViewMsg *msg);
bool MouseMoveMsg(CMouseMoveMsg *msg);
public:
static int _v1;
static bool _open;
public:
CLASSDEF;
/**
* Save the data for the class to file
*/
void save(SimpleFile *file, int indent) override;
/**
* Load the data for the class from file
*/
void load(SimpleFile *file) override;
};
} // End of namespace Titanic
#endif /* TITANIC_CAGE_H */

View File

@@ -0,0 +1,210 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#include "titanic/game/captains_wheel.h"
#include "titanic/translation.h"
namespace Titanic {
BEGIN_MESSAGE_MAP(CCaptainsWheel, CBackground)
ON_MESSAGE(MouseButtonDownMsg)
ON_MESSAGE(LeaveViewMsg)
ON_MESSAGE(ActMsg)
ON_MESSAGE(TurnOff)
ON_MESSAGE(TurnOn)
ON_MESSAGE(MovieEndMsg)
END_MESSAGE_MAP()
CCaptainsWheel::CCaptainsWheel() : CBackground(),
_stopEnabled(false), _actionNum(0), _fieldE8(0),
_cruiseEnabled(false), _goEnabled(false), _fieldF4(0) {
}
void CCaptainsWheel::save(SimpleFile *file, int indent) {
file->writeNumberLine(1, indent);
file->writeNumberLine(_stopEnabled, indent);
file->writeNumberLine(_actionNum, indent);
file->writeNumberLine(_fieldE8, indent);
file->writeNumberLine(_cruiseEnabled, indent);
file->writeNumberLine(_goEnabled, indent);
file->writeNumberLine(_fieldF4, indent);
CBackground::save(file, indent);
}
void CCaptainsWheel::load(SimpleFile *file) {
file->readNumber();
_stopEnabled = file->readNumber();
_actionNum = file->readNumber();
_fieldE8 = file->readNumber();
_cruiseEnabled = file->readNumber();
_goEnabled = file->readNumber();
_fieldF4 = file->readNumber();
CBackground::load(file);
}
bool CCaptainsWheel::MouseButtonDownMsg(CMouseButtonDownMsg *msg) {
if (_stopEnabled) {
_stopEnabled = false;
CTurnOff offMsg;
offMsg.execute(this);
playMovie(162, 168, 0);
} else {
playMovie(0, 8, MOVIE_NOTIFY_OBJECT);
}
return true;
}
bool CCaptainsWheel::LeaveViewMsg(CLeaveViewMsg *msg) {
if (_stopEnabled) {
_stopEnabled = false;
CTurnOff offMsg;
offMsg.execute(this);
playMovie(162, 168, MOVIE_WAIT_FOR_FINISH);
}
return true;
}
bool CCaptainsWheel::ActMsg(CActMsg *msg) {
if (msg->_action == "Spin") {
if (_stopEnabled) {
CTurnOn onMsg;
onMsg.execute("RatchetySound");
playMovie(8, 142, MOVIE_NOTIFY_OBJECT | MOVIE_WAIT_FOR_FINISH);
}
} else if (msg->_action == "Honk") {
if (_stopEnabled) {
playMovie(150, 160, MOVIE_NOTIFY_OBJECT | MOVIE_WAIT_FOR_FINISH);
}
} else if (msg->_action == "Go") {
if (_stopEnabled) {
_goEnabled = false;
incTransitions();
_stopEnabled = false;
_actionNum = 1;
CTurnOff offMsg;
offMsg.execute(this);
playMovie(162, 168, MOVIE_NOTIFY_OBJECT | MOVIE_WAIT_FOR_FINISH);
}
} else if (msg->_action == "Cruise") {
if (_stopEnabled) {
incTransitions();
_stopEnabled = false;
_actionNum = 2;
CTurnOff offMsg;
offMsg.execute(this);
playMovie(162, 168, MOVIE_NOTIFY_OBJECT | MOVIE_WAIT_FOR_FINISH);
}
} else if (msg->_action == "SetDestin") {
playSound(TRANSLATE("a#44.wav", "a#37.wav"));
CSetVolumeMsg volumeMsg;
volumeMsg._volume = 25;
volumeMsg.execute("EngineSounds");
CTurnOn onMsg;
onMsg.execute("EngineSounds");
_goEnabled = true;
} else if (msg->_action == "ClearDestin") {
_goEnabled = false;
}
return true;
}
bool CCaptainsWheel::TurnOff(CTurnOff *msg) {
CSignalObject signalMsg;
signalMsg._numValue = 0;
static const char *const NAMES[8] = {
"WheelSpin", "SeagullHorn", "WheelStopButt", "StopHotSpot",
"WheelCruiseButt", "CruiseHotSpot", "WheelGoButt","GoHotSpot"
};
for (int idx = 0; idx < 8; ++idx)
signalMsg.execute(NAMES[idx]);
return true;
}
bool CCaptainsWheel::TurnOn(CTurnOn *msg) {
CSignalObject signalMsg;
signalMsg._numValue = 1;
signalMsg.execute("WheelSpin");
signalMsg.execute("SeagullHorn");
if (_stopEnabled) {
signalMsg.execute("WheelStopButt");
signalMsg.execute("StopHotSpot");
}
if (_cruiseEnabled) {
signalMsg.execute("WheelCruiseButt");
signalMsg.execute("CruiseHotSpot");
}
if (_goEnabled) {
signalMsg.execute("WheelGoButt");
signalMsg.execute("GoHotSpot");
}
return true;
}
bool CCaptainsWheel::MovieEndMsg(CMovieEndMsg *msg) {
if (msg->_endFrame == 8) {
_stopEnabled = true;
CTurnOn onMsg;
onMsg.execute(this);
}
if (msg->_endFrame == 142) {
CTurnOff offMsg;
offMsg.execute("RatchetySound");
}
if (msg->_endFrame == 168) {
switch (_actionNum) {
case 1: {
CActMsg actMsg(starIsSolved() ? "GoEnd" : "Go");
actMsg.execute("GoSequence");
break;
}
case 2: {
CActMsg actMsg("Cruise");
actMsg.execute("CruiseSequence");
break;
}
default:
break;
}
_actionNum = 0;
}
return true;
}
} // End of namespace Titanic

View File

@@ -0,0 +1,61 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#ifndef TITANIC_CAPTAINS_WHEEL_H
#define TITANIC_CAPTAINS_WHEEL_H
#include "titanic/core/background.h"
namespace Titanic {
class CCaptainsWheel : public CBackground {
DECLARE_MESSAGE_MAP;
bool MouseButtonDownMsg(CMouseButtonDownMsg *msg);
bool LeaveViewMsg(CLeaveViewMsg *msg);
bool ActMsg(CActMsg *msg);
bool TurnOff(CTurnOff *msg);
bool TurnOn(CTurnOn *msg);
bool MovieEndMsg(CMovieEndMsg *msg);
public:
bool _stopEnabled;
int _actionNum;
int _fieldE8;
bool _cruiseEnabled;
bool _goEnabled;
int _fieldF4;
public:
CLASSDEF;
CCaptainsWheel();
/**
* Save the data for the class to file
*/
void save(SimpleFile *file, int indent) override;
/**
* Load the data for the class from file
*/
void load(SimpleFile *file) override;
};
} // End of namespace Titanic
#endif /* TITANIC_CAPTAINS_WHEEL_H */

View File

@@ -0,0 +1,90 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#include "titanic/game/cdrom.h"
#include "titanic/core/room_item.h"
#include "titanic/game/cdrom_tray.h"
namespace Titanic {
BEGIN_MESSAGE_MAP(CCDROM, CGameObject)
ON_MESSAGE(MouseDragStartMsg)
ON_MESSAGE(MouseDragEndMsg)
ON_MESSAGE(MouseDragMoveMsg)
ON_MESSAGE(ActMsg)
END_MESSAGE_MAP()
CCDROM::CCDROM() : CGameObject() {
}
void CCDROM::save(SimpleFile *file, int indent) {
file->writeNumberLine(1, indent);
file->writePoint(_centroid, indent);
CGameObject::save(file, indent);
}
void CCDROM::load(SimpleFile *file) {
file->readNumber();
_centroid = file->readPoint();
CGameObject::load(file);
}
bool CCDROM::MouseDragStartMsg(CMouseDragStartMsg *msg) {
if (checkStartDragging(msg)) {
hideMouse();
_centroid = msg->_mousePos - _bounds;
setPosition(msg->_mousePos - _centroid);
return true;
} else {
return false;
}
}
bool CCDROM::MouseDragEndMsg(CMouseDragEndMsg *msg) {
showMouse();
if (msg->_dropTarget && msg->_dropTarget->getName() == "newComputer") {
CCDROMTray *newTray = dynamic_cast<CCDROMTray *>(getRoom()->findByName("newTray"));
if (newTray->_isOpened && newTray->_insertedCD == "None") {
CActMsg actMsg(getName());
actMsg.execute(newTray);
setVisible(false);
}
}
resetPosition();
return true;
}
bool CCDROM::MouseDragMoveMsg(CMouseDragMoveMsg *msg) {
setPosition(msg->_mousePos - _centroid);
return true;
}
bool CCDROM::ActMsg(CActMsg *msg) {
if (msg->_action == "Ejected")
setVisible(true);
return true;
}
} // End of namespace Titanic

View File

@@ -0,0 +1,56 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#ifndef TITANIC_CDROM_H
#define TITANIC_CDROM_H
#include "titanic/core/game_object.h"
#include "titanic/messages/messages.h"
#include "titanic/messages/mouse_messages.h"
namespace Titanic {
class CCDROM : public CGameObject {
DECLARE_MESSAGE_MAP;
bool MouseDragStartMsg(CMouseDragStartMsg *msg);
bool MouseDragEndMsg(CMouseDragEndMsg *msg);
bool MouseDragMoveMsg(CMouseDragMoveMsg *msg);
bool ActMsg(CActMsg *msg);
private:
Point _centroid;
public:
CLASSDEF;
CCDROM();
/**
* Save the data for the class to file
*/
void save(SimpleFile *file, int indent) override;
/**
* Load the data for the class from file
*/
void load(SimpleFile *file) override;
};
} // End of namespace Titanic
#endif /* TITANIC_CDROM_H */

View File

@@ -0,0 +1,77 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#include "titanic/game/cdrom_computer.h"
#include "titanic/core/room_item.h"
namespace Titanic {
BEGIN_MESSAGE_MAP(CCDROMComputer, CGameObject)
ON_MESSAGE(MouseButtonDownMsg)
END_MESSAGE_MAP()
CCDROMComputer::CCDROMComputer() : CGameObject(),
_clickRect(0, 3, 55, 32) {
}
void CCDROMComputer::save(SimpleFile *file, int indent) {
file->writeNumberLine(1, indent);
file->writeNumberLine(_clickRect.left, indent);
file->writeNumberLine(_clickRect.top, indent);
file->writeNumberLine(_clickRect.right, indent);
file->writeNumberLine(_clickRect.bottom, indent);
CGameObject::save(file, indent);
}
void CCDROMComputer::load(SimpleFile *file) {
file->readNumber();
_clickRect.left = file->readNumber();
_clickRect.top = file->readNumber();
_clickRect.right = file->readNumber();
_clickRect.bottom = file->readNumber();
CGameObject::load(file);
}
bool CCDROMComputer::MouseButtonDownMsg(CMouseButtonDownMsg *msg) {
CTreeItem *tray = getRoom()->findByName("newTray");
if (tray) {
CStatusChangeMsg statusMsg;
statusMsg.execute(tray);
if (!statusMsg._success) {
// Check if the mouse is within the clickable area
Rect tempRect = _clickRect;
tempRect.translate(_bounds.left, _bounds.top);
if (!tempRect.contains(msg->_mousePos))
return true;
}
CActMsg actMsg("ClickedOn");
actMsg.execute(tray);
}
return true;
}
} // End of namespace Titanic

View File

@@ -0,0 +1,52 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#ifndef TITANIC_CDROM_COMPUTER_H
#define TITANIC_CDROM_COMPUTER_H
#include "titanic/core/game_object.h"
#include "titanic/messages/mouse_messages.h"
namespace Titanic {
class CCDROMComputer : public CGameObject {
DECLARE_MESSAGE_MAP;
bool MouseButtonDownMsg(CMouseButtonDownMsg *msg);
private:
Rect _clickRect;
public:
CLASSDEF;
CCDROMComputer();
/**
* Save the data for the class to file
*/
void save(SimpleFile *file, int indent) override;
/**
* Load the data for the class from file
*/
void load(SimpleFile *file) override;
};
} // End of namespace Titanic
#endif /* TITANIC_CDROM_COMPUTER_H */

View File

@@ -0,0 +1,128 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#include "titanic/core/room_item.h"
#include "titanic/game/cdrom_tray.h"
#include "titanic/messages/messages.h"
#include "titanic/translation.h"
namespace Titanic {
BEGIN_MESSAGE_MAP(CCDROMTray, CGameObject)
ON_MESSAGE(ActMsg)
ON_MESSAGE(MovieEndMsg)
ON_MESSAGE(StatusChangeMsg)
END_MESSAGE_MAP()
CCDROMTray::CCDROMTray() : CGameObject(), _isOpened(false) {
}
void CCDROMTray::save(SimpleFile *file, int indent) {
file->writeNumberLine(1, indent);
file->writeNumberLine(_isOpened, indent);
file->writeQuotedLine(_insertedCD, indent);
CGameObject::save(file, indent);
}
void CCDROMTray::load(SimpleFile *file) {
file->readNumber();
_isOpened = file->readNumber();
_insertedCD = file->readString();
CGameObject::load(file);
}
bool CCDROMTray::ActMsg(CActMsg *msg) {
if (msg->_action == "ClickedOn") {
if (_isOpened) {
// Closing the tray
if (_insertedCD == "None") {
// No CD in tray
playMovie(55, 65, 0);
playSound(TRANSLATE("a#35.wav", "a#30.wav"), 50, 0, 0);
_isOpened = false;
} else {
// Ejecting tray with CD
CTreeItem *cdrom = getRoom()->findByName(_insertedCD);
if (cdrom) {
CActMsg actMsg("Ejected");
actMsg.execute(cdrom);
}
_insertedCD = "None";
loadFrame(52);
}
} else if (_insertedCD == "None") {
// Opening tray with no CD
playMovie(44, 54, 0);
playSound(TRANSLATE("a#34.wav", "a#29.wav"), 50, 0, 0);
_isOpened = true;
} else if (_insertedCD == "newCD1" || _insertedCD == "newCD2") {
// Opening tray with standard CD
playMovie(22, 32, 0);
playSound(TRANSLATE("a#34.wav", "a#29.wav"), 50, 0, 0);
_isOpened = true;
} else if (_insertedCD == "newSTCD") {
// Opening tray with Starship Titanic CD
playMovie(0, 10, 0);
playSound(TRANSLATE("a#34.wav", "a#29.wav"), 50, 0, 0);
_isOpened = true;
}
} else if (_isOpened) {
if (msg->_action == "newCD1" || msg->_action == "newCD2") {
// Standard CD dropped on CDROM Tray
playMovie(33, 43, MOVIE_NOTIFY_OBJECT);
playSound(TRANSLATE("a#35.wav", "a#30.wav"), 50, 0, 0);
} else if (msg->_action == "newSTCD") {
// Starship Titanic CD dropped on CDROM Tray
disableMouse();
playMovie(11, 21, MOVIE_NOTIFY_OBJECT);
playSound(TRANSLATE("a#35.wav", "a#30.wav"), 50, 0, 0);
} else {
return true;
}
_insertedCD = msg->_action;
_isOpened = false;
}
return true;
}
bool CCDROMTray::MovieEndMsg(CMovieEndMsg *msg) {
CTreeItem *screen = getRoom()->findByName("newScreen");
if (screen) {
CActMsg actMsg(_insertedCD);
actMsg.execute(screen);
}
return true;
}
bool CCDROMTray::StatusChangeMsg(CStatusChangeMsg *msg) {
msg->_success = _isOpened;
return true;
}
} // End of namespace Titanic

View File

@@ -0,0 +1,55 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#ifndef TITANIC_CDROM_TRAY_H
#define TITANIC_CDROM_TRAY_H
#include "titanic/core/game_object.h"
#include "titanic/messages/messages.h"
namespace Titanic {
class CCDROMTray : public CGameObject {
DECLARE_MESSAGE_MAP;
bool ActMsg(CActMsg *msg);
bool MovieEndMsg(CMovieEndMsg *msg);
bool StatusChangeMsg(CStatusChangeMsg *msg);
public:
bool _isOpened;
CString _insertedCD;
public:
CLASSDEF;
CCDROMTray();
/**
* Save the data for the class to file
*/
void save(SimpleFile *file, int indent) override;
/**
* Load the data for the class from file
*/
void load(SimpleFile *file) override;
};
} // End of namespace Titanic
#endif /* TITANIC_CDROM_TRAY_H */

View File

@@ -0,0 +1,103 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#include "titanic/game/cell_point_button.h"
#include "titanic/translation.h"
namespace Titanic {
BEGIN_MESSAGE_MAP(CCellPointButton, CBackground)
ON_MESSAGE(MouseButtonDownMsg)
ON_MESSAGE(EnterViewMsg)
END_MESSAGE_MAP()
CCellPointButton::CCellPointButton() : CBackground() {
_unused1 = 0;
_unused2 = 0;
_unused3 = 0;
_unused4 = 0;
_regionNum = 0;
_unused5 = 0;
_unused6 = 0;
_unused7 = 0;
_unused8 = 0;
_unused9 = 0;
_unused10 = 1;
}
void CCellPointButton::save(SimpleFile *file, int indent) {
file->writeNumberLine(1, indent);
file->writeNumberLine(_unused1, indent);
file->writeNumberLine(_unused2, indent);
file->writeNumberLine(_unused3, indent);
file->writeNumberLine(_unused4, indent);
file->writeNumberLine(_regionNum, indent);
file->writeNumberLine(_unused5, indent);
file->writeNumberLine(_unused6, indent);
file->writeNumberLine(_unused7, indent);
file->writeNumberLine(_unused8, indent);
file->writeNumberLine(_unused9, indent);
file->writeNumberLine(_unused10, indent);
file->writeQuotedLine(_npcName, indent);
file->writeNumberLine(_dialNum, indent);
CBackground::save(file, indent);
}
void CCellPointButton::load(SimpleFile *file) {
file->readNumber();
_unused1 = file->readNumber();
_unused2 = file->readNumber();
_unused3 = file->readNumber();
_unused4 = file->readNumber();
_regionNum = file->readNumber();
_unused5 = file->readNumber();
_unused6 = file->readNumber();
_unused7 = file->readNumber();
_unused8 = file->readNumber();
_unused9 = file->readNumber();
_unused10 = file->readNumber();
_npcName = file->readString();
_dialNum = file->readNumber();
CBackground::load(file);
}
bool CCellPointButton::MouseButtonDownMsg(CMouseButtonDownMsg *msg) {
if (getRandomNumber(2) == 0) {
CParrotSpeakMsg speakMsg("Cellpoints", _npcName);
speakMsg.execute("PerchedParrot");
}
playMovie(0);
_regionNum = _regionNum ? 0 : 1;
playSound(TRANSLATE("z#425.wav", "z#170.wav"));
talkSetDialRegion(_npcName, _dialNum, _regionNum);
return true;
}
bool CCellPointButton::EnterViewMsg(CEnterViewMsg *msg) {
_regionNum = talkGetDialRegion(_npcName, _dialNum);
return true;
}
} // End of namespace Titanic

View File

@@ -0,0 +1,64 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#ifndef TITANIC_CELL_POINT_BUTTON_H
#define TITANIC_CELL_POINT_BUTTON_H
#include "titanic/core/background.h"
namespace Titanic {
class CCellPointButton : public CBackground {
DECLARE_MESSAGE_MAP;
bool MouseButtonDownMsg(CMouseButtonDownMsg *msg);
bool EnterViewMsg(CEnterViewMsg *msg);
public:
int _unused1;
int _unused2;
int _unused3;
int _unused4;
int _regionNum;
int _unused5;
int _unused6;
int _unused7;
int _unused8;
int _unused9;
int _unused10;
CString _npcName;
int _dialNum;
public:
CLASSDEF;
CCellPointButton();
/**
* Save the data for the class to file
*/
void save(SimpleFile *file, int indent) override;
/**
* Load the data for the class from file
*/
void load(SimpleFile *file) override;
};
} // End of namespace Titanic
#endif /* TITANIC_CELL_POINT_BUTTON_H */

View File

@@ -0,0 +1,287 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#include "titanic/game/chev_code.h"
namespace Titanic {
BEGIN_MESSAGE_MAP(CChevCode, CGameObject)
ON_MESSAGE(SetChevLiftBits)
ON_MESSAGE(SetChevClassBits)
ON_MESSAGE(SetChevFloorBits)
ON_MESSAGE(SetChevRoomBits)
ON_MESSAGE(GetChevLiftNum)
ON_MESSAGE(GetChevClassNum)
ON_MESSAGE(GetChevFloorNum)
ON_MESSAGE(GetChevRoomNum)
ON_MESSAGE(CheckChevCode)
ON_MESSAGE(GetChevCodeFromRoomNameMsg)
END_MESSAGE_MAP()
void CChevCode::save(SimpleFile *file, int indent) {
file->writeNumberLine(1, indent);
file->writeNumberLine(_chevCode, indent);
CGameObject::save(file, indent);
}
void CChevCode::load(SimpleFile *file) {
file->readNumber();
_chevCode = file->readNumber();
CGameObject::load(file);
}
bool CChevCode::SetChevLiftBits(CSetChevLiftBits *msg) {
_chevCode &= ~0xC0000;
if (msg->_liftNum > 0 && msg->_liftNum < 5)
_chevCode = ((msg->_liftNum - 1) << 18) | _chevCode;
return true;
}
bool CChevCode::SetChevClassBits(CSetChevClassBits *msg) {
_chevCode &= ~0x30000;
if (msg->_classNum > 0 && msg->_classNum < 4)
_chevCode = (msg->_classNum << 16) | msg->_classNum;
return true;
}
bool CChevCode::SetChevFloorBits(CSetChevFloorBits *msg) {
int section = (msg->_floorNum + 4) / 10;
int index = (msg->_floorNum + 4) % 10;
_chevCode &= ~0xFF00;
int val = 0;
switch (section) {
case 0:
val = 144;
break;
case 1:
val = 208;
break;
case 2:
val = 224;
break;
case 3:
val = 240;
break;
default:
break;
}
_chevCode |= ((index + val) << 8);
return true;
}
bool CChevCode::SetChevRoomBits(CSetChevRoomBits *msg) {
_chevCode &= ~0xff;
if (msg->_roomFlags > 0 && msg->_roomFlags < 128)
_chevCode |= msg->_roomFlags * 2;
return true;
}
bool CChevCode::GetChevLiftNum(CGetChevLiftNum *msg) {
msg->_liftNum = ((_chevCode >> 18) & 3) + 1;
return true;
}
bool CChevCode::GetChevClassNum(CGetChevClassNum *msg) {
msg->_classNum = (_chevCode >> 16) & 3;
return true;
}
bool CChevCode::GetChevFloorNum(CGetChevFloorNum *msg) {
int val1 = (_chevCode >> 8) & 0xF;
int val2 = ((_chevCode >> 12) & 0xF) - 9;
switch (val2) {
case 0:
val2 = 0;
break;
case 4:
val2 = 1;
break;
case 5:
val2 = 2;
break;
case 6:
val2 = 3;
break;
default:
val2 = 4;
break;
}
msg->_floorNum = (val1 >= 10) ? 0 : val2 * 10 + val1;
return true;
}
bool CChevCode::GetChevRoomNum(CGetChevRoomNum *msg) {
msg->_roomNum = (_chevCode >> 1) & 0x7F;
return true;
}
bool CChevCode::CheckChevCode(CCheckChevCode *msg) {
CGetChevClassNum getClassMsg;
CGetChevLiftNum getLiftMsg;
CGetChevFloorNum getFloorMsg;
CGetChevRoomNum getRoomMsg;
CString roomName;
int classNum = 0;
uint bits = 0;
if (_chevCode & 1) {
switch (_chevCode) {
case 0x1D0D9:
roomName = "ParrLobby";
classNum = 4;
break;
case 0x196D9:
roomName = "FCRestrnt";
classNum = 4;
break;
case 0x39FCB:
roomName = "Bridge";
classNum = 4;
break;
case 0x2F86D:
roomName = "CrtrsCham";
classNum = 4;
break;
case 0x465FB:
roomName = "SculpCham";
classNum = 4;
break;
case 0x3D94B:
roomName = "BilgeRoom";
classNum = 4;
break;
case 0x59FAD:
roomName = "BoWell";
classNum = 4;
break;
case 0x4D6AF:
roomName = "Arboretum";
classNum = 4;
break;
case 0x8A397:
roomName = "TitRoom";
classNum = 4;
break;
case 0x79C45:
roomName = "PromDeck";
classNum = 4;
break;
case 0xB3D97:
roomName = "Bar";
classNum = 4;
break;
case 0xCC971:
roomName = "EmbLobby";
classNum = 4;
break;
case 0xF34DB:
roomName = "MusicRoom";
classNum = 4;
break;
default:
roomName = "BadRoom";
classNum = 5;
break;
}
bits = classNum == 5 ? 0x3D94B : _chevCode;
} else {
getFloorMsg.execute(this);
getRoomMsg.execute(this);
getClassMsg.execute(this);
getLiftMsg.execute(this);
if (getFloorMsg._floorNum > 37 || getRoomMsg._roomNum > 18)
classNum = 5;
if (classNum == 5) {
bits = 0x3D94B;
} else {
switch (getClassMsg._classNum) {
case 1:
if (getFloorMsg._floorNum >= 2 && getFloorMsg._floorNum <= 18
&& getRoomMsg._roomNum >= 1 && getRoomMsg._roomNum <= 3
&& getLiftMsg._liftNum >= 1 && getLiftMsg._liftNum <= 4)
classNum = 1;
else
classNum = 5;
break;
case 2:
if (getFloorMsg._floorNum >= 19 && getFloorMsg._floorNum <= 26
&& getRoomMsg._roomNum >= 1 && getRoomMsg._roomNum <= 5
&& getLiftMsg._liftNum >= 1 && getLiftMsg._liftNum <= 4)
classNum = 2;
else
classNum = 5;
break;
case 3:
if (getFloorMsg._floorNum >= 27 && getFloorMsg._floorNum <= 37
&& getRoomMsg._roomNum >= 1 && getRoomMsg._roomNum <= 18
&& (getLiftMsg._liftNum & 1) == 1
&& getLiftMsg._liftNum >= 1 && getLiftMsg._liftNum <= 4)
classNum = 3;
else
classNum = 5;
break;
default:
break;
}
}
}
msg->_classNum = classNum;
msg->_chevCode = bits;
// WORKAROUND: Skipped code from original that was for debugging purposes only
return true;
}
bool CChevCode::GetChevCodeFromRoomNameMsg(CGetChevCodeFromRoomNameMsg *msg) {
static const char *const ROOM_NAMES[13] = {
"ParrotLobby", "sculptureChamber", "Bar", "EmbLobby", "MusicRoom",
"Titania", "BottomOfWell", "Arboretum", "PromenadeDeck",
"FCRestrnt", "CrtrsCham", "BilgeRoom", "Bridge"
};
static const uint CHEV_CODES[13] = {
0x1D0D9, 0x465FB, 0xB3D97, 0xCC971, 0xF34DB, 0x8A397, 0x59FAD,
0x4D6AF, 0x79C45, 0x196D9, 0x2F86D, 0x3D94B, 0x39FCB
};
for (int idx = 0; idx < 13; ++idx) {
if (msg->_roomName == ROOM_NAMES[idx]) {
msg->_chevCode = CHEV_CODES[idx];
break;
}
}
return true;
}
} // End of namespace Titanic

View File

@@ -0,0 +1,60 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#ifndef TITANIC_CHEV_CODE_H
#define TITANIC_CHEV_CODE_H
#include "titanic/core/game_object.h"
namespace Titanic {
class CChevCode : public CGameObject {
DECLARE_MESSAGE_MAP;
bool SetChevLiftBits(CSetChevLiftBits *msg);
bool SetChevClassBits(CSetChevClassBits *msg);
bool SetChevFloorBits(CSetChevFloorBits *msg);
bool SetChevRoomBits(CSetChevRoomBits *msg);
bool GetChevLiftNum(CGetChevLiftNum *msg);
bool GetChevClassNum(CGetChevClassNum *msg);
bool GetChevFloorNum(CGetChevFloorNum *msg);
bool GetChevRoomNum(CGetChevRoomNum *msg);
bool CheckChevCode(CCheckChevCode *msg);
bool GetChevCodeFromRoomNameMsg(CGetChevCodeFromRoomNameMsg *msg);
public:
int _chevCode;
public:
CLASSDEF;
CChevCode() : CGameObject(), _chevCode(0) {}
/**
* Save the data for the class to file
*/
void save(SimpleFile *file, int indent) override;
/**
* Load the data for the class from file
*/
void load(SimpleFile *file) override;
};
} // End of namespace Titanic
#endif /* TITANIC_CHEV_CODE_H */

View File

@@ -0,0 +1,120 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#include "titanic/game/chev_panel.h"
#include "titanic/game/chev_code.h"
namespace Titanic {
BEGIN_MESSAGE_MAP(CChevPanel, CGameObject)
ON_MESSAGE(MouseDragStartMsg)
ON_MESSAGE(MouseDragMoveMsg)
ON_MESSAGE(MouseButtonUpMsg)
ON_MESSAGE(SetChevPanelBitMsg)
ON_MESSAGE(MouseDragEndMsg)
ON_MESSAGE(ClearChevPanelBits)
ON_MESSAGE(MouseButtonDownMsg)
ON_MESSAGE(SetChevPanelButtonsMsg)
END_MESSAGE_MAP()
void CChevPanel::save(SimpleFile *file, int indent) {
file->writeNumberLine(1, indent);
file->writeNumberLine(_startPos.x, indent);
file->writeNumberLine(_startPos.y, indent);
file->writeNumberLine(_chevCode, indent);
CGameObject::save(file, indent);
}
void CChevPanel::load(SimpleFile *file) {
file->readNumber();
_startPos.x = file->readNumber();
_startPos.y = file->readNumber();
_chevCode = file->readNumber();
CGameObject::load(file);
}
bool CChevPanel::MouseDragStartMsg(CMouseDragStartMsg *msg) {
if (checkStartDragging(msg)) {
_startPos = Point(msg->_mousePos.x - _bounds.left,
msg->_mousePos.y - _bounds.top);
CChildDragStartMsg dragMsg(_startPos);
dragMsg.execute(this, nullptr, MSGFLAG_SCAN);
}
return true;
}
bool CChevPanel::MouseDragMoveMsg(CMouseDragMoveMsg *msg) {
CChildDragMoveMsg dragMsg(_startPos);
dragMsg.execute(this, nullptr, MSGFLAG_SCAN);
setPosition(msg->_mousePos - _startPos);
return true;
}
bool CChevPanel::MouseButtonUpMsg(CMouseButtonUpMsg *msg) {
CChevCode chevCode;
chevCode._chevCode = _chevCode;
CCheckChevCode checkCode;
checkCode.execute(this);
CClearChevPanelBits panelBits;
panelBits.execute(this, nullptr, MSGFLAG_SCAN);
CSetChevPanelButtonsMsg setMsg;
setMsg._chevCode = checkCode._chevCode;
setMsg.execute(this);
return true;
}
bool CChevPanel::SetChevPanelBitMsg(CSetChevPanelBitMsg *msg) {
_chevCode = (_chevCode & ~(1 << msg->_value1)) | (msg->_value2 << msg->_value1);
return true;
}
bool CChevPanel::MouseDragEndMsg(CMouseDragEndMsg *msg) {
setPosition(msg->_mousePos - _startPos);
return true;
}
bool CChevPanel::ClearChevPanelBits(CClearChevPanelBits *msg) {
CSetChevPanelButtonsMsg setMsg;
setMsg._chevCode = 0;
setMsg.execute(this);
return true;
}
bool CChevPanel::MouseButtonDownMsg(CMouseButtonDownMsg *msg) {
return true;
}
bool CChevPanel::SetChevPanelButtonsMsg(CSetChevPanelButtonsMsg *msg) {
_chevCode = msg->_chevCode;
CSetChevButtonImageMsg setMsg;
setMsg._value2 = 1;
setMsg.execute(this, nullptr, MSGFLAG_SCAN);
return true;
}
} // End of namespace Titanic

View File

@@ -0,0 +1,59 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#ifndef TITANIC_CHEV_PANEL_H
#define TITANIC_CHEV_PANEL_H
#include "titanic/core/game_object.h"
namespace Titanic {
class CChevPanel : public CGameObject {
DECLARE_MESSAGE_MAP;
bool MouseDragStartMsg(CMouseDragStartMsg *msg);
bool MouseDragMoveMsg(CMouseDragMoveMsg *msg);
bool MouseButtonUpMsg(CMouseButtonUpMsg *msg);
bool SetChevPanelBitMsg(CSetChevPanelBitMsg *msg);
bool MouseDragEndMsg(CMouseDragEndMsg *msg);
bool ClearChevPanelBits(CClearChevPanelBits *msg);
bool MouseButtonDownMsg(CMouseButtonDownMsg *msg);
bool SetChevPanelButtonsMsg(CSetChevPanelButtonsMsg *msg);
public:
Point _startPos;
int _chevCode;
public:
CLASSDEF;
CChevPanel() : _chevCode(0) {}
/**
* Save the data for the class to file
*/
void save(SimpleFile *file, int indent) override;
/**
* Load the data for the class from file
*/
void load(SimpleFile *file) override;
};
} // End of namespace Titanic
#endif /* TITANIC_CHEV_PANEL_H */

View File

@@ -0,0 +1,75 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#include "titanic/game/chicken_cooler.h"
#include "titanic/carry/chicken.h"
namespace Titanic {
BEGIN_MESSAGE_MAP(CChickenCooler, CGameObject)
ON_MESSAGE(EnterRoomMsg)
ON_MESSAGE(EnterViewMsg)
END_MESSAGE_MAP()
void CChickenCooler::save(SimpleFile *file, int indent) {
file->writeNumberLine(1, indent);
file->writeNumberLine(_newTemperature, indent);
file->writeNumberLine(_triggerOnRoomEntry, indent);
CGameObject::save(file, indent);
}
void CChickenCooler::load(SimpleFile *file) {
file->readNumber();
_newTemperature = file->readNumber();
_triggerOnRoomEntry = file->readNumber();
CGameObject::load(file);
}
bool CChickenCooler::EnterRoomMsg(CEnterRoomMsg *msg) {
if (_triggerOnRoomEntry) {
CGameObject *obj = getMailManFirstObject();
if (!obj) {
if (CChicken::_temperature > _newTemperature)
CChicken::_temperature = _newTemperature;
}
}
return true;
}
bool CChickenCooler::EnterViewMsg(CEnterViewMsg *msg) {
if (!_triggerOnRoomEntry) {
for (CGameObject *obj = getMailManFirstObject(); obj;
obj = getNextMail(obj)) {
if (obj->isEquals("Chicken"))
return true;
}
if (CChicken::_temperature > _newTemperature)
CChicken::_temperature = _newTemperature;
}
return true;
}
} // End of namespace Titanic

View File

@@ -0,0 +1,54 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#ifndef TITANIC_CHICKEN_COOLER_H
#define TITANIC_CHICKEN_COOLER_H
#include "titanic/core/game_object.h"
#include "titanic/messages/messages.h"
namespace Titanic {
class CChickenCooler : public CGameObject {
DECLARE_MESSAGE_MAP;
bool EnterRoomMsg(CEnterRoomMsg *msg);
bool EnterViewMsg(CEnterViewMsg *msg);
private:
int _newTemperature;
bool _triggerOnRoomEntry;
public:
CLASSDEF;
CChickenCooler() : CGameObject(), _newTemperature(0), _triggerOnRoomEntry(false) {}
/**
* Save the data for the class to file
*/
void save(SimpleFile *file, int indent) override;
/**
* Load the data for the class from file
*/
void load(SimpleFile *file) override;
};
} // End of namespace Titanic
#endif /* TITANIC_CHICKEN_COOLER_H */

View File

@@ -0,0 +1,192 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#include "titanic/game/chicken_dispensor.h"
#include "titanic/carry/chicken.h"
#include "titanic/core/project_item.h"
#include "titanic/pet_control/pet_control.h"
#include "titanic/translation.h"
namespace Titanic {
BEGIN_MESSAGE_MAP(CChickenDispensor, CBackground)
ON_MESSAGE(StatusChangeMsg)
ON_MESSAGE(MovieEndMsg)
ON_MESSAGE(ActMsg)
ON_MESSAGE(LeaveViewMsg)
ON_MESSAGE(EnterViewMsg)
ON_MESSAGE(MouseDragStartMsg)
ON_MESSAGE(TurnOff)
END_MESSAGE_MAP()
CChickenDispensor::CChickenDispensor() : CBackground(),
_disabled(false), _dispenseMode(DISPENSE_NONE), _dispensed(false) {
}
void CChickenDispensor::save(SimpleFile *file, int indent) {
file->writeNumberLine(1, indent);
file->writeNumberLine(_disabled, indent);
file->writeNumberLine(_dispenseMode, indent);
file->writeNumberLine(_dispensed, indent);
CBackground::save(file, indent);
}
void CChickenDispensor::load(SimpleFile *file) {
file->readNumber();
_disabled = file->readNumber();
_dispenseMode = (DispenseMode)file->readNumber();
_dispensed = file->readNumber();
CBackground::load(file);
}
bool CChickenDispensor::StatusChangeMsg(CStatusChangeMsg *msg) {
msg->execute("SGTRestLeverAnimation");
DispenseMode dispenseMode = _dispensed ? DISPENSE_NONE : _dispenseMode;
CPetControl *pet = getPetControl();
CGameObject *obj;
for (obj = pet->getFirstObject(); obj; obj = pet->getNextObject(obj)) {
if (obj->isEquals("Chicken")) {
petDisplayMessage(1, ONE_CHICKEN_PER_CUSTOMER);
return true;
}
}
for (obj = getMailManFirstObject(); obj; obj = getNextMail(obj)) {
if (obj->isEquals("Chicken")) {
petDisplayMessage(1, ONE_CHICKEN_PER_CUSTOMER);
return true;
}
}
switch (dispenseMode) {
case DISPENSE_NONE:
petDisplayMessage(1, ONE_ALLOCATED_CHICKEN_PER_CUSTOMER);
break;
case DISPENSE_HOT:
case DISPENSE_COLD:
_dispensed = true;
setVisible(true);
if (_disabled) {
playMovie(0, 12, MOVIE_NOTIFY_OBJECT | MOVIE_WAIT_FOR_FINISH);
playSound(TRANSLATE("z#400.wav", "z#145.wav"));
} else {
playMovie(12, 16, MOVIE_NOTIFY_OBJECT | MOVIE_WAIT_FOR_FINISH);
}
break;
default:
break;
}
return true;
}
bool CChickenDispensor::MovieEndMsg(CMovieEndMsg *msg) {
int movieFrame = msg->_endFrame;
if (movieFrame == 16) {
// Dispensed a chicken
_cursorId = CURSOR_HAND;
playSound(TRANSLATE("b#50.wav", "b#30.wav"), 50);
CActMsg actMsg("Dispense Chicken");
actMsg.execute("Chicken");
#ifdef FIX_DISPENSOR_TEMPATURE
if (_dispenseMode != DISPENSE_HOT) {
// WORKAROUND: If the fuse for the dispensor is removed in Titania's fusebox,
// make the dispensed chicken already cold
CChicken::_temperature = 0;
}
#endif
} else if (_dispensed) {
// Chicken dispensed whilst dispensor is "disabled", which basically
// spits the chicken out at high speed directly into the SuccUBus
_cursorId = CURSOR_ARROW;
loadFrame(0);
setVisible(false);
if (_dispenseMode == DISPENSE_COLD)
_dispensed = false;
} else {
// Doors closing as the view is being left
loadFrame(0);
setVisible(false);
changeView("SgtLobby.Node 1.N");
}
return true;
}
bool CChickenDispensor::ActMsg(CActMsg *msg) {
if (msg->_action == "EnableObject")
_disabled = false;
else if (msg->_action == "DisableObject")
_disabled = true;
else if (msg->_action == "IncreaseQuantity")
_dispenseMode = DISPENSE_COLD;
else if (msg->_action == "DecreaseQuantity")
_dispenseMode = DISPENSE_HOT;
return true;
}
bool CChickenDispensor::LeaveViewMsg(CLeaveViewMsg *msg) {
return true;
}
bool CChickenDispensor::EnterViewMsg(CEnterViewMsg *msg) {
playSound(TRANSLATE("b#51.wav", "b#31.wav"));
_dispensed = false;
_cursorId = CURSOR_ARROW;
return true;
}
bool CChickenDispensor::MouseDragStartMsg(CMouseDragStartMsg *msg) {
if (getMovieFrame() == 16) {
setVisible(false);
loadFrame(0);
_cursorId = CURSOR_ARROW;
_dispensed = true;
CVisibleMsg visibleMsg;
visibleMsg.execute("Chicken");
CPassOnDragStartMsg passMsg(msg->_mousePos, 1);
passMsg.execute("Chicken");
msg->_dragItem = getRoot()->findByName("Chicken");
}
return true;
}
bool CChickenDispensor::TurnOff(CTurnOff *msg) {
if (getMovieFrame() != 16)
setVisible(false);
playMovie(16, 12, MOVIE_NOTIFY_OBJECT | MOVIE_WAIT_FOR_FINISH);
_dispensed = false;
return true;
}
} // End of namespace Titanic

View File

@@ -0,0 +1,61 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#ifndef TITANIC_CHICKEN_DISPENSOR_H
#define TITANIC_CHICKEN_DISPENSOR_H
#include "titanic/core/background.h"
namespace Titanic {
enum DispenseMode { DISPENSE_NONE = 0, DISPENSE_HOT = 1, DISPENSE_COLD = 2 };
class CChickenDispensor : public CBackground {
DECLARE_MESSAGE_MAP;
bool StatusChangeMsg(CStatusChangeMsg *msg);
bool MovieEndMsg(CMovieEndMsg *msg);
bool ActMsg(CActMsg *msg);
bool LeaveViewMsg(CLeaveViewMsg *msg);
bool EnterViewMsg(CEnterViewMsg *msg);
bool MouseDragStartMsg(CMouseDragStartMsg *msg);
bool TurnOff(CTurnOff *msg);
public:
bool _disabled;
DispenseMode _dispenseMode;
bool _dispensed;
public:
CLASSDEF;
CChickenDispensor();
/**
* Save the data for the class to file
*/
void save(SimpleFile *file, int indent) override;
/**
* Load the data for the class from file
*/
void load(SimpleFile *file) override;
};
} // End of namespace Titanic
#endif /* TITANIC_CHICKEN_DISPENSOR_H */

View File

@@ -0,0 +1,48 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#include "titanic/game/close_broken_pel.h"
namespace Titanic {
BEGIN_MESSAGE_MAP(CCloseBrokenPel, CBackground)
ON_MESSAGE(MouseButtonDownMsg)
END_MESSAGE_MAP()
void CCloseBrokenPel::save(SimpleFile *file, int indent) {
file->writeNumberLine(1, indent);
file->writeQuotedLine(_target, indent);
CBackground::save(file, indent);
}
void CCloseBrokenPel::load(SimpleFile *file) {
file->readNumber();
_target = file->readString();
CBackground::load(file);
}
bool CCloseBrokenPel::MouseButtonDownMsg(CMouseButtonDownMsg *msg) {
CActMsg actMsg("Close");
actMsg.execute(_target);
return true;
}
} // End of namespace Titanic

View File

@@ -0,0 +1,50 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#ifndef TITANIC_CLOSE_BROKEN_PEL_H
#define TITANIC_CLOSE_BROKEN_PEL_H
#include "titanic/core/background.h"
namespace Titanic {
class CCloseBrokenPel : public CBackground {
DECLARE_MESSAGE_MAP;
bool MouseButtonDownMsg(CMouseButtonDownMsg *msg);
public:
CString _target;
public:
CLASSDEF;
/**
* Save the data for the class to file
*/
void save(SimpleFile *file, int indent) override;
/**
* Load the data for the class from file
*/
void load(SimpleFile *file) override;
};
} // End of namespace Titanic
#endif /* TITANIC_CLOSE_BROKEN_PEL_H */

View File

@@ -0,0 +1,160 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#include "titanic/game/code_wheel.h"
#include "titanic/translation.h"
namespace Titanic {
BEGIN_MESSAGE_MAP(CodeWheel, CBomb)
ON_MESSAGE(MouseButtonDownMsg)
ON_MESSAGE(EnterViewMsg)
ON_MESSAGE(MouseButtonUpMsg)
ON_MESSAGE(MovieEndMsg)
ON_MESSAGE(CheckCodeWheelsMsg)
END_MESSAGE_MAP()
static const int START_FRAMES_EN[15] = {
0, 5, 10, 15, 19, 24, 28, 33, 38, 42, 47, 52, 57, 61, 66
};
static const int END_FRAMES_EN[15] = {
5, 10, 15, 19, 24, 28, 33, 38, 42, 47, 52, 57, 61, 66, 70
};
static const int CORRECT_VALUES_DE[3][8] = {
{ 2, 7, 4, 8, 18, 18, 4, 17 },
{ 12, 0, 6, 10, 11, 20, 6, 18 },
{ 13, 8, 4, 12, 0, 13, 3, 26 }
};
static const int START_FRAMES_DE[28] = {
0, 7, 15, 22, 29, 37, 44, 51, 58, 66,
73, 80, 88, 95, 102, 110, 117, 125, 132, 139,
146, 154, 161, 168, 175, 183, 190, 0
};
static const int END_FRAMES_DE[28] = {
7, 15, 22, 29, 37, 44, 51, 58, 66, 73,
80, 88, 95, 102, 110, 117, 125, 132, 139, 146,
154, 161, 168, 175, 183, 190, 198, 0
};
static const int START_FRAMES_REV_DE[28] = {
390, 383, 375, 368, 361, 353, 346, 339, 331, 324,
317, 309, 302, 295, 287, 280, 272, 265, 258, 251,
244, 236, 229, 221, 214, 207, 199, 0
};
static const int END_FRAMES_REV_DE[28] = {
397, 390, 383, 375, 368, 361, 353, 346, 339, 331,
324, 317, 309, 302, 295, 287, 280, 272, 265, 258,
251, 244, 236, 229, 221, 214, 207, 0
};
CodeWheel::CodeWheel() : CBomb(), _correctValue(0), _value(4),
_matched(false), _column(0), _row(0) {
}
void CodeWheel::save(SimpleFile *file, int indent) {
file->writeNumberLine(1, indent);
file->writeNumberLine(_correctValue, indent);
file->writeNumberLine(_value, indent);
file->writeNumberLine(_matched, indent);
if (g_language == Common::DE_DEU) {
file->writeNumberLine(_row, indent);
file->writeNumberLine(_column, indent);
}
CBomb::save(file, indent);
}
void CodeWheel::load(SimpleFile *file) {
file->readNumber();
_correctValue = file->readNumber();
_value = file->readNumber();
_matched = file->readNumber();
if (g_language == Common::DE_DEU) {
_row = file->readNumber();
_column = file->readNumber();
assert(_column >= 1 && _column <= 8);
assert(_row >= 0 && _row <= 2);
_correctValue = CORRECT_VALUES_DE[_row][_column - 1];
}
CBomb::load(file);
}
bool CodeWheel::MouseButtonDownMsg(CMouseButtonDownMsg *msg) {
int yp = _bounds.top + _bounds.height() / 2;
_matched = false;
if (msg->_mousePos.y > yp) {
_value = (_value + 1) % TRANSLATE(15, 27);
playMovie(TRANSLATE(START_FRAMES_EN[_value], START_FRAMES_DE[_value]),
TRANSLATE(END_FRAMES_EN[_value], END_FRAMES_DE[_value]),
MOVIE_WAIT_FOR_FINISH | MOVIE_NOTIFY_OBJECT);
} else {
playMovie(TRANSLATE(START_FRAMES_EN[14 - _value] + 68, START_FRAMES_REV_DE[_value]),
TRANSLATE(END_FRAMES_EN[14 - _value] + 68, END_FRAMES_REV_DE[_value]),
MOVIE_WAIT_FOR_FINISH | MOVIE_NOTIFY_OBJECT);
_value = (_value <= 0) ? TRANSLATE(14, 26) : _value - 1;
}
if (_value == _correctValue)
_matched = true;
playSound(TRANSLATE("z#59.wav", "z#590.wav"));
return true;
}
bool CodeWheel::EnterViewMsg(CEnterViewMsg *msg) {
// WORKAROUND: Don't keep resetting code wheels back to default
loadFrame(TRANSLATE(END_FRAMES_EN[_value], END_FRAMES_DE[_value]));
return true;
}
bool CodeWheel::MouseButtonUpMsg(CMouseButtonUpMsg *msg) {
return true;
}
bool CodeWheel::MovieEndMsg(CMovieEndMsg *msg) {
sleep(200);
// Signal that a code wheel has changed
CStatusChangeMsg changeMsg;
changeMsg.execute("Bomb");
return true;
}
bool CodeWheel::CheckCodeWheelsMsg(CCheckCodeWheelsMsg *msg) {
if (_value != _correctValue)
msg->_isCorrect = false;
return true;
}
void CodeWheel::reset() {
_value = TRANSLATE(4, 14);
}
} // End of namespace Titanic

View File

@@ -0,0 +1,64 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#ifndef TITANIC_CODE_WHEEL_H
#define TITANIC_CODE_WHEEL_H
#include "titanic/game/bomb.h"
namespace Titanic {
class CodeWheel : public CBomb {
DECLARE_MESSAGE_MAP;
bool MouseButtonDownMsg(CMouseButtonDownMsg *msg);
bool EnterViewMsg(CEnterViewMsg *msg);
bool MouseButtonUpMsg(CMouseButtonUpMsg *msg);
bool MovieEndMsg(CMovieEndMsg *msg);
bool CheckCodeWheelsMsg(CCheckCodeWheelsMsg *msg);
private:
int _correctValue;
int _value;
bool _matched;
// German specific fields
int _row, _column;
public:
CLASSDEF;
CodeWheel();
/**
* Save the data for the class to file
*/
void save(SimpleFile *file, int indent) override;
/**
* Load the data for the class from file
*/
void load(SimpleFile *file) override;
/**
* Resets a code wheel back to the default 'O' value
*/
void reset();
};
} // End of namespace Titanic
#endif /* TITANIC_CODE_WHEEL_H */

View File

@@ -0,0 +1,106 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#include "titanic/game/computer.h"
#include "titanic/translation.h"
namespace Titanic {
BEGIN_MESSAGE_MAP(CComputer, CBackground)
ON_MESSAGE(ActMsg)
ON_MESSAGE(MouseButtonDownMsg)
ON_MESSAGE(MovieEndMsg)
END_MESSAGE_MAP()
void CComputer::save(SimpleFile *file, int indent) {
file->writeNumberLine(1, indent);
file->writeQuotedLine(_currentCD, indent);
file->writeNumberLine(_state, indent);
CBackground::save(file, indent);
}
void CComputer::load(SimpleFile *file) {
file->readNumber();
_currentCD = file->readString();
_state = file->readNumber();
CBackground::load(file);
}
bool CComputer::ActMsg(CActMsg *msg) {
if (_state) {
playSound(TRANSLATE("a#35.wav", "a#30.wav"));
playMovie(32, 42, 0);
if (msg->_action == "CD1")
playMovie(43, 49, 0);
else if (msg->_action == "CD2")
playMovie(50, 79, 0);
else if (msg->_action == "STCD")
playMovie(80, 90, MOVIE_NOTIFY_OBJECT);
_currentCD = msg->_action;
_state = 0;
}
return true;
}
bool CComputer::MouseButtonDownMsg(CMouseButtonDownMsg *msg) {
if (_currentCD == "None") {
if (_state) {
playSound(TRANSLATE("a#35.wav", "a#30.wav"));
playMovie(11, 21, 0);
_state = 0;
} else {
playSound(TRANSLATE("a#34.wav", "a#29.wav"));
playMovie(0, 10, 0);
_state = 1;
}
} else {
if (_state) {
loadFrame(11);
CActMsg actMsg("EjectCD");
actMsg.execute(_currentCD);
_currentCD = "None";
} else {
playSound(TRANSLATE("a#34.wav", "a#29.wav"));
playMovie(21, 31, 0);
_state = 1;
}
}
return true;
}
bool CComputer::MovieEndMsg(CMovieEndMsg *msg) {
if (msg->_endFrame == 90) {
playSound(TRANSLATE("a#32.wav", "a#27.wav"));
playSound(TRANSLATE("a#33.wav", "a#28.wav"));
playSound(TRANSLATE("a#31.wav", "a#26.wav"));
playSound(TRANSLATE("a#0.wav", "a#52.wav"));
gotoView("Home.Node 4.E", "_TRACK,3,e-cu,4,E");
}
return true;
}
} // End of namespace Titanic

View File

@@ -0,0 +1,54 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#ifndef TITANIC_COMPUTER_H
#define TITANIC_COMPUTER_H
#include "titanic/core/background.h"
namespace Titanic {
class CComputer : public CBackground {
DECLARE_MESSAGE_MAP;
bool ActMsg(CActMsg *msg);
bool MouseButtonDownMsg(CMouseButtonDownMsg *msg);
bool MovieEndMsg(CMovieEndMsg *msg);
public:
CString _currentCD;
int _state;
public:
CLASSDEF;
CComputer() : CBackground(), _currentCD("None"), _state(0) {}
/**
* Save the data for the class to file
*/
void save(SimpleFile *file, int indent) override;
/**
* Load the data for the class from file
*/
void load(SimpleFile *file) override;
};
} // End of namespace Titanic
#endif /* TITANIC_COMPUTER_H */

View File

@@ -0,0 +1,164 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#include "titanic/game/computer_screen.h"
#include "titanic/messages/messages.h"
#include "titanic/translation.h"
namespace Titanic {
BEGIN_MESSAGE_MAP(CComputerScreen, CGameObject)
ON_MESSAGE(ActMsg)
ON_MESSAGE(MovieEndMsg)
ON_MESSAGE(EnterViewMsg)
ON_MESSAGE(TimerMsg)
ON_MESSAGE(MovementMsg)
END_MESSAGE_MAP()
CComputerScreen::CComputerScreen() : CGameObject() {
}
void CComputerScreen::save(SimpleFile *file, int indent) {
file->writeNumberLine(1, indent);
CGameObject::save(file, indent);
}
void CComputerScreen::load(SimpleFile *file) {
file->readNumber();
CGameObject::load(file);
}
bool CComputerScreen::ActMsg(CActMsg *msg) {
if (msg->_action == "newCD1" || msg->_action == "newCD2") {
playMovie(27, 53, MOVIE_WAIT_FOR_FINISH);
playMovie(19, 26, MOVIE_WAIT_FOR_FINISH);
} else if (msg->_action == "newSTCD") {
playMovie(0, 18, MOVIE_WAIT_FOR_FINISH | MOVIE_NOTIFY_OBJECT);
}
return true;
}
bool CComputerScreen::MovieEndMsg(CMovieEndMsg *msg) {
playSound(TRANSLATE("z#47.wav", "z#578.wav"));
addTimer(0, 3000, 0);
for (int idx = 0; idx < 10; ++idx)
playMovie(0, 18, 0);
return true;
}
bool CComputerScreen::EnterViewMsg(CEnterViewMsg *msg) {
loadFrame(26);
// WORKAROUND: The original game leaves in a debug link that
// allows skipping of Doorbot arrival sequence. Disable it
static_cast<CLinkItem *>(getParent()->findByName("_TRACK,3,e-cu,4,E"))->_bounds.clear();
return true;
}
bool CComputerScreen::MovementMsg(CMovementMsg *msg) {
if (msg->_movement != MOVE_BACKWARDS)
return true;
msg->_posToUse = Common::Point(320, 50);
return false;
}
bool CComputerScreen::TimerMsg(CTimerMsg *msg) {
int handle;
switch (msg->_actionVal) {
case 0:
if (g_language == Common::DE_DEU) {
loadSound("a#27.wav");
loadSound("a#26.wav");
loadSound("a#28.wav");
loadSound("a#25.wav");
loadSound("a#24.wav");
playSound("a#20.wav");
} else {
loadSound("a#32.wav");
loadSound("a#31.wav");
loadSound("a#33.wav");
loadSound("a#30.wav");
loadSound("a#29.wav");
playSound("a#25.wav");
}
addTimer(1, 2000, 0);
break;
case 1:
playMovie(23, 26, MOVIE_STOP_PREVIOUS);
playSound(TRANSLATE("a#32.wav", "a#27.wav"));
playSound(TRANSLATE("a#31.wav", "a#26.wav"));
addTimer(2, 2000, 0);
break;
case 2: {
CChangeMusicMsg musicMsg(CString(), MUSIC_STOP);
musicMsg.execute("HomeMusicPlayer");
playSound(TRANSLATE("a#33.wav", "a#28.wav"));
playSound(TRANSLATE("a#31.wav", "a#26.wav"));
changeView("Home.Node 4.E", "");
playClip(51, 150);
playSound(TRANSLATE("a#31.wav", "a#26.wav"));
playClip(151, 200);
handle = playSound(TRANSLATE("a#27.wav", "a#22.wav"));
playClip(200, 306);
playSound(TRANSLATE("a#30.wav", "a#25.wav"));
stopSound(handle, 0);
playClip(306, 338);
handle = playSound(TRANSLATE("a#28.wav", "a#23.wav"));
playClip(338, 392);
playSound(TRANSLATE("a#29.wav", "a#24.wav"));
stopSound(handle);
handle = playSound(TRANSLATE("y#662.wav", "y#0.wav"));
setSoundVolume(handle, 10, 2);
playClip(392, 450);
startTalking("Doorbot", 0x3611A);
sleep(TRANSLATE(8000, 7000));
playClip(450, 492);
startTalking("Doorbot", 0x36121);
playClip(492, 522);
setSoundVolume(handle, 30, 2);
playClip(523, 540);
setSoundVolume(handle, 0, 1);
playClip(541, 551);
stopSound(handle);
break;
}
default:
break;
}
return true;
}
} // End of namespace Titanic

View File

@@ -0,0 +1,53 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#ifndef TITANIC_COMPUTER_SCREEN_H
#define TITANIC_COMPUTER_SCREEN_H
#include "titanic/core/game_object.h"
namespace Titanic {
class CComputerScreen : public CGameObject {
DECLARE_MESSAGE_MAP;
bool ActMsg(CActMsg *msg);
bool MovieEndMsg(CMovieEndMsg *msg);
bool EnterViewMsg(CEnterViewMsg *msg);
bool TimerMsg(CTimerMsg *msg);
bool MovementMsg(CMovementMsg *msg);
public:
CLASSDEF;
CComputerScreen();
/**
* Save the data for the class to file
*/
void save(SimpleFile *file, int indent) override;
/**
* Load the data for the class from file
*/
void load(SimpleFile *file) override;
};
} // End of namespace Titanic
#endif /* TITANIC_COMPUTER_SCREEN_H */

View File

@@ -0,0 +1,59 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#include "titanic/game/cookie.h"
namespace Titanic {
BEGIN_MESSAGE_MAP(CCookie, CGameObject)
ON_MESSAGE(LeaveNodeMsg)
ON_MESSAGE(FreshenCookieMsg)
END_MESSAGE_MAP()
void CCookie::save(SimpleFile *file, int indent) {
file->writeNumberLine(1, indent);
file->writeNumberLine(_value1, indent);
file->writeNumberLine(_value2, indent);
CGameObject::save(file, indent);
}
void CCookie::load(SimpleFile *file) {
file->readNumber();
_value1 = file->readNumber();
_value2 = file->readNumber();
CGameObject::load(file);
}
bool CCookie::LeaveNodeMsg(CLeaveNodeMsg *msg) {
if (_value2)
_value1 = 1;
return true;
}
bool CCookie::FreshenCookieMsg(CFreshenCookieMsg *msg) {
_value1 = msg->_value2;
_value2 = msg->_value1;
return true;
}
} // End of namespace Titanic

View File

@@ -0,0 +1,53 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#ifndef TITANIC_COOKIE_H
#define TITANIC_COOKIE_H
#include "titanic/core/game_object.h"
namespace Titanic {
class CCookie : public CGameObject {
DECLARE_MESSAGE_MAP;
bool LeaveNodeMsg(CLeaveNodeMsg *msg);
bool FreshenCookieMsg(CFreshenCookieMsg *msg);
public:
int _value1;
int _value2;
public:
CLASSDEF;
CCookie() : CGameObject(), _value1(0), _value2(0) {}
/**
* Save the data for the class to file
*/
void save(SimpleFile *file, int indent) override;
/**
* Load the data for the class from file
*/
void load(SimpleFile *file) override;
};
} // End of namespace Titanic
#endif /* TITANIC_COOKIE_H */

View File

@@ -0,0 +1,83 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#include "titanic/game/credits.h"
#include "titanic/translation.h"
namespace Titanic {
BEGIN_MESSAGE_MAP(CCredits, CGameObject)
ON_MESSAGE(SignalObject)
ON_MESSAGE(TimerMsg)
END_MESSAGE_MAP()
CCredits::CCredits() : CGameObject(), _fieldBC(-1), _fieldC0(1) {
}
void CCredits::save(SimpleFile *file, int indent) {
file->writeNumberLine(1, indent);
file->writeNumberLine(_fieldBC, indent);
file->writeNumberLine(_fieldC0, indent);
CGameObject::save(file, indent);
}
void CCredits::load(SimpleFile *file) {
file->readNumber();
_fieldBC = file->readNumber();
_fieldC0 = file->readNumber();
CGameObject::load(file);
}
bool CCredits::SignalObject(CSignalObject *msg) {
petHide();
disableMouse();
addTimer(50);
return true;
}
bool CCredits::TimerMsg(CTimerMsg *msg) {
stopAmbientSound(true, -1);
setVisible(true);
loadSound(TRANSLATE("a#16.wav", "a#11.wav"));
loadSound(TRANSLATE("a#24.wav", "a#19.wav"));
if (playCutscene(0, 18)) {
playAmbientSound(TRANSLATE("a#16.wav", "a#11.wav"), VOL_NORMAL, false, false, 0);
if (playCutscene(19, 642)) {
playSound(TRANSLATE("a#24.wav", "a#19.wav"));
playCutscene(643, 750);
}
}
COpeningCreditsMsg creditsMsg;
creditsMsg.execute("Service Elevator Entity");
changeView("EmbLobby.Node 6.S");
setVisible(false);
petShow();
enableMouse();
stopAmbientSound(true, -1);
return true;
}
} // End of namespace Titanic

View File

@@ -0,0 +1,52 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#ifndef TITANIC_CREDITS_H
#define TITANIC_CREDITS_H
#include "titanic/core/game_object.h"
namespace Titanic {
class CCredits : public CGameObject {
DECLARE_MESSAGE_MAP;
bool SignalObject(CSignalObject *msg);
bool TimerMsg(CTimerMsg *msg);
public:
int _fieldBC, _fieldC0;
public:
CLASSDEF;
CCredits();
/**
* Save the data for the class to file
*/
void save(SimpleFile *file, int indent) override;
/**
* Load the data for the class from file
*/
void load(SimpleFile *file) override;
};
} // End of namespace Titanic
#endif /* TITANIC_CREDITS_H */

View File

@@ -0,0 +1,62 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#include "titanic/game/credits_button.h"
#include "titanic/translation.h"
namespace Titanic {
BEGIN_MESSAGE_MAP(CCreditsButton, CBackground)
ON_MESSAGE(MouseButtonUpMsg)
ON_MESSAGE(MouseButtonDownMsg)
END_MESSAGE_MAP()
CCreditsButton::CCreditsButton() : CBackground(), _fieldE0(1) {
}
void CCreditsButton::save(SimpleFile *file, int indent) {
file->writeNumberLine(1, indent);
file->writeNumberLine(_fieldE0, indent);
CBackground::save(file, indent);
}
void CCreditsButton::load(SimpleFile *file) {
file->readNumber();
_fieldE0 = file->readNumber();
CBackground::load(file);
}
bool CCreditsButton::MouseButtonUpMsg(CMouseButtonUpMsg *msg) {
return true;
}
bool CCreditsButton::MouseButtonDownMsg(CMouseButtonDownMsg *msg) {
if (_fieldE0) {
playSound(TRANSLATE("a#20.wav", "a#15.wav"));
CSignalObject signalMsg;
signalMsg._numValue = 1;
signalMsg.execute("CreditsPlayer");
}
return true;
}
} // End of namespace Titanic

View File

@@ -0,0 +1,52 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#ifndef TITANIC_CREDITS_BUTTON_H
#define TITANIC_CREDITS_BUTTON_H
#include "titanic/core/background.h"
namespace Titanic {
class CCreditsButton : public CBackground {
DECLARE_MESSAGE_MAP;
bool MouseButtonUpMsg(CMouseButtonUpMsg *msg);
bool MouseButtonDownMsg(CMouseButtonDownMsg *msg);
public:
int _fieldE0;
public:
CLASSDEF;
CCreditsButton();
/**
* Save the data for the class to file
*/
void save(SimpleFile *file, int indent) override;
/**
* Load the data for the class from file
*/
void load(SimpleFile *file) override;
};
} // End of namespace Titanic
#endif /* TITANIC_CREDITS_BUTTON_H */

View File

@@ -0,0 +1,44 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#include "titanic/game/dead_area.h"
namespace Titanic {
BEGIN_MESSAGE_MAP(CDeadArea, CGameObject)
ON_MESSAGE(MouseButtonDownMsg)
ON_MESSAGE(MouseButtonUpMsg)
END_MESSAGE_MAP()
CDeadArea::CDeadArea() : CGameObject() {
}
void CDeadArea::save(SimpleFile *file, int indent) {
file->writeNumberLine(1, indent);
CGameObject::save(file, indent);
}
void CDeadArea::load(SimpleFile *file) {
file->readNumber();
CGameObject::load(file);
}
} // End of namespace Titanic

View File

@@ -0,0 +1,54 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#ifndef TITANIC_DEAD_AREA_H
#define TITANIC_DEAD_AREA_H
#include "titanic/core/game_object.h"
#include "titanic/messages/mouse_messages.h"
namespace Titanic {
/**
* Implements a non-responsive screen area
*/
class CDeadArea : public CGameObject {
DECLARE_MESSAGE_MAP;
bool MouseButtonDownMsg(CMouseButtonDownMsg *msg) { return true; }
bool MouseButtonUpMsg(CMouseButtonUpMsg *msg) { return true; }
public:
CLASSDEF;
CDeadArea();
/**
* Save the data for the class to file
*/
void save(SimpleFile *file, int indent) override;
/**
* Load the data for the class from file
*/
void load(SimpleFile *file) override;
};
} // End of namespace Titanic
#endif /* TITANIC_DEAD_AREA_H */

View File

@@ -0,0 +1,67 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#include "titanic/game/desk_click_responder.h"
#include "titanic/translation.h"
namespace Titanic {
BEGIN_MESSAGE_MAP(CDeskClickResponder, CClickResponder)
ON_MESSAGE(MouseButtonDownMsg)
ON_MESSAGE(LoadSuccessMsg)
END_MESSAGE_MAP()
void CDeskClickResponder::save(SimpleFile *file, int indent) {
file->writeNumberLine(1, indent);
file->writeNumberLine(_fieldD4, indent);
file->writeNumberLine(_ticks, indent);
CClickResponder::save(file, indent);
}
void CDeskClickResponder::load(SimpleFile *file) {
file->readNumber();
_fieldD4 = file->readNumber();
_ticks = file->readNumber();
CClickResponder::load(file);
}
bool CDeskClickResponder::MouseButtonDownMsg(CMouseButtonDownMsg *msg) {
_fieldD4 = (_fieldD4 + 1) % 3;
if (_fieldD4)
return CClickResponder::MouseButtonDownMsg(msg);
uint ticks = getTicksCount();
if (!_ticks || ticks > (_ticks + 4000)) {
playSound(TRANSLATE("a#22.wav", "a#17.wav"));
_ticks = ticks;
}
return true;
}
bool CDeskClickResponder::LoadSuccessMsg(CLoadSuccessMsg *msg) {
_ticks = 0;
return true;
}
} // End of namespace Titanic

View File

@@ -0,0 +1,52 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#ifndef TITANIC_DESK_CLICK_RESPONDER_H
#define TITANIC_DESK_CLICK_RESPONDER_H
#include "titanic/core/click_responder.h"
namespace Titanic {
class CDeskClickResponder : public CClickResponder {
DECLARE_MESSAGE_MAP;
bool MouseButtonDownMsg(CMouseButtonDownMsg *msg);
bool LoadSuccessMsg(CLoadSuccessMsg *msg);
protected:
int _fieldD4;
uint _ticks;
public:
CLASSDEF;
/**
* Save the data for the class to file
*/
void save(SimpleFile *file, int indent) override;
/**
* Load the data for the class from file
*/
void load(SimpleFile *file) override;
};
} // End of namespace Titanic
#endif /* TITANIC_DESK_CLICK_RESPONDER_H */

View File

@@ -0,0 +1,55 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#include "titanic/game/doorbot_elevator_handler.h"
namespace Titanic {
BEGIN_MESSAGE_MAP(CDoorbotElevatorHandler, CGameObject)
ON_MESSAGE(EnterNodeMsg)
END_MESSAGE_MAP()
void CDoorbotElevatorHandler::save(SimpleFile *file, int indent) {
file->writeNumberLine(1, indent);
file->writeNumberLine(_value, indent);
file->writeNumberLine(_called, indent);
CGameObject::save(file, indent);
}
void CDoorbotElevatorHandler::load(SimpleFile *file) {
file->readNumber();
_value = file->readNumber();
_called = file->readNumber();
CGameObject::load(file);
}
bool CDoorbotElevatorHandler::EnterNodeMsg(CEnterNodeMsg *msg) {
if (!_called) {
CDoorbotNeededInElevatorMsg elevatorMsg;
elevatorMsg._value = 0;
elevatorMsg.execute("Doorbot");
_called = true;
}
return true;
}
} // End of namespace Titanic

View File

@@ -0,0 +1,52 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#ifndef TITANIC_DOORBOT_ELEVATOR_HANDLER_H
#define TITANIC_DOORBOT_ELEVATOR_HANDLER_H
#include "titanic/core/game_object.h"
#include "titanic/messages/messages.h"
namespace Titanic {
class CDoorbotElevatorHandler : public CGameObject {
DECLARE_MESSAGE_MAP;
bool EnterNodeMsg(CEnterNodeMsg *msg);
private:
bool _called;
int _value;
public:
CLASSDEF;
/**
* Save the data for the class to file
*/
void save(SimpleFile *file, int indent) override;
/**
* Load the data for the class from file
*/
void load(SimpleFile *file) override;
};
} // End of namespace Titanic
#endif /* TITANIC_DOORBOT_ELEVATOR_HANDLER_H */

View File

@@ -0,0 +1,49 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#include "titanic/game/doorbot_home_handler.h"
namespace Titanic {
BEGIN_MESSAGE_MAP(CDoorbotHomeHandler, CGameObject)
ON_MESSAGE(EnterViewMsg)
END_MESSAGE_MAP()
CDoorbotHomeHandler::CDoorbotHomeHandler() {
}
void CDoorbotHomeHandler::save(SimpleFile *file, int indent) {
file->writeNumberLine(1, indent);
CGameObject::save(file, indent);
}
void CDoorbotHomeHandler::load(SimpleFile *file) {
file->readNumber();
CGameObject::load(file);
}
bool CDoorbotHomeHandler::EnterViewMsg(CEnterViewMsg *msg) {
CDoorbotNeededInHomeMsg neededMsg;
neededMsg.execute("Doorbot");
return true;
}
} // End of namespace Titanic

View File

@@ -0,0 +1,49 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#ifndef TITANIC_DOORBOT_HOME_HANDLER_H
#define TITANIC_DOORBOT_HOME_HANDLER_H
#include "titanic/core/game_object.h"
namespace Titanic {
class CDoorbotHomeHandler : public CGameObject {
DECLARE_MESSAGE_MAP;
bool EnterViewMsg(CEnterViewMsg *msg);
public:
CLASSDEF;
CDoorbotHomeHandler();
/**
* Save the data for the class to file
*/
void save(SimpleFile *file, int indent) override;
/**
* Load the data for the class from file
*/
void load(SimpleFile *file) override;
};
} // End of namespace Titanic
#endif /* TITANIC_DOORBOT_HOME_HANDLER_H */

View File

@@ -0,0 +1,66 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#include "titanic/game/ear_sweet_bowl.h"
#include "titanic/core/room_item.h"
#include "titanic/pet_control/pet_control.h"
namespace Titanic {
BEGIN_MESSAGE_MAP(CEarSweetBowl, CSweetBowl)
ON_MESSAGE(MovieEndMsg)
ON_MESSAGE(ReplaceBowlAndNutsMsg)
END_MESSAGE_MAP()
void CEarSweetBowl::save(SimpleFile *file, int indent) {
file->writeNumberLine(1, indent);
CSweetBowl::save(file, indent);
}
void CEarSweetBowl::load(SimpleFile *file) {
file->readNumber();
CSweetBowl::load(file);
}
bool CEarSweetBowl::MovieEndMsg(CMovieEndMsg *msg) {
setVisible(false);
CIsEarBowlPuzzleDone doneMsg;
doneMsg.execute(findRoom());
if (!doneMsg._value) {
CIsParrotPresentMsg parrotMsg;
parrotMsg.execute(findRoom());
if (parrotMsg._isPresent) {
CNutPuzzleMsg nutMsg("Jiggle");
nutMsg.execute("NutsParrotPlayer");
}
}
return true;
}
bool CEarSweetBowl::ReplaceBowlAndNutsMsg(CReplaceBowlAndNutsMsg *msg) {
setVisible(false);
return true;
}
} // End of namespace Titanic

View File

@@ -0,0 +1,49 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#ifndef TITANIC_EAR_SWEET_BOWL_H
#define TITANIC_EAR_SWEET_BOWL_H
#include "titanic/game/sweet_bowl.h"
namespace Titanic {
class CEarSweetBowl : public CSweetBowl {
DECLARE_MESSAGE_MAP;
bool MovieEndMsg(CMovieEndMsg *msg);
bool ReplaceBowlAndNutsMsg(CReplaceBowlAndNutsMsg *msg);
public:
CLASSDEF;
/**
* Save the data for the class to file
*/
void save(SimpleFile *file, int indent) override;
/**
* Load the data for the class from file
*/
void load(SimpleFile *file) override;
};
} // End of namespace Titanic
#endif /* TITANIC_EAR_SWEET_BOWL_H */

View File

@@ -0,0 +1,79 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#include "titanic/game/eject_phonograph_button.h"
namespace Titanic {
BEGIN_MESSAGE_MAP(CEjectPhonographButton, CBackground)
ON_MESSAGE(MouseButtonDownMsg)
ON_MESSAGE(CylinderHolderReadyMsg)
END_MESSAGE_MAP()
void CEjectPhonographButton::save(SimpleFile *file, int indent) {
file->writeNumberLine(1, indent);
file->writeNumberLine(_ejected, indent);
file->writeNumberLine(_readyFlag, indent);
file->writeQuotedLine(_soundName, indent);
file->writeQuotedLine(_readySoundName, indent);
CBackground::save(file, indent);
}
void CEjectPhonographButton::load(SimpleFile *file) {
file->readNumber();
_ejected = file->readNumber();
_readyFlag = file->readNumber();
_soundName = file->readString();
_readySoundName = file->readString();
CBackground::load(file);
}
bool CEjectPhonographButton::MouseButtonDownMsg(CMouseButtonDownMsg *msg) {
CQueryPhonographState queryMsg;
queryMsg.execute(getParent(), nullptr, MSGFLAG_SCAN);
if (!_ejected && !queryMsg._value) {
loadFrame(1);
playSound(_soundName);
_readyFlag = true;
CEjectCylinderMsg ejectMsg;
ejectMsg.execute(getParent(), nullptr, MSGFLAG_SCAN);
_ejected = true;
}
return true;
}
bool CEjectPhonographButton::CylinderHolderReadyMsg(CCylinderHolderReadyMsg *msg) {
if (_readyFlag) {
loadFrame(0);
playSound(_readySoundName);
_readyFlag = 0;
}
_ejected = false;
return true;
}
} // End of namespace Titanic

View File

@@ -0,0 +1,55 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#ifndef TITANIC_EJECT_PHONOGRAPH_BUTTON_H
#define TITANIC_EJECT_PHONOGRAPH_BUTTON_H
#include "titanic/core/background.h"
namespace Titanic {
class CEjectPhonographButton : public CBackground {
DECLARE_MESSAGE_MAP;
bool MouseButtonDownMsg(CMouseButtonDownMsg *msg);
bool CylinderHolderReadyMsg(CCylinderHolderReadyMsg *msg);
public:
bool _ejected;
bool _readyFlag;
CString _soundName;
CString _readySoundName;
public:
CLASSDEF;
CEjectPhonographButton() : CBackground(), _ejected(false), _readyFlag(false) {}
/**
* Save the data for the class to file
*/
void save(SimpleFile *file, int indent) override;
/**
* Load the data for the class from file
*/
void load(SimpleFile *file) override;
};
} // End of namespace Titanic
#endif /* TITANIC_EJECT_PHONOGRAPH_BUTTON_H */

View File

@@ -0,0 +1,49 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#include "titanic/game/elevator_action_area.h"
#include "titanic/core/room_item.h"
namespace Titanic {
BEGIN_MESSAGE_MAP(CElevatorActionArea, CGameObject)
ON_MESSAGE(MouseButtonDownMsg)
END_MESSAGE_MAP()
void CElevatorActionArea::save(SimpleFile *file, int indent) {
file->writeNumberLine(1, indent);
file->writeNumberLine(_value, indent);
CGameObject::save(file, indent);
}
void CElevatorActionArea::load(SimpleFile *file) {
file->readNumber();
_value = file->readNumber();
CGameObject::load(file);
}
bool CElevatorActionArea::MouseButtonDownMsg(CMouseButtonDownMsg *msg) {
CServiceElevatorMsg elevMsg(_value);
elevMsg.execute(findRoom()->findByName("Service Elevator Entity"));
return true;
}
} // End of namespace Titanic

View File

@@ -0,0 +1,51 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#ifndef TITANIC_ELEVATOR_ACTION_AREA_H
#define TITANIC_ELEVATOR_ACTION_AREA_H
#include "titanic/core/game_object.h"
namespace Titanic {
class CElevatorActionArea : public CGameObject {
DECLARE_MESSAGE_MAP;
bool MouseButtonDownMsg(CMouseButtonDownMsg *msg);
public:
int _value;
public:
CLASSDEF;
CElevatorActionArea() : CGameObject(), _value(4) {}
/**
* Save the data for the class to file
*/
void save(SimpleFile *file, int indent) override;
/**
* Load the data for the class from file
*/
void load(SimpleFile *file) override;
};
} // End of namespace Titanic
#endif /* TITANIC_ELEVATOR_ACTION_AREA_H */

View File

@@ -0,0 +1,65 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#include "titanic/game/emma_control.h"
#include "titanic/core/room_item.h"
#include "titanic/sound/auto_music_player.h"
namespace Titanic {
BEGIN_MESSAGE_MAP(CEmmaControl, CBackground)
ON_MESSAGE(EnterViewMsg)
ON_MESSAGE(StatusChangeMsg)
END_MESSAGE_MAP()
void CEmmaControl::save(SimpleFile *file, int indent) {
file->writeNumberLine(1, indent);
file->writeNumberLine(_flag, indent);
file->writeQuotedLine(_hiddenSoundName, indent);
file->writeQuotedLine(_visibleSoundName, indent);
CBackground::save(file, indent);
}
void CEmmaControl::load(SimpleFile *file) {
file->readNumber();
_flag = file->readNumber();
_hiddenSoundName = file->readString();
_visibleSoundName = file->readString();
CBackground::load(file);
}
bool CEmmaControl::EnterViewMsg(CEnterViewMsg *msg) {
setVisible(_flag);
return true;
}
bool CEmmaControl::StatusChangeMsg(CStatusChangeMsg *msg) {
_flag = !_flag;
setVisible(_flag);
CChangeMusicMsg changeMsg(_flag ? _visibleSoundName : _hiddenSoundName, MUSIC_NONE);
changeMsg.execute(findRoom(), CAutoMusicPlayer::_type,
MSGFLAG_SCAN | MSGFLAG_BREAK_IF_HANDLED | MSGFLAG_CLASS_DEF);
return true;
}
} // End of namespace Titanic

View File

@@ -0,0 +1,56 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#ifndef TITANIC_EMMA_CONTROL_H
#define TITANIC_EMMA_CONTROL_H
#include "titanic/core/background.h"
namespace Titanic {
class CEmmaControl : public CBackground {
DECLARE_MESSAGE_MAP;
bool EnterViewMsg(CEnterViewMsg *msg);
bool StatusChangeMsg(CStatusChangeMsg *msg);
private:
bool _flag;
CString _hiddenSoundName;
CString _visibleSoundName;
public:
CLASSDEF;
CEmmaControl() : CBackground(), _flag(false),
_hiddenSoundName("b#39.wav"), _visibleSoundName("b#38.wav") {}
/**
* Save the data for the class to file
*/
void save(SimpleFile *file, int indent) override;
/**
* Load the data for the class from file
*/
void load(SimpleFile *file) override;
};
} // End of namespace Titanic
#endif /* TITANIC_EMMA_CONTROL_H */

View File

@@ -0,0 +1,77 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#include "titanic/game/empty_nut_bowl.h"
#include "titanic/core/room_item.h"
namespace Titanic {
BEGIN_MESSAGE_MAP(CEmptyNutBowl, CGameObject)
ON_MESSAGE(MouseButtonDownMsg)
ON_MESSAGE(ReplaceBowlAndNutsMsg)
ON_MESSAGE(NutPuzzleMsg)
ON_MESSAGE(MouseDragStartMsg)
END_MESSAGE_MAP()
void CEmptyNutBowl::save(SimpleFile *file, int indent) {
file->writeNumberLine(1, indent);
file->writeNumberLine(_flag, indent);
CGameObject::save(file, indent);
}
void CEmptyNutBowl::load(SimpleFile *file) {
file->readNumber();
_flag = file->readNumber();
CGameObject::load(file);
}
bool CEmptyNutBowl::MouseButtonDownMsg(CMouseButtonDownMsg *msg) {
if (_flag) {
CNutPuzzleMsg nutMsg("UnlockBowl");
nutMsg.execute(getRoom(), nullptr, MSGFLAG_SCAN);
_flag = false;
}
return true;
}
bool CEmptyNutBowl::ReplaceBowlAndNutsMsg(CReplaceBowlAndNutsMsg *msg) {
setVisible(false);
_flag = true;
return true;
}
bool CEmptyNutBowl::NutPuzzleMsg(CNutPuzzleMsg *msg) {
if (msg->_action == "NutsGone")
setVisible(true);
return true;
}
bool CEmptyNutBowl::MouseDragStartMsg(CMouseDragStartMsg *msg) {
if (!_flag) {
msg->execute("Ear1");
setVisible(false);
}
return true;
}
} // End of namespace Titanic

View File

@@ -0,0 +1,54 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#ifndef TITANIC_EMPTY_NUT_BOWL_H
#define TITANIC_EMPTY_NUT_BOWL_H
#include "titanic/core/background.h"
namespace Titanic {
class CEmptyNutBowl : public CGameObject {
DECLARE_MESSAGE_MAP;
bool MouseButtonDownMsg(CMouseButtonDownMsg *msg);
bool ReplaceBowlAndNutsMsg(CReplaceBowlAndNutsMsg *msg);
bool NutPuzzleMsg(CNutPuzzleMsg *msg);
bool MouseDragStartMsg(CMouseDragStartMsg *msg);
public:
bool _flag;
public:
CLASSDEF;
CEmptyNutBowl() : CGameObject(), _flag(true) {}
/**
* Save the data for the class to file
*/
void save(SimpleFile *file, int indent) override;
/**
* Load the data for the class from file
*/
void load(SimpleFile *file) override;
};
} // End of namespace Titanic
#endif /* TITANIC_EMPTY_NUT_BOWL_H */

View File

@@ -0,0 +1,72 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#include "titanic/game/end_credit_text.h"
#include "titanic/translation.h"
namespace Titanic {
BEGIN_MESSAGE_MAP(CEndCreditText, CGameObject)
ON_MESSAGE(ActMsg)
ON_MESSAGE(FrameMsg)
ON_MESSAGE(TimerMsg)
END_MESSAGE_MAP()
void CEndCreditText::save(SimpleFile *file, int indent) {
file->writeNumberLine(1, indent);
file->writeNumberLine(_flag, indent);
CGameObject::save(file, indent);
}
void CEndCreditText::load(SimpleFile *file) {
file->readNumber();
_flag = file->readNumber();
CGameObject::load(file);
}
bool CEndCreditText::ActMsg(CActMsg *msg) {
playAmbientSound(TRANSLATE("z#41.wav", "z#573.wav"), VOL_NORMAL, false, false, 0);
createCredits();
_flag = true;
return true;
}
bool CEndCreditText::FrameMsg(CFrameMsg *msg) {
if (_flag) {
if (_credits) {
makeDirty();
} else {
addTimer(5000);
_flag = false;
}
}
return true;
}
bool CEndCreditText::TimerMsg(CTimerMsg *msg) {
setAmbientSoundVolume(VOL_MUTE, 2, -1);
sleep(1000);
quitGame();
return true;
}
} // End of namespace Titanic

View File

@@ -0,0 +1,53 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#ifndef TITANIC_END_CREDIT_TEXT_H
#define TITANIC_END_CREDIT_TEXT_H
#include "titanic/core/game_object.h"
namespace Titanic {
class CEndCreditText : public CGameObject {
DECLARE_MESSAGE_MAP;
bool ActMsg(CActMsg *msg);
bool FrameMsg(CFrameMsg *msg);
bool TimerMsg(CTimerMsg *msg);
private:
bool _flag;
public:
CLASSDEF;
CEndCreditText() : CGameObject(), _flag(false) {}
/**
* Save the data for the class to file
*/
void save(SimpleFile *file, int indent) override;
/**
* Load the data for the class from file
*/
void load(SimpleFile *file) override;
};
} // End of namespace Titanic
#endif /* TITANIC_END_CREDIT_TEXT_H */

View File

@@ -0,0 +1,64 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#include "titanic/game/end_credits.h"
#include "titanic/translation.h"
namespace Titanic {
BEGIN_MESSAGE_MAP(CEndCredits, CGameObject)
ON_MESSAGE(MouseButtonDownMsg)
ON_MESSAGE(FrameMsg)
END_MESSAGE_MAP()
void CEndCredits::save(SimpleFile *file, int indent) {
file->writeNumberLine(1, indent);
file->writeNumberLine(_flag, indent);
CGameObject::save(file, indent);
}
void CEndCredits::load(SimpleFile *file) {
file->readNumber();
_flag = file->readNumber();
CGameObject::load(file);
}
bool CEndCredits::MouseButtonDownMsg(CMouseButtonDownMsg *msg) {
if (_flag) {
deinit();
stopAmbientSound(true, -1);
_flag = false;
} else {
loadSound(TRANSLATE("z#41.wav", "z#573.wav"));
playAmbientSound(TRANSLATE("z#41.wav", "z#573.wav"), VOL_NORMAL, false, false, 0);
_flag = true;
}
return true;
}
bool CEndCredits::FrameMsg(CFrameMsg *msg) {
if (_flag)
makeDirty();
return true;
}
} // End of namespace Titanic

View File

@@ -0,0 +1,52 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#ifndef TITANIC_END_CREDITS_H
#define TITANIC_END_CREDITS_H
#include "titanic/core/game_object.h"
namespace Titanic {
class CEndCredits : public CGameObject {
DECLARE_MESSAGE_MAP;
bool MouseButtonDownMsg(CMouseButtonDownMsg *msg);
bool FrameMsg(CFrameMsg *msg);
public:
bool _flag;
public:
CLASSDEF;
CEndCredits() : CGameObject(), _flag(false) {}
/**
* Save the data for the class to file
*/
void save(SimpleFile *file, int indent) override;
/**
* Load the data for the class from file
*/
void load(SimpleFile *file) override;
};
} // End of namespace Titanic
#endif /* TITANIC_END_CREDITS_H */

View File

@@ -0,0 +1,107 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#include "titanic/game/end_explode_ship.h"
#include "titanic/translation.h"
namespace Titanic {
BEGIN_MESSAGE_MAP(CEndExplodeShip, CGameObject)
ON_MESSAGE(ActMsg)
ON_MESSAGE(TimerMsg)
ON_MESSAGE(MovieEndMsg)
ON_MESSAGE(MovieFrameMsg)
END_MESSAGE_MAP()
void CEndExplodeShip::save(SimpleFile *file, int indent) {
file->writeNumberLine(1, indent);
file->writeNumberLine(_isExploding, indent);
file->writeNumberLine(_unused5, indent);
CGameObject::save(file, indent);
}
void CEndExplodeShip::load(SimpleFile *file) {
file->readNumber();
_isExploding = file->readNumber();
_unused5 = file->readNumber();
CGameObject::load(file);
}
bool CEndExplodeShip::ActMsg(CActMsg *msg) {
if (msg->_action == "Arm Bomb") {
_isExploding = true;
} else if (msg->_action == "Disarm Bomb") {
_isExploding = false;
} else if (msg->_action == "TakeOff") {
loadSound(TRANSLATE("a#31.wav", "a#26.wav"));
loadSound(TRANSLATE("a#14.wav", "a#7.wav"));
playAmbientSound(TRANSLATE("a#13.wav", "a#6.wav"), VOL_NORMAL, true, true, 0);
addTimer(1, 10212, 0);
}
return true;
}
bool CEndExplodeShip::TimerMsg(CTimerMsg *msg) {
if (msg->_actionVal == 1) {
setVisible(true);
playMovie(0, 449, 0);
movieEvent(58);
playMovie(516, _isExploding ? 550 : 551, MOVIE_NOTIFY_OBJECT);
}
if (msg->_actionVal == 3) {
setAmbientSoundVolume(VOL_MUTE, 2, -1);
CActMsg actMsg(_isExploding ? "ExplodeCredits" : "Credits");
actMsg.execute("EndGameCredits");
}
if (msg->_action == "Boom") {
playMovie(550, 583, MOVIE_NOTIFY_OBJECT);
movieEvent(551);
}
return true;
}
bool CEndExplodeShip::MovieEndMsg(CMovieEndMsg *msg) {
if (msg->_endFrame == 550) {
playSound(TRANSLATE("z#399.wav", "a#10.wav"));
startAnimTimer("Boom", 4200, 0);
} else {
addTimer(3, 8000, 0);
}
return true;
}
bool CEndExplodeShip::MovieFrameMsg(CMovieFrameMsg *msg) {
if (msg->_frameNumber == 58)
playSound(TRANSLATE("a#31.wav", "a#26.wav"), 70);
else if (msg->_frameNumber == 551)
playSound(TRANSLATE("a#14.wav", "a#7.wav"));
return true;
}
} // End of namespace Titanic

View File

@@ -0,0 +1,55 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#ifndef TITANIC_END_EXPLODE_SHIP_H
#define TITANIC_END_EXPLODE_SHIP_H
#include "titanic/core/game_object.h"
namespace Titanic {
class CEndExplodeShip : public CGameObject {
DECLARE_MESSAGE_MAP;
bool ActMsg(CActMsg *msg);
bool TimerMsg(CTimerMsg *msg);
bool MovieEndMsg(CMovieEndMsg *msg);
bool MovieFrameMsg(CMovieFrameMsg *msg);
public:
bool _isExploding;
int _unused5;
public:
CLASSDEF;
CEndExplodeShip() : CGameObject(), _isExploding(false), _unused5(0) {}
/**
* Save the data for the class to file
*/
void save(SimpleFile *file, int indent) override;
/**
* Load the data for the class from file
*/
void load(SimpleFile *file) override;
};
} // End of namespace Titanic
#endif /* TITANIC_END_EXPLODE_SHIP_H */

View File

@@ -0,0 +1,87 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#include "titanic/game/end_game_credits.h"
namespace Titanic {
BEGIN_MESSAGE_MAP(CEndGameCredits, CGameObject)
ON_MESSAGE(ActMsg)
ON_MESSAGE(EnterViewMsg)
ON_MESSAGE(MovieEndMsg)
ON_MESSAGE(TimerMsg)
END_MESSAGE_MAP()
CEndGameCredits::CEndGameCredits() : CGameObject(), _flag(false),
_frameRange(0, 28) {
}
void CEndGameCredits::save(SimpleFile *file, int indent) {
file->writeNumberLine(1, indent);
file->writeNumberLine(_flag, indent);
file->writePoint(_frameRange, indent);
CGameObject::save(file, indent);
}
void CEndGameCredits::load(SimpleFile *file) {
file->readNumber();
_flag = file->readNumber();
_frameRange = file->readPoint();
CGameObject::load(file);
}
bool CEndGameCredits::ActMsg(CActMsg *msg) {
if (!_flag) {
if (msg->_action == "ExplodeCredits")
_frameRange = Point(0, 27);
if (msg->_action == "Credits")
_frameRange = Point(28, 46);
changeView("TheEnd.Node 4.N");
}
return true;
}
bool CEndGameCredits::EnterViewMsg(CEnterViewMsg *msg) {
playMovie(_frameRange.x, _frameRange.y, MOVIE_NOTIFY_OBJECT);
return true;
}
bool CEndGameCredits::MovieEndMsg(CMovieEndMsg *msg) {
if (getMovieFrame() == 46) {
CVisibleMsg visibleMsg;
visibleMsg.execute("CreditsBackdrop");
}
addTimer(4000, 0);
return true;
}
bool CEndGameCredits::TimerMsg(CTimerMsg *msg) {
CActMsg actMsg;
actMsg.execute("EndCreditsText");
return true;
}
} // End of namespace Titanic

View File

@@ -0,0 +1,55 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#ifndef TITANIC_END_GAME_CREDITS_H
#define TITANIC_END_GAME_CREDITS_H
#include "titanic/core/game_object.h"
namespace Titanic {
class CEndGameCredits : public CGameObject {
DECLARE_MESSAGE_MAP;
bool ActMsg(CActMsg *msg);
bool EnterViewMsg(CEnterViewMsg *msg);
bool MovieEndMsg(CMovieEndMsg *msg);
bool TimerMsg(CTimerMsg *msg);
private:
bool _flag;
Point _frameRange;
public:
CLASSDEF;
CEndGameCredits();
/**
* Save the data for the class to file
*/
void save(SimpleFile *file, int indent) override;
/**
* Load the data for the class from file
*/
void load(SimpleFile *file) override;
};
} // End of namespace Titanic
#endif /* TITANIC_END_GAME_CREDITS_H */

View File

@@ -0,0 +1,84 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#include "titanic/game/end_sequence_control.h"
#include "titanic/translation.h"
namespace Titanic {
BEGIN_MESSAGE_MAP(CEndSequenceControl, CGameObject)
ON_MESSAGE(TimerMsg)
ON_MESSAGE(MovieEndMsg)
ON_MESSAGE(EnterRoomMsg)
ON_MESSAGE(EnterViewMsg)
END_MESSAGE_MAP()
void CEndSequenceControl::save(SimpleFile *file, int indent) {
file->writeNumberLine(1, indent);
CGameObject::save(file, indent);
}
void CEndSequenceControl::load(SimpleFile *file) {
file->readNumber();
CGameObject::load(file);
}
bool CEndSequenceControl::TimerMsg(CTimerMsg *msg) {
switch (msg->_actionVal) {
case 1:
changeView("TheEnd.Node 2.N");
break;
case 2: {
playSound("ShipFlyingMusic.wav");
CActMsg actMsg("TakeOff");
actMsg.execute("EndExplodeShip");
break;
}
default:
break;
}
return true;
}
bool CEndSequenceControl::MovieEndMsg(CMovieEndMsg *msg) {
setAmbientSoundVolume(VOL_MUTE, 2, -1);
changeView("TheEnd.Node 3.N");
addTimer(2, 1000, 0);
return true;
}
bool CEndSequenceControl::EnterRoomMsg(CEnterRoomMsg *msg) {
petHide();
disableMouse();
addTimer(1, 1000, 0);
playAmbientSound(TRANSLATE("a#15.wav", "a#8.wav"), VOL_NORMAL, true, true, 0, Audio::Mixer::kSpeechSoundType);
return true;
}
bool CEndSequenceControl::EnterViewMsg(CEnterViewMsg *msg) {
playMovie(MOVIE_NOTIFY_OBJECT | MOVIE_WAIT_FOR_FINISH);
movieSetPlaying(true);
return true;
}
} // End of namespace Titanic

View File

@@ -0,0 +1,52 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#ifndef TITANIC_END_SEQUENCE_CONTROL_H
#define TITANIC_END_SEQUENCE_CONTROL_H
#include "titanic/core/game_object.h"
#include "titanic/messages/messages.h"
namespace Titanic {
class CEndSequenceControl : public CGameObject {
DECLARE_MESSAGE_MAP;
bool TimerMsg(CTimerMsg *msg);
bool MovieEndMsg(CMovieEndMsg *msg);
bool EnterRoomMsg(CEnterRoomMsg *msg);
bool EnterViewMsg(CEnterViewMsg *msg);
public:
CLASSDEF;
/**
* Save the data for the class to file
*/
void save(SimpleFile *file, int indent) override;
/**
* Load the data for the class from file
*/
void load(SimpleFile *file) override;
};
} // End of namespace Titanic
#endif /* TITANIC_END_SEQUENCE_CONTROL_H */

View File

@@ -0,0 +1,126 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#include "titanic/game/fan.h"
namespace Titanic {
BEGIN_MESSAGE_MAP(CFan, CGameObject)
ON_MESSAGE(EnterViewMsg)
ON_MESSAGE(StatusChangeMsg)
ON_MESSAGE(MovieEndMsg)
END_MESSAGE_MAP()
void CFan::save(SimpleFile *file, int indent) {
file->writeNumberLine(1, indent);
file->writeNumberLine(_state, indent);
file->writeNumberLine(_value2, indent);
CGameObject::save(file, indent);
}
void CFan::load(SimpleFile *file) {
file->readNumber();
_state = file->readNumber();
_value2 = file->readNumber();
CGameObject::load(file);
}
bool CFan::EnterViewMsg(CEnterViewMsg *msg) {
switch (_state) {
case 0:
loadFrame(0);
break;
case 1:
playMovie(24, 34, MOVIE_REPEAT);
break;
case 2:
playMovie(63, 65, MOVIE_REPEAT);
break;
default:
break;
}
return true;
}
bool CFan::StatusChangeMsg(CStatusChangeMsg *msg) {
if (msg->_newStatus >= -1 && msg->_newStatus < 3) {
int oldState = _state;
_state = msg->_newStatus;
switch (_state) {
case -1:
case 0:
if (oldState == 0)
loadFrame(0);
else if (oldState == 1)
playMovie(24, 34, MOVIE_STOP_PREVIOUS | MOVIE_NOTIFY_OBJECT);
else if (oldState == 2) {
playMovie(66, 79, MOVIE_STOP_PREVIOUS);
playMovie(24, 34, MOVIE_NOTIFY_OBJECT);
}
break;
case 1:
if (oldState == 0)
playMovie(24, 34, MOVIE_REPEAT | MOVIE_STOP_PREVIOUS);
if (oldState == 2)
playMovie(66, 79, MOVIE_NOTIFY_OBJECT | MOVIE_STOP_PREVIOUS);
break;
case 2:
if (oldState == 1)
playMovie(48, 62, MOVIE_NOTIFY_OBJECT | MOVIE_STOP_PREVIOUS);
break;
default:
break;
}
}
msg->execute("PromDeckFanNoises");
return true;
}
bool CFan::MovieEndMsg(CMovieEndMsg *msg) {
switch (_state) {
case -1:
case 0:
loadFrame(0);
break;
case 1:
playMovie(24, 34, MOVIE_REPEAT);
break;
case 2:
playMovie(63, 65, MOVIE_REPEAT);
break;
default:
break;
}
return true;
}
} // End of namespace Titanic

View File

@@ -0,0 +1,53 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#ifndef TITANIC_FAN_H
#define TITANIC_FAN_H
#include "titanic/core/game_object.h"
namespace Titanic {
class CFan : public CGameObject {
DECLARE_MESSAGE_MAP;
bool EnterViewMsg(CEnterViewMsg *msg);
bool StatusChangeMsg(CStatusChangeMsg *msg);
bool MovieEndMsg(CMovieEndMsg *msg);
public:
int _state, _value2;
public:
CLASSDEF;
CFan() : CGameObject(), _state(0), _value2(0) {}
/**
* Save the data for the class to file
*/
void save(SimpleFile *file, int indent) override;
/**
* Load the data for the class from file
*/
void load(SimpleFile *file) override;
};
} // End of namespace Titanic
#endif /* TITANIC_FAN_H */

Some files were not shown because too many files have changed in this diff Show More