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,202 @@
/* 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/carry/arm.h"
#include "titanic/messages/messages.h"
#include "titanic/translation.h"
namespace Titanic {
BEGIN_MESSAGE_MAP(CArm, CCarry)
ON_MESSAGE(PuzzleSolvedMsg)
ON_MESSAGE(TranslateObjectMsg)
ON_MESSAGE(UseWithOtherMsg)
ON_MESSAGE(MouseDragStartMsg)
ON_MESSAGE(MaitreDHappyMsg)
ON_MESSAGE(PETGainedObjectMsg)
ON_MESSAGE(MouseDragMoveMsg)
END_MESSAGE_MAP()
CArm::CArm() : CCarry(), _heldItemName("Key"),
_puzzleUnused(0), _armUnlocked(false), _arboretumFrame(3), _unlockedFrame(0),
_armRect(220, 208, 409, 350) {
}
void CArm::save(SimpleFile *file, int indent) {
file->writeNumberLine(1, indent);
file->writeQuotedLine(_heldItemName, indent);
file->writeNumberLine(_puzzleUnused, indent);
file->writeRect(_hookedRect, indent);
file->writeQuotedLine(_hookedTarget, indent);
file->writeNumberLine(_armUnlocked, indent);
file->writeRect(_armRect, indent);
file->writeNumberLine(_arboretumFrame, indent);
file->writeNumberLine(_unlockedFrame, indent);
CCarry::save(file, indent);
}
void CArm::load(SimpleFile *file) {
file->readNumber();
_heldItemName = file->readString();
_puzzleUnused = file->readNumber();
_hookedRect = file->readRect();
_hookedTarget = file->readString();
_armUnlocked = file->readNumber();
_armRect = file->readRect();
_arboretumFrame = file->readNumber();
_unlockedFrame = file->readNumber();
CCarry::load(file);
}
bool CArm::PuzzleSolvedMsg(CPuzzleSolvedMsg *msg) {
_puzzleUnused = 0;
_canTake = true;
CString name = getName();
if (name == "Arm1") {
CActMsg actMsg("LoseArm");
actMsg.execute("MaitreD");
CPuzzleSolvedMsg solvedMsg;
solvedMsg.execute("AuditoryCentre");
} else if (name == "Arm2") {
CPuzzleSolvedMsg solvedMsg;
solvedMsg.execute("Key");
}
return true;
}
bool CArm::TranslateObjectMsg(CTranslateObjectMsg *msg) {
Point newPos(_bounds.left + msg->_delta.x, _bounds.top + msg->_delta.y);
setPosition(newPos);
return true;
}
bool CArm::UseWithOtherMsg(CUseWithOtherMsg *msg) {
if (_heldItemName != "None") {
CShowTextMsg textMsg(ARM_ALREADY_HOLDING);
textMsg.execute("PET");
return false;
} else if (msg->_other->getName() == "GondolierLeftLever") {
CIsHookedOnMsg hookedMsg(_hookedRect, 0, getName());
hookedMsg._rect.translate(_bounds.left, _bounds.top);
hookedMsg.execute("GondolierLeftLever");
if (hookedMsg._isHooked) {
_hookedTarget = "GondolierLeftLever";
} else {
petAddToInventory();
}
} else if (msg->_other->getName() == "GondolierRightLever") {
CIsHookedOnMsg hookedMsg(_hookedRect, 0, getName());
hookedMsg._rect.translate(_bounds.left, _bounds.top);
hookedMsg.execute("GondolierRightLever");
if (hookedMsg._isHooked) {
_hookedTarget = "GondolierRightLever";
} else {
petAddToInventory();
}
} else {
petAddToInventory();
}
return true;
}
bool CArm::MouseDragStartMsg(CMouseDragStartMsg *msg) {
if (!_canTake) {
CShowTextMsg textMsg(YOU_CANT_GET_THIS);
textMsg.execute("PET");
} else if (checkStartDragging(msg)) {
hideMouse();
_centroid = msg->_mousePos - _bounds;
setPosition(msg->_mousePos - _centroid);
if (!_hookedTarget.empty()) {
CActMsg actMsg("Unhook");
actMsg.execute(_hookedTarget);
_hookedTarget.clear();
}
loadFrame(_visibleFrame);
return true;
}
return false;
}
bool CArm::MaitreDHappyMsg(CMaitreDHappyMsg *msg) {
CGameObject *petItem;
if (find(getName(), &petItem, FIND_PET)) {
if (!_armUnlocked)
playSound(TRANSLATE("z#47.wav", "z#578.wav"));
if (_heldItemName == "Key" || _heldItemName == "AuditoryCentre") {
CGameObject *heldItem = dynamic_cast<CGameObject *>(getFirstChild());
if (heldItem) {
heldItem->setVisible(true);
heldItem->petAddToInventory();
}
_visibleFrame = _unlockedFrame;
loadFrame(_visibleFrame);
_heldItemName = "None";
petInvChange();
}
}
_armUnlocked = true;
_canTake = true;
return true;
}
bool CArm::PETGainedObjectMsg(CPETGainedObjectMsg *msg) {
if (_armUnlocked) {
if (_heldItemName == "Key" || _heldItemName == "AuditoryCentre") {
CCarry *child = dynamic_cast<CCarry *>(getFirstChild());
if (child) {
_visibleFrame = _unlockedFrame;
loadFrame(_visibleFrame);
child->setVisible(true);
child->petAddToInventory();
}
_heldItemName = "None";
}
}
return true;
}
bool CArm::MouseDragMoveMsg(CMouseDragMoveMsg *msg) {
setPosition(msg->_mousePos - _centroid);
if (_heldItemName == "None" && compareViewNameTo("FrozenArboretum.Node 5.S")) {
loadFrame(_armRect.contains(msg->_mousePos) ?
_arboretumFrame : _visibleFrame);
}
return true;
}
} // End of namespace Titanic

View File

@@ -0,0 +1,67 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#ifndef TITANIC_ARM_H
#define TITANIC_ARM_H
#include "titanic/carry/carry.h"
#include "titanic/messages/messages.h"
#include "titanic/messages/mouse_messages.h"
#include "titanic/messages/pet_messages.h"
namespace Titanic {
class CArm : public CCarry {
DECLARE_MESSAGE_MAP;
bool PuzzleSolvedMsg(CPuzzleSolvedMsg *msg);
bool TranslateObjectMsg(CTranslateObjectMsg *msg);
bool UseWithOtherMsg(CUseWithOtherMsg *msg);
bool MouseDragStartMsg(CMouseDragStartMsg *msg);
bool MaitreDHappyMsg(CMaitreDHappyMsg *msg);
bool PETGainedObjectMsg(CPETGainedObjectMsg *msg);
bool MouseDragMoveMsg(CMouseDragMoveMsg *msg);
private:
CString _heldItemName;
int _puzzleUnused;
Rect _hookedRect;
CString _hookedTarget;
bool _armUnlocked;
Rect _armRect;
int _arboretumFrame;
int _unlockedFrame;
public:
CLASSDEF;
CArm();
/**
* 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_ARM_H */

View File

@@ -0,0 +1,46 @@
/* 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/carry/auditory_centre.h"
namespace Titanic {
BEGIN_MESSAGE_MAP(CAuditoryCentre, CBrain)
ON_MESSAGE(PuzzleSolvedMsg)
END_MESSAGE_MAP()
void CAuditoryCentre::save(SimpleFile *file, int indent) {
file->writeNumberLine(1, indent);
CBrain::save(file, indent);
}
void CAuditoryCentre::load(SimpleFile *file) {
file->readNumber();
CBrain::load(file);
}
bool CAuditoryCentre::PuzzleSolvedMsg(CPuzzleSolvedMsg *msg) {
_canTake = true;
setVisible(true);
return true;
}
} // End of namespace Titanic

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/>.
*
*/
#ifndef TITANIC_AUDITORY_CENTRE_H
#define TITANIC_AUDITORY_CENTRE_H
#include "titanic/carry/brain.h"
namespace Titanic {
class CAuditoryCentre : public CBrain {
DECLARE_MESSAGE_MAP;
bool PuzzleSolvedMsg(CPuzzleSolvedMsg *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_AUDITORY_CENTRE_H */

View File

@@ -0,0 +1,67 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#include "titanic/carry/bowl_ear.h"
namespace Titanic {
BEGIN_MESSAGE_MAP(CBowlEar, CEar)
ON_MESSAGE(PETGainedObjectMsg)
ON_MESSAGE(ReplaceBowlAndNutsMsg)
ON_MESSAGE(NutPuzzleMsg)
ON_MESSAGE(MouseDragStartMsg)
END_MESSAGE_MAP()
void CBowlEar::save(SimpleFile *file, int indent) {
file->writeNumberLine(1, indent);
CEar::save(file, indent);
}
void CBowlEar::load(SimpleFile *file) {
file->readNumber();
CEar::load(file);
}
bool CBowlEar::PETGainedObjectMsg(CPETGainedObjectMsg *msg) {
CBowlStateChangeMsg changeMsg(3);
changeMsg.execute("ParrotNutBowlActor");
return CEar::PETGainedObjectMsg(msg);
}
bool CBowlEar::ReplaceBowlAndNutsMsg(CReplaceBowlAndNutsMsg *msg) {
setVisible(false);
return true;
}
bool CBowlEar::NutPuzzleMsg(CNutPuzzleMsg *msg) {
if (msg->_action == "BowlUnlocked")
_canTake = true;
return true;
}
bool CBowlEar::MouseDragStartMsg(CMouseDragStartMsg *msg) {
setVisible(true);
return CEar::MouseDragStartMsg(msg);
}
} // 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_BOWL_EAR_H
#define TITANIC_BOWL_EAR_H
#include "titanic/carry/ear.h"
namespace Titanic {
class CBowlEar : public CEar {
DECLARE_MESSAGE_MAP;
bool PETGainedObjectMsg(CPETGainedObjectMsg *msg);
bool ReplaceBowlAndNutsMsg(CReplaceBowlAndNutsMsg *msg);
bool NutPuzzleMsg(CNutPuzzleMsg *msg);
bool MouseDragStartMsg(CMouseDragStartMsg *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_BOWL_EAR_H */

View File

@@ -0,0 +1,135 @@
/* 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/carry/brain.h"
#include "titanic/game/brain_slot.h"
#include "titanic/translation.h"
namespace Titanic {
BEGIN_MESSAGE_MAP(CBrain, CCarry)
ON_MESSAGE(UseWithOtherMsg)
ON_MESSAGE(VisibleMsg)
ON_MESSAGE(MouseDragStartMsg)
ON_MESSAGE(PassOnDragStartMsg)
ON_MESSAGE(PETGainedObjectMsg)
END_MESSAGE_MAP()
CBrain::CBrain() : CCarry(), _pieceAdded(false), _perchGained(false) {
}
void CBrain::save(SimpleFile *file, int indent) {
file->writeNumberLine(1, indent);
file->writePoint(_pos1, indent);
file->writeNumberLine(_pieceAdded, indent);
file->writeNumberLine(_perchGained, indent);
CCarry::save(file, indent);
}
void CBrain::load(SimpleFile *file) {
file->readNumber();
_pos1 = file->readPoint();
_pieceAdded = file->readNumber();
_perchGained = file->readNumber();
CCarry::load(file);
}
bool CBrain::UseWithOtherMsg(CUseWithOtherMsg *msg) {
CBrainSlot *slot = dynamic_cast<CBrainSlot *>(msg->_other);
if (!slot)
return CCarry::UseWithOtherMsg(msg);
if (isEquals("CentralCore")) {
setVisible(false);
petMoveToHiddenRoom();
CAddHeadPieceMsg headpieceMsg(getName());
headpieceMsg.execute("CentralCoreSlot");
} else if (!slot->_occupied && slot->getName() != "CentralCoreSlot") {
// Brain card goes into vacant slot
setVisible(false);
petMoveToHiddenRoom();
CAddHeadPieceMsg headpieceMsg(getName());
headpieceMsg.execute(msg->_other);
playSound(TRANSLATE("z#116.wav", "z#647.wav"));
setPosition(Point(0, 0));
setVisible(false);
_pieceAdded = true;
} else {
// Trying to put brain card into an already occupied slot
petAddToInventory();
}
return true;
}
bool CBrain::VisibleMsg(CVisibleMsg *msg) {
setVisible(msg->_visible);
return true;
}
bool CBrain::MouseDragStartMsg(CMouseDragStartMsg *msg) {
if (!checkStartDragging(msg))
return false;
if (_pieceAdded) {
CTakeHeadPieceMsg headpieceMsg(getName());
headpieceMsg.execute("TitaniaControl");
_pieceAdded = false;
setVisible(true);
moveToView();
setPosition(Point(msg->_mousePos.x - _bounds.width() / 2,
msg->_mousePos.y - _bounds.height() / 2));
}
return CCarry::MouseDragStartMsg(msg);
}
bool CBrain::PassOnDragStartMsg(CPassOnDragStartMsg *msg) {
if (_pieceAdded) {
CTakeHeadPieceMsg headpieceMsg(getName());
headpieceMsg.execute("TitaniaControl");
_pieceAdded = false;
setVisible(true);
moveToView();
setPosition(Point(msg->_mousePos.x - _bounds.width() / 2,
msg->_mousePos.y - _bounds.height() / 2));
}
return CCarry::PassOnDragStartMsg(msg);
}
bool CBrain::PETGainedObjectMsg(CPETGainedObjectMsg *msg) {
if (!_perchGained) {
if (getName() == "Perch") {
incParrotResponse();
_perchGained = true;
}
}
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_BRAIN_H
#define TITANIC_BRAIN_H
#include "titanic/carry/carry.h"
#include "titanic/messages/messages.h"
#include "titanic/messages/mouse_messages.h"
#include "titanic/messages/pet_messages.h"
namespace Titanic {
class CBrain : public CCarry {
DECLARE_MESSAGE_MAP;
bool UseWithOtherMsg(CUseWithOtherMsg *msg);
bool VisibleMsg(CVisibleMsg *msg);
bool MouseDragStartMsg(CMouseDragStartMsg *msg);
bool PassOnDragStartMsg(CPassOnDragStartMsg *msg);
bool PETGainedObjectMsg(CPETGainedObjectMsg *msg);
private:
Point _pos1;
bool _pieceAdded;
bool _perchGained;
public:
CLASSDEF;
CBrain();
/**
* Save the data for the class to file
*/
void save(SimpleFile *file, int indent) override;
/**
* Load the data for the class from file
*/
void load(SimpleFile *file) override;
};
} // End of namespace Titanic
#endif /* TITANIC_BRAIN_H */

View File

@@ -0,0 +1,95 @@
/* 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/carry/bridge_piece.h"
#include "titanic/game/ship_setting.h"
#include "titanic/translation.h"
namespace Titanic {
BEGIN_MESSAGE_MAP(CBridgePiece, CCarry)
ON_MESSAGE(UseWithOtherMsg)
ON_MESSAGE(PassOnDragStartMsg)
END_MESSAGE_MAP()
CBridgePiece::CBridgePiece() : CCarry(), _field140(0) {
}
void CBridgePiece::save(SimpleFile *file, int indent) {
file->writeNumberLine(1, indent);
file->writeQuotedLine(_string6, indent);
file->writePoint(_pos3, indent);
file->writeNumberLine(_field140, indent);
CCarry::save(file, indent);
}
void CBridgePiece::load(SimpleFile *file) {
file->readNumber();
_string6 = file->readString();
_pos3 = file->readPoint();
_field140 = file->readNumber();
CCarry::load(file);
}
bool CBridgePiece::UseWithOtherMsg(CUseWithOtherMsg *msg) {
CShipSetting *shipSetting = dynamic_cast<CShipSetting *>(msg->_other);
if (!shipSetting) {
return CCarry::UseWithOtherMsg(msg);
} else if (shipSetting->_itemName != "NULL") {
petAddToInventory();
return true;
} else {
setVisible(false);
playSound(TRANSLATE("z#54.wav", "z#585.wav"));
setPosition(shipSetting->_pos1);
shipSetting->_itemName = getName();
petMoveToHiddenRoom();
CAddHeadPieceMsg headpieceMsg(shipSetting->getName() == _string6 ?
"Enable" : "Disable");
CSetFrameMsg frameMsg;
CString name = getName();
if (name == "ChickenBridge") {
frameMsg._frameNumber = 1;
} else if (name == "FanBridge") {
frameMsg._frameNumber = 2;
} else if (name == "SeasonBridge") {
frameMsg._frameNumber = 3;
} else if (name == "BeamBridge") {
frameMsg._frameNumber = 4;
}
frameMsg.execute(shipSetting);
headpieceMsg.execute(shipSetting);
return true;
}
}
bool CBridgePiece::PassOnDragStartMsg(CPassOnDragStartMsg *msg) {
setVisible(true);
moveToView();
return CCarry::PassOnDragStartMsg(msg);
}
} // End of namespace Titanic

View File

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

View File

@@ -0,0 +1,245 @@
/* 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/carry/carry.h"
#include "titanic/debugger.h"
#include "titanic/messages/messages.h"
#include "titanic/npcs/character.h"
#include "titanic/npcs/succubus.h"
#include "titanic/pet_control/pet_control.h"
#include "titanic/titanic.h"
namespace Titanic {
BEGIN_MESSAGE_MAP(CCarry, CGameObject)
ON_MESSAGE(MouseDragStartMsg)
ON_MESSAGE(MouseDragMoveMsg)
ON_MESSAGE(MouseDragEndMsg)
ON_MESSAGE(UseWithCharMsg)
ON_MESSAGE(LeaveViewMsg)
ON_MESSAGE(UseWithOtherMsg)
ON_MESSAGE(VisibleMsg)
ON_MESSAGE(MouseButtonDownMsg)
ON_MESSAGE(RemoveFromGameMsg)
ON_MESSAGE(MoveToStartPosMsg)
ON_MESSAGE(EnterViewMsg)
ON_MESSAGE(PassOnDragStartMsg)
END_MESSAGE_MAP()
CCarry::CCarry() : CGameObject(), _unused5(0), _canTake(true),
_unusedR(0), _unusedG(0), _unusedB(0), _itemFrame(0),
_enterFrame(0), _enterFrameSet(false), _visibleFrame(0),
_npcUse("None"), _fullViewName("NULL"),
_doesNothingMsg(g_vm->_strings[DOESNT_DO_ANYTHING]),
_doesntWantMsg(g_vm->_strings[DOESNT_WANT_THIS]) {
}
void CCarry::save(SimpleFile *file, int indent) {
file->writeNumberLine(1, indent);
file->writeQuotedLine(_npcUse, indent);
file->writePoint(_origPos, indent);
file->writeQuotedLine(_fullViewName, indent);
file->writeNumberLine(_unused5, indent);
file->writeNumberLine(_canTake, indent);
file->writeQuotedLine(_doesNothingMsg, indent);
file->writeQuotedLine(_doesntWantMsg, indent);
file->writePoint(_centroid, indent);
file->writeNumberLine(_unusedR, indent);
file->writeNumberLine(_unusedG, indent);
file->writeNumberLine(_unusedB, indent);
file->writeNumberLine(_itemFrame, indent);
file->writeQuotedLine(_unused6, indent);
file->writeNumberLine(_enterFrame, indent);
file->writeNumberLine(_enterFrameSet, indent);
file->writeNumberLine(_visibleFrame, indent);
CGameObject::save(file, indent);
}
void CCarry::load(SimpleFile *file) {
file->readNumber();
_npcUse = file->readString();
_origPos = file->readPoint();
_fullViewName = file->readString();
_unused5 = file->readNumber();
_canTake = file->readNumber();
_doesNothingMsg = file->readString();
_doesntWantMsg = file->readString();
_centroid = file->readPoint();
_unusedR = file->readNumber();
_unusedG = file->readNumber();
_unusedB = file->readNumber();
_itemFrame = file->readNumber();
_unused6 = file->readString();
_enterFrame = file->readNumber();
_enterFrameSet = file->readNumber();
_visibleFrame = file->readNumber();
CGameObject::load(file);
}
bool CCarry::MouseDragStartMsg(CMouseDragStartMsg *msg) {
CString name = getName();
debugC(DEBUG_BASIC, kDebugScripts, "MosueDragStartMsg - %s", name.c_str());
if (_canTake) {
if (checkStartDragging(msg)) {
CPassOnDragStartMsg startMsg(msg->_mousePos);
startMsg.execute(this);
return true;
}
} else {
if (_visible) {
CShowTextMsg textMsg(YOU_CANT_GET_THIS);
textMsg.execute("PET");
}
}
return false;
}
bool CCarry::MouseDragMoveMsg(CMouseDragMoveMsg *msg) {
setPosition(msg->_mousePos - _centroid);
return true;
}
bool CCarry::MouseDragEndMsg(CMouseDragEndMsg *msg) {
debugC(DEBUG_BASIC, kDebugScripts, "MouseDragEndMsg");
showMouse();
if (msg->_dropTarget) {
if (msg->_dropTarget->isPet()) {
petAddToInventory();
return true;
}
CCharacter *npc = dynamic_cast<CCharacter *>(msg->_dropTarget);
if (npc) {
CUseWithCharMsg charMsg(npc);
charMsg.execute(this, nullptr, 0);
return true;
}
CDropObjectMsg dropMsg(this);
if (dropMsg.execute(msg->_dropTarget))
return true;
// Fall back on a use with other message
CUseWithOtherMsg otherMsg(msg->_dropTarget);
if (otherMsg.execute(this, nullptr, 0))
return true;
}
if (!compareViewNameTo(_fullViewName) || msg->_mousePos.y >= 360) {
sleep(250);
petAddToInventory();
} else {
setPosition(_origPos);
loadFrame(_itemFrame);
}
return true;
}
bool CCarry::UseWithCharMsg(CUseWithCharMsg *msg) {
CSuccUBus *succubus = dynamic_cast<CSuccUBus *>(msg->_character);
if (succubus) {
CSubAcceptCCarryMsg carryMsg;
carryMsg._item = this;
carryMsg.execute(succubus);
} else {
CShowTextMsg textMsg(_doesntWantMsg);
textMsg.execute("PET");
petAddToInventory();
}
return true;
}
bool CCarry::LeaveViewMsg(CLeaveViewMsg *msg) {
return true;
}
bool CCarry::UseWithOtherMsg(CUseWithOtherMsg *msg) {
CShowTextMsg textMsg(_doesNothingMsg);
textMsg.execute("PET");
if (!compareViewNameTo(_fullViewName) || _bounds.top >= 360) {
sleep(250);
petAddToInventory();
} else {
setPosition(_origPos);
}
return true;
}
bool CCarry::VisibleMsg(CVisibleMsg *msg) {
setVisible(msg->_visible);
if (msg->_visible && _visibleFrame != -1)
loadFrame(_visibleFrame);
return true;
}
bool CCarry::MouseButtonDownMsg(CMouseButtonDownMsg *msg) {
return true;
}
bool CCarry::RemoveFromGameMsg(CRemoveFromGameMsg *msg) {
setPosition(Point(0, 0));
setVisible(false);
return true;
}
bool CCarry::MoveToStartPosMsg(CMoveToStartPosMsg *msg) {
setPosition(_origPos);
return true;
}
bool CCarry::EnterViewMsg(CEnterViewMsg *msg) {
if (!_enterFrameSet) {
loadFrame(_enterFrame);
_enterFrameSet = true;
}
return true;
}
bool CCarry::PassOnDragStartMsg(CPassOnDragStartMsg *msg) {
hideMouse();
if (_visibleFrame != -1)
loadFrame(_visibleFrame);
if (msg->_value3) {
_centroid.x = _bounds.width() / 2;
_centroid.y = _bounds.height() / 2;
} else {
_centroid = msg->_mousePos - _bounds;
}
setPosition(getMousePos() - _centroid);
return true;
}
} // End of namespace Titanic

View File

@@ -0,0 +1,79 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#ifndef TITANIC_CARRY_H
#define TITANIC_CARRY_H
#include "titanic/core/game_object.h"
#include "titanic/messages/messages.h"
#include "titanic/messages/mouse_messages.h"
namespace Titanic {
class CCarry : public CGameObject {
DECLARE_MESSAGE_MAP;
bool MouseDragStartMsg(CMouseDragStartMsg *msg);
bool MouseDragMoveMsg(CMouseDragMoveMsg *msg);
bool MouseDragEndMsg(CMouseDragEndMsg *msg);
bool UseWithCharMsg(CUseWithCharMsg *msg);
bool LeaveViewMsg(CLeaveViewMsg *msg);
bool UseWithOtherMsg(CUseWithOtherMsg *msg);
bool VisibleMsg(CVisibleMsg *msg);
bool MouseButtonDownMsg(CMouseButtonDownMsg *msg);
bool RemoveFromGameMsg(CRemoveFromGameMsg *msg);
bool MoveToStartPosMsg(CMoveToStartPosMsg *msg);
bool EnterViewMsg(CEnterViewMsg *msg);
bool PassOnDragStartMsg(CPassOnDragStartMsg *msg);
private:
int _unused5;
CString _doesNothingMsg;
CString _doesntWantMsg;
int _unusedR, _unusedG, _unusedB;
int _itemFrame;
CString _unused6;
int _enterFrame;
bool _enterFrameSet;
protected:
Point _centroid;
int _visibleFrame;
public:
CString _npcUse;
bool _canTake;
Point _origPos;
CString _fullViewName;
public:
CLASSDEF;
CCarry();
/**
* 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_CARRY_H */

View File

@@ -0,0 +1,237 @@
/* 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/carry/carry_parrot.h"
#include "titanic/core/project_item.h"
#include "titanic/core/room_item.h"
#include "titanic/game/cage.h"
#include "titanic/npcs/parrot.h"
#include "titanic/npcs/succubus.h"
#include "titanic/pet_control/pet_control.h"
#include "titanic/translation.h"
namespace Titanic {
BEGIN_MESSAGE_MAP(CCarryParrot, CCarry)
ON_MESSAGE(PETGainedObjectMsg)
ON_MESSAGE(TimerMsg)
ON_MESSAGE(IsParrotPresentMsg)
ON_MESSAGE(LeaveViewMsg)
ON_MESSAGE(MouseDragEndMsg)
ON_MESSAGE(PassOnDragStartMsg)
ON_MESSAGE(PreEnterViewMsg)
ON_MESSAGE(UseWithCharMsg)
ON_MESSAGE(ActMsg)
END_MESSAGE_MAP()
CCarryParrot::CCarryParrot() : CCarry(), _parrotName("PerchedParrot"),
_timerId(0), _freeCounter(0), _feathersFlag(false) {
}
void CCarryParrot::save(SimpleFile *file, int indent) {
file->writeNumberLine(1, indent);
file->writeQuotedLine(_parrotName, indent);
file->writeNumberLine(_timerId, indent);
file->writeNumberLine(_freeCounter, indent);
file->writeNumberLine(_feathersFlag, indent);
CCarry::save(file, indent);
}
void CCarryParrot::load(SimpleFile *file) {
file->readNumber();
_parrotName = file->readString();
_timerId = file->readNumber();
_freeCounter = file->readNumber();
_feathersFlag = file->readNumber();
CCarry::load(file);
}
bool CCarryParrot::PETGainedObjectMsg(CPETGainedObjectMsg *msg) {
CParrot::_state = PARROT_4;
CActMsg actMsg("Shut");
actMsg.execute("ParrotCage");
return true;
}
bool CCarryParrot::TimerMsg(CTimerMsg *msg) {
if (CParrot::_state == PARROT_1 || CParrot::_state == PARROT_4) {
if (++_freeCounter >= 30) {
CActMsg actMsg("FreeParrot");
actMsg.execute(this);
}
}
return true;
}
bool CCarryParrot::IsParrotPresentMsg(CIsParrotPresentMsg *msg) {
msg->_isPresent = true;
return true;
}
bool CCarryParrot::LeaveViewMsg(CLeaveViewMsg *msg) {
if (_visible) {
setVisible(false);
_canTake = false;
CParrot::_state = PARROT_ESCAPED;
}
return true;
}
bool CCarryParrot::MouseDragEndMsg(CMouseDragEndMsg *msg) {
stopMovie();
if (msg->_mousePos.y >= 360) {
petAddToInventory();
} else if (compareViewNameTo("ParrotLobby.Node 1.N")) {
if (msg->_mousePos.x >= 75 && msg->_mousePos.x <= 565 &&
!CParrot::_takeOff && !CCage::_open) {
setVisible(false);
_canTake = false;
CTreeItem *perchedParrot = findUnder(getRoot(), "PerchedParrot");
detach();
addUnder(perchedParrot);
stopSoundChannel(true);
CPutParrotBackMsg backMsg(msg->_mousePos.x);
backMsg.execute(perchedParrot);
} else {
setVisible(false);
_canTake = false;
CParrot::_state = PARROT_ESCAPED;
playSound(TRANSLATE("z#475.wav", "z#212.wav"));
stopSoundChannel(true);
moveUnder(findRoom());
CActMsg actMsg("Shut");
actMsg.execute("ParrotCage");
}
} else {
CCharacter *character = dynamic_cast<CCharacter *>(msg->_dropTarget);
if (character) {
CUseWithCharMsg charMsg(character);
charMsg.execute(this, nullptr, 0);
} else {
setVisible(false);
_canTake = false;
playSound(TRANSLATE("z#475.wav", "z#212.wav"));
stopSoundChannel(true);
moveUnder(findRoom());
}
}
showMouse();
return true;
}
bool CCarryParrot::PassOnDragStartMsg(CPassOnDragStartMsg *msg) {
if (CParrot::_state != PARROT_MAILED) {
moveToView();
setPosition(Point(0, 0));
setVisible(true);
playClip("Pick Up", MOVIE_STOP_PREVIOUS);
playClip("Flapping", MOVIE_REPEAT);
stopTimer(_timerId);
_timerId = addTimer(1000, 1000);
_freeCounter = 0;
CParrot::_state = PARROT_1;
msg->_value3 = 1;
return CCarry::PassOnDragStartMsg(msg);
}
CTrueTalkNPC *npc = dynamic_cast<CTrueTalkNPC *>(getRoot()->findByName(_parrotName));
if (npc)
startTalking(npc, 0x446BF);
_canTake = false;
CProximity prox(Audio::Mixer::kSpeechSoundType);
playSound(TRANSLATE("z#475.wav", "z#212.wav"), prox);
moveUnder(findRoom());
CParrot::_state = PARROT_ESCAPED;
msg->_value4 = 1;
return true;
}
bool CCarryParrot::PreEnterViewMsg(CPreEnterViewMsg *msg) {
loadSurface();
CCarryParrot *parrot = dynamic_cast<CCarryParrot *>(getRoot()->findByName("CarryParrot"));
if (parrot)
parrot->_canTake = false;
return true;
}
bool CCarryParrot::UseWithCharMsg(CUseWithCharMsg *msg) {
CSuccUBus *succubus = dynamic_cast<CSuccUBus *>(msg->_character);
if (succubus)
CParrot::_state = PARROT_MAILED;
return CCarry::UseWithCharMsg(msg);
}
bool CCarryParrot::ActMsg(CActMsg *msg) {
if (msg->_action == "FreeParrot" && (CParrot::_state == PARROT_4 || CParrot::_state == PARROT_1)) {
CTrueTalkNPC *npc = dynamic_cast<CTrueTalkNPC *>(getRoot()->findByName(_parrotName));
if (npc)
startTalking(npc, 0x446BF);
setVisible(false);
_canTake = false;
if (CParrot::_state == PARROT_4) {
playSound(TRANSLATE("z#475.wav", "z#212.wav"));
if (!_feathersFlag) {
CCarry *feathers = dynamic_cast<CCarry *>(getRoot()->findByName("Feathers"));
if (feathers) {
feathers->setVisible(true);
feathers->petAddToInventory();
}
_feathersFlag = true;
}
CPetControl *pet = getPetControl();
pet->removeFromInventory(this);
pet->setAreaChangeType(1);
moveUnder(getRoom());
} else {
CActMsg actMsg("Shut");
actMsg.execute("ParrotCage");
}
CParrot::_state = PARROT_ESCAPED;
stopAnimTimer(_timerId);
_timerId = 0;
}
return true;
}
} // End of namespace Titanic

View File

@@ -0,0 +1,65 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#ifndef TITANIC_CARRY_PARROT_H
#define TITANIC_CARRY_PARROT_H
#include "titanic/carry/carry.h"
#include "titanic/messages/messages.h"
#include "titanic/messages/mouse_messages.h"
#include "titanic/messages/pet_messages.h"
namespace Titanic {
class CCarryParrot : public CCarry {
DECLARE_MESSAGE_MAP;
bool PETGainedObjectMsg(CPETGainedObjectMsg *msg);
bool TimerMsg(CTimerMsg *msg);
bool IsParrotPresentMsg(CIsParrotPresentMsg *msg);
bool LeaveViewMsg(CLeaveViewMsg *msg);
bool MouseDragEndMsg(CMouseDragEndMsg *msg);
bool PassOnDragStartMsg(CPassOnDragStartMsg *msg);
bool PreEnterViewMsg(CPreEnterViewMsg *msg);
bool UseWithCharMsg(CUseWithCharMsg *msg);
bool ActMsg(CActMsg *msg);
private:
CString _parrotName;
int _timerId;
int _freeCounter;
bool _feathersFlag;
public:
CLASSDEF;
CCarryParrot();
/**
* 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_CARRY_PARROT_H */

View File

@@ -0,0 +1,94 @@
/* 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/carry/central_core.h"
#include "titanic/npcs/parrot.h"
namespace Titanic {
BEGIN_MESSAGE_MAP(CCentralCore, CBrain)
ON_MESSAGE(UseWithOtherMsg)
ON_MESSAGE(DropZoneLostObjectMsg)
ON_MESSAGE(DropZoneGotObjectMsg)
END_MESSAGE_MAP()
void CCentralCore::save(SimpleFile *file, int indent) {
file->writeNumberLine(1, indent);
CBrain::save(file, indent);
}
void CCentralCore::load(SimpleFile *file) {
file->readNumber();
CBrain::load(file);
}
bool CCentralCore::UseWithOtherMsg(CUseWithOtherMsg *msg) {
CString name = msg->_other->getName();
if (name == "HammerDispensorButton") {
CPuzzleSolvedMsg solvedMsg;
solvedMsg.execute("BigHammer");
} else if (name == "SpeechCentre") {
CShowTextMsg textMsg(DOES_NOT_REACH);
textMsg.execute("PET");
}
return CBrain::UseWithOtherMsg(msg);
}
bool CCentralCore::DropZoneLostObjectMsg(CDropZoneLostObjectMsg *msg) {
CString name = msg->_object->getName();
if (name == "PerchCoreHolder") {
CParrot::_takeOff = true;
if (isEquals("CentralCore"))
CParrot::_coreReplaced = false;
CActMsg actMsg("LosePerch");
actMsg.execute("ParrotLobbyController");
} else if (name == "PerchHolder") {
CActMsg actMsg("LoseStick");
actMsg.execute("ParrotLobbyController");
}
return true;
}
bool CCentralCore::DropZoneGotObjectMsg(CDropZoneGotObjectMsg *msg) {
CString name = msg->_object->getName();
if (name == "PerchCoreHolder") {
CParrot::_takeOff = false;
if (isEquals("CentralCore")) {
CParrot::_coreReplaced = true;
CActMsg actMsg("CoreReplaced");
actMsg.execute("ParrotCage");
}
CActMsg actMsg("GainPerch");
actMsg.execute("ParrotLobbyController");
} else if (name == "PerchHolder") {
CActMsg actMsg("GainStick");
actMsg.execute("ParrotLobbyController");
}
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_CENTRAL_CORE_H
#define TITANIC_CENTRAL_CORE_H
#include "titanic/carry/brain.h"
namespace Titanic {
class CCentralCore : public CBrain {
DECLARE_MESSAGE_MAP;
bool UseWithOtherMsg(CUseWithOtherMsg *msg);
bool DropZoneLostObjectMsg(CDropZoneLostObjectMsg *msg);
bool DropZoneGotObjectMsg(CDropZoneGotObjectMsg *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_CENTRAL_CORE_H */

View File

@@ -0,0 +1,227 @@
/* 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/carry/chicken.h"
#include "titanic/game/sauce_dispensor.h"
#include "titanic/npcs/succubus.h"
#include "titanic/pet_control/pet_control.h"
namespace Titanic {
BEGIN_MESSAGE_MAP(CChicken, CCarry)
ON_MESSAGE(UseWithOtherMsg)
ON_MESSAGE(UseWithCharMsg)
ON_MESSAGE(ActMsg)
ON_MESSAGE(VisibleMsg)
ON_MESSAGE(TimerMsg)
ON_MESSAGE(PETGainedObjectMsg)
ON_MESSAGE(ParrotTriesChickenMsg)
ON_MESSAGE(MouseDragEndMsg)
ON_MESSAGE(PETObjectStateMsg)
ON_MESSAGE(PETLostObjectMsg)
END_MESSAGE_MAP()
int CChicken::_temperature;
#define HOT_TEMPERATURE 120
CChicken::CChicken() : CCarry(), _condiment("None"),
_greasy(true), _inactive(false), _timerId(0) {
}
void CChicken::save(SimpleFile *file, int indent) {
file->writeNumberLine(1, indent);
file->writeNumberLine(_greasy, indent);
file->writeQuotedLine(_condiment, indent);
file->writeNumberLine(_temperature, indent);
file->writeNumberLine(_inactive, indent);
file->writeNumberLine(_timerId, indent);
CCarry::save(file, indent);
}
void CChicken::load(SimpleFile *file) {
file->readNumber();
_greasy = file->readNumber();
_condiment = file->readString();
_temperature = file->readNumber();
_inactive = file->readNumber();
_timerId = file->readNumber();
CCarry::load(file);
}
bool CChicken::UseWithOtherMsg(CUseWithOtherMsg *msg) {
if (msg->_other->getName() == "Napkin") {
if (_greasy || _condiment != "None") {
CActMsg actMsg("Clean");
actMsg.execute(this);
petAddToInventory();
} else {
CShowTextMsg textMsg(CHICKEN_ALREADY_CLEAN);
textMsg.execute("PET");
}
petAddToInventory();
} else {
CSauceDispensor *dispensor = dynamic_cast<CSauceDispensor *>(msg->_other);
if (dispensor && _condiment == "None") {
setVisible(false);
CUse use(this);
use.execute(msg->_other);
} else {
return CCarry::UseWithOtherMsg(msg);
}
}
return true;
}
bool CChicken::UseWithCharMsg(CUseWithCharMsg *msg) {
CSuccUBus *succubus = dynamic_cast<CSuccUBus *>(msg->_character);
if (succubus) {
setPosition(Point(330, 300));
CSubAcceptCCarryMsg acceptMsg;
acceptMsg._item = this;
acceptMsg.execute(succubus);
} else {
petAddToInventory();
}
return true;
}
bool CChicken::ActMsg(CActMsg *msg) {
if (msg->_action == "GoToPET") {
setVisible(true);
petAddToInventory();
} else if (msg->_action == "Tomato") {
_condiment = "Tomato";
loadFrame(4);
_visibleFrame = 4;
} else if (msg->_action == "Mustard") {
_condiment = "Mustard";
loadFrame(5);
_visibleFrame = 5;
} else if (msg->_action == "Bird") {
_condiment = "Bird";
loadFrame(2);
_visibleFrame = 2;
} else if (msg->_action == "None") {
setVisible(false);
} else if (msg->_action == "Clean") {
_condiment = "None";
loadFrame(3);
_greasy = false;
_visibleFrame = 3;
} else if (msg->_action == "Dispense Chicken") {
_condiment = "None";
_inactive = false;
_greasy = true;
loadFrame(1);
_visibleFrame = 1;
_temperature = HOT_TEMPERATURE;
} else if (msg->_action == "Hot") {
_temperature = HOT_TEMPERATURE;
} else if (msg->_action == "Eaten") {
setVisible(false);
petMoveToHiddenRoom();
_inactive = true;
}
return true;
}
bool CChicken::VisibleMsg(CVisibleMsg *msg) {
setVisible(msg->_visible);
if (msg->_visible)
loadFrame(_visibleFrame);
return true;
}
bool CChicken::TimerMsg(CTimerMsg *msg) {
// Check whether chicken has been mailed
CGameObject *obj = getMailManFirstObject();
while (obj && obj->getName() != "Chicken")
obj = getMailManNextObject(obj);
// If chicken is not mailed, and still hot, cool it down a bit
if (!obj && _temperature > 0)
--_temperature;
// If chicken is cooled, refresh the inventory, just in case
// the user had the hot chicken selected
if (!_temperature) {
petInvChange();
stopTimer(_timerId);
}
return true;
}
bool CChicken::PETGainedObjectMsg(CPETGainedObjectMsg *msg) {
stopTimer(_timerId);
_timerId = addTimer(1000, 1000);
return true;
}
bool CChicken::ParrotTriesChickenMsg(CParrotTriesChickenMsg *msg) {
if (_temperature > 0)
msg->_isHot = true;
if (_condiment == "Tomato") {
msg->_condiment = 1;
} else if (_condiment == "Mustard") {
msg->_condiment = 2;
} else if (_condiment == "Bird") {
msg->_condiment = 3;
}
return true;
}
bool CChicken::MouseDragEndMsg(CMouseDragEndMsg *msg) {
if (_inactive) {
showMouse();
return true;
} else {
return CCarry::MouseDragEndMsg(msg);
}
}
bool CChicken::PETObjectStateMsg(CPETObjectStateMsg *msg) {
if (_temperature > 0)
msg->_value = 2;
return true;
}
bool CChicken::PETLostObjectMsg(CPETLostObjectMsg *msg) {
if (compareViewNameTo("ParrotLobby.Node 1.N")) {
CActMsg actMsg("StartChickenDrag");
actMsg.execute("PerchedParrot");
}
return true;
}
} // End of namespace Titanic

View File

@@ -0,0 +1,67 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#ifndef TITANIC_CHICKEN_H
#define TITANIC_CHICKEN_H
#include "titanic/carry/carry.h"
#include "titanic/messages/messages.h"
#include "titanic/messages/pet_messages.h"
namespace Titanic {
class CChicken : public CCarry {
DECLARE_MESSAGE_MAP;
bool UseWithOtherMsg(CUseWithOtherMsg *msg);
bool UseWithCharMsg(CUseWithCharMsg *msg);
bool ActMsg(CActMsg *msg);
bool VisibleMsg(CVisibleMsg *msg);
bool TimerMsg(CTimerMsg *msg);
bool PETGainedObjectMsg(CPETGainedObjectMsg *msg);
bool ParrotTriesChickenMsg(CParrotTriesChickenMsg *msg);
bool MouseDragEndMsg(CMouseDragEndMsg *msg);
bool PETObjectStateMsg(CPETObjectStateMsg *msg);
bool PETLostObjectMsg(CPETLostObjectMsg *msg);
public:
static int _temperature;
public:
bool _greasy;
CString _condiment;
bool _inactive;
int _timerId;
public:
CLASSDEF;
CChicken();
/**
* Save the data for the class to file
*/
void save(SimpleFile *file, int indent) override;
/**
* Load the data for the class from file
*/
void load(SimpleFile *file) override;
};
} // End of namespace Titanic
#endif /* TITANIC_CHICKEN_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/carry/crushed_tv.h"
#include "titanic/npcs/character.h"
namespace Titanic {
BEGIN_MESSAGE_MAP(CCrushedTV, CCarry)
ON_MESSAGE(ActMsg)
ON_MESSAGE(UseWithCharMsg)
ON_MESSAGE(MouseDragStartMsg)
END_MESSAGE_MAP()
CCrushedTV::CCrushedTV() : CCarry() {
}
void CCrushedTV::save(SimpleFile *file, int indent) {
file->writeNumberLine(1, indent);
CCarry::save(file, indent);
}
void CCrushedTV::load(SimpleFile *file) {
file->readNumber();
CCarry::load(file);
}
bool CCrushedTV::ActMsg(CActMsg *msg) {
if (msg->_action == "SmashTV") {
setVisible(true);
_canTake = true;
}
return true;
}
bool CCrushedTV::UseWithCharMsg(CUseWithCharMsg *msg) {
if (msg->_character->getName() == "Barbot" && msg->_character->_visible) {
setVisible(false);
CActMsg actMsg("CrushedTV");
actMsg.execute(msg->_character);
return true;
} else {
return CCarry::UseWithCharMsg(msg);
}
}
bool CCrushedTV::MouseDragStartMsg(CMouseDragStartMsg *msg) {
if (!checkStartDragging(msg)) {
return false;
} else if (compareViewNameTo("BottomOfWell.Node 7.N")) {
changeView("BottomOfWell.Node 12.N", "");
CActMsg actMsg("TelevisionTaken");
actMsg.execute("BOWTelevisionMonitor");
}
return CCarry::MouseDragStartMsg(msg);
}
} // 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_CRUSHED_TV_H
#define TITANIC_CRUSHED_TV_H
#include "titanic/carry/carry.h"
#include "titanic/messages/messages.h"
#include "titanic/messages/mouse_messages.h"
namespace Titanic {
class CCrushedTV : public CCarry {
DECLARE_MESSAGE_MAP;
bool ActMsg(CActMsg *msg);
bool UseWithCharMsg(CUseWithCharMsg *msg);
bool MouseDragStartMsg(CMouseDragStartMsg *msg);
public:
CLASSDEF;
CCrushedTV();
/**
* 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_CRUSHED_TV_H */

View File

@@ -0,0 +1,68 @@
/* 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/carry/ear.h"
#include "titanic/game/head_slot.h"
namespace Titanic {
BEGIN_MESSAGE_MAP(CEar, CHeadPiece)
ON_MESSAGE(ActMsg)
ON_MESSAGE(UseWithOtherMsg)
END_MESSAGE_MAP()
CEar::CEar() : CHeadPiece() {
}
void CEar::save(SimpleFile *file, int indent) {
file->writeNumberLine(1, indent);
CHeadPiece::save(file, indent);
}
void CEar::load(SimpleFile *file) {
file->readNumber();
CHeadPiece::load(file);
}
bool CEar::ActMsg(CActMsg *msg) {
if (msg->_action == "MusicSolved")
_canTake = true;
return true;
}
bool CEar::UseWithOtherMsg(CUseWithOtherMsg *msg) {
CHeadSlot *slot = dynamic_cast<CHeadSlot *>(msg->_other);
if (slot) {
setVisible(false);
petMoveToHiddenRoom();
setPosition(Point(0, 0));
CAddHeadPieceMsg addMsg(getName());
if (addMsg._value != "NULL")
addMsg.execute(addMsg._value == "Ear1" ? "Ear1Slot" : "Ear2Slot");
return true;
} else {
return CCarry::UseWithOtherMsg(msg);
}
}
} // 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_EAR_H
#define TITANIC_EAR_H
#include "titanic/carry/head_piece.h"
namespace Titanic {
class CEar : public CHeadPiece {
DECLARE_MESSAGE_MAP;
bool ActMsg(CActMsg *msg);
bool UseWithOtherMsg(CUseWithOtherMsg *msg);
public:
CLASSDEF;
CEar();
/**
* Save the data for the class to file
*/
void save(SimpleFile *file, int indent) override;
/**
* Load the data for the class from file
*/
void load(SimpleFile *file) override;
};
} // End of namespace Titanic
#endif /* TITANIC_EAR_H */

View File

@@ -0,0 +1,142 @@
/* 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/carry/eye.h"
#include "titanic/game/head_slot.h"
#include "titanic/game/light.h"
#include "titanic/game/television.h"
#include "titanic/game/transport/lift.h"
#include "titanic/pet_control/pet_control.h"
#include "titanic/translation.h"
namespace Titanic {
BEGIN_MESSAGE_MAP(CEye, CHeadPiece)
ON_MESSAGE(UseWithOtherMsg)
ON_MESSAGE(UseWithCharMsg)
ON_MESSAGE(ActMsg)
ON_MESSAGE(PETGainedObjectMsg)
ON_MESSAGE(PassOnDragStartMsg)
END_MESSAGE_MAP()
CEye::CEye() : CHeadPiece(), _eyeFlag(false) {
}
void CEye::save(SimpleFile *file, int indent) {
file->writeNumberLine(1, indent);
file->writeNumberLine(_eyeFlag, indent);
CHeadPiece::save(file, indent);
}
void CEye::load(SimpleFile *file) {
file->readNumber();
_eyeFlag = file->readNumber();
CHeadPiece::load(file);
}
bool CEye::UseWithOtherMsg(CUseWithOtherMsg *msg) {
CHeadSlot *slot = dynamic_cast<CHeadSlot *>(msg->_other);
if (slot) {
petMoveToHiddenRoom();
_flag = true;
CAddHeadPieceMsg headMsg(getName());
if (headMsg._value != "NULL")
headMsg.execute(isEquals("Eye1") ? "Eye1Slot" : "Eye2Slot");
} else if (msg->_other->isEquals("LiftbotWithoutHead")) {
CPetControl *pet = getPetControl();
if (!CLift::_hasHead && pet->getRoomsElevatorNum() == 4) {
_eyeFlag = true;
setPosition(_origPos);
setVisible(false);
CActMsg actMsg1(getName());
actMsg1.execute("GetLiftEye");
CTelevision::_eyeFlag = true;
CActMsg actMsg2("AddWrongHead");
actMsg2.execute("FaultyLiftbot");
}
} else {
return CCarry::UseWithOtherMsg(msg);
}
return true;
}
bool CEye::UseWithCharMsg(CUseWithCharMsg *msg) {
CLift *lift = dynamic_cast<CLift *>(msg->_character);
if (lift && lift->getName() == "Well") {
CPetControl *pet = getPetControl();
if (!CLift::_hasHead && pet->getRoomsElevatorNum() == 4) {
_eyeFlag = true;
setPosition(_origPos);
setVisible(false);
CActMsg actMsg1(getName());
actMsg1.execute("GetLiftEye");
CActMsg actMsg2("AddWrongHead");
actMsg2.execute(msg->_character);
}
return true;
} else {
return CHeadPiece::UseWithCharMsg(msg);
}
}
bool CEye::ActMsg(CActMsg *msg) {
if (msg->_action == "BellbotGetLight") {
setVisible(true);
petAddToInventory();
playSound(TRANSLATE("z#47.wav", "z#578.wav"));
CActMsg actMsg("Eye Removed");
actMsg.execute("1stClassState", CLight::_type,
MSGFLAG_CLASS_DEF | MSGFLAG_SCAN);
} else {
_eyeFlag = false;
CActMsg actMsg("LoseHead");
actMsg.execute("FaultyLiftbot");
}
return true;
}
bool CEye::PETGainedObjectMsg(CPETGainedObjectMsg *msg) {
if (isEquals("Eye1"))
CTelevision::_channel4Glyph = false;
return CHeadPiece::PETGainedObjectMsg(msg);
}
bool CEye::PassOnDragStartMsg(CPassOnDragStartMsg *msg) {
setVisible(true);
if (_eyeFlag)
CTelevision::_eyeFlag = false;
else if (isEquals("Eye1"))
CTelevision::_channel4Glyph = false;
return CHeadPiece::PassOnDragStartMsg(msg);
}
} // 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_EYE_H
#define TITANIC_EYE_H
#include "titanic/carry/head_piece.h"
namespace Titanic {
class CEye : public CHeadPiece {
DECLARE_MESSAGE_MAP;
bool UseWithOtherMsg(CUseWithOtherMsg *msg);
bool UseWithCharMsg(CUseWithCharMsg *msg);
bool ActMsg(CActMsg *msg);
bool PETGainedObjectMsg(CPETGainedObjectMsg *msg);
bool PassOnDragStartMsg(CPassOnDragStartMsg *msg);
private:
bool _eyeFlag;
public:
CLASSDEF;
CEye();
/**
* 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_EYE_H */

View File

@@ -0,0 +1,41 @@
/* 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/carry/feathers.h"
namespace Titanic {
EMPTY_MESSAGE_MAP(CFeathers, CCarry);
CFeathers::CFeathers() : CCarry() {
}
void CFeathers::save(SimpleFile *file, int indent) {
file->writeNumberLine(1, indent);
CCarry::save(file, indent);
}
void CFeathers::load(SimpleFile *file) {
file->readNumber();
CCarry::load(file);
}
} // End of namespace Titanic

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/>.
*
*/
#ifndef TITANIC_FEATHERS_H
#define TITANIC_FEATHERS_H
#include "titanic/carry/carry.h"
namespace Titanic {
class CFeathers : public CCarry {
DECLARE_MESSAGE_MAP;
public:
CLASSDEF;
CFeathers();
/**
* 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_FEATHERS_H */

View File

@@ -0,0 +1,97 @@
/* 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/carry/fruit.h"
#include "titanic/npcs/character.h"
namespace Titanic {
BEGIN_MESSAGE_MAP(CFruit, CCarry)
ON_MESSAGE(UseWithCharMsg)
ON_MESSAGE(LemonFallsFromTreeMsg)
ON_MESSAGE(UseWithOtherMsg)
ON_MESSAGE(FrameMsg)
END_MESSAGE_MAP()
CFruit::CFruit() : CCarry(), _field12C(0),
_field130(0), _field134(0), _field138(0) {
}
void CFruit::save(SimpleFile *file, int indent) {
file->writeNumberLine(1, indent);
file->writeNumberLine(_field12C, indent);
file->writeNumberLine(_field130, indent);
file->writeNumberLine(_field134, indent);
file->writeNumberLine(_field138, indent);
CCarry::save(file, indent);
}
void CFruit::load(SimpleFile *file) {
file->readNumber();
_field12C = file->readNumber();
_field130 = file->readNumber();
_field134 = file->readNumber();
_field138 = file->readNumber();
CCarry::load(file);
}
bool CFruit::UseWithCharMsg(CUseWithCharMsg *msg) {
if (msg->_character->isEquals("Barbot") && msg->_character->_visible) {
CActMsg actMsg("Fruit");
actMsg.execute(msg->_character);
_canTake = false;
setVisible(false);
return true;
} else {
return CCarry::UseWithCharMsg(msg);
}
}
bool CFruit::LemonFallsFromTreeMsg(CLemonFallsFromTreeMsg *msg) {
setVisible(true);
dragMove(msg->_pt);
_field130 = 1;
return true;
}
bool CFruit::UseWithOtherMsg(CUseWithOtherMsg *msg) {
petAddToInventory();
return true;
}
bool CFruit::FrameMsg(CFrameMsg *msg) {
if (_field130) {
if (_bounds.top > 240) {
_field130 = 0;
_field134 = 1;
}
makeDirty();
_bounds.top += 3;
makeDirty();
}
return true;
}
} // End of namespace Titanic

View File

@@ -0,0 +1,57 @@
/* 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_FRUIT_H
#define TITANIC_FRUIT_H
#include "titanic/carry/carry.h"
namespace Titanic {
class CFruit : public CCarry {
DECLARE_MESSAGE_MAP;
bool UseWithCharMsg(CUseWithCharMsg *msg);
bool LemonFallsFromTreeMsg(CLemonFallsFromTreeMsg *msg);
bool UseWithOtherMsg(CUseWithOtherMsg *msg);
bool FrameMsg(CFrameMsg *msg);
private:
int _field12C;
int _field130;
int _field134;
int _field138;
public:
CLASSDEF;
CFruit();
/**
* 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_FRUIT_H */

View File

@@ -0,0 +1,160 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#include "titanic/carry/glass.h"
#include "titanic/carry/chicken.h"
#include "titanic/game/sauce_dispensor.h"
#include "titanic/npcs/character.h"
namespace Titanic {
BEGIN_MESSAGE_MAP(CGlass, CCarry)
ON_MESSAGE(UseWithOtherMsg)
ON_MESSAGE(UseWithCharMsg)
ON_MESSAGE(ActMsg)
ON_MESSAGE(MouseDragEndMsg)
ON_MESSAGE(TurnOn)
ON_MESSAGE(TurnOff)
END_MESSAGE_MAP()
CGlass::CGlass() : CCarry(), _condiment("None") {
}
void CGlass::save(SimpleFile *file, int indent) {
file->writeNumberLine(1, indent);
file->writeQuotedLine(_condiment, indent);
CCarry::save(file, indent);
}
void CGlass::load(SimpleFile *file) {
file->readNumber();
_condiment = file->readString();
CCarry::load(file);
}
bool CGlass::UseWithOtherMsg(CUseWithOtherMsg *msg) {
CSauceDispensor *dispensor = dynamic_cast<CSauceDispensor *>(msg->_other);
CChicken *chicken = dynamic_cast<CChicken *>(msg->_other);
if (dispensor && _condiment == "None") {
CUse useMsg(this);
useMsg.execute(dispensor);
} else if (msg->_other->isEquals("Chicken") && _condiment == "None") {
if (chicken->_condiment != "None") {
if (!chicken->_greasy) {
CActMsg actMsg(_condiment);
actMsg.execute("Chicken");
}
_condiment = "None";
loadFrame(0);
_visibleFrame = 0;
}
petAddToInventory();
} else if (msg->_other->isEquals("Napkin") && _condiment == "None") {
petAddToInventory();
_condiment = "None";
loadFrame(0);
_visibleFrame = 0;
} else {
petAddToInventory();
}
return true;
}
bool CGlass::UseWithCharMsg(CUseWithCharMsg *msg) {
if (msg->_character->isEquals("Barbot") && msg->_character->_visible) {
CActMsg actMsg(_condiment);
setVisible(false);
if (_condiment != "Bird")
setPosition(_origPos);
actMsg.execute(msg->_character);
} else {
petAddToInventory();
}
return true;
}
bool CGlass::ActMsg(CActMsg *msg) {
if (msg->_action == "GoToPET") {
setVisible(true);
petAddToInventory();
} else if (msg->_action == "Mustard") {
_condiment = "Mustard";
loadFrame(1);
_visibleFrame = 1;
} else if (msg->_action == "Tomato") {
_condiment = "Tomato";
loadFrame(2);
_visibleFrame = 2;
} else if (msg->_action == "Bird") {
_condiment = "Bird";
loadFrame(3);
_visibleFrame = 3;
} else if (msg->_action == "InTitilator") {
_condiment = "None";
loadFrame(0);
_visibleFrame = 0;
}
return true;
}
bool CGlass::MouseDragEndMsg(CMouseDragEndMsg *msg) {
showMouse();
if (msg->_dropTarget) {
if (msg->_dropTarget->isPet()) {
petAddToInventory();
} else {
CCharacter *npc = dynamic_cast<CCharacter *>(msg->_dropTarget);
if (npc) {
CUseWithCharMsg useMsg(npc);
useMsg.execute(this);
} else {
CUseWithOtherMsg otherMsg(msg->_dropTarget);
otherMsg.execute(this);
}
}
} else if (compareViewNameTo(_fullViewName) && msg->_mousePos.y < 360) {
setPosition(_origPos);
} else {
petAddToInventory();
}
return true;
}
bool CGlass::TurnOn(CTurnOn *msg) {
setVisible(true);
return true;
}
bool CGlass::TurnOff(CTurnOff *msg) {
setVisible(false);
return true;
}
} // End of namespace Titanic

View File

@@ -0,0 +1,56 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#ifndef TITANIC_GLASS_H
#define TITANIC_GLASS_H
#include "titanic/carry/carry.h"
namespace Titanic {
class CGlass : public CCarry {
DECLARE_MESSAGE_MAP;
bool UseWithOtherMsg(CUseWithOtherMsg *msg);
bool UseWithCharMsg(CUseWithCharMsg *msg);
bool ActMsg(CActMsg *msg);
bool MouseDragEndMsg(CMouseDragEndMsg *msg);
bool TurnOn(CTurnOn *msg);
bool TurnOff(CTurnOff *msg);
public:
CString _condiment;
public:
CLASSDEF;
CGlass();
/**
* 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_GLASS_H */

View File

@@ -0,0 +1,62 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#include "titanic/carry/hammer.h"
namespace Titanic {
BEGIN_MESSAGE_MAP(CHammer, CCarry)
ON_MESSAGE(PuzzleSolvedMsg)
ON_MESSAGE(UseWithOtherMsg)
END_MESSAGE_MAP()
CHammer::CHammer() : CCarry() {
}
void CHammer::save(SimpleFile *file, int indent) {
file->writeNumberLine(1, indent);
CCarry::save(file, indent);
}
void CHammer::load(SimpleFile *file) {
file->readNumber();
CCarry::load(file);
}
bool CHammer::PuzzleSolvedMsg(CPuzzleSolvedMsg *msg) {
_canTake = true;
return true;
}
bool CHammer::UseWithOtherMsg(CUseWithOtherMsg *msg) {
CString name = msg->_other->getName();
if (name == "LongStickDispenser") {
CPuzzleSolvedMsg solvedMsg;
solvedMsg.execute("LongStickDispenser");
} else if (name == "Bomb") {
CActMsg actMsg("Hit");
actMsg.execute("Bomb");
}
return CCarry::UseWithOtherMsg(msg);
}
} // 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_HAMMER_H
#define TITANIC_HAMMER_H
#include "titanic/carry/carry.h"
namespace Titanic {
class CHammer : public CCarry {
DECLARE_MESSAGE_MAP;
bool PuzzleSolvedMsg(CPuzzleSolvedMsg *msg);
bool UseWithOtherMsg(CUseWithOtherMsg *msg);
public:
CLASSDEF;
CHammer();
/**
* 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_HAMMER_H */

View File

@@ -0,0 +1,97 @@
/* 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/carry/head_piece.h"
namespace Titanic {
BEGIN_MESSAGE_MAP(CHeadPiece, CCarry)
ON_MESSAGE(SenseWorkingMsg)
ON_MESSAGE(PETGainedObjectMsg)
ON_MESSAGE(MouseDragStartMsg)
END_MESSAGE_MAP()
CHeadPiece::CHeadPiece() : CCarry(), _string6("Not Working"),
_flag(false), _field13C(false) {
}
void CHeadPiece::save(SimpleFile *file, int indent) {
file->writeNumberLine(1, indent);
file->writeNumberLine(_flag, indent);
file->writeQuotedLine(_string6, indent);
file->writeNumberLine(_field13C, indent);
CCarry::save(file, indent);
}
void CHeadPiece::load(SimpleFile *file) {
file->readNumber();
_flag = file->readNumber();
_string6 = file->readString();
_field13C = file->readNumber();
CCarry::load(file);
}
bool CHeadPiece::SenseWorkingMsg(CSenseWorkingMsg *msg) {
_string6 = msg->_value;
return true;
}
bool CHeadPiece::PETGainedObjectMsg(CPETGainedObjectMsg *msg) {
_visibleFrame = 1;
if (!_field13C) {
incParrotResponse();
_field13C = true;
}
// WORKAROUND: This fixes a bug in the original where if head pieces
// were removed from Titania after adding, she would still reactivate
CTakeHeadPieceMsg takeMsg(getName());
takeMsg.execute("TitaniaControl");
return true;
}
bool CHeadPiece::MouseDragStartMsg(CMouseDragStartMsg *msg) {
if (!checkPoint(msg->_mousePos, false, true)) {
return false;
} else if (!_canTake) {
return true;
}
if (_flag) {
setVisible(true);
moveToView();
setPosition(Point(msg->_mousePos.x - _bounds.width() / 2,
msg->_mousePos.y - _bounds.height() / 2));
CTakeHeadPieceMsg takeMsg(getName());
if (takeMsg._value != "NULL")
takeMsg.execute("TitaniaControl");
_flag = false;
}
return CCarry::MouseDragStartMsg(msg);
}
} // 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_HEAD_PIECE_H
#define TITANIC_HEAD_PIECE_H
#include "titanic/carry/carry.h"
#include "titanic/messages/pet_messages.h"
namespace Titanic {
class CHeadPiece : public CCarry {
DECLARE_MESSAGE_MAP;
bool SenseWorkingMsg(CSenseWorkingMsg *msg);
bool PETGainedObjectMsg(CPETGainedObjectMsg *msg);
bool MouseDragStartMsg(CMouseDragStartMsg *msg);
protected:
bool _flag;
CString _string6;
bool _field13C;
public:
CLASSDEF;
CHeadPiece();
/**
* 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_HEAD_PIECE_H */

View File

@@ -0,0 +1,119 @@
/* 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/carry/hose.h"
#include "titanic/npcs/succubus.h"
#include "titanic/titanic.h"
namespace Titanic {
BEGIN_MESSAGE_MAP(CHose, CCarry)
ON_MESSAGE(DropZoneGotObjectMsg)
ON_MESSAGE(PumpingMsg)
ON_MESSAGE(UseWithCharMsg)
ON_MESSAGE(HoseConnectedMsg)
ON_MESSAGE(DropZoneLostObjectMsg)
END_MESSAGE_MAP()
CHoseStatics *CHose::_statics;
void CHose::init() {
_statics = new CHoseStatics();
}
void CHose::deinit() {
delete _statics;
}
CHose::CHose() : CCarry() {
}
void CHose::save(SimpleFile *file, int indent) {
file->writeNumberLine(1, indent);
file->writeNumberLine(_statics->_actionVal, indent);
file->writeQuotedLine(_statics->_actionTarget, indent);
file->writeQuotedLine(_unused1, indent);
CCarry::save(file, indent);
}
void CHose::load(SimpleFile *file) {
file->readNumber();
_statics->_actionVal = file->readNumber();
_statics->_actionTarget = file->readString();
_unused1 = file->readString();
CCarry::load(file);
}
bool CHose::DropZoneGotObjectMsg(CDropZoneGotObjectMsg *msg) {
_statics->_actionTarget = msg->_object->getName();
CPumpingMsg pumpingMsg;
pumpingMsg._value = _statics->_actionVal;
pumpingMsg.execute(_statics->_actionTarget);
CHoseConnectedMsg connectedMsg;
connectedMsg._connected = true;
connectedMsg.execute(this);
return true;
}
bool CHose::PumpingMsg(CPumpingMsg *msg) {
_statics->_actionVal = msg->_value;
if (!_statics->_actionTarget.empty()) {
CPumpingMsg pumpingMsg;
pumpingMsg._value = _statics->_actionVal;
pumpingMsg.execute(_statics->_actionTarget);
}
return true;
}
bool CHose::UseWithCharMsg(CUseWithCharMsg *msg) {
CSuccUBus *succubus = dynamic_cast<CSuccUBus *>(msg->_character);
if (!_statics->_actionVal && succubus) {
CHoseConnectedMsg connectedMsg(1, this);
if (connectedMsg.execute(succubus))
return true;
}
return CCarry::UseWithCharMsg(msg);
}
bool CHose::HoseConnectedMsg(CHoseConnectedMsg *msg) {
if (msg->_connected) {
CHose *hose = dynamic_cast<CHose *>(findChildInstanceOf(CHose::_type));
if (hose) {
hose->setVisible(true);
hose->petAddToInventory();
}
}
return true;
}
bool CHose::DropZoneLostObjectMsg(CDropZoneLostObjectMsg *msg) {
CPumpingMsg pumpingMsg;
pumpingMsg._value = 0;
pumpingMsg.execute(msg->_object);
return true;
}
} // End of namespace Titanic

View File

@@ -0,0 +1,65 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#ifndef TITANIC_HOSE_H
#define TITANIC_HOSE_H
#include "titanic/carry/carry.h"
namespace Titanic {
struct CHoseStatics {
int _actionVal;
CString _actionTarget;
CHoseStatics() : _actionVal(0) {}
};
class CHose : public CCarry {
DECLARE_MESSAGE_MAP;
bool DropZoneGotObjectMsg(CDropZoneGotObjectMsg *msg);
bool PumpingMsg(CPumpingMsg *msg);
bool UseWithCharMsg(CUseWithCharMsg *msg);
bool HoseConnectedMsg(CHoseConnectedMsg *msg);
bool DropZoneLostObjectMsg(CDropZoneLostObjectMsg *msg);
protected:
CString _unused1;
public:
static CHoseStatics *_statics;
public:
CLASSDEF;
CHose();
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_HOSE_H */

View File

@@ -0,0 +1,43 @@
/* 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/carry/hose_end.h"
namespace Titanic {
EMPTY_MESSAGE_MAP(CHoseEnd, CHose);
CHoseEnd::CHoseEnd() : CHose() {
}
void CHoseEnd::save(SimpleFile *file, int indent) {
file->writeNumberLine(1, indent);
file->writeQuotedLine(_unused1, indent);
CHose::save(file, indent);
}
void CHoseEnd::load(SimpleFile *file) {
file->readNumber();
_unused1 = file->readString();
CHose::load(file);
}
} // End of namespace Titanic

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/>.
*
*/
#ifndef TITANIC_HOSE_END_H
#define TITANIC_HOSE_END_H
#include "titanic/carry/hose.h"
namespace Titanic {
class CHoseEnd : public CHose {
DECLARE_MESSAGE_MAP;
public:
CLASSDEF;
CHoseEnd();
/**
* 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_HOSE_END_H */

View File

@@ -0,0 +1,59 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#include "titanic/carry/key.h"
namespace Titanic {
BEGIN_MESSAGE_MAP(CKey, CCarry)
ON_MESSAGE(PuzzleSolvedMsg)
ON_MESSAGE(UseWithOtherMsg)
END_MESSAGE_MAP()
CKey::CKey() : CCarry() {
}
void CKey::save(SimpleFile *file, int indent) {
file->writeNumberLine(1, indent);
CCarry::save(file, indent);
}
void CKey::load(SimpleFile *file) {
file->readNumber();
CCarry::load(file);
}
bool CKey::PuzzleSolvedMsg(CPuzzleSolvedMsg *msg) {
_canTake = true;
setVisible(true);
return true;
}
bool CKey::UseWithOtherMsg(CUseWithOtherMsg *msg) {
if (msg->_other->getName() == "1stClassPhono") {
CActMsg actMsg("Unlock");
actMsg.execute(msg->_other);
}
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_KEY_H
#define TITANIC_KEY_H
#include "titanic/carry/carry.h"
namespace Titanic {
class CKey : public CCarry {
DECLARE_MESSAGE_MAP;
bool PuzzleSolvedMsg(CPuzzleSolvedMsg *msg);
bool UseWithOtherMsg(CUseWithOtherMsg *msg);
public:
CLASSDEF;
CKey();
/**
* 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_KEY_H */

View File

@@ -0,0 +1,104 @@
/* 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/carry/liftbot_head.h"
#include "titanic/game/transport/lift.h"
#include "titanic/pet_control/pet_control.h"
namespace Titanic {
BEGIN_MESSAGE_MAP(CLiftbotHead, CCarry)
ON_MESSAGE(UseWithOtherMsg)
ON_MESSAGE(UseWithCharMsg)
ON_MESSAGE(MouseDragStartMsg)
END_MESSAGE_MAP()
CLiftbotHead::CLiftbotHead() : CCarry(), _flag(false) {
}
void CLiftbotHead::save(SimpleFile *file, int indent) {
file->writeNumberLine(1, indent);
file->writeNumberLine(_flag, indent);
CCarry::save(file, indent);
}
void CLiftbotHead::load(SimpleFile *file) {
file->readNumber();
_flag = file->readNumber();
CCarry::load(file);
}
bool CLiftbotHead::UseWithOtherMsg(CUseWithOtherMsg *msg) {
if (msg->_other->getName() == "LiftbotWithoutHead") {
CPetControl *pet = getPetControl();
if (!CLift::_hasHead && pet->getRoomsElevatorNum() == 4) {
_flag = true;
CActMsg actMsg("AddRightHead");
actMsg.execute("FaultyLiftbot");
setVisible(false);
} else {
petAddToInventory();
}
return true;
} else {
return CCarry::UseWithOtherMsg(msg);
}
}
bool CLiftbotHead::UseWithCharMsg(CUseWithCharMsg *msg) {
CLift *lift = dynamic_cast<CLift *>(msg->_character);
if (lift) {
CPetControl *pet = getPetControl();
if (lift->isEquals("Well") && !CLift::_hasHead && pet->getRoomsElevatorNum() == 4) {
_flag = true;
CActMsg actMsg("AddRightHead");
actMsg.execute(lift);
setVisible(false);
return true;
}
}
return CCarry::UseWithCharMsg(msg);
}
bool CLiftbotHead::MouseDragStartMsg(CMouseDragStartMsg *msg) {
if (!checkStartDragging(msg)) {
return false;
} else if (compareViewNameTo("BottomOfWell.Node 8.N")) {
changeView("BottomOfWell.Node 13.N");
moveToView();
CActMsg actMsg("LiftbotHeadTaken");
actMsg.execute("BOWLiftbotHeadMonitor");
return CCarry::MouseDragStartMsg(msg);
} else if (_flag) {
_flag = false;
CActMsg actMsg("LoseHead");
actMsg.execute("FaultyLiftbot");
}
return CCarry::MouseDragStartMsg(msg);
}
} // 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_LIFTBOT_HEAD_H
#define TITANIC_LIFTBOT_HEAD_H
#include "titanic/carry/carry.h"
namespace Titanic {
class CLiftbotHead : public CCarry {
DECLARE_MESSAGE_MAP;
bool UseWithOtherMsg(CUseWithOtherMsg *msg);
bool UseWithCharMsg(CUseWithCharMsg *msg);
bool MouseDragStartMsg(CMouseDragStartMsg *msg);
private:
bool _flag;
public:
CLASSDEF;
CLiftbotHead();
/**
* 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_LIFTBOT_HEAD_H */

View File

@@ -0,0 +1,72 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#include "titanic/carry/long_stick.h"
namespace Titanic {
BEGIN_MESSAGE_MAP(CLongStick, CCarry)
ON_MESSAGE(UseWithOtherMsg)
ON_MESSAGE(PuzzleSolvedMsg)
ON_MESSAGE(LeaveViewMsg)
END_MESSAGE_MAP()
CLongStick::CLongStick() : CCarry() {
}
void CLongStick::save(SimpleFile *file, int indent) {
file->writeNumberLine(1, indent);
CCarry::save(file, indent);
}
void CLongStick::load(SimpleFile *file) {
file->readNumber();
CCarry::load(file);
}
bool CLongStick::UseWithOtherMsg(CUseWithOtherMsg *msg) {
if (msg->_other->isEquals("SpeechCentre")) {
CPuzzleSolvedMsg puzzleMsg;
puzzleMsg.execute(msg->_other);
} else if (msg->_other->isEquals("LongStickDispenser")) {
petDisplayMessage(1, ALREADY_HAVE_STICK);
} else if (msg->_other->isEquals("Bomb")) {
CActMsg actMsg("Hit");
actMsg.execute("Bomb");
} else {
return CCarry::UseWithOtherMsg(msg);
}
petAddToInventory();
return true;
}
bool CLongStick::PuzzleSolvedMsg(CPuzzleSolvedMsg *msg) {
_canTake = true;
return true;
}
bool CLongStick::LeaveViewMsg(CLeaveViewMsg *msg) {
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_LONG_STICK_H
#define TITANIC_LONG_STICK_H
#include "titanic/carry/carry.h"
namespace Titanic {
class CLongStick : public CCarry {
DECLARE_MESSAGE_MAP;
bool UseWithOtherMsg(CUseWithOtherMsg *msg);
bool PuzzleSolvedMsg(CPuzzleSolvedMsg *msg);
bool LeaveViewMsg(CLeaveViewMsg *msg);
public:
CLASSDEF;
CLongStick();
/**
* 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_LONG_STICK_H */

View File

@@ -0,0 +1,94 @@
/* 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/carry/magazine.h"
#include "titanic/npcs/deskbot.h"
namespace Titanic {
BEGIN_MESSAGE_MAP(CMagazine, CCarry)
ON_MESSAGE(UseWithCharMsg)
ON_MESSAGE(MouseDoubleClickMsg)
ON_MESSAGE(VisibleMsg)
ON_MESSAGE(UseWithOtherMsg)
END_MESSAGE_MAP()
CMagazine::CMagazine() : CCarry() {
}
void CMagazine::save(SimpleFile *file, int indent) {
file->writeNumberLine(1, indent);
file->writeNumberLine(_field12C, indent);
file->writeNumberLine(_field130, indent);
CCarry::save(file, indent);
}
void CMagazine::load(SimpleFile *file) {
file->readNumber();
_field12C = file->readNumber();
_field130 = file->readNumber();
CCarry::load(file);
}
bool CMagazine::UseWithCharMsg(CUseWithCharMsg *msg) {
// WORKAROUND: Slight difference to original to ensure that when the
// magazine is used on an incorrect char, it's returned to inventory
CDeskbot *deskbot = dynamic_cast<CDeskbot *>(msg->_character);
if (deskbot && deskbot->_deskbotActive) {
setVisible(false);
setPosition(Point(1000, 1000));
CActMsg actMsg("2ndClassUpgrade");
actMsg.execute("Deskbot");
return true;
}
return CCarry::UseWithCharMsg(msg);
}
bool CMagazine::MouseDoubleClickMsg(CMouseDoubleClickMsg *msg) {
return true;
}
bool CMagazine::VisibleMsg(CVisibleMsg *msg) {
setVisible(msg->_visible);
return true;
}
bool CMagazine::UseWithOtherMsg(CUseWithOtherMsg *msg) {
// WORKAROUND: Slight difference to original to ensure that when the
// magazine is used on an incorrect object, it's returned to inventory
if (msg->_other->getName() == "SwitchOnDeskbot") {
CDeskbot *deskbot = dynamic_cast<CDeskbot *>(msg->_other);
if (deskbot && deskbot->_deskbotActive) {
setVisible(false);
setPosition(Point(1000, 1000));
CActMsg actMsg("2ndClassUpgrade");
actMsg.execute("Deskbot");
return true;
}
}
return CCarry::UseWithOtherMsg(msg);
}
} // End of namespace Titanic

View File

@@ -0,0 +1,57 @@
/* 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_MAGAZINE_H
#define TITANIC_MAGAZINE_H
#include "titanic/carry/carry.h"
#include "titanic/messages/messages.h"
#include "titanic/messages/mouse_messages.h"
namespace Titanic {
class CMagazine : public CCarry {
DECLARE_MESSAGE_MAP;
bool UseWithCharMsg(CUseWithCharMsg *msg);
bool MouseDoubleClickMsg(CMouseDoubleClickMsg *msg);
bool VisibleMsg(CVisibleMsg *msg);
bool UseWithOtherMsg(CUseWithOtherMsg *msg);
private:
int _field12C;
int _field130;
public:
CLASSDEF;
CMagazine();
/**
* 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_MAGAZINE_H */

View File

@@ -0,0 +1,67 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#include "titanic/carry/maitred_left_arm.h"
#include "titanic/npcs/true_talk_npc.h"
namespace Titanic {
BEGIN_MESSAGE_MAP(CMaitreDLeftArm, CArm)
ON_MESSAGE(MouseButtonDownMsg)
ON_MESSAGE(MouseDragStartMsg)
END_MESSAGE_MAP()
void CMaitreDLeftArm::save(SimpleFile *file, int indent) {
file->writeNumberLine(1, indent);
file->writeNumberLine(_flag, indent);
CArm::save(file, indent);
}
void CMaitreDLeftArm::load(SimpleFile *file) {
file->readNumber();
_flag = file->readNumber();
CArm::load(file);
}
bool CMaitreDLeftArm::MouseButtonDownMsg(CMouseButtonDownMsg *msg) {
if (!_flag) {
CTrueTalkNPC *maitreD = dynamic_cast<CTrueTalkNPC *>(findRoomObject("MaitreD"));
startTalking(maitreD, 126);
startTalking(maitreD, 127);
}
return true;
}
bool CMaitreDLeftArm::MouseDragStartMsg(CMouseDragStartMsg *msg) {
if (checkPoint(msg->_mousePos) && !_flag) {
CVisibleMsg visibleMsg;
visibleMsg.execute("MD left arm background image");
_flag = true;
CArmPickedUpFromTableMsg takenMsg;
takenMsg.execute("Restaurant Table Pan Handler", nullptr, MSGFLAG_SCAN);
}
return CArm::MouseDragStartMsg(msg);
}
} // End of namespace Titanic

View File

@@ -0,0 +1,52 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#ifndef TITANIC_LEFT_ARM_H
#define TITANIC_LEFT_ARM_H
#include "titanic/carry/arm.h"
namespace Titanic {
class CMaitreDLeftArm : public CArm {
DECLARE_MESSAGE_MAP;
bool MouseButtonDownMsg(CMouseButtonDownMsg *msg);
bool MouseDragStartMsg(CMouseDragStartMsg *msg);
private:
bool _flag;
public:
CLASSDEF;
CMaitreDLeftArm() : CArm(), _flag(false) {}
/**
* Save the data for the class to file
*/
void save(SimpleFile *file, int indent) override;
/**
* Load the data for the class from file
*/
void load(SimpleFile *file) override;
};
} // End of namespace Titanic
#endif /* TITANIC_LEFT_ARM_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/carry/maitred_right_arm.h"
namespace Titanic {
BEGIN_MESSAGE_MAP(CMaitreDRightArm, CArm)
ON_MESSAGE(DropZoneLostObjectMsg)
END_MESSAGE_MAP()
void CMaitreDRightArm::save(SimpleFile *file, int indent) {
file->writeNumberLine(1, indent);
CArm::save(file, indent);
}
void CMaitreDRightArm::load(SimpleFile *file) {
file->readNumber();
CArm::load(file);
}
bool CMaitreDRightArm::DropZoneLostObjectMsg(CDropZoneLostObjectMsg *msg) {
CActMsg actMsg("LoseArm");
actMsg.execute("MaitreDBody");
actMsg.execute("MaitreD Arm Holder");
_canTake = true;
return true;
}
} // End of namespace Titanic

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/>.
*
*/
#ifndef TITANIC_MAITRED_RIGHT_ARM_H
#define TITANIC_MAITRED_RIGHT_ARM_H
#include "titanic/carry/arm.h"
namespace Titanic {
class CMaitreDRightArm : public CArm {
DECLARE_MESSAGE_MAP;
bool DropZoneLostObjectMsg(CDropZoneLostObjectMsg *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_MAITRED_RIGHT_ARM_H */

View File

@@ -0,0 +1,84 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#include "titanic/carry/mouth.h"
#include "titanic/game/head_slot.h"
namespace Titanic {
BEGIN_MESSAGE_MAP(CMouth, CHeadPiece)
ON_MESSAGE(UseWithOtherMsg)
ON_MESSAGE(MovieEndMsg)
ON_MESSAGE(PETGainedObjectMsg)
END_MESSAGE_MAP()
CMouth::CMouth() : CHeadPiece() {
}
void CMouth::save(SimpleFile *file, int indent) {
file->writeNumberLine(1, indent);
CHeadPiece::save(file, indent);
}
void CMouth::load(SimpleFile *file) {
file->readNumber();
CHeadPiece::load(file);
}
bool CMouth::UseWithOtherMsg(CUseWithOtherMsg *msg) {
CHeadSlot *slot = dynamic_cast<CHeadSlot *>(msg->_other);
if (!slot)
return CHeadPiece::UseWithOtherMsg(msg);
_flag = true;
setVisible(false);
setPosition(Point(0, 0));
petMoveToHiddenRoom();
CAddHeadPieceMsg addMsg(getName());
if (addMsg._value != "NULL")
addMsg.execute("MouthSlot");
return true;
}
bool CMouth::MovieEndMsg(CMovieEndMsg *msg) {
return true;
}
bool CMouth::PETGainedObjectMsg(CPETGainedObjectMsg *msg) {
_visibleFrame = 2;
loadFrame(2);
setVisible(true);
if (!_field13C) {
incParrotResponse();
_field13C = true;
}
// WORKAROUND: If Mouth is removed from Titania after inserting,
// message the Titania control so it can be flagged as removed
CTakeHeadPieceMsg headpieceMsg(getName());
headpieceMsg.execute("TitaniaControl");
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_MOUTH_H
#define TITANIC_MOUTH_H
#include "titanic/carry/head_piece.h"
namespace Titanic {
class CMouth : public CHeadPiece {
DECLARE_MESSAGE_MAP;
bool UseWithOtherMsg(CUseWithOtherMsg *msg);
bool MovieEndMsg(CMovieEndMsg *msg);
bool PETGainedObjectMsg(CPETGainedObjectMsg *msg);
public:
CLASSDEF;
CMouth();
/**
* 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_MOUTH_H */

View File

@@ -0,0 +1,59 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#include "titanic/carry/napkin.h"
#include "titanic/carry/chicken.h"
namespace Titanic {
BEGIN_MESSAGE_MAP(CNapkin, CCarry)
ON_MESSAGE(UseWithOtherMsg)
END_MESSAGE_MAP()
CNapkin::CNapkin() : CCarry() {
}
void CNapkin::save(SimpleFile *file, int indent) {
file->writeNumberLine(1, indent);
CCarry::save(file, indent);
}
void CNapkin::load(SimpleFile *file) {
file->readNumber();
CCarry::load(file);
}
bool CNapkin::UseWithOtherMsg(CUseWithOtherMsg *msg) {
CChicken *chicken = dynamic_cast<CChicken *>(msg->_other);
if (chicken) {
if (chicken->_condiment != "None" || chicken->_greasy) {
CActMsg actMsg("Clean");
actMsg.execute("Chicken");
} else {
petDisplayMessage(CHICKEN_IS_CLEAN);
}
}
petAddToInventory();
return CCarry::UseWithOtherMsg(msg);
}
} // 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_NAPKIN_H
#define TITANIC_NAPKIN_H
#include "titanic/carry/carry.h"
#include "titanic/messages/messages.h"
namespace Titanic {
class CNapkin : public CCarry {
DECLARE_MESSAGE_MAP;
bool UseWithOtherMsg(CUseWithOtherMsg *msg);
public:
CLASSDEF;
CNapkin();
/**
* 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_NAPKIN_H */

View File

@@ -0,0 +1,64 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#include "titanic/carry/nose.h"
#include "titanic/game/head_slot.h"
namespace Titanic {
BEGIN_MESSAGE_MAP(CNose, CHeadPiece)
ON_MESSAGE(ChangeSeasonMsg)
ON_MESSAGE(UseWithOtherMsg)
END_MESSAGE_MAP()
CNose::CNose() : CHeadPiece() {
}
void CNose::save(SimpleFile *file, int indent) {
file->writeNumberLine(1, indent);
CHeadPiece::save(file, indent);
}
void CNose::load(SimpleFile *file) {
file->readNumber();
CHeadPiece::load(file);
}
bool CNose::ChangeSeasonMsg(CChangeSeasonMsg *msg) {
// WORKAROUND: Redundant code in original skipped
return true;
}
bool CNose::UseWithOtherMsg(CUseWithOtherMsg *msg) {
CHeadSlot *slot = dynamic_cast<CHeadSlot *>(msg->_other);
if (!slot)
return CCarry::UseWithOtherMsg(msg);
petMoveToHiddenRoom();
_flag = false;
CAddHeadPieceMsg addMsg(getName());
if (addMsg._value != "NULL")
addMsg.execute("NoseSlot");
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_NOSE_H
#define TITANIC_NOSE_H
#include "titanic/carry/head_piece.h"
namespace Titanic {
class CNose : public CHeadPiece {
DECLARE_MESSAGE_MAP;
bool ChangeSeasonMsg(CChangeSeasonMsg *msg);
bool UseWithOtherMsg(CUseWithOtherMsg *msg);
public:
CLASSDEF;
CNose();
/**
* 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_NOSE_H */

View File

@@ -0,0 +1,53 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#include "titanic/carry/note.h"
namespace Titanic {
BEGIN_MESSAGE_MAP(CNote, CCarry)
ON_MESSAGE(MouseDoubleClickMsg)
END_MESSAGE_MAP()
CNote::CNote() : CCarry(), _field138(1) {
}
void CNote::save(SimpleFile *file, int indent) {
file->writeNumberLine(1, indent);
file->writeQuotedLine(_string6, indent);
file->writeNumberLine(_field138, indent);
CCarry::save(file, indent);
}
void CNote::load(SimpleFile *file) {
file->readNumber();
_string6 = file->readString();
_field138 = file->readNumber();
CCarry::load(file);
}
bool CNote::MouseDoubleClickMsg(CMouseDoubleClickMsg *msg) {
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_NOTE_H
#define TITANIC_NOTE_H
#include "titanic/carry/carry.h"
#include "titanic/messages/messages.h"
namespace Titanic {
class CNote : public CCarry {
DECLARE_MESSAGE_MAP;
bool MouseDoubleClickMsg(CMouseDoubleClickMsg *msg);
private:
CString _string6;
int _field138;
public:
CLASSDEF;
CNote();
/**
* 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_NOTE_H */

View File

@@ -0,0 +1,41 @@
/* 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/carry/parcel.h"
namespace Titanic {
EMPTY_MESSAGE_MAP(CParcel, CCarry);
CParcel::CParcel() : CCarry() {
}
void CParcel::save(SimpleFile *file, int indent) {
file->writeNumberLine(1, indent);
CCarry::save(file, indent);
}
void CParcel::load(SimpleFile *file) {
file->readNumber();
CCarry::load(file);
}
} // End of namespace Titanic

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/>.
*
*/
#ifndef TITANIC_PARCEL_H
#define TITANIC_PARCEL_H
#include "titanic/carry/carry.h"
namespace Titanic {
class CParcel : public CCarry {
DECLARE_MESSAGE_MAP;
public:
CLASSDEF;
CParcel();
/**
* 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_PARCEL_H */

View File

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

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/>.
*
*/
#ifndef TITANIC_PERCH_H
#define TITANIC_PERCH_H
#include "titanic/carry/central_core.h"
namespace Titanic {
class CPerch : public CCentralCore {
DECLARE_MESSAGE_MAP;
bool UseWithOtherMsg(CUseWithOtherMsg *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_PERCH_H */

View File

@@ -0,0 +1,204 @@
/* 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/carry/phonograph_cylinder.h"
#include "titanic/game/phonograph.h"
#include "titanic/sound/music_room.h"
namespace Titanic {
BEGIN_MESSAGE_MAP(CPhonographCylinder, CCarry)
ON_MESSAGE(UseWithOtherMsg)
ON_MESSAGE(QueryCylinderMsg)
ON_MESSAGE(RecordOntoCylinderMsg)
ON_MESSAGE(SetMusicControlsMsg)
ON_MESSAGE(ErasePhonographCylinderMsg)
END_MESSAGE_MAP()
CPhonographCylinder::CPhonographCylinder() : CCarry(),
_bellsMuteControl(false), _bellsPitchControl(0),
_bellsSpeedControl(0), _bellsDirectionControl(false),
_bellsInversionControl(false), _snakeMuteControl(false),
_snakeSpeedControl(0), _snakePitchControl(0),
_snakeInversionControl(false), _snakeDirectionControl(false),
_pianoMuteControl(false), _pianoSpeedControl(0),
_pianoPitchControl(0), _pianoInversionControl(false),
_pianoDirectionControl(false), _bassMuteControl(false),
_bassSpeedControl(0), _bassPitchControl(0),
_bassInversionControl(false) {
}
void CPhonographCylinder::save(SimpleFile *file, int indent) {
file->writeNumberLine(1, indent);
file->writeQuotedLine(_itemName, indent);
file->writeNumberLine(_bellsMuteControl, indent);
file->writeNumberLine(_bellsPitchControl, indent);
file->writeNumberLine(_bellsSpeedControl, indent);
file->writeNumberLine(_bellsDirectionControl, indent);
file->writeNumberLine(_bellsInversionControl, indent);
file->writeNumberLine(_snakeMuteControl, indent);
file->writeNumberLine(_snakeSpeedControl, indent);
file->writeNumberLine(_snakePitchControl, indent);
file->writeNumberLine(_snakeInversionControl, indent);
file->writeNumberLine(_snakeDirectionControl, indent);
file->writeNumberLine(_pianoMuteControl, indent);
file->writeNumberLine(_pianoSpeedControl, indent);
file->writeNumberLine(_pianoPitchControl, indent);
file->writeNumberLine(_pianoInversionControl, indent);
file->writeNumberLine(_pianoDirectionControl, indent);
file->writeNumberLine(_bassMuteControl, indent);
file->writeNumberLine(_bassSpeedControl, indent);
file->writeNumberLine(_bassPitchControl, indent);
file->writeNumberLine(_bassInversionControl, indent);
file->writeNumberLine(_bassDirectionControl, indent);
CCarry::save(file, indent);
}
void CPhonographCylinder::load(SimpleFile *file) {
file->readNumber();
_itemName = file->readString();
_bellsMuteControl = file->readNumber();
_bellsPitchControl = file->readNumber();
_bellsSpeedControl = file->readNumber();
_bellsDirectionControl = file->readNumber();
_bellsInversionControl = file->readNumber();
_snakeMuteControl = file->readNumber();
_snakeSpeedControl = file->readNumber();
_snakePitchControl = file->readNumber();
_snakeInversionControl = file->readNumber();
_snakeDirectionControl = file->readNumber();
_pianoMuteControl = file->readNumber();
_pianoSpeedControl = file->readNumber();
_pianoPitchControl = file->readNumber();
_pianoInversionControl = file->readNumber();
_pianoDirectionControl = file->readNumber();
_bassMuteControl = file->readNumber();
_bassSpeedControl = file->readNumber();
_bassPitchControl = file->readNumber();
_bassInversionControl = file->readNumber();
_bassDirectionControl = file->readNumber();
CCarry::load(file);
}
bool CPhonographCylinder::UseWithOtherMsg(CUseWithOtherMsg *msg) {
CPhonograph *phonograph = dynamic_cast<CPhonograph *>(msg->_other);
if (phonograph) {
// Below is redundant, since original never actually executes message
CSetVarMsg varMsg("m_RecordStatus", 1);
return true;
} else {
return CCarry::UseWithOtherMsg(msg);
}
}
bool CPhonographCylinder::QueryCylinderMsg(CQueryCylinderMsg *msg) {
msg->_name = _itemName;
return true;
}
bool CPhonographCylinder::RecordOntoCylinderMsg(CRecordOntoCylinderMsg *msg) {
_itemName = "STMusic";
CQueryMusicControlSettingMsg queryMsg;
queryMsg.execute("Bells Mute Control");
_bellsMuteControl = queryMsg._value;
queryMsg.execute("Bells Pitch Control");
_bellsPitchControl = queryMsg._value;
queryMsg.execute("Bells Speed Control");
_bellsSpeedControl = queryMsg._value;
queryMsg.execute("Bells Direction Control");
_bellsDirectionControl = queryMsg._value;
queryMsg.execute("Bells Inversion Control");
_bellsInversionControl = queryMsg._value;
queryMsg.execute("Snake Mute Control");
_snakeMuteControl = queryMsg._value;
queryMsg.execute("Snake Speed Control");
_snakeSpeedControl = queryMsg._value;
queryMsg.execute("Snake Pitch Control");
_snakePitchControl = queryMsg._value;
queryMsg.execute("Snake Inversion Control");
_snakeInversionControl = queryMsg._value;
queryMsg.execute("Snake Direction Control");
_snakeDirectionControl = queryMsg._value;
queryMsg.execute("Piano Mute Control");
_pianoMuteControl = queryMsg._value;
queryMsg.execute("Piano Speed Control");
_pianoSpeedControl = queryMsg._value;
queryMsg.execute("Piano Pitch Control");
_pianoPitchControl = queryMsg._value;
queryMsg.execute("Piano Inversion Control");
_pianoInversionControl = queryMsg._value;
queryMsg.execute("Piano Direction Control");
_pianoDirectionControl = queryMsg._value;
queryMsg.execute("Bass Mute Control");
_bassMuteControl = queryMsg._value;
queryMsg.execute("Bass Speed Control");
_bassSpeedControl = queryMsg._value;
queryMsg.execute("Bass Pitch Control");
_bassPitchControl = queryMsg._value;
queryMsg.execute("Bass Inversion Control");
_bassInversionControl = queryMsg._value;
queryMsg.execute("Bass Direction Control");
_bassDirectionControl = queryMsg._value;
return true;
}
bool CPhonographCylinder::SetMusicControlsMsg(CSetMusicControlsMsg *msg) {
if (!_itemName.hasPrefix("STMusic"))
return true;
CMusicRoom *musicRoom = getMusicRoom();
musicRoom->setMuteControl(BELLS, _bellsMuteControl);
musicRoom->setPitchControl(BELLS, _bellsPitchControl);
musicRoom->setSpeedControl(BELLS, _bellsSpeedControl);
musicRoom->setInversionControl(BELLS, _bellsInversionControl);
musicRoom->setDirectionControl(BELLS, _bellsDirectionControl);
musicRoom->setMuteControl(SNAKE, _snakeMuteControl);
musicRoom->setPitchControl(SNAKE, _snakePitchControl);
musicRoom->setSpeedControl(SNAKE, _snakeSpeedControl);
musicRoom->setInversionControl(SNAKE, _snakeInversionControl);
musicRoom->setDirectionControl(SNAKE, _snakeDirectionControl);
musicRoom->setMuteControl(PIANO, _pianoMuteControl);
musicRoom->setPitchControl(PIANO, _pianoPitchControl);
musicRoom->setSpeedControl(PIANO, _pianoSpeedControl);
musicRoom->setInversionControl(PIANO, _pianoInversionControl);
musicRoom->setDirectionControl(PIANO, _pianoDirectionControl);
musicRoom->setMuteControl(BASS, _bassMuteControl);
musicRoom->setPitchControl(BASS, _bassPitchControl);
musicRoom->setSpeedControl(BASS, _bassSpeedControl);
musicRoom->setInversionControl(BASS, _bassInversionControl);
musicRoom->setDirectionControl(BASS, _bassDirectionControl);
return true;
}
bool CPhonographCylinder::ErasePhonographCylinderMsg(CErasePhonographCylinderMsg *msg) {
_itemName.clear();
return true;
}
} // End of namespace Titanic

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/>.
*
*/
#ifndef TITANIC_PHONOGRAPH_CYLINDER_H
#define TITANIC_PHONOGRAPH_CYLINDER_H
#include "titanic/carry/carry.h"
namespace Titanic {
class CPhonographCylinder : public CCarry {
DECLARE_MESSAGE_MAP;
bool UseWithOtherMsg(CUseWithOtherMsg *msg);
bool QueryCylinderMsg(CQueryCylinderMsg *msg);
bool RecordOntoCylinderMsg(CRecordOntoCylinderMsg *msg);
bool SetMusicControlsMsg(CSetMusicControlsMsg *msg);
bool ErasePhonographCylinderMsg(CErasePhonographCylinderMsg *msg);
private:
CString _itemName;
int _bellsPitchControl;
int _bellsSpeedControl;
bool _bellsMuteControl;
bool _bellsDirectionControl;
bool _bellsInversionControl;
int _snakeSpeedControl;
int _snakePitchControl;
bool _snakeMuteControl;
bool _snakeInversionControl;
bool _snakeDirectionControl;
int _pianoSpeedControl;
int _pianoPitchControl;
bool _pianoMuteControl;
bool _pianoInversionControl;
bool _pianoDirectionControl;
int _bassSpeedControl;
int _bassPitchControl;
bool _bassMuteControl;
bool _bassInversionControl;
bool _bassDirectionControl;
public:
CLASSDEF;
CPhonographCylinder();
/**
* 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_PHONOGRAPH_CYLINDER_H */

View File

@@ -0,0 +1,65 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#include "titanic/carry/phonograph_ear.h"
namespace Titanic {
BEGIN_MESSAGE_MAP(CPhonographEar, CEar)
ON_MESSAGE(CorrectMusicPlayedMsg)
ON_MESSAGE(PETGainedObjectMsg)
ON_MESSAGE(TimerMsg)
END_MESSAGE_MAP()
void CPhonographEar::save(SimpleFile *file, int indent) {
file->writeNumberLine(1, indent);
file->writeNumberLine(_replacementEar, indent);
CEar::save(file, indent);
}
void CPhonographEar::load(SimpleFile *file) {
file->readNumber();
_replacementEar = file->readNumber();
CEar::load(file);
}
bool CPhonographEar::CorrectMusicPlayedMsg(CCorrectMusicPlayedMsg *msg) {
_canTake = true;
return true;
}
bool CPhonographEar::PETGainedObjectMsg(CPETGainedObjectMsg *msg) {
if (_replacementEar) {
// Start a timer to add a replacement ear to the Phonograph
_replacementEar = false;
addTimer(1000);
}
return CEar::PETGainedObjectMsg(msg);
}
bool CPhonographEar::TimerMsg(CTimerMsg *msg) {
CVisibleMsg visibleMsg;
visibleMsg.execute("Replacement Phonograph Ear");
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_PHONOGRAPH_EAR_H
#define TITANIC_PHONOGRAPH_EAR_H
#include "titanic/carry/ear.h"
namespace Titanic {
class CPhonographEar : public CEar {
DECLARE_MESSAGE_MAP;
bool CorrectMusicPlayedMsg(CCorrectMusicPlayedMsg *msg);
bool PETGainedObjectMsg(CPETGainedObjectMsg *msg);
bool TimerMsg(CTimerMsg *msg);
private:
bool _replacementEar;
public:
CLASSDEF;
CPhonographEar() : CEar(), _replacementEar(true) {}
/**
* Save the data for the class to file
*/
void save(SimpleFile *file, int indent) override;
/**
* Load the data for the class from file
*/
void load(SimpleFile *file) override;
};
} // End of namespace Titanic
#endif /* TITANIC_PHONOGRAPH_EYE_H */

View File

@@ -0,0 +1,103 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#include "titanic/carry/photograph.h"
#include "titanic/core/dont_save_file_item.h"
#include "titanic/core/room_item.h"
#include "titanic/translation.h"
namespace Titanic {
BEGIN_MESSAGE_MAP(CPhotograph, CCarry)
ON_MESSAGE(MouseDragStartMsg)
ON_MESSAGE(MouseDragEndMsg)
ON_MESSAGE(PETGainedObjectMsg)
ON_MESSAGE(ActMsg)
END_MESSAGE_MAP()
int CPhotograph::_v1;
CPhotograph::CPhotograph() : CCarry(), _field12C(0), _field130(0) {
}
void CPhotograph::save(SimpleFile *file, int indent) {
file->writeNumberLine(1, indent);
file->writeNumberLine(_field12C, indent);
file->writeNumberLine(_v1, indent);
file->writeNumberLine(_field130, indent);
CCarry::save(file, indent);
}
void CPhotograph::load(SimpleFile *file) {
file->readNumber();
_field12C = file->readNumber();
_v1 = file->readNumber();
_field130 = file->readNumber();
CCarry::load(file);
}
bool CPhotograph::MouseDragEndMsg(CMouseDragEndMsg *msg) {
_v1 = 0;
CGameObject *target = msg->_dropTarget;
if (target && target->isEquals("NavigationComputer")) {
moveUnder(getDontSave());
makeDirty();
playSound(TRANSLATE("a#46.wav", "a#39.wav"));
starFn(STAR_SET_REFERENCE);
showMouse();
return true;
} else {
return CCarry::MouseDragEndMsg(msg);
}
}
bool CPhotograph::MouseDragStartMsg(CMouseDragStartMsg *msg) {
if (checkPoint(msg->_mousePos, true, true)) {
_v1 = true;
CActMsg actMsg("PlayerPicksUpPhoto");
actMsg.execute("Doorbot");
}
return CCarry::MouseDragStartMsg(msg);
}
bool CPhotograph::PETGainedObjectMsg(CPETGainedObjectMsg *msg) {
if (getRoom()->isEquals("Home")) {
CActMsg actMsg("PlayerPutsPhotoInPET");
actMsg.execute("Doorbot");
}
return true;
}
bool CPhotograph::ActMsg(CActMsg *msg) {
if (msg->_action == "BecomeGettable") {
_canTake = true;
_cursorId = CURSOR_HAND;
}
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_PHOTOGRAPH_H
#define TITANIC_PHOTOGRAPH_H
#include "titanic/carry/carry.h"
#include "titanic/messages/messages.h"
#include "titanic/messages/mouse_messages.h"
#include "titanic/messages/pet_messages.h"
namespace Titanic {
class CPhotograph : public CCarry {
DECLARE_MESSAGE_MAP;
bool MouseDragEndMsg(CMouseDragEndMsg *msg);
bool MouseDragStartMsg(CMouseDragStartMsg *msg);
bool PETGainedObjectMsg(CPETGainedObjectMsg *msg);
bool ActMsg(CActMsg *msg);
private:
static int _v1;
private:
int _field12C;
int _field130;
public:
CLASSDEF;
CPhotograph();
/**
* 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_PHOTOGRAPH_H */

View File

@@ -0,0 +1,59 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#include "titanic/carry/plug_in.h"
namespace Titanic {
BEGIN_MESSAGE_MAP(CPlugIn, CCarry)
ON_MESSAGE(UseWithOtherMsg)
END_MESSAGE_MAP()
CPlugIn::CPlugIn() : CCarry(), _unused(0) {
}
void CPlugIn::save(SimpleFile *file, int indent) {
file->writeNumberLine(1, indent);
file->writeNumberLine(_unused, indent);
CCarry::save(file, indent);
}
void CPlugIn::load(SimpleFile *file) {
file->readNumber();
_unused = file->readNumber();
CCarry::load(file);
}
bool CPlugIn::UseWithOtherMsg(CUseWithOtherMsg *msg) {
CGameObject *other = msg->_other;
CString otherName = other->getName();
if (otherName == "PET") {
return CCarry::UseWithOtherMsg(msg);
} else if (isEquals("DatasideTransporter")) {
CShowTextMsg textMsg(INCORRECTLY_CALIBRATED);
textMsg.execute("PET");
}
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_PLUG_IN_H
#define TITANIC_PLUG_IN_H
#include "titanic/carry/carry.h"
namespace Titanic {
class CPlugIn : public CCarry {
DECLARE_MESSAGE_MAP;
bool UseWithOtherMsg(CUseWithOtherMsg *msg);
private:
int _unused;
public:
CLASSDEF;
CPlugIn();
/**
* 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_PLUG_IN_H */

View File

@@ -0,0 +1,82 @@
/* 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/carry/speech_centre.h"
namespace Titanic {
BEGIN_MESSAGE_MAP(CSpeechCentre, CBrain)
ON_MESSAGE(PuzzleSolvedMsg)
ON_MESSAGE(ChangeSeasonMsg)
ON_MESSAGE(SpeechFallsFromTreeMsg)
ON_MESSAGE(FrameMsg)
END_MESSAGE_MAP()
void CSpeechCentre::save(SimpleFile *file, int indent) {
file->writeNumberLine(1, indent);
file->writeNumberLine(_field13C, indent);
file->writeQuotedLine(_season, indent);
file->writeNumberLine(_field14C, indent);
CBrain::save(file, indent);
}
void CSpeechCentre::load(SimpleFile *file) {
file->readNumber();
_field13C = file->readNumber();
_season = file->readString();
_field14C = file->readNumber();
CBrain::load(file);
}
bool CSpeechCentre::PuzzleSolvedMsg(CPuzzleSolvedMsg *msg) {
if (_field13C == 1 && _season == "Autumn")
_canTake = true;
return true;
}
bool CSpeechCentre::ChangeSeasonMsg(CChangeSeasonMsg *msg) {
_season = msg->_season;
return true;
}
bool CSpeechCentre::SpeechFallsFromTreeMsg(CSpeechFallsFromTreeMsg *msg) {
setVisible(true);
dragMove(msg->_pos);
_field14C = true;
return true;
}
bool CSpeechCentre::FrameMsg(CFrameMsg *msg) {
if (_field14C) {
if (_bounds.top > 200)
_field14C = false;
makeDirty();
_bounds.top += 3;
makeDirty();
}
return true;
}
} // End of namespace Titanic

View File

@@ -0,0 +1,57 @@
/* 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_SPEECH_CENTRE_H
#define TITANIC_SPEECH_CENTRE_H
#include "titanic/carry/brain.h"
namespace Titanic {
class CSpeechCentre : public CBrain {
DECLARE_MESSAGE_MAP;
bool PuzzleSolvedMsg(CPuzzleSolvedMsg *msg);
bool ChangeSeasonMsg(CChangeSeasonMsg *msg);
bool SpeechFallsFromTreeMsg(CSpeechFallsFromTreeMsg *msg);
bool FrameMsg(CFrameMsg *msg);
private:
int _field13C;
CString _season;
int _field14C;
public:
CLASSDEF;
CSpeechCentre() : CBrain(), _season("Summer"),
_field13C(1), _field14C(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_SPEECH_CENTRE_H */

View File

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

View File

@@ -0,0 +1,65 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#include "titanic/carry/vision_centre.h"
namespace Titanic {
BEGIN_MESSAGE_MAP(CVisionCentre, CBrain)
ON_MESSAGE(PuzzleSolvedMsg)
ON_MESSAGE(MouseButtonDownMsg)
ON_MESSAGE(MouseDragStartMsg)
END_MESSAGE_MAP()
void CVisionCentre::save(SimpleFile *file, int indent) {
file->writeNumberLine(1, indent);
CBrain::save(file, indent);
}
void CVisionCentre::load(SimpleFile *file) {
file->readNumber();
CBrain::load(file);
}
bool CVisionCentre::PuzzleSolvedMsg(CPuzzleSolvedMsg *msg) {
_canTake = true;
return true;
}
bool CVisionCentre::MouseButtonDownMsg(CMouseButtonDownMsg *msg) {
if (_canTake) {
return CBrain::MouseButtonDownMsg(msg);
} else {
petDisplayMessage(1, NICE_IF_TAKE_BUT_CANT);
return true;
}
}
bool CVisionCentre::MouseDragStartMsg(CMouseDragStartMsg *msg) {
if (_canTake) {
return CBrain::MouseDragStartMsg(msg);
} else {
petDisplayMessage(1, NICE_IF_TAKE_BUT_CANT);
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_VISION_CENTRE_H
#define TITANIC_VISION_CENTRE_H
#include "titanic/carry/brain.h"
namespace Titanic {
class CVisionCentre : public CBrain {
DECLARE_MESSAGE_MAP;
bool PuzzleSolvedMsg(CPuzzleSolvedMsg *msg);
bool MouseButtonDownMsg(CMouseButtonDownMsg *msg);
bool MouseDragStartMsg(CMouseDragStartMsg *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_VISION_CENTRE_H */