Initial commit
This commit is contained in:
45
engines/titanic/game/transport/exit_pellerator.cpp
Normal file
45
engines/titanic/game/transport/exit_pellerator.cpp
Normal file
@@ -0,0 +1,45 @@
|
||||
/* 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/transport/pellerator.h"
|
||||
|
||||
namespace Titanic {
|
||||
|
||||
int CPellerator::_v1;
|
||||
int CPellerator::_v2;
|
||||
|
||||
void CPellerator::save(SimpleFile *file, int indent) const {
|
||||
file->writeNumberLine(1, indent);
|
||||
file->writeNumberLine(_v1, indent);
|
||||
file->writeNumberLine(_v2, indent);
|
||||
|
||||
CTransport::save(file, indent);
|
||||
}
|
||||
|
||||
void CPellerator::load(SimpleFile *file) {
|
||||
file->readNumber();
|
||||
_v1 = file->readNumber();
|
||||
_v2 = file->readNumber();
|
||||
|
||||
CTransport::load(file);
|
||||
}
|
||||
|
||||
} // End of namespace Titanic
|
||||
49
engines/titanic/game/transport/exit_pellerator.h
Normal file
49
engines/titanic/game/transport/exit_pellerator.h
Normal 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_PELLERATOR_H
|
||||
#define TITANIC_PELLERATOR_H
|
||||
|
||||
#include "titanic/game/transport/transport.h"
|
||||
|
||||
namespace Titanic {
|
||||
|
||||
class CPellerator : public CTransport {
|
||||
private:
|
||||
static int _v1;
|
||||
static int _v2;
|
||||
public:
|
||||
CLASSDEF;
|
||||
|
||||
/**
|
||||
* Save the data for the class to file
|
||||
*/
|
||||
virtual void save(SimpleFile *file, int indent);
|
||||
|
||||
/**
|
||||
* Load the data for the class from file
|
||||
*/
|
||||
virtual void load(SimpleFile *file);
|
||||
};
|
||||
|
||||
} // End of namespace Titanic
|
||||
|
||||
#endif /* TITANIC_PELLERATOR_H */
|
||||
53
engines/titanic/game/transport/gondolier.cpp
Normal file
53
engines/titanic/game/transport/gondolier.cpp
Normal 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/transport/gondolier.h"
|
||||
|
||||
namespace Titanic {
|
||||
|
||||
BEGIN_MESSAGE_MAP(CGondolier, CTransport)
|
||||
ON_MESSAGE(StatusChangeMsg)
|
||||
END_MESSAGE_MAP()
|
||||
|
||||
int CGondolier::_v1;
|
||||
int CGondolier::_v2;
|
||||
|
||||
void CGondolier::save(SimpleFile *file, int indent) {
|
||||
file->writeNumberLine(1, indent);
|
||||
file->writeNumberLine(_v1, indent);
|
||||
file->writeNumberLine(_v2, indent);
|
||||
CTransport::save(file, indent);
|
||||
}
|
||||
|
||||
void CGondolier::load(SimpleFile *file) {
|
||||
file->readNumber();
|
||||
_v1 = file->readNumber();
|
||||
_v2 = file->readNumber();
|
||||
CTransport::load(file);
|
||||
}
|
||||
|
||||
bool CGondolier::StatusChangeMsg(CStatusChangeMsg *msg) {
|
||||
CShowTextMsg textMsg(GONDOLIERS_FIRST_CLASS_ONLY);
|
||||
textMsg.execute("PET");
|
||||
return true;
|
||||
}
|
||||
|
||||
} // End of namespace Titanic
|
||||
51
engines/titanic/game/transport/gondolier.h
Normal file
51
engines/titanic/game/transport/gondolier.h
Normal 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_GONDOLIER_H
|
||||
#define TITANIC_GONDOLIER_H
|
||||
|
||||
#include "titanic/game/transport/transport.h"
|
||||
|
||||
namespace Titanic {
|
||||
|
||||
class CGondolier : public CTransport {
|
||||
DECLARE_MESSAGE_MAP;
|
||||
bool StatusChangeMsg(CStatusChangeMsg *msg);
|
||||
private:
|
||||
static int _v1;
|
||||
static int _v2;
|
||||
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_GONDOLIER_H */
|
||||
329
engines/titanic/game/transport/lift.cpp
Normal file
329
engines/titanic/game/transport/lift.cpp
Normal file
@@ -0,0 +1,329 @@
|
||||
/* 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/transport/lift.h"
|
||||
#include "titanic/debugger.h"
|
||||
#include "titanic/moves/multi_move.h"
|
||||
#include "titanic/pet_control/pet_control.h"
|
||||
#include "titanic/translation.h"
|
||||
|
||||
namespace Titanic {
|
||||
|
||||
BEGIN_MESSAGE_MAP(CLift, CTransport)
|
||||
ON_MESSAGE(StatusChangeMsg)
|
||||
ON_MESSAGE(MovieEndMsg)
|
||||
ON_MESSAGE(EnterViewMsg)
|
||||
ON_MESSAGE(EnterRoomMsg)
|
||||
ON_MESSAGE(LeaveRoomMsg)
|
||||
ON_MESSAGE(ActMsg)
|
||||
END_MESSAGE_MAP()
|
||||
|
||||
bool CLift::_hasHead;
|
||||
bool CLift::_hasCorrectHead;
|
||||
int CLift::_elevator1Floor;
|
||||
int CLift::_elevator2Floor;
|
||||
int CLift::_elevator3Floor;
|
||||
int CLift::_elevator4Floor;
|
||||
|
||||
void CLift::save(SimpleFile *file, int indent) {
|
||||
file->writeNumberLine(1, indent);
|
||||
file->writeNumberLine(_hasHead, indent);
|
||||
file->writeNumberLine(_elevator1Floor, indent);
|
||||
file->writeNumberLine(_elevator2Floor, indent);
|
||||
file->writeNumberLine(_elevator3Floor, indent);
|
||||
file->writeNumberLine(_elevator4Floor, indent);
|
||||
file->writeNumberLine(_liftNum, indent);
|
||||
file->writeNumberLine(_hasCorrectHead, indent);
|
||||
|
||||
CTransport::save(file, indent);
|
||||
}
|
||||
|
||||
void CLift::load(SimpleFile *file) {
|
||||
file->readNumber();
|
||||
_hasHead = file->readNumber();
|
||||
_elevator1Floor = file->readNumber();
|
||||
_elevator2Floor = file->readNumber();
|
||||
_elevator3Floor = file->readNumber();
|
||||
_elevator4Floor = file->readNumber();
|
||||
_liftNum = file->readNumber();
|
||||
_hasCorrectHead = file->readNumber();
|
||||
|
||||
CTransport::load(file);
|
||||
}
|
||||
|
||||
bool CLift::StatusChangeMsg(CStatusChangeMsg *msg) {
|
||||
CPetControl *pet = getPetControl();
|
||||
if ((!_hasHead && pet->getRoomsElevatorNum() == 4) ||
|
||||
(!_hasCorrectHead && pet->getRoomsElevatorNum() == 4))
|
||||
return true;
|
||||
|
||||
int oldFloorNum = msg->_oldStatus;
|
||||
int floorNum = msg->_newStatus;
|
||||
int oldClass = 1, newClass = 1;
|
||||
if (oldFloorNum > 27)
|
||||
oldClass = 3;
|
||||
else if (oldFloorNum > 19)
|
||||
oldClass = 2;
|
||||
if (floorNum > 27)
|
||||
newClass = 3;
|
||||
else if (floorNum > 19)
|
||||
newClass = 2;
|
||||
|
||||
static const int UP_FRAME_NUMBERS[40] = {
|
||||
0, 8, 13, 18, 23, 28, 33, 38, 43, 48, 53, 58,
|
||||
63, 68, 73, 78, 83, 88, 93, 118, 123, 128, 133,
|
||||
138, 143, 148, 153, 228, 233, 238, 243, 248, 253,
|
||||
258, 263, 268, 273, 278, 298, 299
|
||||
};
|
||||
static const int DOWN_FRAME_NUMBERS[39] = {
|
||||
598, 589, 584, 579, 574, 569, 564, 559, 554, 549,
|
||||
544, 539, 534, 529, 524, 519, 514, 509, 504, 479,
|
||||
474, 469, 464, 459, 454, 449, 444, 369, 364, 359,
|
||||
354, 349, 344, 339, 334, 329, 324, 319, 299
|
||||
};
|
||||
|
||||
pet->setRoomsFloorNum(floorNum);
|
||||
if (pet->getRoomsElevatorNum() == 2 || pet->getRoomsElevatorNum() == 4) {
|
||||
if (floorNum > 27)
|
||||
floorNum = 27;
|
||||
if (oldFloorNum > 27)
|
||||
oldFloorNum = 27;
|
||||
}
|
||||
|
||||
changeView("Lift.Node 1.N");
|
||||
CTurnOn onMsg;
|
||||
onMsg.execute("LiftHood");
|
||||
|
||||
CString debugStr;
|
||||
if (floorNum > oldFloorNum) {
|
||||
// Animate lift going up
|
||||
_startFrame = UP_FRAME_NUMBERS[oldFloorNum - 1];
|
||||
_endFrame = UP_FRAME_NUMBERS[floorNum - 1];
|
||||
|
||||
if (oldClass == newClass) {
|
||||
debugStr = CString::format("Same (%d-%d)", _startFrame, _endFrame);
|
||||
playMovie(_startFrame, _endFrame, MOVIE_NOTIFY_OBJECT | MOVIE_WAIT_FOR_FINISH);
|
||||
} else if (oldClass == 1 && newClass == 2) {
|
||||
debugStr = CString::format("1 to 2 (%d-108, 108-%d)", _startFrame, _endFrame);
|
||||
playMovie(_startFrame, 108, MOVIE_NOTIFY_OBJECT | MOVIE_WAIT_FOR_FINISH);
|
||||
playMovie(108, _endFrame, MOVIE_NOTIFY_OBJECT | MOVIE_WAIT_FOR_FINISH);
|
||||
} else if (oldClass == 1 && newClass == 3) {
|
||||
debugStr = CString::format("1 to 3 (%d-108, 108-190, 190-%d)", _startFrame, _endFrame);
|
||||
playMovie(_startFrame, 108, MOVIE_NOTIFY_OBJECT | MOVIE_WAIT_FOR_FINISH);
|
||||
playMovie(108, 190, MOVIE_NOTIFY_OBJECT | MOVIE_WAIT_FOR_FINISH);
|
||||
playMovie(190, _endFrame, MOVIE_NOTIFY_OBJECT | MOVIE_WAIT_FOR_FINISH);
|
||||
} else {
|
||||
debugStr = CString::format("2 to 3 (%d-190, 190-%d)", _startFrame, _endFrame);
|
||||
playMovie(_startFrame, 190, MOVIE_NOTIFY_OBJECT | MOVIE_WAIT_FOR_FINISH);
|
||||
playMovie(190, _endFrame, MOVIE_NOTIFY_OBJECT | MOVIE_WAIT_FOR_FINISH);
|
||||
}
|
||||
}
|
||||
|
||||
if (floorNum < oldFloorNum) {
|
||||
// Animate lift going down
|
||||
_startFrame = DOWN_FRAME_NUMBERS[oldFloorNum - 1];
|
||||
_endFrame = DOWN_FRAME_NUMBERS[floorNum - 1];
|
||||
|
||||
if (oldClass == newClass) {
|
||||
debugStr = CString::format("Same (%d-%d)", _startFrame, _endFrame);
|
||||
playMovie(_startFrame, _endFrame, MOVIE_NOTIFY_OBJECT | MOVIE_WAIT_FOR_FINISH);
|
||||
} else if (oldClass == 3 && newClass == 2) {
|
||||
debugStr = CString::format("3 to 2 (%d-407, 407-%d)", _startFrame, _endFrame);
|
||||
playMovie(_startFrame, 407, MOVIE_NOTIFY_OBJECT | MOVIE_WAIT_FOR_FINISH);
|
||||
playMovie(407, _endFrame, MOVIE_NOTIFY_OBJECT | MOVIE_WAIT_FOR_FINISH);
|
||||
} else if (oldClass == 3 && newClass == 1) {
|
||||
debugStr = CString::format("3 to 1 (%d-407, 407-489, 489-%d)", _startFrame, _endFrame);
|
||||
playMovie(_startFrame, 407, MOVIE_NOTIFY_OBJECT | MOVIE_WAIT_FOR_FINISH);
|
||||
playMovie(407, 489, MOVIE_NOTIFY_OBJECT | MOVIE_WAIT_FOR_FINISH);
|
||||
playMovie(489, _endFrame, MOVIE_NOTIFY_OBJECT | MOVIE_WAIT_FOR_FINISH);
|
||||
} else {
|
||||
debugStr = CString::format("2 to 1 (%d-489, 489-%d)", _startFrame, _endFrame);
|
||||
playMovie(_startFrame, 489, MOVIE_NOTIFY_OBJECT | MOVIE_WAIT_FOR_FINISH);
|
||||
playMovie(489, _endFrame, MOVIE_NOTIFY_OBJECT | MOVIE_WAIT_FOR_FINISH);
|
||||
}
|
||||
}
|
||||
|
||||
CShipSettingMsg settingMsg;
|
||||
switch (pet->getRoomsElevatorNum()) {
|
||||
case 1:
|
||||
_elevator1Floor = floorNum;
|
||||
break;
|
||||
case 2:
|
||||
_elevator2Floor = floorNum;
|
||||
_elevator4Floor = oldFloorNum;
|
||||
settingMsg._value = oldFloorNum;
|
||||
settingMsg.execute("SGTStateroomTV");
|
||||
break;
|
||||
case 3:
|
||||
_elevator3Floor = floorNum;
|
||||
break;
|
||||
case 4:
|
||||
_elevator4Floor = floorNum;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
debugC(1, kDebugScripts, "%s", debugStr.c_str());
|
||||
return true;
|
||||
}
|
||||
|
||||
bool CLift::MovieEndMsg(CMovieEndMsg *msg) {
|
||||
switch (msg->_endFrame) {
|
||||
case 108:
|
||||
setAmbientSoundVolume(VOL_MUTE, 1, 0);
|
||||
setAmbientSoundVolume(VOL_QUIET, 1, 1);
|
||||
break;
|
||||
|
||||
case 190:
|
||||
setAmbientSoundVolume(VOL_MUTE, 1, 1);
|
||||
setAmbientSoundVolume(VOL_QUIET, 1, 2);
|
||||
break;
|
||||
|
||||
case 407:
|
||||
setAmbientSoundVolume(VOL_MUTE, 1, 2);
|
||||
setAmbientSoundVolume(VOL_QUIET, 1, 1);
|
||||
break;
|
||||
|
||||
case 489:
|
||||
setAmbientSoundVolume(VOL_MUTE, 1, 1);
|
||||
setAmbientSoundVolume(VOL_QUIET, 1, 0);
|
||||
break;
|
||||
|
||||
default: {
|
||||
CActMsg actMsg("LiftArrive");
|
||||
actMsg.execute("Liftbot");
|
||||
sleep(500);
|
||||
playSound("352 gp button 1.wav");
|
||||
|
||||
CTurnOff offMsg;
|
||||
offMsg.execute("LiftHood");
|
||||
changeView("Lift.Node 1.W");
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool CLift::EnterViewMsg(CEnterViewMsg *msg) {
|
||||
static const int FRAME_NUMBERS[40] = {
|
||||
0, 8, 13, 18, 23, 28, 33, 38, 43, 48, 53, 58, 63, 68, 73,
|
||||
78, 83, 88, 93, 118, 123, 128, 133, 138, 143, 148, 153,
|
||||
228, 233, 238, 243, 248, 253, 258, 263, 268, 273, 278, 298
|
||||
};
|
||||
|
||||
CPetControl *pet = getPetControl();
|
||||
loadFrame(FRAME_NUMBERS[pet->getRoomsFloorNum() - 1]);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool CLift::EnterRoomMsg(CEnterRoomMsg *msg) {
|
||||
if (isEquals("Well")) {
|
||||
CPetControl *pet = getPetControl();
|
||||
int floorNum = pet->getRoomsFloorNum();
|
||||
int elevNum = pet->getRoomsElevatorNum();
|
||||
loadSound(TRANSLATE("z#520.wav", "z#259.wav"));
|
||||
loadSound(TRANSLATE("z#519.wav", "z#258.wav"));
|
||||
loadSound(TRANSLATE("z#518.wav", "z#257.wav"));
|
||||
|
||||
if (elevNum == 4 && _hasHead && !_hasCorrectHead) {
|
||||
CVisibleMsg visibleMsg;
|
||||
visibleMsg.execute("GetLiftEye");
|
||||
}
|
||||
|
||||
if (floorNum < 20) {
|
||||
playAmbientSound(TRANSLATE("z#520.wav", "z#259.wav"), VOL_QUIET, true, true, 0);
|
||||
playAmbientSound(TRANSLATE("z#519.wav", "z#258.wav"), VOL_MUTE, false, true, 1);
|
||||
playAmbientSound(TRANSLATE("z#518.wav", "z#257.wav"), VOL_MUTE, false, true, 2);
|
||||
} else if (floorNum < 28) {
|
||||
playAmbientSound(TRANSLATE("z#520.wav", "z#259.wav"), VOL_MUTE, false, true, 0);
|
||||
playAmbientSound(TRANSLATE("z#519.wav", "z#258.wav"), VOL_QUIET, true, true, 1);
|
||||
playAmbientSound(TRANSLATE("z#518.wav", "z#257.wav"), VOL_MUTE, false, true, 2);
|
||||
} else {
|
||||
playAmbientSound(TRANSLATE("z#520.wav", "z#259.wav"), VOL_MUTE, false, true, 0);
|
||||
playAmbientSound(TRANSLATE("z#519.wav", "z#258.wav"), VOL_MUTE, false, true, 1);
|
||||
playAmbientSound(TRANSLATE("z#518.wav", "z#257.wav"), VOL_QUIET, true, true, 2);
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool CLift::LeaveRoomMsg(CLeaveRoomMsg *msg) {
|
||||
stopAmbientSound(true, -1);
|
||||
|
||||
CPetControl *pet = getPetControl();
|
||||
if (pet->getRoomsElevatorNum() == 4 && _hasHead && !_hasCorrectHead) {
|
||||
CVisibleMsg visibleMsg(false);
|
||||
visibleMsg.execute("Eye2");
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool CLift::ActMsg(CActMsg *msg) {
|
||||
if (msg->_action == "LoseHead") {
|
||||
_hasHead = false;
|
||||
_hasCorrectHead = false;
|
||||
|
||||
CActMsg actMsg1("Lift.Node 2.N");
|
||||
actMsg1.execute("RPanInLiftW");
|
||||
CActMsg actMsg2("Lift.Node 2.S");
|
||||
actMsg2.execute("LPanInLiftW");
|
||||
|
||||
// WORKAROUND: In the original, when Lift 4's head is removed, the other
|
||||
// view directions use Node 2. These "removed" views have links, but their
|
||||
// movement cursors weren't correctly set. This fixes them
|
||||
CNamedItem *node2 = findRoom()->findByName("Node 2");
|
||||
static_cast<CMultiMove *>(node2->findByName("LMultiLiftPan"))->_cursorId = CURSOR_MOVE_LEFT;
|
||||
static_cast<CLinkItem *>(node2->findByName("_PANR,2,N,E"))->_cursorId = CURSOR_MOVE_RIGHT;
|
||||
static_cast<CLinkItem *>(node2->findByName("_PANL,2,E,N"))->_cursorId = CURSOR_MOVE_LEFT;
|
||||
static_cast<CLinkItem *>(node2->findByName("_PANR,2,E,S"))->_cursorId = CURSOR_MOVE_RIGHT;
|
||||
static_cast<CLinkItem *>(node2->findByName("_PANL,2,S,E"))->_cursorId = CURSOR_MOVE_LEFT;
|
||||
static_cast<CMultiMove *>(node2->findByName("RMultiLiftPan"))->_cursorId = CURSOR_MOVE_RIGHT;
|
||||
} else if (msg->_action == "AddWrongHead") {
|
||||
_hasHead = true;
|
||||
_hasCorrectHead = false;
|
||||
|
||||
CActMsg actMsg1("Lift.Node 1.N");
|
||||
actMsg1.execute("RPanInLiftW");
|
||||
CActMsg actMsg2("Lift.Node 1.S");
|
||||
actMsg2.execute("LPanInLiftW");
|
||||
} else if (msg->_action == "AddRightHead") {
|
||||
_hasHead = true;
|
||||
_hasCorrectHead = true;
|
||||
petSetRoomsElevatorBroken(false);
|
||||
|
||||
CActMsg actMsg1("Lift.Node 1.N");
|
||||
actMsg1.execute("RPanInLiftW");
|
||||
CActMsg actMsg2("Lift.Node 1.S");
|
||||
actMsg2.execute("LPanInLiftW");
|
||||
CActMsg actMsg3("ActivateLift");
|
||||
actMsg3.execute("Liftbot");
|
||||
}
|
||||
|
||||
CVisibleMsg visibleMsg;
|
||||
visibleMsg.execute("LiftbotWithoutHead");
|
||||
return true;
|
||||
}
|
||||
|
||||
} // End of namespace Titanic
|
||||
64
engines/titanic/game/transport/lift.h
Normal file
64
engines/titanic/game/transport/lift.h
Normal 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_LIFT_H
|
||||
#define TITANIC_LIFT_H
|
||||
|
||||
#include "titanic/game/transport/transport.h"
|
||||
#include "titanic/messages/messages.h"
|
||||
|
||||
namespace Titanic {
|
||||
|
||||
class CLift : public CTransport {
|
||||
DECLARE_MESSAGE_MAP;
|
||||
bool StatusChangeMsg(CStatusChangeMsg *msg);
|
||||
bool MovieEndMsg(CMovieEndMsg *msg);
|
||||
bool EnterViewMsg(CEnterViewMsg *msg);
|
||||
bool EnterRoomMsg(CEnterRoomMsg *msg);
|
||||
bool LeaveRoomMsg(CLeaveRoomMsg *msg);
|
||||
bool ActMsg(CActMsg *msg);
|
||||
public:
|
||||
static bool _hasHead;
|
||||
static bool _hasCorrectHead;
|
||||
static int _elevator1Floor;
|
||||
static int _elevator2Floor;
|
||||
static int _elevator3Floor;
|
||||
static int _elevator4Floor;
|
||||
|
||||
int _liftNum;
|
||||
public:
|
||||
CLASSDEF;
|
||||
CLift() : CTransport(), _liftNum(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_LIFT_H */
|
||||
234
engines/titanic/game/transport/lift_indicator.cpp
Normal file
234
engines/titanic/game/transport/lift_indicator.cpp
Normal file
@@ -0,0 +1,234 @@
|
||||
/* 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/transport/lift_indicator.h"
|
||||
#include "titanic/game/transport/lift.h"
|
||||
#include "titanic/debugger.h"
|
||||
#include "titanic/pet_control/pet_control.h"
|
||||
|
||||
namespace Titanic {
|
||||
|
||||
BEGIN_MESSAGE_MAP(CLiftindicator, CLift)
|
||||
ON_MESSAGE(EnterViewMsg)
|
||||
ON_MESSAGE(LeaveViewMsg)
|
||||
ON_MESSAGE(PETActivateMsg)
|
||||
ON_MESSAGE(MovieEndMsg)
|
||||
ON_MESSAGE(EnterRoomMsg)
|
||||
ON_MESSAGE(LeaveRoomMsg)
|
||||
ON_MESSAGE(TimerMsg)
|
||||
END_MESSAGE_MAP()
|
||||
|
||||
CLiftindicator::CLiftindicator() : CLift(),
|
||||
_multiplier(0), _startY(0), _endY(0) {
|
||||
}
|
||||
|
||||
void CLiftindicator::save(SimpleFile *file, int indent) {
|
||||
file->writeNumberLine(1, indent);
|
||||
file->writeNumberLine(_multiplier, indent);
|
||||
file->writePoint(_indicatorPos, indent);
|
||||
file->writeNumberLine(_startY, indent);
|
||||
file->writeNumberLine(_endY, indent);
|
||||
|
||||
CLift::save(file, indent);
|
||||
}
|
||||
|
||||
void CLiftindicator::load(SimpleFile *file) {
|
||||
file->readNumber();
|
||||
_multiplier = file->readNumber();
|
||||
_indicatorPos = file->readPoint();
|
||||
_startY = file->readNumber();
|
||||
_endY = file->readNumber();
|
||||
|
||||
CLift::load(file);
|
||||
}
|
||||
|
||||
bool CLiftindicator::EnterViewMsg(CEnterViewMsg *msg) {
|
||||
double multiplier = _multiplier * 0.037037037;
|
||||
CPetControl *pet = getPetControl();
|
||||
int floorNum = pet->getRoomsFloorNum();
|
||||
debugC(kDebugScripts, "Lifts = %d,%d,%d,%d, %d",
|
||||
CLift::_elevator1Floor, CLift::_elevator2Floor,
|
||||
CLift::_elevator3Floor, CLift::_elevator4Floor,
|
||||
floorNum);
|
||||
|
||||
if ((pet->petGetRoomsWellEntry() & 1) == (_liftNum & 1)) {
|
||||
petSetRemoteTarget();
|
||||
petSetArea(PET_REMOTE);
|
||||
petHighlightGlyph(0);
|
||||
|
||||
petDisplayMessage(OUTSIDE_ELEVATOR_NUM, petGetRoomsWellEntry());
|
||||
|
||||
debugC(kDebugScripts, "Claiming PET - %d, Multiplier = %f",
|
||||
_liftNum, multiplier);
|
||||
}
|
||||
|
||||
switch (_liftNum) {
|
||||
case 0:
|
||||
loadFrame(pet->getRoomsFloorNum());
|
||||
break;
|
||||
|
||||
case 1:
|
||||
case 3:
|
||||
switch (petGetRoomsWellEntry()) {
|
||||
case 1:
|
||||
case 2:
|
||||
setPosition(Point(_bounds.left, _indicatorPos.y +
|
||||
(int)(multiplier * CLift::_elevator1Floor)));
|
||||
_startFrame = CLift::_elevator1Floor;
|
||||
break;
|
||||
|
||||
case 3:
|
||||
case 4:
|
||||
setPosition(Point(_bounds.left, _indicatorPos.y +
|
||||
(int)(multiplier * CLift::_elevator3Floor)));
|
||||
_startFrame = CLift::_elevator3Floor;
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
case 2:
|
||||
case 4:
|
||||
switch (petGetRoomsWellEntry()) {
|
||||
case 1:
|
||||
case 2:
|
||||
setPosition(Point(_bounds.left, _indicatorPos.y +
|
||||
(int)(multiplier * CLift::_elevator2Floor)));
|
||||
_startFrame = CLift::_elevator2Floor;
|
||||
break;
|
||||
|
||||
case 3:
|
||||
case 4:
|
||||
setPosition(Point(_bounds.left, _indicatorPos.y +
|
||||
(int)(multiplier * CLift::_elevator4Floor)));
|
||||
_startFrame = CLift::_elevator4Floor;
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool CLiftindicator::LeaveViewMsg(CLeaveViewMsg *msg) {
|
||||
petClear();
|
||||
return true;
|
||||
}
|
||||
|
||||
bool CLiftindicator::PETActivateMsg(CPETActivateMsg *msg) {
|
||||
double multiplier = _multiplier * 0.037037037;
|
||||
CPetControl *pet = getPetControl();
|
||||
|
||||
if (msg->_name == "Lift") {
|
||||
if (petDoorOrBellbotPresent()) {
|
||||
petDisplayMessage(1, BOT_BLOCKING_ELEVATOR);
|
||||
} else {
|
||||
_endFrame = pet->getRoomsFloorNum();
|
||||
|
||||
if (petGetRoomsWellEntry() == 4 && !CLift::_hasCorrectHead
|
||||
&& pet->getRoomsFloorNum() != CLift::_elevator4Floor) {
|
||||
petDisplayMessage(1, ELEVATOR_NON_FUNCTIONAL);
|
||||
} else {
|
||||
_startY = _indicatorPos.y + (int)(_startFrame * multiplier);
|
||||
_endY = _indicatorPos.y + (int)(_endFrame * multiplier);
|
||||
lockMouse();
|
||||
addTimer(100);
|
||||
|
||||
if (petGetRoomsWellEntry() == 2) {
|
||||
CLift::_elevator4Floor = CLift::_elevator2Floor;
|
||||
CShipSettingMsg settingMsg;
|
||||
settingMsg._value = CLift::_elevator4Floor;
|
||||
settingMsg.execute("SGTStateroomTV");
|
||||
}
|
||||
|
||||
switch (petGetRoomsWellEntry()) {
|
||||
case 1:
|
||||
CLift::_elevator1Floor = pet->getRoomsFloorNum();
|
||||
break;
|
||||
case 2:
|
||||
CLift::_elevator2Floor = pet->getRoomsFloorNum();
|
||||
break;
|
||||
case 3:
|
||||
CLift::_elevator3Floor = pet->getRoomsFloorNum();
|
||||
break;
|
||||
case 4:
|
||||
CLift::_elevator4Floor = pet->getRoomsFloorNum();
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
debugC(kDebugScripts, "Lifts = %d,%d,%d,%d %d",
|
||||
CLift::_elevator1Floor, CLift::_elevator2Floor,
|
||||
CLift::_elevator3Floor, CLift::_elevator4Floor,
|
||||
petGetRoomsWellEntry());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool CLiftindicator::MovieEndMsg(CMovieEndMsg *msg) {
|
||||
playSound("357 gp button 1.wav");
|
||||
sleep(100);
|
||||
changeView("Lift.Node 1.N");
|
||||
|
||||
unlockMouse();
|
||||
return true;
|
||||
}
|
||||
|
||||
bool CLiftindicator::EnterRoomMsg(CEnterRoomMsg *msg) {
|
||||
return true;
|
||||
}
|
||||
|
||||
bool CLiftindicator::LeaveRoomMsg(CLeaveRoomMsg *msg) {
|
||||
return true;
|
||||
}
|
||||
|
||||
bool CLiftindicator::TimerMsg(CTimerMsg *msg) {
|
||||
debugC(kDebugScripts, "Start %d, End %d", _startY, _endY);
|
||||
|
||||
if (_startY > _endY) {
|
||||
setPosition(Point(_bounds.left, _bounds.top - 1));
|
||||
--_startY;
|
||||
addTimer(20);
|
||||
} else if (_startY < _endY) {
|
||||
setPosition(Point(_bounds.left, _bounds.top + 1));
|
||||
++_startY;
|
||||
addTimer(20);
|
||||
} else {
|
||||
CMovieEndMsg endMsg(0, 0);
|
||||
endMsg.execute(this);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
} // End of namespace Titanic
|
||||
62
engines/titanic/game/transport/lift_indicator.h
Normal file
62
engines/titanic/game/transport/lift_indicator.h
Normal 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/>.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef TITANIC_LIFT_INDICATOR_H
|
||||
#define TITANIC_LIFT_INDICATOR_H
|
||||
|
||||
#include "titanic/game/transport/lift.h"
|
||||
#include "titanic/messages/messages.h"
|
||||
#include "titanic/messages/pet_messages.h"
|
||||
|
||||
namespace Titanic {
|
||||
|
||||
class CLiftindicator : public CLift {
|
||||
DECLARE_MESSAGE_MAP;
|
||||
bool EnterViewMsg(CEnterViewMsg *msg);
|
||||
bool LeaveViewMsg(CLeaveViewMsg *msg);
|
||||
bool PETActivateMsg(CPETActivateMsg *msg);
|
||||
bool MovieEndMsg(CMovieEndMsg *msg);
|
||||
bool EnterRoomMsg(CEnterRoomMsg *msg);
|
||||
bool LeaveRoomMsg(CLeaveRoomMsg *msg);
|
||||
bool TimerMsg(CTimerMsg *msg);
|
||||
private:
|
||||
int _multiplier;
|
||||
Point _indicatorPos;
|
||||
int _startY;
|
||||
int _endY;
|
||||
public:
|
||||
CLASSDEF;
|
||||
CLiftindicator();
|
||||
|
||||
/**
|
||||
* 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_LIFT_INDICATOR_H */
|
||||
384
engines/titanic/game/transport/pellerator.cpp
Normal file
384
engines/titanic/game/transport/pellerator.cpp
Normal file
@@ -0,0 +1,384 @@
|
||||
/* 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/transport/pellerator.h"
|
||||
#include "titanic/core/room_item.h"
|
||||
#include "titanic/translation.h"
|
||||
|
||||
namespace Titanic {
|
||||
|
||||
static const char *const WAVE_NAMES_EN[10] = {
|
||||
"z#465.wav", "z#456.wav", "z#455.wav", "z#453.wav",
|
||||
"z#452.wav", "NoStandingInFunnyWays", "z#450.wav",
|
||||
"z#449.wav", "z#435.wav", "z#434.wav"
|
||||
};
|
||||
|
||||
static const char *const WAVE_NAMES_DE[10] = {
|
||||
"z#202.wav", "z#193.wav", "z#192.wav", "z#190.wav",
|
||||
"z#189.wav", "NoStandingInFunnyWays", "z#187.wav",
|
||||
"z#186.wav", "z#180.wav", "z#179.wav"
|
||||
};
|
||||
|
||||
BEGIN_MESSAGE_MAP(CPellerator, CTransport)
|
||||
ON_MESSAGE(StatusChangeMsg)
|
||||
ON_MESSAGE(EnterRoomMsg)
|
||||
ON_MESSAGE(MovieEndMsg)
|
||||
ON_MESSAGE(TimerMsg)
|
||||
END_MESSAGE_MAP()
|
||||
|
||||
int CPellerator::_soundHandle;
|
||||
int CPellerator::_destination;
|
||||
|
||||
CPellerator::CPellerator() : CTransport() {
|
||||
}
|
||||
|
||||
void CPellerator::save(SimpleFile *file, int indent) {
|
||||
file->writeNumberLine(1, indent);
|
||||
file->writeNumberLine(_soundHandle, indent);
|
||||
file->writeNumberLine(_destination, indent);
|
||||
|
||||
CTransport::save(file, indent);
|
||||
}
|
||||
|
||||
void CPellerator::load(SimpleFile *file) {
|
||||
file->readNumber();
|
||||
_soundHandle = file->readNumber();
|
||||
_destination = file->readNumber();
|
||||
|
||||
CTransport::load(file);
|
||||
}
|
||||
|
||||
bool CPellerator::StatusChangeMsg(CStatusChangeMsg *msg) {
|
||||
setVisible(true);
|
||||
int classNum = getPassengerClass();
|
||||
int newDest = msg->_newStatus;
|
||||
|
||||
if (msg->_newStatus == _destination) {
|
||||
petDisplayMessage(1, ALREADY_AT_DESTINATION);
|
||||
} else if (classNum == 3 || (msg->_newStatus > 4 && classNum != 1)) {
|
||||
petDisplayMessage(1, CLASS_NOT_ALLOWED_AT_DEST);
|
||||
} else if (newDest > _destination) {
|
||||
playAmbientSound(TRANSLATE("z#74.wav", "z#605.wav"), VOL_QUIET, true, true, 0);
|
||||
|
||||
CString name = getName();
|
||||
changeView(name == "PelleratorObject2" ?
|
||||
"Pellerator.Node 1.N" : "Pellerator.Node 1.S");
|
||||
|
||||
if (name == "PelleratorObject") {
|
||||
for (; _destination < newDest; ++_destination) {
|
||||
switch (_destination) {
|
||||
case 0:
|
||||
case 1:
|
||||
playMovie(315, 323, 0);
|
||||
for (int idx = 0; idx < 3; ++idx)
|
||||
playMovie(299, 304, 0);
|
||||
playMovie(305, 313, MOVIE_WAIT_FOR_FINISH);
|
||||
break;
|
||||
|
||||
case 2:
|
||||
playMovie(315, 323, 0);
|
||||
for (int idx = 0; idx < 3; ++idx)
|
||||
playMovie(299, 304, 0);
|
||||
for (int idx = 0; idx < 5; ++idx)
|
||||
playMovie(253, 263, 0);
|
||||
playMovie(153, 197, 0);
|
||||
for (int idx = 0; idx < 5; ++idx)
|
||||
playMovie(253, 263, 0);
|
||||
playMovie(290, 293, MOVIE_WAIT_FOR_FINISH);
|
||||
break;
|
||||
|
||||
case 4:
|
||||
playMovie(267, 270, 0);
|
||||
for (int idx = 0; idx < 5; ++idx)
|
||||
playMovie(253, 263, 0);
|
||||
playMovie(3, 71, 0);
|
||||
for (int idx = 0; idx < 3; ++idx)
|
||||
playMovie(253, 263, 0);
|
||||
for (int idx = 0; idx < 7; ++idx)
|
||||
playMovie(336, 341, 0);
|
||||
playMovie(342, 348, MOVIE_WAIT_FOR_FINISH);
|
||||
break;
|
||||
|
||||
case 5:
|
||||
playMovie(315, 323, 0);
|
||||
for (int idx = 0; idx < 7; ++idx)
|
||||
playMovie(299, 304, 0);
|
||||
for (int idx = 0; idx < 3; ++idx)
|
||||
playMovie(253, 263, 0);
|
||||
playMovie(3, 71, 0);
|
||||
for (int idx = 0; idx < 3; ++idx)
|
||||
playMovie(299, 304, 0);
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
for (; _destination < newDest; ++_destination) {
|
||||
switch (_destination) {
|
||||
case 0:
|
||||
case 1:
|
||||
playMovie(315, 323, 0);
|
||||
for (int idx = 0; idx < 3; ++idx)
|
||||
playMovie(299, 304, 0);
|
||||
playMovie(305, 313, MOVIE_WAIT_FOR_FINISH);
|
||||
break;
|
||||
|
||||
case 2:
|
||||
playMovie(315, 323, 0);
|
||||
for (int idx = 0; idx < 4; ++idx)
|
||||
playMovie(299, 304, 0);
|
||||
for (int idx = 0; idx < 15; ++idx)
|
||||
playMovie(245, 255, 0);
|
||||
playMovie(264, 267, MOVIE_WAIT_FOR_FINISH);
|
||||
++_destination;
|
||||
break;
|
||||
|
||||
case 4:
|
||||
playMovie(241, 244, 0);
|
||||
for (int idx = 0; idx < 15; ++idx)
|
||||
playMovie(245, 255, 0);
|
||||
for (int idx = 0; idx < 7; ++idx)
|
||||
playMovie(336, 341, 0);
|
||||
playMovie(342, 348, MOVIE_WAIT_FOR_FINISH);
|
||||
break;
|
||||
|
||||
case 5:
|
||||
playMovie(315, 323, 0);
|
||||
for (int idx = 0; idx < 7; ++idx)
|
||||
playMovie(299, 304, 0);
|
||||
for (int idx = 0; idx < 12; ++idx)
|
||||
playMovie(245, 255, 0);
|
||||
for (int idx = 0; idx < 3; ++idx)
|
||||
playMovie(299, 304, 0);
|
||||
playMovie(305, 313, MOVIE_WAIT_FOR_FINISH);
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
playMovie(264, 264, MOVIE_NOTIFY_OBJECT);
|
||||
_destination = newDest;
|
||||
} else if (newDest < _destination) {
|
||||
playAmbientSound(TRANSLATE("z#74.wav", "z#605.wav"), VOL_QUIET, true, true, 0);
|
||||
|
||||
CString name = getName();
|
||||
changeView(name == "PelleratorObject2" ?
|
||||
"Pellerator.Node 1.N" : "Pellerator.Node 1.S");
|
||||
|
||||
if (name == "PelleratorObject") {
|
||||
for (--_destination; _destination > newDest; --_destination) {
|
||||
switch (_destination) {
|
||||
case 0:
|
||||
case 1:
|
||||
playMovie(351, 359, 0);
|
||||
for (int idx = 0; idx < 3; ++idx)
|
||||
playMovie(336, 341, 0);
|
||||
playMovie(342, 348, MOVIE_WAIT_FOR_FINISH);
|
||||
break;
|
||||
|
||||
case 3:
|
||||
playMovie(241, 244, 0);
|
||||
for (int idx = 0; idx < 5; ++idx)
|
||||
playMovie(245, 255, 0);
|
||||
playMovie(197, 239, 0);
|
||||
for (int idx = 0; idx < 5; ++idx)
|
||||
playMovie(245, 255, 0);
|
||||
for (int idx = 0; idx < 3; ++idx)
|
||||
playMovie(336, 341, 0);
|
||||
playMovie(342, 348, MOVIE_WAIT_FOR_FINISH);
|
||||
--_destination;
|
||||
break;
|
||||
|
||||
case 4:
|
||||
playMovie(315, 323, 0);
|
||||
for (int idx = 0; idx < 7; ++idx)
|
||||
playMovie(299, 304, 0);
|
||||
for (int idx = 0; idx < 3; ++idx)
|
||||
playMovie(245, 255, 0);
|
||||
playMovie(78, 149, 0);
|
||||
for (int idx = 0; idx < 5; ++idx)
|
||||
playMovie(245, 255, 0);
|
||||
playMovie(264, 267, MOVIE_WAIT_FOR_FINISH);
|
||||
break;
|
||||
|
||||
case 5:
|
||||
playMovie(351, 359, 0);
|
||||
for (int idx = 0; idx < 7; ++idx)
|
||||
playMovie(336, 341, 0);
|
||||
for (int idx = 0; idx < 3; ++idx)
|
||||
playMovie(245, 255, 0);
|
||||
playMovie(78, 149, 0);
|
||||
for (int idx = 0; idx < 3; ++idx)
|
||||
playMovie(336, 341, 0);
|
||||
playMovie(342, 348, MOVIE_WAIT_FOR_FINISH);
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
for (--_destination; _destination >= newDest; --_destination) {
|
||||
switch (_destination) {
|
||||
case 0:
|
||||
case 1:
|
||||
playMovie(351, 359, 0);
|
||||
for (int idx = 0; idx < 3; ++idx)
|
||||
playMovie(336, 341, 0);
|
||||
playMovie(342, 348, MOVIE_WAIT_FOR_FINISH);
|
||||
break;
|
||||
|
||||
case 3:
|
||||
playMovie(267, 270, 0);
|
||||
for (int idx = 0; idx < 15; ++idx)
|
||||
playMovie(253, 263, 0);
|
||||
for (int idx = 0; idx < 3; ++idx)
|
||||
playMovie(336, 341, 0);
|
||||
playMovie(342, 348, MOVIE_WAIT_FOR_FINISH);
|
||||
--_destination;
|
||||
break;
|
||||
|
||||
case 4:
|
||||
playMovie(315, 323, 0);
|
||||
for (int idx = 0; idx < 7; ++idx)
|
||||
playMovie(299, 304, 0);
|
||||
for (int idx = 0; idx < 15; ++idx)
|
||||
playMovie(253, 263, 0);
|
||||
playMovie(290, 293, MOVIE_WAIT_FOR_FINISH);
|
||||
break;
|
||||
|
||||
case 5:
|
||||
playMovie(351, 359, 0);
|
||||
for (int idx = 0; idx < 7; ++idx)
|
||||
playMovie(336, 341, 0);
|
||||
for (int idx = 0; idx < 13; ++idx)
|
||||
playMovie(253, 263, 0);
|
||||
for (int idx = 0; idx < 3; ++idx)
|
||||
playMovie(336, 341, 0);
|
||||
playMovie(342, 348, MOVIE_WAIT_FOR_FINISH);
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
playMovie(264, 264, MOVIE_NOTIFY_OBJECT);
|
||||
_destination = newDest;
|
||||
}
|
||||
|
||||
CStatusChangeMsg statusMsg;
|
||||
statusMsg._newStatus = _destination;
|
||||
statusMsg.execute("ExitPellerator");
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool CPellerator::EnterRoomMsg(CEnterRoomMsg *msg) {
|
||||
if (isEquals("PelleratorObject")) {
|
||||
if (g_language == Common::DE_DEU)
|
||||
_soundHandle = queueSound("z#200.wav", _soundHandle);
|
||||
|
||||
for (int idx = 0; idx < 10; ++idx)
|
||||
loadSound(TRANSLATE(WAVE_NAMES_EN[idx], WAVE_NAMES_DE[idx]));
|
||||
addTimer(10000);
|
||||
}
|
||||
|
||||
CString name = msg->_oldRoom ? msg->_oldRoom->getName() : "";
|
||||
int oldVal = _destination;
|
||||
|
||||
if (name.empty()) {
|
||||
// WORKAROUND: Called when loading a savegame, the original reset the
|
||||
// destination to '4' resulting in potentially longer travel times.
|
||||
// Since the destination is saved as part of savegames anyway, I'm
|
||||
// changing this to leave it unchanged
|
||||
oldVal = _destination;
|
||||
} else if (name == "PromenadeDeck") {
|
||||
_destination = 0;
|
||||
} else if (name == "MusicRoomLobby") {
|
||||
_destination = 1;
|
||||
} else if (name == "Bar") {
|
||||
_destination = 2;
|
||||
} else if (name == "TopOfWell") {
|
||||
_destination = 4;
|
||||
} else if (name == "1stClassRestaurant") {
|
||||
_destination = 5;
|
||||
} else if (name == "Arboretum" || name == "FrozenArboretum") {
|
||||
_destination = 6;
|
||||
}
|
||||
|
||||
if (_destination != oldVal) {
|
||||
CStatusChangeMsg statusMsg;
|
||||
statusMsg._newStatus = _destination;
|
||||
statusMsg.execute("ExitPellerator");
|
||||
}
|
||||
|
||||
loadFrame(264);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool CPellerator::MovieEndMsg(CMovieEndMsg *msg) {
|
||||
setVisible(false);
|
||||
stopAmbientSound(true, -1);
|
||||
|
||||
switch (_destination) {
|
||||
case 0:
|
||||
_soundHandle = queueSound(TRANSLATE("z#429.wav", "z#174.wav"), _soundHandle);
|
||||
break;
|
||||
case 1:
|
||||
_soundHandle = queueSound(TRANSLATE("z#430.wav", "z#175.wav"), _soundHandle);
|
||||
break;
|
||||
case 2:
|
||||
_soundHandle = queueSound(TRANSLATE("z#431.wav", "z#176.wav"), _soundHandle);
|
||||
break;
|
||||
case 4:
|
||||
_soundHandle = queueSound(TRANSLATE("z#428.wav", "z#173.wav"), _soundHandle);
|
||||
break;
|
||||
case 5:
|
||||
_soundHandle = queueSound(TRANSLATE("z#433.wav", "z#178.wav"), _soundHandle);
|
||||
break;
|
||||
case 6:
|
||||
_soundHandle = queueSound(TRANSLATE("z#432.wav", "z#177.wav"), _soundHandle);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool CPellerator::TimerMsg(CTimerMsg *msg) {
|
||||
if (compareRoomNameTo("Pellerator")) {
|
||||
_soundHandle = queueSound(TRANSLATE(WAVE_NAMES_EN[getRandomNumber(9)],
|
||||
WAVE_NAMES_DE[getRandomNumber(9)]), _soundHandle);
|
||||
addTimer(20000 + getRandomNumber(10000));
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
} // End of namespace Titanic
|
||||
56
engines/titanic/game/transport/pellerator.h
Normal file
56
engines/titanic/game/transport/pellerator.h
Normal 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_PELLERATOR_H
|
||||
#define TITANIC_PELLERATOR_H
|
||||
|
||||
#include "titanic/game/transport/transport.h"
|
||||
#include "titanic/messages/messages.h"
|
||||
|
||||
namespace Titanic {
|
||||
|
||||
class CPellerator : public CTransport {
|
||||
DECLARE_MESSAGE_MAP;
|
||||
bool StatusChangeMsg(CStatusChangeMsg *msg);
|
||||
bool EnterRoomMsg(CEnterRoomMsg *msg);
|
||||
bool MovieEndMsg(CMovieEndMsg *msg);
|
||||
bool TimerMsg(CTimerMsg *msg);
|
||||
public:
|
||||
static int _soundHandle;
|
||||
static int _destination;
|
||||
public:
|
||||
CLASSDEF;
|
||||
CPellerator();
|
||||
|
||||
/**
|
||||
* 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_PELLERATOR_H */
|
||||
276
engines/titanic/game/transport/service_elevator.cpp
Normal file
276
engines/titanic/game/transport/service_elevator.cpp
Normal file
@@ -0,0 +1,276 @@
|
||||
/* 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/transport/service_elevator.h"
|
||||
#include "titanic/core/room_item.h"
|
||||
#include "titanic/npcs/doorbot.h"
|
||||
#include "titanic/translation.h"
|
||||
|
||||
namespace Titanic {
|
||||
|
||||
BEGIN_MESSAGE_MAP(CServiceElevator, CTransport)
|
||||
ON_MESSAGE(BodyInBilgeRoomMsg)
|
||||
ON_MESSAGE(EnterViewMsg)
|
||||
ON_MESSAGE(ServiceElevatorMsg)
|
||||
ON_MESSAGE(TimerMsg)
|
||||
ON_MESSAGE(ServiceElevatorFloorRequestMsg)
|
||||
ON_MESSAGE(LeaveRoomMsg)
|
||||
ON_MESSAGE(OpeningCreditsMsg)
|
||||
END_MESSAGE_MAP()
|
||||
|
||||
bool CServiceElevator::_v1;
|
||||
int CServiceElevator::_v2;
|
||||
int CServiceElevator::_v3;
|
||||
|
||||
CServiceElevator::CServiceElevator() : CTransport(),
|
||||
_fieldF8(0), _soundHandle1(0), _timerId(0), _soundHandle2(0) {
|
||||
}
|
||||
|
||||
void CServiceElevator::save(SimpleFile *file, int indent) {
|
||||
file->writeNumberLine(1, indent);
|
||||
file->writeNumberLine(_v1, indent);
|
||||
file->writeNumberLine(_v2, indent);
|
||||
file->writeNumberLine(_v3, indent);
|
||||
file->writeNumberLine(_fieldF8, indent);
|
||||
file->writeNumberLine(_soundHandle1, indent);
|
||||
file->writeNumberLine(_timerId, indent);
|
||||
file->writeNumberLine(_soundHandle2, indent);
|
||||
|
||||
CTransport::save(file, indent);
|
||||
}
|
||||
|
||||
void CServiceElevator::load(SimpleFile *file) {
|
||||
file->readNumber();
|
||||
_v1 = file->readNumber();
|
||||
_v2 = file->readNumber();
|
||||
_v3 = file->readNumber();
|
||||
_fieldF8 = file->readNumber();
|
||||
_soundHandle1 = file->readNumber();
|
||||
_timerId = file->readNumber();
|
||||
_soundHandle2 = file->readNumber();
|
||||
|
||||
CTransport::load(file);
|
||||
}
|
||||
|
||||
bool CServiceElevator::BodyInBilgeRoomMsg(CBodyInBilgeRoomMsg *msg) {
|
||||
_v2 = true;
|
||||
_string1 = "BilgeRoomWith.Node 2.N";
|
||||
return true;
|
||||
}
|
||||
|
||||
bool CServiceElevator::EnterViewMsg(CEnterViewMsg *msg) {
|
||||
petShow();
|
||||
return true;
|
||||
}
|
||||
|
||||
bool CServiceElevator::ServiceElevatorMsg(CServiceElevatorMsg *msg) {
|
||||
switch (msg->_value) {
|
||||
case 1:
|
||||
case 2:
|
||||
case 3: {
|
||||
switch (msg->_value) {
|
||||
case 1:
|
||||
_v3 = 0;
|
||||
break;
|
||||
case 2:
|
||||
_v3 = 1;
|
||||
break;
|
||||
case 3:
|
||||
_v3 = 2;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
CServiceElevatorFloorRequestMsg requestMsg;
|
||||
requestMsg.execute(this);
|
||||
break;
|
||||
}
|
||||
|
||||
case 4:
|
||||
if (!_string1.empty()) {
|
||||
if (_string1 == "DeepSpace") {
|
||||
disableMouse();
|
||||
_soundHandle1 = playSound(TRANSLATE("z#413.wav", "z#157.wav"), 50);
|
||||
_timerId = addTimer(1, 1000, 500);
|
||||
} else {
|
||||
changeView(_string1);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case 5:
|
||||
// Reaching destination floor
|
||||
_fieldF8 = false;
|
||||
_fieldDC = _v3;
|
||||
loadSound(TRANSLATE("z#423.wav", "z#168.wav"));
|
||||
stopSound(_soundHandle2);
|
||||
_soundHandle2 = playSound(TRANSLATE("z#423.wav", "z#168.wav"), 80);
|
||||
|
||||
switch (_fieldDC) {
|
||||
case 0:
|
||||
_string1 = "DeepSpace";
|
||||
_string2 = TRANSLATE("a#2.wav", "a#54.wav");
|
||||
queueSound(TRANSLATE("z#416.wav", "z#160.wav"), _soundHandle2, 50);
|
||||
break;
|
||||
|
||||
case 1:
|
||||
_string1 = _v2 ? "BilgeRoomWith.Node 2.N" : "BilgeRoom.Node 1.N";
|
||||
queueSound(TRANSLATE("z#421.wav", "z#165.wav"), _soundHandle2, 50);
|
||||
break;
|
||||
|
||||
case 2:
|
||||
_string1 = _v1 ? "MoonEmbLobby.Node 1.NE" : "EmbLobby.Node 1.NE";
|
||||
queueSound(TRANSLATE("z#411.wav", "z#155.wav"), _soundHandle2, 50);
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
enableMouse();
|
||||
if (findRoom()->findByName("Doorbot"))
|
||||
addTimer(3, 3000, 0);
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool CServiceElevator::TimerMsg(CTimerMsg *msg) {
|
||||
CDoorbot *doorbot = dynamic_cast<CDoorbot *>(findRoom()->findByName("Doorbot"));
|
||||
|
||||
switch (msg->_actionVal) {
|
||||
case 0:
|
||||
case 1:
|
||||
if (!isSoundActive(_soundHandle1)) {
|
||||
stopAnimTimer(_timerId);
|
||||
if (msg->_actionVal == 0) {
|
||||
// Elevator in motion after pressing button
|
||||
_fieldF8 = true;
|
||||
CServiceElevatorFloorChangeMsg changeMsg(_fieldDC, _v3);
|
||||
changeMsg.execute(getRoom(), nullptr, MSGFLAG_SCAN);
|
||||
_soundHandle2 = playSound(TRANSLATE("z#424.wav", "z#169.wav"));
|
||||
|
||||
if (doorbot) {
|
||||
CActMsg actMsg("DoorbotPlayerPressedTopButton");
|
||||
actMsg.execute(doorbot);
|
||||
}
|
||||
} else {
|
||||
// Finished playing message for bottom/middle floor disabled
|
||||
enableMouse();
|
||||
if (doorbot) {
|
||||
CActMsg actMsg;
|
||||
if (_v3 == 0)
|
||||
actMsg._action = "DoorbotPlayerPressedBottomButton";
|
||||
else if (_v3 == 1)
|
||||
actMsg._action = "DoorbotPlayerPressedMiddleButton";
|
||||
|
||||
actMsg.execute(doorbot);
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case 3: {
|
||||
CActMsg actMsg("DoorbotReachedEmbLobby");
|
||||
actMsg.execute(doorbot);
|
||||
break;
|
||||
}
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool CServiceElevator::ServiceElevatorFloorRequestMsg(CServiceElevatorFloorRequestMsg *msg) {
|
||||
disableMouse();
|
||||
CDoorbot *doorbot = dynamic_cast<CDoorbot *>(findRoom()->findByName("Doorbot"));
|
||||
|
||||
if (doorbot && _v3 == 0) {
|
||||
_soundHandle1 = playSound(TRANSLATE("z#415.wav", "z#159.wav"), 50);
|
||||
_timerId = addTimer(1, 1000, 500);
|
||||
} else if (doorbot && _v3 == 1) {
|
||||
_soundHandle1 = playSound(TRANSLATE("z#417.wav", "z#161.wav"), 50);
|
||||
_timerId = addTimer(1, 1000, 500);
|
||||
} else if (_fieldDC == _v3) {
|
||||
switch (_v3) {
|
||||
case 0:
|
||||
_soundHandle1 = playSound(TRANSLATE("z#415.wav", "z#159.wav"), 50);
|
||||
break;
|
||||
case 1:
|
||||
_soundHandle1 = playSound(TRANSLATE("z#420.wav", "z#164.wav"), 50);
|
||||
break;
|
||||
case 2:
|
||||
_soundHandle1 = playSound(TRANSLATE("z#410.wav", "z#154.wav"), 50);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
_timerId = addTimer(1, 1000, 500);
|
||||
} else {
|
||||
switch (_v3) {
|
||||
case 0:
|
||||
_soundHandle1 = playSound(TRANSLATE("z#414.wav", "z#158.wav"), 50);
|
||||
break;
|
||||
case 1:
|
||||
_soundHandle1 = playSound(_fieldDC ? TRANSLATE("z#419.wav", "z#163.wav")
|
||||
: TRANSLATE("z#418.wav", "z#162.wav"), 50);
|
||||
break;
|
||||
case 2:
|
||||
_soundHandle1 = playSound(TRANSLATE("z#409.wav", "z#153.wav"), 50);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
_timerId = addTimer(0, 1000, 500);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool CServiceElevator::LeaveRoomMsg(CLeaveRoomMsg *msg) {
|
||||
CDoorbot *doorbot = dynamic_cast<CDoorbot *>(findRoom()->findByName("Doorbot"));
|
||||
|
||||
if (doorbot) {
|
||||
CPutBotBackInHisBoxMsg boxMsg(0);
|
||||
boxMsg.execute("Doorbot");
|
||||
doorbot->performAction(false);
|
||||
enableMouse();
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool CServiceElevator::OpeningCreditsMsg(COpeningCreditsMsg *msg) {
|
||||
_v1 = false;
|
||||
_string1 = "EmbLobby.Node 1.NE";
|
||||
return true;
|
||||
}
|
||||
|
||||
} // End of namespace Titanic
|
||||
64
engines/titanic/game/transport/service_elevator.h
Normal file
64
engines/titanic/game/transport/service_elevator.h
Normal 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_SERVICE_ELEVATOR_H
|
||||
#define TITANIC_SERVICE_ELEVATOR_H
|
||||
|
||||
#include "titanic/game/transport/transport.h"
|
||||
|
||||
namespace Titanic {
|
||||
|
||||
class CServiceElevator : public CTransport {
|
||||
DECLARE_MESSAGE_MAP;
|
||||
bool BodyInBilgeRoomMsg(CBodyInBilgeRoomMsg *msg);
|
||||
bool EnterViewMsg(CEnterViewMsg *msg);
|
||||
bool ServiceElevatorMsg(CServiceElevatorMsg *msg);
|
||||
bool TimerMsg(CTimerMsg *msg);
|
||||
bool ServiceElevatorFloorRequestMsg(CServiceElevatorFloorRequestMsg *msg);
|
||||
bool LeaveRoomMsg(CLeaveRoomMsg *msg);
|
||||
bool OpeningCreditsMsg(COpeningCreditsMsg *msg);
|
||||
private:
|
||||
static bool _v1;
|
||||
static int _v2;
|
||||
static int _v3;
|
||||
|
||||
int _fieldF8;
|
||||
int _soundHandle1;
|
||||
int _timerId;
|
||||
int _soundHandle2;
|
||||
public:
|
||||
CLASSDEF;
|
||||
CServiceElevator();
|
||||
|
||||
/**
|
||||
* 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_SERVICE_ELEVATOR_H */
|
||||
47
engines/titanic/game/transport/transport.cpp
Normal file
47
engines/titanic/game/transport/transport.cpp
Normal 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/transport/transport.h"
|
||||
|
||||
namespace Titanic {
|
||||
|
||||
EMPTY_MESSAGE_MAP(CTransport, CMobile);
|
||||
|
||||
CTransport::CTransport() : CMobile(), _string1("*.*.*") {
|
||||
}
|
||||
|
||||
void CTransport::save(SimpleFile *file, int indent) {
|
||||
file->writeNumberLine(1, indent);
|
||||
file->writeQuotedLine(_string1, indent);
|
||||
file->writeQuotedLine(_string2, indent);
|
||||
|
||||
CMobile::save(file, indent);
|
||||
}
|
||||
|
||||
void CTransport::load(SimpleFile *file) {
|
||||
file->readNumber();
|
||||
_string1 = file->readString();
|
||||
_string2 = file->readString();
|
||||
|
||||
CMobile::load(file);
|
||||
}
|
||||
|
||||
} // End of namespace Titanic
|
||||
51
engines/titanic/game/transport/transport.h
Normal file
51
engines/titanic/game/transport/transport.h
Normal 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_TRANSPORT_H
|
||||
#define TITANIC_TRANSPORT_H
|
||||
|
||||
#include "titanic/npcs/mobile.h"
|
||||
|
||||
namespace Titanic {
|
||||
|
||||
class CTransport : public CMobile {
|
||||
DECLARE_MESSAGE_MAP;
|
||||
public:
|
||||
CString _string1;
|
||||
CString _string2;
|
||||
public:
|
||||
CLASSDEF;
|
||||
CTransport();
|
||||
|
||||
/**
|
||||
* 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_TRANSPORT_H */
|
||||
Reference in New Issue
Block a user