diff options
Diffstat (limited to 'engines/titanic/game/pickup')
-rw-r--r-- | engines/titanic/game/pickup/pick_up.cpp | 49 | ||||
-rw-r--r-- | engines/titanic/game/pickup/pick_up.h | 52 | ||||
-rw-r--r-- | engines/titanic/game/pickup/pick_up_bar_glass.cpp | 88 | ||||
-rw-r--r-- | engines/titanic/game/pickup/pick_up_bar_glass.h | 51 | ||||
-rw-r--r-- | engines/titanic/game/pickup/pick_up_hose.cpp | 106 | ||||
-rw-r--r-- | engines/titanic/game/pickup/pick_up_hose.h | 56 | ||||
-rw-r--r-- | engines/titanic/game/pickup/pick_up_lemon.cpp | 62 | ||||
-rw-r--r-- | engines/titanic/game/pickup/pick_up_lemon.h | 50 | ||||
-rw-r--r-- | engines/titanic/game/pickup/pick_up_speech_centre.cpp | 73 | ||||
-rw-r--r-- | engines/titanic/game/pickup/pick_up_speech_centre.h | 51 | ||||
-rw-r--r-- | engines/titanic/game/pickup/pick_up_vis_centre.cpp | 60 | ||||
-rw-r--r-- | engines/titanic/game/pickup/pick_up_vis_centre.h | 50 |
12 files changed, 748 insertions, 0 deletions
diff --git a/engines/titanic/game/pickup/pick_up.cpp b/engines/titanic/game/pickup/pick_up.cpp new file mode 100644 index 0000000000..64d2d1d0d2 --- /dev/null +++ b/engines/titanic/game/pickup/pick_up.cpp @@ -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 2 + * 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, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + */ + +#include "titanic/game/pickup/pick_up.h" + +namespace Titanic { + +BEGIN_MESSAGE_MAP(CPickUp, CGameObject) + ON_MESSAGE(StatusChangeMsg) +END_MESSAGE_MAP() + +void CPickUp::save(SimpleFile *file, int indent) { + file->writeNumberLine(1, indent); + file->writeNumberLine(_enabled, indent); + CGameObject::save(file, indent); +} + +void CPickUp::load(SimpleFile *file) { + file->readNumber(); + _enabled = file->readNumber(); + CGameObject::load(file); +} + +bool CPickUp::StatusChangeMsg(CStatusChangeMsg *msg) { + _enabled = msg->_newStatus == 1; + setVisible(_enabled); + return true; +} + +} // End of namespace Titanic diff --git a/engines/titanic/game/pickup/pick_up.h b/engines/titanic/game/pickup/pick_up.h new file mode 100644 index 0000000000..f5ee06fd32 --- /dev/null +++ b/engines/titanic/game/pickup/pick_up.h @@ -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 2 + * 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, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + */ + +#ifndef TITANIC_PICK_UP_H +#define TITANIC_PICK_UP_H + +#include "titanic/core/game_object.h" + +namespace Titanic { + +class CPickUp : public CGameObject { + DECLARE_MESSAGE_MAP; + bool StatusChangeMsg(CStatusChangeMsg *msg); +protected: + bool _enabled; +public: + CLASSDEF; + CPickUp() : CGameObject(), _enabled(false) {} + + /** + * Save the data for the class to file + */ + virtual void save(SimpleFile *file, int indent); + + /** + * Load the data for the class from file + */ + virtual void load(SimpleFile *file); +}; + +} // End of namespace Titanic + +#endif /* TITANIC_ANNOY_BARBOT_H */ diff --git a/engines/titanic/game/pickup/pick_up_bar_glass.cpp b/engines/titanic/game/pickup/pick_up_bar_glass.cpp new file mode 100644 index 0000000000..9da17b139e --- /dev/null +++ b/engines/titanic/game/pickup/pick_up_bar_glass.cpp @@ -0,0 +1,88 @@ +/* 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 2 + * 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, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + */ + +#include "titanic/game/pickup/pick_up_bar_glass.h" +#include "titanic/core/project_item.h" + +namespace Titanic { + +BEGIN_MESSAGE_MAP(CPickUpBarGlass, CPickUp) + ON_MESSAGE(StatusChangeMsg) + ON_MESSAGE(MouseDragStartMsg) + ON_MESSAGE(MouseButtonDownMsg) +END_MESSAGE_MAP() + +void CPickUpBarGlass::save(SimpleFile *file, int indent) { + file->writeNumberLine(1, indent); + CPickUp::save(file, indent); +} + +void CPickUpBarGlass::load(SimpleFile *file) { + file->readNumber(); + CPickUp::load(file); +} + +bool CPickUpBarGlass::StatusChangeMsg(CStatusChangeMsg *msg) { + switch (msg->_newStatus) { + case 0: + setVisible(false); + _enabled = false; + break; + case 1: + setVisible(true); + _enabled = true; + break; + case 2: + setVisible(true); + _enabled = false; + break; + default: + break; + } + + return true; +} + +bool CPickUpBarGlass::MouseDragStartMsg(CMouseDragStartMsg *msg) { + if (checkStartDragging(msg) && _enabled) { + CTurnOn onMsg; + onMsg.execute("BeerGlass"); + CVisibleMsg visibleMsg; + visibleMsg.execute("BeerGlass"); + CPassOnDragStartMsg passMsg(msg->_mousePos, 1, 3); + passMsg.execute("BeerGlass"); + + msg->_dragItem = getRoot()->findByName("BeerGlass"); + + CActMsg actMsg("PlayerTakesGlass"); + actMsg.execute("Barbot"); + return true; + } else { + return false; + } +} + +bool CPickUpBarGlass::MouseButtonDownMsg(CMouseButtonDownMsg *msg) { + return true; +} + +} // End of namespace Titanic diff --git a/engines/titanic/game/pickup/pick_up_bar_glass.h b/engines/titanic/game/pickup/pick_up_bar_glass.h new file mode 100644 index 0000000000..d273d96170 --- /dev/null +++ b/engines/titanic/game/pickup/pick_up_bar_glass.h @@ -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 2 + * 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, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + */ + +#ifndef TITANIC_PICK_UP_BAR_GLASS_H +#define TITANIC_PICK_UP_BAR_GLASS_H + +#include "titanic/game/pickup/pick_up.h" + +namespace Titanic { + +class CPickUpBarGlass : public CPickUp { + DECLARE_MESSAGE_MAP; + bool StatusChangeMsg(CStatusChangeMsg *msg); + bool MouseDragStartMsg(CMouseDragStartMsg *msg); + bool MouseButtonDownMsg(CMouseButtonDownMsg *msg); +public: + CLASSDEF; + + /** + * Save the data for the class to file + */ + virtual void save(SimpleFile *file, int indent); + + /** + * Load the data for the class from file + */ + virtual void load(SimpleFile *file); +}; + +} // End of namespace Titanic + +#endif /* TITANIC_PICK_UP_BAR_GLASS_H */ diff --git a/engines/titanic/game/pickup/pick_up_hose.cpp b/engines/titanic/game/pickup/pick_up_hose.cpp new file mode 100644 index 0000000000..d07088cefd --- /dev/null +++ b/engines/titanic/game/pickup/pick_up_hose.cpp @@ -0,0 +1,106 @@ +/* ScummVM - Graphic Adventure Engine + * + * ScummVM is the legal property of its developers, whose names + * are too numerous to list here. Please refer to the COPYRIGHT + * file distributed with this source distribution. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * 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, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + */ + +#include "titanic/game/pickup/pick_up_hose.h" +#include "titanic/core/project_item.h" +#include "titanic/core/room_item.h" +#include "titanic/core/view_item.h" + +namespace Titanic { + +BEGIN_MESSAGE_MAP(CPickUpHose, CPickUp) + ON_MESSAGE(MouseDragStartMsg) + ON_MESSAGE(StatusChangeMsg) + ON_MESSAGE(EnterViewMsg) + ON_MESSAGE(MouseButtonDownMsg) +END_MESSAGE_MAP() + +bool CPickUpHose::_v1; + +void CPickUpHose::save(SimpleFile *file, int indent) { + file->writeNumberLine(1, indent); + file->writeQuotedLine(_target, indent); + file->writeNumberLine(_v1, indent); + + CPickUp::save(file, indent); +} + +void CPickUpHose::load(SimpleFile *file) { + file->readNumber(); + _target = file->readString(); + _v1 = file->readNumber(); + + CPickUp::load(file); +} + +bool CPickUpHose::MouseDragStartMsg(CMouseDragStartMsg *msg) { + if (!checkStartDragging(msg)) + return true; + if (_v1 || !_enabled) + return false; + + CViewItem *view = getView(); + if (view) { + _v1 = true; + CRoomItem *room = locateRoom("Arboretum"); + CTreeItem *hose = room ? room->findByName("Hose") : nullptr; + + if (!hose) { + room = locateRoom("FrozenArboretum"); + if (room) + hose = room->findByName("Hose"); + } + + if (hose) { + CVisibleMsg visibleMsg; + visibleMsg.execute(this); + moveUnder(view); + + CPassOnDragStartMsg passMsg(msg->_mousePos, 1); + passMsg.execute("Hose"); + + msg->_dragItem = getRoot()->findByName("Hose"); + _cursorId = CURSOR_IGNORE; + + CActMsg actMsg("PlayerGetsHose"); + actMsg.execute(_target); + } + } + + return true; +} + +bool CPickUpHose::StatusChangeMsg(CStatusChangeMsg *msg) { + _cursorId = msg->_newStatus == 1 ? CURSOR_HAND : CURSOR_IGNORE; + return true; +} + +bool CPickUpHose::EnterViewMsg(CEnterViewMsg *msg) { + _cursorId = CURSOR_IGNORE; + return true; +} + +bool CPickUpHose::MouseButtonDownMsg(CMouseButtonDownMsg *msg) { + return _enabled; +} + +} // End of namespace Titanic diff --git a/engines/titanic/game/pickup/pick_up_hose.h b/engines/titanic/game/pickup/pick_up_hose.h new file mode 100644 index 0000000000..2ad7c2a583 --- /dev/null +++ b/engines/titanic/game/pickup/pick_up_hose.h @@ -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 2 + * 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, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + */ + +#ifndef TITANIC_PICK_UP_HOSE_H +#define TITANIC_PICK_UP_HOSE_H + +#include "titanic/game/pickup/pick_up.h" + +namespace Titanic { + +class CPickUpHose : public CPickUp { + DECLARE_MESSAGE_MAP; + bool MouseDragStartMsg(CMouseDragStartMsg *msg); + bool StatusChangeMsg(CStatusChangeMsg *msg); + bool EnterViewMsg(CEnterViewMsg *msg); + bool MouseButtonDownMsg(CMouseButtonDownMsg *msg); +private: + static bool _v1; + + CString _target; +public: + CLASSDEF; + + /** + * Save the data for the class to file + */ + virtual void save(SimpleFile *file, int indent); + + /** + * Load the data for the class from file + */ + virtual void load(SimpleFile *file); +}; + +} // End of namespace Titanic + +#endif /* TITANIC_PICK_UP_HOSE_H */ diff --git a/engines/titanic/game/pickup/pick_up_lemon.cpp b/engines/titanic/game/pickup/pick_up_lemon.cpp new file mode 100644 index 0000000000..5109c36304 --- /dev/null +++ b/engines/titanic/game/pickup/pick_up_lemon.cpp @@ -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 2 + * 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, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + */ + +#include "titanic/game/pickup/pick_up_lemon.h" +#include "titanic/core/project_item.h" + +namespace Titanic { + +BEGIN_MESSAGE_MAP(CPickUpLemon, CPickUp) + ON_MESSAGE(MouseButtonDownMsg) + ON_MESSAGE(MouseDragStartMsg) +END_MESSAGE_MAP() + +void CPickUpLemon::save(SimpleFile *file, int indent) { + file->writeNumberLine(1, indent); + CPickUp::save(file, indent); +} + +void CPickUpLemon::load(SimpleFile *file) { + file->readNumber(); + CPickUp::load(file); +} + +bool CPickUpLemon::MouseButtonDownMsg(CMouseButtonDownMsg *msg) { + return true; +} + +bool CPickUpLemon::MouseDragStartMsg(CMouseDragStartMsg *msg) { + if (!checkStartDragging(msg)) + return true; + if (!_enabled) + return false; + + CVisibleMsg visibleMsg; + visibleMsg.execute("Lemon"); + CPassOnDragStartMsg passMsg(msg->_mousePos, 1); + passMsg.execute("Lemon"); + + msg->_dragItem = getRoot()->findByName("Lemon"); + return true; +} + +} // End of namespace Titanic diff --git a/engines/titanic/game/pickup/pick_up_lemon.h b/engines/titanic/game/pickup/pick_up_lemon.h new file mode 100644 index 0000000000..c196acdeaf --- /dev/null +++ b/engines/titanic/game/pickup/pick_up_lemon.h @@ -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 2 + * 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, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + */ + +#ifndef TITANIC_PICK_UP_LEMON_H +#define TITANIC_PICK_UP_LEMON_H + +#include "titanic/game/pickup/pick_up.h" + +namespace Titanic { + +class CPickUpLemon : public CPickUp { + DECLARE_MESSAGE_MAP; + bool MouseButtonDownMsg(CMouseButtonDownMsg *msg); + bool MouseDragStartMsg(CMouseDragStartMsg *msg); +public: + CLASSDEF; + + /** + * Save the data for the class to file + */ + virtual void save(SimpleFile *file, int indent); + + /** + * Load the data for the class from file + */ + virtual void load(SimpleFile *file); +}; + +} // End of namespace Titanic + +#endif /* TITANIC_PICK_UP_LEMON_H */ diff --git a/engines/titanic/game/pickup/pick_up_speech_centre.cpp b/engines/titanic/game/pickup/pick_up_speech_centre.cpp new file mode 100644 index 0000000000..5e99c0a3b7 --- /dev/null +++ b/engines/titanic/game/pickup/pick_up_speech_centre.cpp @@ -0,0 +1,73 @@ +/* ScummVM - Graphic Adventure Engine + * + * ScummVM is the legal property of its developers, whose names + * are too numerous to list here. Please refer to the COPYRIGHT + * file distributed with this source distribution. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * 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, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + */ + +#include "titanic/game/pickup/pick_up_speech_centre.h" +#include "titanic/core/project_item.h" + +namespace Titanic { + +BEGIN_MESSAGE_MAP(CPickUpSpeechCentre, CPickUp) + ON_MESSAGE(MouseButtonDownMsg) + ON_MESSAGE(StatusChangeMsg) + ON_MESSAGE(MouseDragStartMsg) +END_MESSAGE_MAP() + +void CPickUpSpeechCentre::save(SimpleFile *file, int indent) { + file->writeNumberLine(1, indent); + CPickUp::save(file, indent); +} + +void CPickUpSpeechCentre::load(SimpleFile *file) { + file->readNumber(); + CPickUp::load(file); +} + +bool CPickUpSpeechCentre::MouseButtonDownMsg(CMouseButtonDownMsg *msg) { + return true; +} + +bool CPickUpSpeechCentre::StatusChangeMsg(CStatusChangeMsg *msg) { + _enabled = msg->_newStatus == 1; + return true; +} + +bool CPickUpSpeechCentre::MouseDragStartMsg(CMouseDragStartMsg *msg) { + if (checkStartDragging(msg)) { + if (_enabled) { + CVisibleMsg visibleMsg; + visibleMsg.execute("SpeechCentre"); + CPassOnDragStartMsg passMsg(msg->_mousePos, 1); + passMsg.execute("SpeechCentre"); + + msg->_dragItem = getRoot()->findByName("SpeechCentre"); + + CActMsg actMsg("PlayerGetsSpeechCentre"); + actMsg.execute("SeasonalAdjust"); + } else { + petDisplayMessage("You can't pick this up on account of it being stuck to the branch."); + } + } + + return true; +} + +} // End of namespace Titanic diff --git a/engines/titanic/game/pickup/pick_up_speech_centre.h b/engines/titanic/game/pickup/pick_up_speech_centre.h new file mode 100644 index 0000000000..81ee0b5d77 --- /dev/null +++ b/engines/titanic/game/pickup/pick_up_speech_centre.h @@ -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 2 + * 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, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + */ + +#ifndef TITANIC_PICK_UP_SPEECH_CENTRE_H +#define TITANIC_PICK_UP_SPEECH_CENTRE_H + +#include "titanic/game/pickup/pick_up.h" + +namespace Titanic { + +class CPickUpSpeechCentre : public CPickUp { + DECLARE_MESSAGE_MAP; + bool MouseButtonDownMsg(CMouseButtonDownMsg *msg); + bool StatusChangeMsg(CStatusChangeMsg *msg); + bool MouseDragStartMsg(CMouseDragStartMsg *msg); +public: + CLASSDEF; + + /** + * Save the data for the class to file + */ + virtual void save(SimpleFile *file, int indent); + + /** + * Load the data for the class from file + */ + virtual void load(SimpleFile *file); +}; + +} // End of namespace Titanic + +#endif /* TITANIC_PICK_UP_SPEECH_CENTRE_H */ diff --git a/engines/titanic/game/pickup/pick_up_vis_centre.cpp b/engines/titanic/game/pickup/pick_up_vis_centre.cpp new file mode 100644 index 0000000000..baf1763d09 --- /dev/null +++ b/engines/titanic/game/pickup/pick_up_vis_centre.cpp @@ -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 2 + * 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, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + */ + +#include "titanic/game/pickup/pick_up_vis_centre.h" + +namespace Titanic { + +BEGIN_MESSAGE_MAP(CPickUpVisCentre, CPickUp) + ON_MESSAGE(MouseButtonDownMsg) + ON_MESSAGE(MouseDragStartMsg) +END_MESSAGE_MAP() + +void CPickUpVisCentre::save(SimpleFile *file, int indent) { + file->writeNumberLine(1, indent); + CPickUp::save(file, indent); +} + +void CPickUpVisCentre::load(SimpleFile *file) { + file->readNumber(); + CPickUp::load(file); +} + + +bool CPickUpVisCentre::MouseButtonDownMsg(CMouseButtonDownMsg *msg) { + return true; +} + +bool CPickUpVisCentre::MouseDragStartMsg(CMouseDragStartMsg *msg) { + if (!checkStartDragging(msg) || !_enabled) + return false; + + setVisible(false); + CVisibleMsg visibleMsg; + visibleMsg.execute("VisionCentre"); + msg->execute("VisionCentre"); + CActMsg actMsg("PlayerTakesVisCentre"); + actMsg.execute("Barbot"); + return true; +} + +} // End of namespace Titanic diff --git a/engines/titanic/game/pickup/pick_up_vis_centre.h b/engines/titanic/game/pickup/pick_up_vis_centre.h new file mode 100644 index 0000000000..a5f59211d3 --- /dev/null +++ b/engines/titanic/game/pickup/pick_up_vis_centre.h @@ -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 2 + * 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, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + */ + +#ifndef TITANIC_PICK_UP_VIS_CENTRE_H +#define TITANIC_PICK_UP_VIS_CENTRE_H + +#include "titanic/game/pickup/pick_up.h" + +namespace Titanic { + +class CPickUpVisCentre : public CPickUp { + DECLARE_MESSAGE_MAP; + bool MouseButtonDownMsg(CMouseButtonDownMsg *msg); + bool MouseDragStartMsg(CMouseDragStartMsg *msg); +public: + CLASSDEF; + + /** + * Save the data for the class to file + */ + virtual void save(SimpleFile *file, int indent); + + /** + * Load the data for the class from file + */ + virtual void load(SimpleFile *file); +}; + +} // End of namespace Titanic + +#endif /* TITANIC_PICK_UP_VIS_CENTRE_H */ |