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,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/sgt/armchair.h"
#include "titanic/translation.h"
namespace Titanic {
BEGIN_MESSAGE_MAP(CArmchair, CSGTStateRoom)
ON_MESSAGE(TurnOn)
ON_MESSAGE(TurnOff)
ON_MESSAGE(MovieEndMsg)
END_MESSAGE_MAP()
void CArmchair::save(SimpleFile *file, int indent) {
file->writeNumberLine(1, indent);
CSGTStateRoom::save(file, indent);
}
void CArmchair::load(SimpleFile *file) {
file->readNumber();
CSGTStateRoom::load(file);
}
bool CArmchair::TurnOn(CTurnOn *msg) {
if (_statics->_armchair == "Closed" && _statics->_toilet == "Closed") {
CVisibleMsg visibleMsg(false);
visibleMsg.execute("Deskchair");
if (_statics->_deskchair == "Open") {
CActMsg actMsg("Squash");
actMsg.execute("Deskchair");
_startFrame = 22;
_endFrame = 31;
} else {
_startFrame = 0;
_endFrame = 10;
}
playMovie(_startFrame, _endFrame, MOVIE_WAIT_FOR_FINISH);
playSound(TRANSLATE("b#0.wav", "b#85.wav"));
_statics->_armchair = "Open";
_isClosed = false;
}
return true;
}
bool CArmchair::TurnOff(CTurnOff *msg) {
if (_statics->_armchair == "Open") {
_statics->_armchair = "Closed";
_startFrame = 11;
_endFrame = 21;
_isClosed = true;
playMovie(11, 21, MOVIE_WAIT_FOR_FINISH | MOVIE_NOTIFY_OBJECT);
playSound(TRANSLATE("b#0.wav", "b#85.wav"));
}
return true;
}
bool CArmchair::MovieEndMsg(CMovieEndMsg *msg) {
if (_statics->_armchair == "Closed")
loadFrame(0);
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_ARMCHAIR_H
#define TITANIC_ARMCHAIR_H
#include "titanic/game/sgt/sgt_state_room.h"
namespace Titanic {
class CArmchair : public CSGTStateRoom {
DECLARE_MESSAGE_MAP;
bool TurnOn(CTurnOn *msg);
bool TurnOff(CTurnOff *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_ARMCHAIR_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/sgt/basin.h"
#include "titanic/translation.h"
namespace Titanic {
BEGIN_MESSAGE_MAP(CBasin, CSGTStateRoom)
ON_MESSAGE(TurnOn)
ON_MESSAGE(TurnOff)
ON_MESSAGE(MovieEndMsg)
END_MESSAGE_MAP()
void CBasin::save(SimpleFile *file, int indent) {
file->writeNumberLine(1, indent);
CSGTStateRoom::save(file, indent);
}
void CBasin::load(SimpleFile *file) {
file->readNumber();
CSGTStateRoom::load(file);
}
bool CBasin::TurnOn(CTurnOn *msg) {
if (_statics->_washstand == "Open" && _statics->_basin == "Closed"
&& _statics->_bedfoot == "Closed") {
setVisible(true);
_statics->_basin = "Open";
_isClosed = false;
_startFrame = 0;
_endFrame = 6;
playMovie(0, 6, MOVIE_WAIT_FOR_FINISH);
playSound(TRANSLATE("b#13.wav", "b#98.wav"));
}
return true;
}
bool CBasin::TurnOff(CTurnOff *msg) {
if (_statics->_basin == "Open") {
_statics->_basin = "Closed";
_isClosed = true;
_startFrame = 8;
_endFrame = 14;
playMovie(8, 14, MOVIE_NOTIFY_OBJECT | MOVIE_WAIT_FOR_FINISH);
playSound(TRANSLATE("b#13.wav", "b#98.wav"));
}
return true;
}
bool CBasin::MovieEndMsg(CMovieEndMsg *msg) {
if (_statics->_basin == "Closed")
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_BASIN_H
#define TITANIC_BASIN_H
#include "titanic/game/sgt/sgt_state_room.h"
namespace Titanic {
class CBasin : public CSGTStateRoom {
DECLARE_MESSAGE_MAP;
bool TurnOn(CTurnOn *msg);
bool TurnOff(CTurnOff *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_BASIN_H */

View File

@@ -0,0 +1,129 @@
/* 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/sgt/bedfoot.h"
#include "titanic/translation.h"
namespace Titanic {
BEGIN_MESSAGE_MAP(CBedfoot, CSGTStateRoom)
ON_MESSAGE(TurnOn)
ON_MESSAGE(TurnOff)
END_MESSAGE_MAP()
void CBedfoot::save(SimpleFile *file, int indent) {
file->writeNumberLine(1, indent);
CSGTStateRoom::save(file, indent);
}
void CBedfoot::load(SimpleFile *file) {
file->readNumber();
CSGTStateRoom::load(file);
}
bool CBedfoot::TurnOn(CTurnOn *msg) {
if (_statics->_bedfoot == "Closed" && _statics->_basin == "Closed") {
_isClosed = false;
_startFrame = 0;
if (_statics->_washstand == "Open") {
_endFrame = 13;
_statics->_bedfoot = "Open";
playSound(TRANSLATE("b#7.wav", "b#92.wav"));
} else {
_endFrame = 17;
_statics->_bedfoot = "NotOnWashstand";
playSound(TRANSLATE("b#4.wav", "b#89.wav"));
}
playMovie(_startFrame, _endFrame, MOVIE_WAIT_FOR_FINISH);
} else if (_statics->_bedfoot == "RestingUnderTV") {
_isClosed = false;
_startFrame = 8;
if (_statics->_washstand == "Open") {
_statics->_bedfoot = "Open";
playSound("189_436_bed down 1.wav");
} else {
_statics->_bedfoot = "NotOnWashstand";
playSound("192_436_bed hits floor.wav");
}
playMovie(_startFrame, _endFrame, MOVIE_WAIT_FOR_FINISH);
}
if (_statics->_bedfoot == "Open")
_statics->_bedhead = "Closed";
else if (_statics->_bedfoot == "NotOnWashstand")
_statics->_bedhead = "ClosedWrong";
return true;
}
bool CBedfoot::TurnOff(CTurnOff *msg) {
if (_statics->_bedhead == "Closed" || _statics->_bedhead == "ClosedWrong") {
setVisible(true);
CVisibleMsg visibleMsg(false);
visibleMsg.execute("Bedhead");
}
if (_statics->_bedfoot == "Open" && _statics->_bedhead == "Closed") {
_isClosed = true;
_startFrame = 20;
if (_statics->_tv == "Closed") {
_statics->_bedfoot = "Closed";
_endFrame = 30;
} else {
_statics->_bedfoot = "RestingUnderTV";
_endFrame = 25;
}
playMovie(_startFrame, _endFrame, MOVIE_WAIT_FOR_FINISH);
playSound(TRANSLATE("b#7.wav", "b#92.wav"));
} else if (_statics->_bedfoot == "NotOnWashstand" && _statics->_bedhead == "ClosedWrong") {
_isClosed = true;
_startFrame = 17;
if (_statics->_tv == "Closed") {
_statics->_bedfoot = "Closed";
_endFrame = 30;
} else {
_statics->_bedfoot = "RestingUnderTV";
_endFrame = 25;
}
playMovie(_startFrame, _endFrame, MOVIE_WAIT_FOR_FINISH);
playSound(TRANSLATE("b#7.wav", "b#92.wav"));
} else if (_statics->_bedfoot == "RestingUTV" && _statics->_tv == "Closed") {
_statics->_bedfoot = "Closed";
_startFrame = 25;
_endFrame = 30;
playMovie(25, 30, MOVIE_WAIT_FOR_FINISH);
playSound(TRANSLATE("b#7.wav", "b#92.wav"));
}
if (_statics->_bedfoot == "Closed")
_statics->_bedhead = "Closed";
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_BEDFOOT_H
#define TITANIC_BEDFOOT_H
#include "titanic/game/sgt/sgt_state_room.h"
namespace Titanic {
class CBedfoot : public CSGTStateRoom {
DECLARE_MESSAGE_MAP;
bool TurnOn(CTurnOn *msg);
bool TurnOff(CTurnOff *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_BEDFOOT_H */

View File

@@ -0,0 +1,170 @@
/* 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/sgt/bedhead.h"
#include "titanic/support/files_manager.h"
#include "titanic/titanic.h"
#include "titanic/translation.h"
namespace Titanic {
BEGIN_MESSAGE_MAP(CBedhead, CSGTStateRoom)
ON_MESSAGE(TurnOn)
ON_MESSAGE(TurnOff)
END_MESSAGE_MAP()
void BedheadEntry::load(Common::SeekableReadStream *s) {
_name1 = readStringFromStream(s);
_name2 = readStringFromStream(s);
_name3 = readStringFromStream(s);
_name4 = readStringFromStream(s);
_startFrame = s->readUint32LE();
_endFrame = s->readUint32LE();
}
/*------------------------------------------------------------------------*/
void BedheadEntries::load(Common::SeekableReadStream *s, int count) {
resize(count);
for (int idx = 0; idx < count; ++idx)
(*this)[idx].load(s);
}
/*------------------------------------------------------------------------*/
void TurnOnEntries::load(Common::SeekableReadStream *s) {
_closed.load(s, 4);
_restingTV.load(s, 2);
_restingUV.load(s, 2);
_closedWrong.load(s, 2);
}
/*------------------------------------------------------------------------*/
void TurnOffEntries::load(Common::SeekableReadStream *s) {
_open.load(s, 3);
_restingUTV.load(s, 1);
_restingV.load(s, 1);
_restingG.load(s, 3);
_openWrong.load(s, 1);
_restingDWrong.load(s, 1);
}
/*------------------------------------------------------------------------*/
CBedhead::CBedhead() : CSGTStateRoom() {
Common::SeekableReadStream *s = g_vm->_filesManager->getResource("DATA/BEDHEAD");
_on.load(s);
_off.load(s);
delete s;
}
void CBedhead::save(SimpleFile *file, int indent) {
file->writeNumberLine(1, indent);
CSGTStateRoom::save(file, indent);
}
void CBedhead::load(SimpleFile *file) {
file->readNumber();
CSGTStateRoom::load(file);
}
bool CBedhead::TurnOn(CTurnOn *msg) {
if (_statics->_bedfoot != "Closed" && _statics->_bedfoot != "RestingUnderTV") {
const BedheadEntries *data = nullptr;
if (_statics->_bedhead == "Closed")
data = &_on._closed;
else if (_statics->_bedhead == "RestingTV")
data = &_on._restingTV;
else if (_statics->_bedhead == "RestingUV")
data = &_on._restingUV;
else if (_statics->_bedhead == "ClosedWrong")
data = &_on._closedWrong;
else
return true;
for (uint idx = 0; idx < data->size(); ++idx) {
const BedheadEntry &entry = (*data)[idx];
if ((entry._name1 == _statics->_tv || entry._name1 == "Any")
&& (entry._name2 == _statics->_vase || entry._name2 == "Any")
&& (entry._name3 == _statics->_desk || entry._name3 == "Any")) {
CVisibleMsg visibleMsg(false);
visibleMsg.execute("Bedfoot");
setVisible(true);
_statics->_bedhead = entry._name4;
playMovie(entry._startFrame, entry._endFrame, MOVIE_NOTIFY_OBJECT | MOVIE_WAIT_FOR_FINISH);
playSound(TRANSLATE("b#6.wav", "b#91.wav"));
_isClosed = false;
}
}
}
if (_statics->_bedhead == "Open") {
playMovie(71, 78, 0);
playSound("196_436 bed inflate 2.wav");
}
return true;
}
bool CBedhead::TurnOff(CTurnOff *msg) {
if (_statics->_bedhead == "Open") {
playMovie(78, 85, 0);
playSound("191_436_bed inflate deflate.wav");
}
BedheadEntries *data = nullptr;
if (_statics->_bedhead == "Open")
data = &_off._open;
else if (_statics->_bedhead == "RestingUTV")
data = &_off._restingUTV;
else if (_statics->_bedhead == "RestingV")
data = &_off._restingV;
else if (_statics->_bedhead == "RestingG")
data = &_off._restingG;
else if (_statics->_bedhead == "OpenWrong")
data = &_off._openWrong;
else if (_statics->_bedhead == "RestingDWrong")
data = &_off._restingDWrong;
else
return true;
for (uint idx = 0; idx < data->size(); ++idx) {
const BedheadEntry &entry = (*data)[idx];
if ((entry._name1 == _statics->_tv || entry._name1 == "Any")
&& (entry._name2 == _statics->_vase || entry._name2 == "Any")
&& (entry._name3 == _statics->_desk || entry._name3 == "Any")) {
CVisibleMsg visibleMsg(false);
visibleMsg.execute("Bedfoot");
setVisible(true);
_statics->_bedhead = entry._name4;
playMovie(entry._startFrame, entry._endFrame, MOVIE_NOTIFY_OBJECT | MOVIE_WAIT_FOR_FINISH);
playSound("193_436_bed fold up 1.wav");
_isClosed = true;
}
}
return true;
}
} // End of namespace Titanic

View File

@@ -0,0 +1,89 @@
/* 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_BEDHEAD_H
#define TITANIC_BEDHEAD_H
#include "common/array.h"
#include "titanic/game/sgt/sgt_state_room.h"
namespace Titanic {
struct BedheadEntry {
CString _name1;
CString _name2;
CString _name3;
CString _name4;
int _startFrame;
int _endFrame;
void load(Common::SeekableReadStream *s);
};
class BedheadEntries : public Common::Array<BedheadEntry> {
public:
void load(Common::SeekableReadStream *s, int count);
};
struct TurnOnEntries {
BedheadEntries _closed;
BedheadEntries _restingTV;
BedheadEntries _restingUV;
BedheadEntries _closedWrong;
void load(Common::SeekableReadStream *s);
};
struct TurnOffEntries {
BedheadEntries _open;
BedheadEntries _restingUTV;
BedheadEntries _restingV;
BedheadEntries _restingG;
BedheadEntries _openWrong;
BedheadEntries _restingDWrong;
void load(Common::SeekableReadStream *s);
};
class CBedhead : public CSGTStateRoom {
DECLARE_MESSAGE_MAP;
bool TurnOn(CTurnOn *msg);
bool TurnOff(CTurnOff *msg);
private:
TurnOnEntries _on;
TurnOffEntries _off;
public:
CLASSDEF;
CBedhead();
/**
* 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_BEDHEAD_H */

View File

@@ -0,0 +1,81 @@
/* 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/sgt/chest_of_drawers.h"
#include "titanic/translation.h"
namespace Titanic {
BEGIN_MESSAGE_MAP(CChestOfDrawers, CSGTStateRoom)
ON_MESSAGE(TurnOn)
ON_MESSAGE(TurnOff)
ON_MESSAGE(MovieEndMsg)
END_MESSAGE_MAP()
void CChestOfDrawers::save(SimpleFile *file, int indent) {
file->writeNumberLine(1, indent);
CSGTStateRoom::save(file, indent);
}
void CChestOfDrawers::load(SimpleFile *file) {
file->readNumber();
CSGTStateRoom::load(file);
}
bool CChestOfDrawers::TurnOn(CTurnOn *msg) {
if (_statics->_chestOfDrawers == "Closed" && _statics->_desk == "Open") {
_isClosed = false;
_statics->_chestOfDrawers = "Open";
_startFrame = 1;
_endFrame = 14;
playMovie(1, 14, MOVIE_NOTIFY_OBJECT | MOVIE_WAIT_FOR_FINISH);
playSound(TRANSLATE("b#11.wav", "b#96.wav"));
}
return true;
}
bool CChestOfDrawers::TurnOff(CTurnOff *msg) {
if (_statics->_chestOfDrawers == "Open" && _statics->_drawer == "Closed") {
CVisibleMsg visibleMsg(false);
visibleMsg.execute("Drawer");
_statics->_chestOfDrawers = "Closed";
_isClosed = true;
_startFrame = 14;
_endFrame = 27;
playMovie(14, 27, MOVIE_NOTIFY_OBJECT | MOVIE_WAIT_FOR_FINISH);
playSound(TRANSLATE("b#11.wav", "b#96.wav"));
}
return true;
}
bool CChestOfDrawers::MovieEndMsg(CMovieEndMsg *msg) {
if (_statics->_chestOfDrawers == "Open") {
CVisibleMsg visibleMsg;
visibleMsg.execute("Drawer");
}
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_CHEST_OF_DRAWERS_H
#define TITANIC_CHEST_OF_DRAWERS_H
#include "titanic/game/sgt/sgt_state_room.h"
namespace Titanic {
class CChestOfDrawers : public CSGTStateRoom {
DECLARE_MESSAGE_MAP;
bool TurnOn(CTurnOn *msg);
bool TurnOff(CTurnOff *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_CHEST_OF_DRAWERS_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/sgt/desk.h"
#include "titanic/translation.h"
namespace Titanic {
BEGIN_MESSAGE_MAP(CDesk, CSGTStateRoom)
ON_MESSAGE(TurnOn)
ON_MESSAGE(TurnOff)
ON_MESSAGE(MovieEndMsg)
END_MESSAGE_MAP()
void CDesk::save(SimpleFile *file, int indent) {
file->writeNumberLine(1, indent);
CSGTStateRoom::save(file, indent);
}
void CDesk::load(SimpleFile *file) {
file->readNumber();
CSGTStateRoom::load(file);
}
bool CDesk::TurnOn(CTurnOn *msg) {
if (_statics->_desk == "Closed" && _statics->_bedhead != "RestingG"
&& _statics->_bedhead != "OpenWrong") {
_statics->_desk = "Open";
_isClosed = false;
_startFrame = 1;
_endFrame = 26;
playMovie(1, 26, MOVIE_NOTIFY_OBJECT | MOVIE_WAIT_FOR_FINISH);
playSound(TRANSLATE("b#12.wav", "b#97.wav"));
}
return true;
}
bool CDesk::TurnOff(CTurnOff *msg) {
if (_statics->_desk == "Open" && _statics->_chestOfDrawers == "Closed"
&& _statics->_bedhead != "Open") {
CVisibleMsg visibleMsg(false);
visibleMsg.execute("ChestOfDrawers");
_statics->_desk = "Closed";
_isClosed = true;
_startFrame = 26;
_endFrame = 51;
playMovie(26, 51, MOVIE_WAIT_FOR_FINISH);
playSound(TRANSLATE("b#9.wav", "b#94.wav"));
}
return true;
}
bool CDesk::MovieEndMsg(CMovieEndMsg *msg) {
if (_statics->_desk == "Open") {
CVisibleMsg visibleMsg(true);
visibleMsg.execute("ChestOfDrawers");
}
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_DESK_H
#define TITANIC_DESK_H
#include "titanic/game/sgt/sgt_state_room.h"
namespace Titanic {
class CDesk : public CSGTStateRoom {
DECLARE_MESSAGE_MAP;
bool TurnOn(CTurnOn *msg);
bool TurnOff(CTurnOff *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_DESK_H */

View File

@@ -0,0 +1,89 @@
/* 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/sgt/deskchair.h"
#include "titanic/translation.h"
namespace Titanic {
BEGIN_MESSAGE_MAP(CDeskchair, CSGTStateRoom)
ON_MESSAGE(TurnOn)
ON_MESSAGE(TurnOff)
ON_MESSAGE(ActMsg)
ON_MESSAGE(MovieEndMsg)
END_MESSAGE_MAP()
void CDeskchair::save(SimpleFile *file, int indent) {
file->writeNumberLine(1, indent);
CSGTStateRoom::save(file, indent);
}
void CDeskchair::load(SimpleFile *file) {
file->readNumber();
CSGTStateRoom::load(file);
}
bool CDeskchair::TurnOn(CTurnOn *msg) {
if (_statics->_armchair == "Closed" && _statics->_deskchair == "Closed") {
setVisible(true);
_statics->_deskchair = "Open";
_isClosed = false;
_startFrame = 0;
_endFrame = 16;
playMovie(0, 16, MOVIE_WAIT_FOR_FINISH);
playSound(TRANSLATE("b#8.wav", "b#93.wav"));
}
return true;
}
bool CDeskchair::TurnOff(CTurnOff *msg) {
if (_statics->_deskchair == "Open") {
_statics->_deskchair = "Closed";
_isClosed = true;
_startFrame = 16;
_endFrame = 32;
playMovie(16, 32, MOVIE_NOTIFY_OBJECT | MOVIE_WAIT_FOR_FINISH);
playSound(TRANSLATE("b#2.wav", "b#87.wav"));
}
return true;
}
bool CDeskchair::ActMsg(CActMsg *msg) {
if (msg->_action == "Smash") {
setVisible(false);
_statics->_deskchair = "Closed";
_isClosed = true;
loadFrame(0);
return true;
} else {
return CSGTStateRoom::ActMsg(msg);
}
}
bool CDeskchair::MovieEndMsg(CMovieEndMsg *msg) {
if (_statics->_deskchair == "Closed")
setVisible(false);
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_DESKCHAIR_H
#define TITANIC_DESKCHAIR_H
#include "titanic/game/sgt/sgt_state_room.h"
namespace Titanic {
class CDeskchair : public CSGTStateRoom {
DECLARE_MESSAGE_MAP;
bool TurnOn(CTurnOn *msg);
bool TurnOff(CTurnOff *msg);
bool ActMsg(CActMsg *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_DESKCHAIR_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/sgt/drawer.h"
#include "titanic/translation.h"
namespace Titanic {
BEGIN_MESSAGE_MAP(CDrawer, CSGTStateRoom)
ON_MESSAGE(TurnOn)
ON_MESSAGE(TurnOff)
ON_MESSAGE(MovieEndMsg)
END_MESSAGE_MAP()
CDrawer::CDrawer() : CSGTStateRoom(), _fieldF4(0) {
}
void CDrawer::save(SimpleFile *file, int indent) {
file->writeNumberLine(1, indent);
file->writeNumberLine(_fieldF4, indent);
CSGTStateRoom::save(file, indent);
}
void CDrawer::load(SimpleFile *file) {
file->readNumber();
_fieldF4 = file->readNumber();
CSGTStateRoom::load(file);
}
bool CDrawer::TurnOn(CTurnOn *msg) {
if (_statics->_drawer == "Closed" && _statics->_chestOfDrawers == "Open") {
_statics->_drawer = "Open";
_isClosed = false;
_startFrame = 50;
_endFrame = 75;
setVisible(true);
_statics->_drawer = "Open";
playMovie(_startFrame, _endFrame, MOVIE_NOTIFY_OBJECT | MOVIE_WAIT_FOR_FINISH);
playSound(TRANSLATE("b#10.wav", "b#95.wav"));
}
return true;
}
bool CDrawer::TurnOff(CTurnOff *msg) {
if (_statics->_drawer == "Open") {
_statics->_drawer = "Closed";
_startFrame = 75;
_endFrame = 100;
_isClosed = true;
playMovie(_startFrame, _endFrame, MOVIE_NOTIFY_OBJECT | MOVIE_WAIT_FOR_FINISH);
playSound(TRANSLATE("b#10.wav", "b#95.wav"));
}
return true;
}
bool CDrawer::MovieEndMsg(CMovieEndMsg *msg) {
if (_statics->_drawer == "Closed")
setVisible(false);
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_DRAWER_H
#define TITANIC_DRAWER_H
#include "titanic/game/sgt/sgt_state_room.h"
namespace Titanic {
class CDrawer : public CSGTStateRoom {
DECLARE_MESSAGE_MAP;
bool TurnOn(CTurnOn *msg);
bool TurnOff(CTurnOff *msg);
bool MovieEndMsg(CMovieEndMsg *msg);
private:
int _fieldF4;
public:
CLASSDEF;
CDrawer();
/**
* 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_DRAWER_H */

View File

@@ -0,0 +1,99 @@
/* 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/sgt/sgt_doors.h"
#include "titanic/pet_control/pet_control.h"
namespace Titanic {
BEGIN_MESSAGE_MAP(CSGTDoors, CGameObject)
ON_MESSAGE(EnterViewMsg)
ON_MESSAGE(LeaveViewMsg)
ON_MESSAGE(MovieEndMsg)
ON_MESSAGE(LeaveRoomMsg)
END_MESSAGE_MAP()
void CSGTDoors::save(SimpleFile *file, int indent) {
file->writeNumberLine(1, indent);
file->writeNumberLine(_value1, indent);
file->writeNumberLine(_open, indent);
CGameObject::save(file, indent);
}
void CSGTDoors::load(SimpleFile *file) {
file->readNumber();
_value1 = file->readNumber();
_open = file->readNumber();
CGameObject::load(file);
}
bool CSGTDoors::EnterViewMsg(CEnterViewMsg *msg) {
setVisible(true);
_open = true;
CPetControl *pet = getPetControl();
if (pet) {
int roomNum = pet->getRoomsRoomNum();
static const int START_FRAMES[7] = { 0, 26, 30, 34, 38, 42, 46 };
static const int END_FRAMES[7] = { 12, 29, 33, 37, 41, 45, 49 };
if (pet->getRoomsSublevel() == 1)
playMovie(START_FRAMES[roomNum], END_FRAMES[roomNum],
MOVIE_NOTIFY_OBJECT | MOVIE_WAIT_FOR_FINISH);
else
playMovie(0, 12, MOVIE_NOTIFY_OBJECT | MOVIE_WAIT_FOR_FINISH);
}
return true;
}
bool CSGTDoors::LeaveViewMsg(CLeaveViewMsg *msg) {
return true;
}
bool CSGTDoors::MovieEndMsg(CMovieEndMsg *msg) {
setVisible(!_open);
return true;
}
bool CSGTDoors::LeaveRoomMsg(CLeaveRoomMsg *msg) {
setVisible(true);
_open = false;
CPetControl *pet = getPetControl();
if (pet) {
int roomNum = pet->getRoomsRoomNum();
static const int START_FRAMES[7] = { 12, 69, 65, 61, 57, 53, 49 };
static const int END_FRAMES[7] = { 25, 72, 68, 64, 60, 56, 52 };
if (pet->getRoomsSublevel() == 1)
playMovie(START_FRAMES[roomNum], END_FRAMES[roomNum],
MOVIE_NOTIFY_OBJECT | MOVIE_WAIT_FOR_FINISH);
else
playMovie(12, 25, MOVIE_NOTIFY_OBJECT | MOVIE_WAIT_FOR_FINISH);
}
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_SGT_DOORS_H
#define TITANIC_SGT_DOORS_H
#include "titanic/core/game_object.h"
namespace Titanic {
class CSGTDoors : public CGameObject {
DECLARE_MESSAGE_MAP;
bool EnterViewMsg(CEnterViewMsg *msg);
bool LeaveViewMsg(CLeaveViewMsg *msg);
bool MovieEndMsg(CMovieEndMsg *msg);
bool LeaveRoomMsg(CLeaveRoomMsg *msg);
public:
int _value1;
bool _open;
public:
CLASSDEF;
CSGTDoors() : CGameObject(), _value1(0), _open(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_SGT_DOORS_H */

View File

@@ -0,0 +1,85 @@
/* 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/sgt/sgt_nav.h"
#include "titanic/pet_control/pet_control.h"
namespace Titanic {
BEGIN_MESSAGE_MAP(SGTNav, CSGTStateRoom)
ON_MESSAGE(MouseButtonDownMsg)
ON_MESSAGE(MouseMoveMsg)
END_MESSAGE_MAP()
void SGTNav::save(SimpleFile *file, int indent) {
file->writeNumberLine(1, indent);
CSGTStateRoom::save(file, indent);
}
void SGTNav::load(SimpleFile *file) {
file->readNumber();
CSGTStateRoom::load(file);
}
bool SGTNav::MouseButtonDownMsg(CMouseButtonDownMsg *msg) {
CTurnOn onMsg;
CTurnOff offMsg;
CPetControl *pet = getPetControl();
if (_statics->_chestOfDrawers == "Open" && _statics->_bedhead == "Open"
&& pet->isInAssignedRoom()) {
if (_statics->_vase == "Open")
offMsg.execute("Vase");
if (_statics->_tv == "Closed")
onMsg.execute("SGTTV");
if (_statics->_drawer == "Open")
offMsg.execute("Drawer");
if (_statics->_armchair == "Open")
offMsg.execute("Armchair");
if (_statics->_deskchair == "Open")
offMsg.execute("Deskchair");
if (_statics->_toilet == "Open")
offMsg.execute("Toilet");
changeView("SGTState.Node 2.E");
} else if (_statics->_bedhead != "Open") {
petDisplayMessage(1, YOUR_STATEROOM);
} else if (_statics->_chestOfDrawers == "Closed") {
petDisplayMessage(1, BED_NOT_SUPPORT_YOUR_WEIGHT);
}
return true;
}
bool SGTNav::MouseMoveMsg(CMouseMoveMsg *msg) {
_cursorId = CURSOR_ARROW;
if (_statics->_chestOfDrawers == "Open" && _statics->_bedhead == "Open") {
CPetControl *pet = getPetControl();
if (pet->isInAssignedRoom()) {
_cursorId = CURSOR_MOVE_FORWARD;
}
}
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_SGT_NAV_H
#define TITANIC_SGT_NAV_H
#include "titanic/game/sgt/sgt_state_room.h"
namespace Titanic {
class SGTNav : public CSGTStateRoom {
DECLARE_MESSAGE_MAP;
bool MouseButtonDownMsg(CMouseButtonDownMsg *msg);
bool MouseMoveMsg(CMouseMoveMsg *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_SGT_NAV_H */

View File

@@ -0,0 +1,129 @@
/* 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/sgt/sgt_navigation.h"
#include "titanic/pet_control/pet_control.h"
namespace Titanic {
BEGIN_MESSAGE_MAP(CSGTNavigation, CGameObject)
ON_MESSAGE(StatusChangeMsg)
ON_MESSAGE(MouseButtonDownMsg)
ON_MESSAGE(EnterViewMsg)
END_MESSAGE_MAP()
CSGTNavigationStatics *CSGTNavigation::_statics;
void CSGTNavigation::init() {
_statics = new CSGTNavigationStatics();
}
void CSGTNavigation::deinit() {
delete _statics;
}
void CSGTNavigation::save(SimpleFile *file, int indent) {
file->writeNumberLine(1, indent);
file->writeNumberLine(_statics->_miniLiftFloor, indent);
file->writeQuotedLine(_statics->_destView, indent);
file->writeQuotedLine(_statics->_destRoom, indent);
CGameObject::save(file, indent);
}
void CSGTNavigation::load(SimpleFile *file) {
file->readNumber();
_statics->_miniLiftFloor = file->readNumber();
_statics->_destView = file->readString();
_statics->_destRoom = file->readString();
CGameObject::load(file);
}
bool CSGTNavigation::StatusChangeMsg(CStatusChangeMsg *msg) {
CPetControl *pet = getPetControl();
if (isEquals("SGTLL")) {
static const int FRAMES[7] = { 0, 149, 112, 74, 0, 36, 74 };
_statics->_miniLiftFloor = msg->_newStatus;
if (pet->getRoomsSublevel() != _statics->_miniLiftFloor) {
changeView("SGTLittleLift.Node 1.N");
}
int startVal = pet->getRoomsSublevel();
if (startVal > _statics->_miniLiftFloor)
playMovie(FRAMES[startVal], FRAMES[_statics->_miniLiftFloor], MOVIE_WAIT_FOR_FINISH);
else
playMovie(FRAMES[startVal + 3], FRAMES[_statics->_miniLiftFloor + 3], MOVIE_WAIT_FOR_FINISH);
_cursorId = _statics->_miniLiftFloor != 1 ? CURSOR_MOVE_FORWARD : CURSOR_INVALID;
pet->setRoomsSublevel(_statics->_miniLiftFloor);
pet->resetRoomsHighlight();
}
return true;
}
bool CSGTNavigation::MouseButtonDownMsg(CMouseButtonDownMsg *msg) {
if (compareRoomNameTo("SgtLobby")) {
_statics->_destView = getRoomNodeName();
_statics->_destRoom = "SgtLobby";
changeView("SGTState.Node 1.S");
} else if (compareRoomNameTo("SGTLittleLift")) {
if (_statics->_miniLiftFloor != 1) {
_statics->_destRoom = "SGTLittleLift";
changeView("SGTState.Node 1.S");
}
} else if (compareRoomNameTo("SGTState")) {
if (_statics->_destRoom == "SgtLobby") {
if (compareViewNameTo("SGTState.Node 2.N")) {
changeView("SGTState.Node 1.N");
_statics->_destView += ".S";
} else {
_statics->_destView += ".N";
}
changeView(_statics->_destView);
} else if (_statics->_destRoom == "SGTLittleLift") {
if (compareViewNameTo("SGTState.Node 1.S")) {
changeView("SGTLittleLift.Node 1.N");
} else {
changeView("SGTState.Node 1.N");
changeView("SGTLittleLift.Node 1.S");
}
}
}
return true;
}
bool CSGTNavigation::EnterViewMsg(CEnterViewMsg *msg) {
if (isEquals("SGTLL")) {
static const int FRAMES[3] = { 0, 36, 74 };
CPetControl *pet = getPetControl();
loadFrame(FRAMES[pet->getRoomsSublevel() - 1]);
}
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_SGT_NAVIGATION_H
#define TITANIC_SGT_NAVIGATION_H
#include "titanic/core/game_object.h"
namespace Titanic {
struct CSGTNavigationStatics {
int _miniLiftFloor;
CString _destView;
CString _destRoom;
};
class CSGTNavigation : public CGameObject {
DECLARE_MESSAGE_MAP;
bool StatusChangeMsg(CStatusChangeMsg *msg);
bool MouseButtonDownMsg(CMouseButtonDownMsg *msg);
bool EnterViewMsg(CEnterViewMsg *msg);
protected:
static CSGTNavigationStatics *_statics;
public:
CLASSDEF;
static void init();
static void deinit();
/**
* 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_SGT_NAVIGATION_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/sgt/sgt_restaurant_doors.h"
namespace Titanic {
BEGIN_MESSAGE_MAP(CSGTRestaurantDoors, CGameObject)
ON_MESSAGE(MouseButtonDownMsg)
END_MESSAGE_MAP()
void CSGTRestaurantDoors::save(SimpleFile *file, int indent) {
file->writeNumberLine(1, indent);
file->writeNumberLine(_fieldBC, indent);
CGameObject::save(file, indent);
}
void CSGTRestaurantDoors::load(SimpleFile *file) {
file->readNumber();
_fieldBC = file->readNumber();
CGameObject::load(file);
}
bool CSGTRestaurantDoors::MouseButtonDownMsg(CMouseButtonDownMsg *msg) {
CTurnOff offMsg;
offMsg.execute("ChickenDispenser");
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_SGT_RESTAURANT_DOORS_H
#define TITANIC_SGT_RESTAURANT_DOORS_H
#include "titanic/core/game_object.h"
namespace Titanic {
class CSGTRestaurantDoors : public CGameObject {
DECLARE_MESSAGE_MAP;
bool MouseButtonDownMsg(CMouseButtonDownMsg *msg);
private:
int _fieldBC;
public:
CLASSDEF;
CSGTRestaurantDoors() : CGameObject(), _fieldBC(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_SGT_RESTAURANT_DOORS_H */

View File

@@ -0,0 +1,81 @@
/* 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/sgt/sgt_state_control.h"
namespace Titanic {
BEGIN_MESSAGE_MAP(CSGTStateControl, CBackground)
ON_MESSAGE(PETUpMsg)
ON_MESSAGE(PETDownMsg)
ON_MESSAGE(PETActivateMsg)
ON_MESSAGE(EnterViewMsg)
ON_MESSAGE(LeaveViewMsg)
END_MESSAGE_MAP()
void CSGTStateControl::save(SimpleFile *file, int indent) {
file->writeNumberLine(1, indent);
file->writeNumberLine(_state, indent);
CBackground::save(file, indent);
}
void CSGTStateControl::load(SimpleFile *file) {
file->readNumber();
_state = file->readNumber();
CBackground::load(file);
}
bool CSGTStateControl::PETUpMsg(CPETUpMsg *msg) {
// WORKAROUND: Redundant code in original not included
return true;
}
bool CSGTStateControl::PETDownMsg(CPETDownMsg *msg) {
// WORKAROUND: Redundant code in original not included
return true;
}
bool CSGTStateControl::PETActivateMsg(CPETActivateMsg *msg) {
if (msg->_name == "SGTSelector") {
static const char *const TARGETS[] = {
"Vase", "Bedfoot", "Toilet", "Drawer", "SGTTV", "Armchair", "BedHead",
"WashStand", "Desk", "DeskChair", "Basin", "ChestOfDrawers"
};
_state = msg->_numValue;
CActMsg actMsg;
actMsg.execute(TARGETS[_state]);
}
return true;
}
bool CSGTStateControl::EnterViewMsg(CEnterViewMsg *msg) {
_state = 1;
petSetRemoteTarget();
return true;
}
bool CSGTStateControl::LeaveViewMsg(CLeaveViewMsg *msg) {
petClear();
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_SGT_STATE_CONTROL_H
#define TITANIC_SGT_STATE_CONTROL_H
#include "titanic/core/background.h"
#include "titanic/messages/pet_messages.h"
namespace Titanic {
class CSGTStateControl : public CBackground {
DECLARE_MESSAGE_MAP;
bool PETUpMsg(CPETUpMsg *msg);
bool PETDownMsg(CPETDownMsg *msg);
bool PETActivateMsg(CPETActivateMsg *msg);
bool EnterViewMsg(CEnterViewMsg *msg);
bool LeaveViewMsg(CLeaveViewMsg *msg);
private:
int _state;
public:
CLASSDEF;
CSGTStateControl() : CBackground(), _state(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_SGT_STATE_CONTROL_H */

View File

@@ -0,0 +1,180 @@
/* 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/sgt/sgt_state_room.h"
#include "titanic/pet_control/pet_control.h"
#include "titanic/translation.h"
namespace Titanic {
BEGIN_MESSAGE_MAP(CSGTStateRoom, CBackground)
ON_MESSAGE(ActMsg)
ON_MESSAGE(VisibleMsg)
ON_MESSAGE(EnterRoomMsg)
ON_MESSAGE(LeaveRoomMsg)
END_MESSAGE_MAP()
CSGTStateRoomStatics *CSGTStateRoom::_statics;
void CSGTStateRoom::init() {
_statics = new CSGTStateRoomStatics();
_statics->_bedhead = "Closed";
}
void CSGTStateRoom::deinit() {
delete _statics;
}
CSGTStateRoom::CSGTStateRoom() : CBackground(), _isClosed(true),
_displayFlag(true), _savedFrame(0), _savedIsClosed(true), _savedVisible(true) {
}
void CSGTStateRoom::save(SimpleFile *file, int indent) {
file->writeNumberLine(1, indent);
file->writeQuotedLine(_statics->_bedhead, indent);
file->writeQuotedLine(_statics->_bedfoot, indent);
file->writeQuotedLine(_statics->_vase, indent);
file->writeQuotedLine(_statics->_tv, indent);
file->writeQuotedLine(_statics->_desk, indent);
file->writeQuotedLine(_statics->_chestOfDrawers, indent);
file->writeQuotedLine(_statics->_drawer, indent);
file->writeQuotedLine(_statics->_armchair, indent);
file->writeQuotedLine(_statics->_deskchair, indent);
file->writeQuotedLine(_statics->_washstand, indent);
file->writeQuotedLine(_statics->_basin, indent);
file->writeQuotedLine(_statics->_toilet, indent);
file->writeNumberLine(_isClosed, indent);
file->writeNumberLine(_displayFlag, indent);
file->writeNumberLine(_statics->_announcementFlag, indent);
file->writeNumberLine(_statics->_roomFlags, indent);
file->writeNumberLine(_savedFrame, indent);
file->writeNumberLine(_savedIsClosed, indent);
file->writeNumberLine(_savedVisible, indent);
CBackground::save(file, indent);
}
void CSGTStateRoom::load(SimpleFile *file) {
file->readNumber();
_statics->_bedhead = file->readString();
_statics->_bedfoot = file->readString();
_statics->_vase = file->readString();
_statics->_tv = file->readString();
_statics->_desk = file->readString();
_statics->_chestOfDrawers = file->readString();
_statics->_drawer = file->readString();
_statics->_armchair = file->readString();
_statics->_deskchair = file->readString();
_statics->_washstand = file->readString();
_statics->_basin = file->readString();
_statics->_toilet = file->readString();
_isClosed = file->readNumber();
_displayFlag = file->readNumber();
_statics->_announcementFlag = file->readNumber();
_statics->_roomFlags = file->readNumber();
_savedFrame = file->readNumber();
_savedIsClosed = file->readNumber();
_savedVisible = file->readNumber();
CBackground::load(file);
}
bool CSGTStateRoom::ActMsg(CActMsg *msg) {
CPetControl *pet = getPetControl();
uint roomFlags = pet->getRoomFlags();
uint assignedRoom = pet->getAssignedRoomFlags();
if (roomFlags != assignedRoom) {
petDisplayMessage(NOT_YOUR_ASSIGNED_ROOM);
} else if (_isClosed) {
CTurnOn onMsg;
onMsg.execute(this);
} else {
CTurnOff offMsg;
offMsg.execute(this);
}
return true;
}
bool CSGTStateRoom::VisibleMsg(CVisibleMsg *msg) {
setVisible(msg->_visible);
return true;
}
bool CSGTStateRoom::EnterRoomMsg(CEnterRoomMsg *msg) {
CPetControl *pet = getPetControl();
// WORKAROUND: Correctly show SGT furniture states in assigned stateroom
// even when the user has already upgraded to 2nd or 1st class
if (pet->isInAssignedRoom()) {
loadFrame(_savedFrame);
_isClosed = _savedIsClosed;
setVisible(_savedVisible);
if (isEquals("Desk") && _statics->_desk == "Closed")
loadFrame(1);
}
if (isEquals("Drawer")) {
petSetArea(PET_REMOTE);
if (pet->isInAssignedRoom() && getPassengerClass() == 3
&& _statics->_announcementFlag) {
// Congratulations, you may have won an upgrade
playSound(TRANSLATE("b#21.wav", "b#2.wav"));
_statics->_announcementFlag = false;
}
_statics->_drawer = "Closed";
setVisible(false);
_isClosed = true;
} else if (!pet->isInAssignedRoom()) {
loadFrame(0);
if (_displayFlag) {
setVisible(true);
if (isEquals("Desk"))
loadFrame(1);
} else {
setVisible(false);
}
}
return true;
}
bool CSGTStateRoom::LeaveRoomMsg(CLeaveRoomMsg *msg) {
CPetControl *pet = getPetControl();
uint roomFlags = pet->getRoomFlags();
uint assignedRoom = pet->getAssignedRoomFlags();
if (roomFlags == assignedRoom) {
_savedFrame = getMovieFrame();
_savedIsClosed = _isClosed;
_savedVisible = _visible;
}
_statics->_roomFlags = roomFlags;
return true;
}
} // End of namespace Titanic

View File

@@ -0,0 +1,80 @@
/* 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_SGT_STATE_ROOM_H
#define TITANIC_SGT_STATE_ROOM_H
#include "titanic/core/background.h"
#include "titanic/messages/messages.h"
namespace Titanic {
struct CSGTStateRoomStatics {
CString _bedhead;
CString _bedfoot;
CString _vase;
CString _tv;
CString _desk;
CString _chestOfDrawers;
CString _drawer;
CString _armchair;
CString _deskchair;
CString _washstand;
CString _basin;
CString _toilet;
bool _announcementFlag;
uint _roomFlags;
};
class CSGTStateRoom : public CBackground {
DECLARE_MESSAGE_MAP;
bool ActMsg(CActMsg *msg);
bool VisibleMsg(CVisibleMsg *msg);
bool EnterRoomMsg(CEnterRoomMsg *msg);
bool LeaveRoomMsg(CLeaveRoomMsg *msg);
protected:
static CSGTStateRoomStatics *_statics;
protected:
bool _isClosed;
bool _displayFlag;
int _savedFrame;
bool _savedIsClosed;
bool _savedVisible;
public:
CLASSDEF;
CSGTStateRoom();
static void init();
static void deinit();
/**
* 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_SGT_STATE_ROOM_H */

View File

@@ -0,0 +1,73 @@
/* 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/sgt/sgt_tv.h"
namespace Titanic {
BEGIN_MESSAGE_MAP(CSGTTV, CSGTStateRoom)
ON_MESSAGE(TurnOff)
ON_MESSAGE(TurnOn)
ON_MESSAGE(MovieEndMsg)
END_MESSAGE_MAP()
void CSGTTV::save(SimpleFile *file, int indent) {
file->writeNumberLine(1, indent);
CSGTStateRoom::save(file, indent);
}
void CSGTTV::load(SimpleFile *file) {
file->readNumber();
CSGTStateRoom::load(file);
}
bool CSGTTV::TurnOff(CTurnOff *msg) {
if (CSGTStateRoom::_statics->_tv == "Open") {
CSGTStateRoom::_statics->_tv = "Closed";
_isClosed = true;
_startFrame = 6;
_endFrame = 12;
playMovie(6, 12, MOVIE_NOTIFY_OBJECT | MOVIE_WAIT_FOR_FINISH);
}
return true;
}
bool CSGTTV::TurnOn(CTurnOn *msg) {
if (CSGTStateRoom::_statics->_tv == "Closed" &&
CSGTStateRoom::_statics->_bedfoot != "Closed") {
CSGTStateRoom::_statics->_tv = "Open";
setVisible(true);
_isClosed = false;
_startFrame = 1;
_endFrame = 6;
playMovie(1, 6, MOVIE_WAIT_FOR_FINISH);
}
return true;
}
bool CSGTTV::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_SGT_TV_H
#define TITANIC_SGT_TV_H
#include "titanic/game/sgt/sgt_state_room.h"
namespace Titanic {
class CSGTTV : public CSGTStateRoom {
DECLARE_MESSAGE_MAP;
bool TurnOff(CTurnOff *msg);
bool TurnOn(CTurnOn *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_SGT_TV_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/sgt/sgt_upper_doors_sound.h"
namespace Titanic {
CSGTUpperDoorsSound::CSGTUpperDoorsSound() {
_soundName = "b#53.wav";
}
void CSGTUpperDoorsSound::save(SimpleFile *file, int indent) {
file->writeNumberLine(1, indent);
file->writeQuotedLine(_soundName, indent);
CClickResponder::save(file, indent);
}
void CSGTUpperDoorsSound::load(SimpleFile *file) {
file->readNumber();
_soundName = file->readString();
CClickResponder::load(file);
}
} // End of namespace Titanic

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/>.
*
*/
#ifndef TITANIC_SGT_UPPER_DOORS_SOUND_H
#define TITANIC_SGT_UPPER_DOORS_SOUND_H
#include "titanic/core/click_responder.h"
namespace Titanic {
class CSGTUpperDoorsSound : public CClickResponder {
public:
CLASSDEF;
CSGTUpperDoorsSound();
/**
* 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_SGT_UPPER_DOORS_SOUND_H */

View File

@@ -0,0 +1,81 @@
/* 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/sgt/toilet.h"
#include "titanic/translation.h"
namespace Titanic {
BEGIN_MESSAGE_MAP(CToilet, CSGTStateRoom)
ON_MESSAGE(TurnOn)
ON_MESSAGE(TurnOff)
ON_MESSAGE(MovieEndMsg)
END_MESSAGE_MAP()
void CToilet::save(SimpleFile *file, int indent) {
file->writeNumberLine(1, indent);
CSGTStateRoom::save(file, indent);
}
void CToilet::load(SimpleFile *file) {
file->readNumber();
CSGTStateRoom::load(file);
}
bool CToilet::TurnOn(CTurnOn *msg) {
if (CSGTStateRoom::_statics->_toilet == "Closed"
&& CSGTStateRoom::_statics->_washstand == "Open"
&& CSGTStateRoom::_statics->_armchair == "Closed") {
setVisible(true);
CSGTStateRoom::_statics->_toilet = "Open";
_isClosed = false;
_startFrame = 0;
_endFrame = 11;
playMovie(0, 11, MOVIE_WAIT_FOR_FINISH);
playSound(TRANSLATE("b#1.wav", "b#86.wav"));
}
return true;
}
bool CToilet::TurnOff(CTurnOff *msg) {
if (CSGTStateRoom::_statics->_toilet == "Open") {
CSGTStateRoom::_statics->_toilet = "Closed";
_isClosed = true;
_startFrame = 11;
_endFrame = 18;
playMovie(11, 18, MOVIE_NOTIFY_OBJECT | MOVIE_WAIT_FOR_FINISH);
playSound(TRANSLATE("b#1.wav", "b#86.wav"));
}
return true;
}
bool CToilet::MovieEndMsg(CMovieEndMsg *msg) {
if (CSGTStateRoom::_statics->_toilet == "Closed")
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_TOILET_H
#define TITANIC_TOILET_H
#include "titanic/game/sgt/sgt_state_room.h"
namespace Titanic {
class CToilet : public CSGTStateRoom {
DECLARE_MESSAGE_MAP;
bool TurnOn(CTurnOn *msg);
bool TurnOff(CTurnOff *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_TOILET_H */

View File

@@ -0,0 +1,76 @@
/* 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/sgt/vase.h"
namespace Titanic {
BEGIN_MESSAGE_MAP(CVase, CSGTStateRoom)
ON_MESSAGE(TurnOn)
ON_MESSAGE(TurnOff)
ON_MESSAGE(MovieEndMsg)
END_MESSAGE_MAP()
void CVase::save(SimpleFile *file, int indent) {
file->writeNumberLine(1, indent);
CSGTStateRoom::save(file, indent);
}
void CVase::load(SimpleFile *file) {
file->readNumber();
CSGTStateRoom::load(file);
}
bool CVase::TurnOn(CTurnOn *msg) {
if (CSGTStateRoom::_statics->_vase == "Closed") {
CSGTStateRoom::_statics->_vase = "Open";
setVisible(true);
_isClosed = false;
_startFrame = 1;
_endFrame = 12;
playMovie(1, 12, MOVIE_WAIT_FOR_FINISH);
}
return true;
}
bool CVase::TurnOff(CTurnOff *msg) {
if (CSGTStateRoom::_statics->_vase == "Open"
&& CSGTStateRoom::_statics->_bedhead != "RestingV"
&& CSGTStateRoom::_statics->_bedhead != "RestingUV") {
CSGTStateRoom::_statics->_vase = "Closed";
_isClosed = true;
_startFrame = 12;
_endFrame = 25;
playMovie(12, 25, MOVIE_NOTIFY_OBJECT | MOVIE_WAIT_FOR_FINISH);
}
return true;
}
bool CVase::MovieEndMsg(CMovieEndMsg *msg) {
if (CSGTStateRoom::_statics->_vase == "Closed")
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_VASE_H
#define TITANIC_VASE_H
#include "titanic/game/sgt/sgt_state_room.h"
namespace Titanic {
class CVase : public CSGTStateRoom {
DECLARE_MESSAGE_MAP;
bool TurnOn(CTurnOn *msg);
bool TurnOff(CTurnOff *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_VASE_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/sgt/washstand.h"
#include "titanic/translation.h"
namespace Titanic {
BEGIN_MESSAGE_MAP(CWashstand, CSGTStateRoom)
ON_MESSAGE(TurnOn)
ON_MESSAGE(TurnOff)
ON_MESSAGE(MovieEndMsg)
END_MESSAGE_MAP()
void CWashstand::save(SimpleFile *file, int indent) {
file->writeNumberLine(1, indent);
CSGTStateRoom::save(file, indent);
}
void CWashstand::load(SimpleFile *file) {
file->readNumber();
CSGTStateRoom::load(file);
}
bool CWashstand::TurnOn(CTurnOn *msg) {
if (_statics->_washstand == "Closed" && _statics->_bedfoot != "NotOnWashstand") {
setVisible(true);
_statics->_washstand = "Open";
_isClosed = false;
_startFrame = 0;
_endFrame = 14;
playMovie(0, 14, MOVIE_WAIT_FOR_FINISH);
playSound(TRANSLATE("b#14.wav", "b#99.wav"));
}
return true;
}
bool CWashstand::TurnOff(CTurnOff *msg) {
if (_statics->_washstand == "Open" && _statics->_basin == "Closed"
&& _statics->_toilet == "Closed" && _statics->_bedfoot != "Open") {
_statics->_washstand = "Closed";
_isClosed = true;
_startFrame = 14;
_endFrame = 28;
playMovie(14, 28, MOVIE_WAIT_FOR_FINISH | MOVIE_NOTIFY_OBJECT);
playSound(TRANSLATE("b#14.wav", "b#99.wav"));
}
return true;
}
bool CWashstand::MovieEndMsg(CMovieEndMsg *msg) {
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_WASHSTAND_H
#define TITANIC_WASHSTAND_H
#include "titanic/game/sgt/sgt_state_room.h"
namespace Titanic {
class CWashstand : public CSGTStateRoom {
DECLARE_MESSAGE_MAP;
bool TurnOn(CTurnOn *msg);
bool TurnOff(CTurnOff *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_WASHSTAND_H */