diff options
Diffstat (limited to 'engines/titanic/game/maitred')
-rw-r--r-- | engines/titanic/game/maitred/maitred_arm_holder.cpp | 56 | ||||
-rw-r--r-- | engines/titanic/game/maitred/maitred_arm_holder.h | 50 | ||||
-rw-r--r-- | engines/titanic/game/maitred/maitred_body.cpp | 75 | ||||
-rw-r--r-- | engines/titanic/game/maitred/maitred_body.h | 54 | ||||
-rw-r--r-- | engines/titanic/game/maitred/maitred_legs.cpp | 95 | ||||
-rw-r--r-- | engines/titanic/game/maitred/maitred_legs.h | 53 | ||||
-rw-r--r-- | engines/titanic/game/maitred/maitred_prod_receptor.cpp | 122 | ||||
-rw-r--r-- | engines/titanic/game/maitred/maitred_prod_receptor.h | 58 |
8 files changed, 563 insertions, 0 deletions
diff --git a/engines/titanic/game/maitred/maitred_arm_holder.cpp b/engines/titanic/game/maitred/maitred_arm_holder.cpp new file mode 100644 index 0000000000..75d95640d2 --- /dev/null +++ b/engines/titanic/game/maitred/maitred_arm_holder.cpp @@ -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. + * + */ + +#include "titanic/game/maitred/maitred_arm_holder.h" + +namespace Titanic { + +BEGIN_MESSAGE_MAP(CMaitreDArmHolder, CDropTarget) + ON_MESSAGE(MaitreDArmHolder) + ON_MESSAGE(ActMsg) +END_MESSAGE_MAP() + +void CMaitreDArmHolder::save(SimpleFile *file, int indent) { + file->writeNumberLine(1, indent); + CDropTarget::save(file, indent); +} + +void CMaitreDArmHolder::load(SimpleFile *file) { + file->readNumber(); + CDropTarget::load(file); +} + +bool CMaitreDArmHolder::MaitreDArmHolder(CMaitreDArmHolder *msg) { + _fieldF4 = 0; + return true; +} + +bool CMaitreDArmHolder::ActMsg(CActMsg *msg) { + if (msg->_action == "LoseArm") { + _bounds = Rect(); + setVisible(false); + } + + return true; +} + +} // End of namespace Titanic diff --git a/engines/titanic/game/maitred/maitred_arm_holder.h b/engines/titanic/game/maitred/maitred_arm_holder.h new file mode 100644 index 0000000000..22f961f236 --- /dev/null +++ b/engines/titanic/game/maitred/maitred_arm_holder.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_MAITRED_ARM_HOLDER_H +#define TITANIC_MAITRED_ARM_HOLDER_H + +#include "titanic/core/drop_target.h" + +namespace Titanic { + +class CMaitreDArmHolder : public CDropTarget { + DECLARE_MESSAGE_MAP; + bool MaitreDArmHolder(CMaitreDArmHolder *msg); + bool ActMsg(CActMsg *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_MAITRED_ARM_HOLDER_H */ diff --git a/engines/titanic/game/maitred/maitred_body.cpp b/engines/titanic/game/maitred/maitred_body.cpp new file mode 100644 index 0000000000..4cb12aac8f --- /dev/null +++ b/engines/titanic/game/maitred/maitred_body.cpp @@ -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 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/maitred/maitred_body.h" + +namespace Titanic { + +BEGIN_MESSAGE_MAP(CMaitreDBody, CMaitreDProdReceptor) + ON_MESSAGE(EnterViewMsg) + ON_MESSAGE(AnimateMaitreDMsg) + ON_MESSAGE(ActMsg) +END_MESSAGE_MAP() + +void CMaitreDBody::save(SimpleFile *file, int indent) { + file->writeNumberLine(1, indent); + file->writeNumberLine(_armed, indent); + CMaitreDProdReceptor::save(file, indent); +} + +void CMaitreDBody::load(SimpleFile *file) { + file->readNumber(); + _armed = file->readNumber(); + CMaitreDProdReceptor::load(file); +} + +bool CMaitreDBody::EnterViewMsg(CEnterViewMsg *msg) { + return true; +} + +bool CMaitreDBody::AnimateMaitreDMsg(CAnimateMaitreDMsg *msg) { + static const char *const ARMED_CLIPS[5] = { + "Talking 1", "Talking 2", "Talking 3", "Talking 4", nullptr + }; + static const char *const UNARMED_CLIPS[5] = { + "Armless Talking 1", "Armless Talking 2", "Armless Talking 3", + "Armless Talking 4", nullptr + }; + + if (!hasActiveMovie()) { + playRandomClip(_armed ? ARMED_CLIPS : UNARMED_CLIPS); + } + + return true; +} + +bool CMaitreDBody::ActMsg(CActMsg *msg) { + if (msg->_action == "LoseArm") { + _armed = false; + loadFrame(262); + playSound("c#75.wav"); + } + + return true; +} + +} // End of namespace Titanic diff --git a/engines/titanic/game/maitred/maitred_body.h b/engines/titanic/game/maitred/maitred_body.h new file mode 100644 index 0000000000..1798958e84 --- /dev/null +++ b/engines/titanic/game/maitred/maitred_body.h @@ -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 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_MAITRED_BODY_H +#define TITANIC_MAITRED_BODY_H + +#include "titanic/game/maitred/maitred_prod_receptor.h" + +namespace Titanic { + +class CMaitreDBody : public CMaitreDProdReceptor { + DECLARE_MESSAGE_MAP; + bool EnterViewMsg(CEnterViewMsg *msg); + bool AnimateMaitreDMsg(CAnimateMaitreDMsg *msg); + bool ActMsg(CActMsg *msg); +private: + bool _armed; +public: + CLASSDEF; + CMaitreDBody() : CMaitreDProdReceptor(), _armed(true) {} + + /** + * 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_MAITRED_BODY_H */ diff --git a/engines/titanic/game/maitred/maitred_legs.cpp b/engines/titanic/game/maitred/maitred_legs.cpp new file mode 100644 index 0000000000..8c0b0db5ea --- /dev/null +++ b/engines/titanic/game/maitred/maitred_legs.cpp @@ -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 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/maitred/maitred_legs.h" + +namespace Titanic { + +BEGIN_MESSAGE_MAP(CMaitreDLegs, CMaitreDProdReceptor) + ON_MESSAGE(EnterViewMsg) + ON_MESSAGE(AnimateMaitreDMsg) +END_MESSAGE_MAP() + +void CMaitreDLegs::save(SimpleFile *file, int indent) { + file->writeNumberLine(1, indent); + file->writeNumberLine(_flag, indent); + CMaitreDProdReceptor::save(file, indent); +} + +void CMaitreDLegs::load(SimpleFile *file) { + file->readNumber(); + _flag = file->readNumber(); + CMaitreDProdReceptor::load(file); +} + +bool CMaitreDLegs::EnterViewMsg(CEnterViewMsg *msg) { + _flag = true; + loadFrame(0); + return true; +} + +bool CMaitreDLegs::AnimateMaitreDMsg(CAnimateMaitreDMsg *msg) { + static const char *const WIGGLE_CLIPS[4] = { + "Hip Wiggle", "Knee Bend", "Wire Wiggle", nullptr + }; + static const char *const FIGHTING_CLIPS[4] = { + "Fighting 1", "Fighting 2", "Leg Fidget", nullptr + }; + static const char *const ARCING_SOUNDS[9] = { + "MaitreD Arcing 1.wav", "MaitreD Arcing 2.wav", + "MaitreD Arcing 3.wav", "MaitreD Arcing 4.wav", + "MaitreD Arcing 5.wav", "MaitreD Arcing 6.wav", + "MaitreD Arcing 7.wav", "MaitreD Arcing 8.wav", + "MaitreD Arcing 9.wav" + }; + + switch (msg->_value) { + case 0: + if (_flag) { + playRandomClip(FIGHTING_CLIPS); + + if (getRandomNumber(2) != 0) + playSound(ARCING_SOUNDS[getRandomNumber(9)], + 40 + getRandomNumber(30)); + } else { + playClip("Walk Right"); + _flag = true; + } + break; + + case 1: + if (_flag) { + playClip("Walk Left"); + _flag = false; + } else { + playRandomClip(WIGGLE_CLIPS); + } + break; + + default: + break; + } + + return true; +} + +} // End of namespace Titanic diff --git a/engines/titanic/game/maitred/maitred_legs.h b/engines/titanic/game/maitred/maitred_legs.h new file mode 100644 index 0000000000..b8a32eef4c --- /dev/null +++ b/engines/titanic/game/maitred/maitred_legs.h @@ -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 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_MAITRED_LEGS_H +#define TITANIC_MAITRED_LEGS_H + +#include "titanic/game/maitred/maitred_prod_receptor.h" + +namespace Titanic { + +class CMaitreDLegs : public CMaitreDProdReceptor { + DECLARE_MESSAGE_MAP; + bool EnterViewMsg(CEnterViewMsg *msg); + bool AnimateMaitreDMsg(CAnimateMaitreDMsg *msg); +private: + bool _flag; +public: + CLASSDEF; + CMaitreDLegs() : CMaitreDProdReceptor(), _flag(true) {} + + /** + * 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_MAITRED_LEGS_H */ diff --git a/engines/titanic/game/maitred/maitred_prod_receptor.cpp b/engines/titanic/game/maitred/maitred_prod_receptor.cpp new file mode 100644 index 0000000000..66533a542f --- /dev/null +++ b/engines/titanic/game/maitred/maitred_prod_receptor.cpp @@ -0,0 +1,122 @@ +/* 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/maitred/maitred_prod_receptor.h" +#include "titanic/npcs/maitre_d.h" + +namespace Titanic { + +BEGIN_MESSAGE_MAP(CMaitreDProdReceptor, CGameObject) + ON_MESSAGE(MouseButtonDownMsg) + ON_MESSAGE(MouseMoveMsg) + ON_MESSAGE(ProdMaitreDMsg) + ON_MESSAGE(DisableMaitreDProdReceptor) +END_MESSAGE_MAP() + +void CMaitreDProdReceptor::save(SimpleFile *file, int indent) { + file->writeNumberLine(1, indent); + file->writeNumberLine(_fieldBC, indent); + file->writeNumberLine(_counter, indent); + file->writeNumberLine(_fieldC4, indent); + + CGameObject::save(file, indent); +} + +void CMaitreDProdReceptor::load(SimpleFile *file) { + file->readNumber(); + _fieldBC = file->readNumber(); + _counter = file->readNumber(); + _fieldC4 = file->readNumber(); + + CGameObject::load(file); +} + +bool CMaitreDProdReceptor::MouseButtonDownMsg(CMouseButtonDownMsg *msg) { + if (_fieldBC == 2 && static_cast<CGameObject *>(getParent())->hasActiveMovie()) { + return false; + } else { + CProdMaitreDMsg prodMsg(126); + prodMsg.execute(this); + return true; + } +} + +bool CMaitreDProdReceptor::MouseMoveMsg(CMouseMoveMsg *msg) { + if (_fieldBC == 2 && static_cast<CGameObject *>(getParent())->hasActiveMovie()) + return false; + else if (++_counter < 20) + return true; + + _counter = 0; + CProdMaitreDMsg prodMsg(126); + + if (isEquals("Stick")) + prodMsg._value = 121; + else if (isEquals("Hammer")) + prodMsg._value = 122; + else if (isEquals("Lemon")) + prodMsg._value = 123; + else if (isEquals("Chicken")) + prodMsg._value = 124; + else if (isEquals("Perch")) + prodMsg._value = 125; + + CMaitreD *maitreD = static_cast<CMaitreD *>(findRoomObject("MaitreD")); + if (maitreD->_field100 <= 0) + prodMsg.execute(this); + + return true; +} + +bool CMaitreDProdReceptor::ProdMaitreDMsg(CProdMaitreDMsg *msg) { + if (_fieldC4) { + CMaitreD *maitreD = static_cast<CMaitreD *>(findRoomObject("MaitreD")); + if (maitreD->_field100 <= 0) { + CViewItem *view = findView(); + startTalking(maitreD, msg->_value, view); + + switch (_fieldBC) { + case 1: + startTalking(maitreD, 128, view); + break; + case 2: + startTalking(maitreD, 129, view); + break; + case 3: + startTalking(maitreD, 127, view); + break; + default: + startTalking(maitreD, 130, view); + break; + } + } + } + + return true; +} + +bool CMaitreDProdReceptor::DisableMaitreDProdReceptor(CDisableMaitreDProdReceptor *msg) { + _fieldC4 = 0; + return true; +} + +} // End of namespace Titanic diff --git a/engines/titanic/game/maitred/maitred_prod_receptor.h b/engines/titanic/game/maitred/maitred_prod_receptor.h new file mode 100644 index 0000000000..0b00ce0014 --- /dev/null +++ b/engines/titanic/game/maitred/maitred_prod_receptor.h @@ -0,0 +1,58 @@ +/* ScummVM - Graphic Adventure Engine + * + * ScummVM is the legal property of its developers, whose names + * are too numerous to list here. Please refer to the COPYRIGHT + * file distributed with this source distribution. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 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_MAITRED_PROD_RECEPTOR_H +#define TITANIC_MAITRED_PROD_RECEPTOR_H + +#include "titanic/core/game_object.h" + +namespace Titanic { + +class CMaitreDProdReceptor : public CGameObject { + DECLARE_MESSAGE_MAP; + bool MouseButtonDownMsg(CMouseButtonDownMsg *msg); + bool MouseMoveMsg(CMouseMoveMsg *msg); + bool ProdMaitreDMsg(CProdMaitreDMsg *msg); + bool DisableMaitreDProdReceptor(CDisableMaitreDProdReceptor *msg); +protected: + int _fieldBC; + int _counter; + int _fieldC4; +public: + CLASSDEF; + CMaitreDProdReceptor() : CGameObject(), + _fieldBC(0), _counter(0), _fieldC4(1) {} + + /** + * 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_MAITRED_PROD_RECEPTOR_H */ |