Initial commit
This commit is contained in:
71
engines/titanic/game/parrot/parrot_lobby_controller.cpp
Normal file
71
engines/titanic/game/parrot/parrot_lobby_controller.cpp
Normal file
@@ -0,0 +1,71 @@
|
||||
/* ScummVM - Graphic Adventure Engine
|
||||
*
|
||||
* ScummVM is the legal property of its developers, whose names
|
||||
* are too numerous to list here. Please refer to the COPYRIGHT
|
||||
* file distributed with this source distribution.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "titanic/game/parrot/parrot_lobby_controller.h"
|
||||
#include "titanic/core/room_item.h"
|
||||
|
||||
namespace Titanic {
|
||||
|
||||
BEGIN_MESSAGE_MAP(CParrotLobbyController, CParrotLobbyObject)
|
||||
ON_MESSAGE(ActMsg)
|
||||
END_MESSAGE_MAP()
|
||||
|
||||
void CParrotLobbyController::save(SimpleFile *file, int indent) {
|
||||
file->writeNumberLine(1, indent);
|
||||
CParrotLobbyObject::save(file, indent);
|
||||
}
|
||||
|
||||
void CParrotLobbyController::load(SimpleFile *file) {
|
||||
file->readNumber();
|
||||
CParrotLobbyObject::load(file);
|
||||
}
|
||||
|
||||
bool CParrotLobbyController::ActMsg(CActMsg *msg) {
|
||||
if (msg->_action == "Refresh")
|
||||
return false;
|
||||
else if (msg->_action == "GainParrot")
|
||||
_haveParrot = true;
|
||||
else if (msg->_action == "LoseParrot")
|
||||
_haveParrot = false;
|
||||
else if (msg->_action == "GainPerch")
|
||||
_havePerch = true;
|
||||
else if (msg->_action == "LosePerch")
|
||||
_havePerch = false;
|
||||
else if (msg->_action == "GainStick")
|
||||
_haveStick = true;
|
||||
else if (msg->_action == "LoseStick")
|
||||
_haveStick = false;
|
||||
|
||||
_flags = 0;
|
||||
if (_haveParrot)
|
||||
_flags = 4;
|
||||
if (_havePerch)
|
||||
_flags |= 2;
|
||||
if (_haveStick)
|
||||
_flags |= 1;
|
||||
|
||||
CActMsg actMsg("Refresh");
|
||||
actMsg.execute(findRoom(), CParrotLobbyObject::_type, MSGFLAG_CLASS_DEF | MSGFLAG_SCAN);
|
||||
actMsg.execute("ParrotLobbyUpdater_TOW");
|
||||
return true;
|
||||
}
|
||||
|
||||
} // End of namespace Titanic
|
||||
48
engines/titanic/game/parrot/parrot_lobby_controller.h
Normal file
48
engines/titanic/game/parrot/parrot_lobby_controller.h
Normal 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_PARROT_LOBBY_CONTROLLER_H
|
||||
#define TITANIC_PARROT_LOBBY_CONTROLLER_H
|
||||
|
||||
#include "titanic/game/parrot/parrot_lobby_object.h"
|
||||
|
||||
namespace Titanic {
|
||||
|
||||
class CParrotLobbyController : public CParrotLobbyObject {
|
||||
DECLARE_MESSAGE_MAP;
|
||||
bool ActMsg(CActMsg *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_PARROT_LOBBY_CONTROLLER_H */
|
||||
115
engines/titanic/game/parrot/parrot_lobby_link_updater.cpp
Normal file
115
engines/titanic/game/parrot/parrot_lobby_link_updater.cpp
Normal file
@@ -0,0 +1,115 @@
|
||||
/* ScummVM - Graphic Adventure Engine
|
||||
*
|
||||
* ScummVM is the legal property of its developers, whose names
|
||||
* are too numerous to list here. Please refer to the COPYRIGHT
|
||||
* file distributed with this source distribution.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "titanic/game/parrot/parrot_lobby_link_updater.h"
|
||||
#include "titanic/support/files_manager.h"
|
||||
#include "titanic/titanic.h"
|
||||
|
||||
namespace Titanic {
|
||||
|
||||
BEGIN_MESSAGE_MAP(CParrotLobbyLinkUpdater, CParrotLobbyObject)
|
||||
ON_MESSAGE(ActMsg)
|
||||
END_MESSAGE_MAP()
|
||||
|
||||
/*------------------------------------------------------------------------*/
|
||||
|
||||
LinkUpdatorEntry::LinkUpdatorEntry() {
|
||||
Common::fill(&_vals[0], &_vals[8], 0);
|
||||
}
|
||||
|
||||
void LinkUpdatorEntry::load(Common::SeekableReadStream *s) {
|
||||
_linkStr = readStringFromStream(s);
|
||||
for (int idx = 0; idx < 8; ++idx)
|
||||
_vals[idx] = s->readByte();
|
||||
}
|
||||
|
||||
/*------------------------------------------------------------------------*/
|
||||
|
||||
void LinkUpdatorEntries::load(Common::SeekableReadStream *s, int count) {
|
||||
resize(count);
|
||||
for (int idx = 0; idx < count; ++idx)
|
||||
(*this)[idx].load(s);
|
||||
}
|
||||
|
||||
/*------------------------------------------------------------------------*/
|
||||
|
||||
CParrotLobbyLinkUpdater::CParrotLobbyLinkUpdater() : CParrotLobbyObject(), _fieldBC(1) {
|
||||
Common::SeekableReadStream *s = g_vm->_filesManager->getResource("DATA/PARROT_LOBBY_LINK_UPDATOR");
|
||||
_entries[0].load(s, 7);
|
||||
_entries[1].load(s, 5);
|
||||
_entries[2].load(s, 6);
|
||||
_entries[3].load(s, 9);
|
||||
_entries[4].load(s, 1);
|
||||
delete s;
|
||||
}
|
||||
|
||||
void CParrotLobbyLinkUpdater::save(SimpleFile *file, int indent) {
|
||||
file->writeNumberLine(1, indent);
|
||||
CParrotLobbyObject::save(file, indent);
|
||||
}
|
||||
|
||||
void CParrotLobbyLinkUpdater::load(SimpleFile *file) {
|
||||
file->readNumber();
|
||||
CParrotLobbyObject::load(file);
|
||||
}
|
||||
|
||||
bool CParrotLobbyLinkUpdater::ActMsg(CActMsg *msg) {
|
||||
if (msg->_action != "Refresh")
|
||||
return false;
|
||||
|
||||
CNodeItem *node = findNode();
|
||||
LinkUpdatorEntries *entriesP;
|
||||
if (isEquals("ParrotLobbyUpdater_TOW")) {
|
||||
entriesP = &_entries[4];
|
||||
} else {
|
||||
if (node->_nodeNumber < 1 || node->_nodeNumber > 4)
|
||||
return true;
|
||||
entriesP = &_entries[node->_nodeNumber - 1];
|
||||
}
|
||||
int count = entriesP->size();
|
||||
|
||||
for (CTreeItem *item = node->getFirstChild(); item; item = item->scan(node)) {
|
||||
CLinkItem *link = dynamic_cast<CLinkItem *>(item);
|
||||
if (!link || count == 0)
|
||||
continue;
|
||||
|
||||
CString linkName = link->getName();
|
||||
char c = linkName.lastChar();
|
||||
if (c >= 'a' && c <= 'd')
|
||||
linkName.deleteLastChar();
|
||||
|
||||
for (uint idx = 0; idx < entriesP->size(); ++idx) {
|
||||
const LinkUpdatorEntry &entry = (*entriesP)[idx];
|
||||
if (entry._linkStr == linkName) {
|
||||
int val = entry._vals[CParrotLobbyObject::_flags];
|
||||
if (val)
|
||||
linkName += (char)(0x60 + val);
|
||||
|
||||
link->_name = linkName;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
} // End of namespace Titanic
|
||||
67
engines/titanic/game/parrot/parrot_lobby_link_updater.h
Normal file
67
engines/titanic/game/parrot/parrot_lobby_link_updater.h
Normal 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_PARROT_LOBBY_LINK_UPDATER_H
|
||||
#define TITANIC_PARROT_LOBBY_LINK_UPDATER_H
|
||||
|
||||
#include "common/stream.h"
|
||||
#include "titanic/game/parrot/parrot_lobby_object.h"
|
||||
|
||||
namespace Titanic {
|
||||
|
||||
struct LinkUpdatorEntry {
|
||||
CString _linkStr;
|
||||
int _vals[8];
|
||||
|
||||
LinkUpdatorEntry();
|
||||
void load(Common::SeekableReadStream *s);
|
||||
};
|
||||
|
||||
class LinkUpdatorEntries : public Common::Array<LinkUpdatorEntry> {
|
||||
public:
|
||||
void load(Common::SeekableReadStream *s, int count);
|
||||
};
|
||||
|
||||
class CParrotLobbyLinkUpdater : public CParrotLobbyObject {
|
||||
DECLARE_MESSAGE_MAP;
|
||||
bool ActMsg(CActMsg *msg);
|
||||
private:
|
||||
LinkUpdatorEntries _entries[5];
|
||||
public:
|
||||
int _fieldBC;
|
||||
public:
|
||||
CLASSDEF;
|
||||
CParrotLobbyLinkUpdater();
|
||||
|
||||
/**
|
||||
* 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_PARROT_LOBBY_LINK_UPDATER_H */
|
||||
60
engines/titanic/game/parrot/parrot_lobby_object.cpp
Normal file
60
engines/titanic/game/parrot/parrot_lobby_object.cpp
Normal 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/>.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "titanic/game/parrot/parrot_lobby_object.h"
|
||||
|
||||
namespace Titanic {
|
||||
|
||||
EMPTY_MESSAGE_MAP(CParrotLobbyObject, CGameObject);
|
||||
|
||||
bool CParrotLobbyObject::_haveParrot;
|
||||
bool CParrotLobbyObject::_havePerch;
|
||||
bool CParrotLobbyObject::_haveStick;
|
||||
int CParrotLobbyObject::_flags;
|
||||
|
||||
void CParrotLobbyObject::init() {
|
||||
_haveParrot = true;
|
||||
_havePerch = true;
|
||||
_haveStick = true;
|
||||
_flags = 7;
|
||||
}
|
||||
|
||||
void CParrotLobbyObject::save(SimpleFile *file, int indent) {
|
||||
file->writeNumberLine(1, indent);
|
||||
file->writeNumberLine(_haveParrot, indent);
|
||||
file->writeNumberLine(_havePerch, indent);
|
||||
file->writeNumberLine(_haveStick, indent);
|
||||
file->writeNumberLine(_flags, indent);
|
||||
|
||||
CGameObject::save(file, indent);
|
||||
}
|
||||
|
||||
void CParrotLobbyObject::load(SimpleFile *file) {
|
||||
file->readNumber();
|
||||
_haveParrot = file->readNumber();
|
||||
_havePerch = file->readNumber();
|
||||
_haveStick = file->readNumber();
|
||||
_flags = file->readNumber();
|
||||
|
||||
CGameObject::load(file);
|
||||
}
|
||||
|
||||
} // End of namespace Titanic
|
||||
54
engines/titanic/game/parrot/parrot_lobby_object.h
Normal file
54
engines/titanic/game/parrot/parrot_lobby_object.h
Normal 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_PARROT_LOBBY_OBJECT_H
|
||||
#define TITANIC_PARROT_LOBBY_OBJECT_H
|
||||
|
||||
#include "titanic/core/game_object.h"
|
||||
|
||||
namespace Titanic {
|
||||
|
||||
class CParrotLobbyObject : public CGameObject {
|
||||
DECLARE_MESSAGE_MAP;
|
||||
public:
|
||||
static bool _haveParrot;
|
||||
static bool _havePerch;
|
||||
static bool _haveStick;
|
||||
static int _flags;
|
||||
|
||||
static void init();
|
||||
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_PARROT_LOBBY_OBJECT_H */
|
||||
50
engines/titanic/game/parrot/parrot_lobby_view_object.cpp
Normal file
50
engines/titanic/game/parrot/parrot_lobby_view_object.cpp
Normal 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/>.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "titanic/game/parrot/parrot_lobby_view_object.h"
|
||||
|
||||
namespace Titanic {
|
||||
|
||||
BEGIN_MESSAGE_MAP(CParrotLobbyViewObject, CParrotLobbyObject)
|
||||
ON_MESSAGE(ActMsg)
|
||||
END_MESSAGE_MAP()
|
||||
|
||||
void CParrotLobbyViewObject::save(SimpleFile *file, int indent) {
|
||||
file->writeNumberLine(1, indent);
|
||||
file->writeNumberLine(_flag, indent);
|
||||
CParrotLobbyObject::save(file, indent);
|
||||
}
|
||||
|
||||
void CParrotLobbyViewObject::load(SimpleFile *file) {
|
||||
file->readNumber();
|
||||
_flag = file->readNumber();
|
||||
CParrotLobbyObject::load(file);
|
||||
}
|
||||
|
||||
bool CParrotLobbyViewObject::ActMsg(CActMsg *msg) {
|
||||
if (msg->_action != "Refresh")
|
||||
return false;
|
||||
|
||||
setVisible(_flag ? _haveParrot : _haveStick);
|
||||
return true;
|
||||
}
|
||||
|
||||
} // End of namespace Titanic
|
||||
51
engines/titanic/game/parrot/parrot_lobby_view_object.h
Normal file
51
engines/titanic/game/parrot/parrot_lobby_view_object.h
Normal file
@@ -0,0 +1,51 @@
|
||||
/* ScummVM - Graphic Adventure Engine
|
||||
*
|
||||
* ScummVM is the legal property of its developers, whose names
|
||||
* are too numerous to list here. Please refer to the COPYRIGHT
|
||||
* file distributed with this source distribution.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef TITANIC_PARROT_LOBBY_VIEW_OBJECT_H
|
||||
#define TITANIC_PARROT_LOBBY_VIEW_OBJECT_H
|
||||
|
||||
#include "titanic/game/parrot/parrot_lobby_object.h"
|
||||
|
||||
namespace Titanic {
|
||||
|
||||
class CParrotLobbyViewObject : public CParrotLobbyObject {
|
||||
DECLARE_MESSAGE_MAP;
|
||||
bool ActMsg(CActMsg *msg);
|
||||
public:
|
||||
bool _flag;
|
||||
public:
|
||||
CLASSDEF;
|
||||
CParrotLobbyViewObject() : CParrotLobbyObject(), _flag(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_PARROT_LOBBY_VIEW_OBJECT_H */
|
||||
46
engines/titanic/game/parrot/parrot_loser.cpp
Normal file
46
engines/titanic/game/parrot/parrot_loser.cpp
Normal 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/game/parrot/parrot_loser.h"
|
||||
|
||||
namespace Titanic {
|
||||
|
||||
BEGIN_MESSAGE_MAP(CParrotLoser, CGameObject)
|
||||
ON_MESSAGE(LeaveRoomMsg)
|
||||
END_MESSAGE_MAP()
|
||||
|
||||
void CParrotLoser::save(SimpleFile *file, int indent) {
|
||||
file->writeNumberLine(1, indent);
|
||||
CGameObject::save(file, indent);
|
||||
}
|
||||
|
||||
void CParrotLoser::load(SimpleFile *file) {
|
||||
file->readNumber();
|
||||
CGameObject::load(file);
|
||||
}
|
||||
|
||||
bool CParrotLoser::LeaveRoomMsg(CLeaveRoomMsg *msg) {
|
||||
CActMsg actMsg("FreeParrot");
|
||||
actMsg.execute("CarryParrot");
|
||||
return true;
|
||||
}
|
||||
|
||||
} // End of namespace Titanic
|
||||
48
engines/titanic/game/parrot/parrot_loser.h
Normal file
48
engines/titanic/game/parrot/parrot_loser.h
Normal 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_PARROT_LOSER_H
|
||||
#define TITANIC_PARROT_LOSER_H
|
||||
|
||||
#include "titanic/core/game_object.h"
|
||||
|
||||
namespace Titanic {
|
||||
|
||||
class CParrotLoser : public CGameObject {
|
||||
DECLARE_MESSAGE_MAP;
|
||||
bool LeaveRoomMsg(CLeaveRoomMsg *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_PARROT_LOSER_H */
|
||||
115
engines/titanic/game/parrot/parrot_nut_bowl_actor.cpp
Normal file
115
engines/titanic/game/parrot/parrot_nut_bowl_actor.cpp
Normal file
@@ -0,0 +1,115 @@
|
||||
/* ScummVM - Graphic Adventure Engine
|
||||
*
|
||||
* ScummVM is the legal property of its developers, whose names
|
||||
* are too numerous to list here. Please refer to the COPYRIGHT
|
||||
* file distributed with this source distribution.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "titanic/game/parrot/parrot_nut_bowl_actor.h"
|
||||
#include "titanic/core/room_item.h"
|
||||
#include "titanic/translation.h"
|
||||
|
||||
namespace Titanic {
|
||||
|
||||
BEGIN_MESSAGE_MAP(CParrotNutBowlActor, CGameObject)
|
||||
ON_MESSAGE(MouseButtonUpMsg)
|
||||
ON_MESSAGE(BowlStateChangeMsg)
|
||||
ON_MESSAGE(IsEarBowlPuzzleDone)
|
||||
ON_MESSAGE(MouseButtonDownMsg)
|
||||
ON_MESSAGE(ReplaceBowlAndNutsMsg)
|
||||
ON_MESSAGE(LeaveViewMsg)
|
||||
ON_MESSAGE(NutPuzzleMsg)
|
||||
END_MESSAGE_MAP()
|
||||
|
||||
CParrotNutBowlActor::CParrotNutBowlActor() : CGameObject(),
|
||||
_puzzleDone(false), _state(0) {
|
||||
}
|
||||
|
||||
void CParrotNutBowlActor::save(SimpleFile *file, int indent) {
|
||||
file->writeNumberLine(1, indent);
|
||||
file->writeNumberLine(_puzzleDone, indent);
|
||||
file->writeNumberLine(_state, indent);
|
||||
|
||||
CGameObject::save(file, indent);
|
||||
}
|
||||
|
||||
void CParrotNutBowlActor::load(SimpleFile *file) {
|
||||
file->readNumber();
|
||||
_puzzleDone = file->readNumber();
|
||||
_state = file->readNumber();
|
||||
|
||||
CGameObject::load(file);
|
||||
}
|
||||
|
||||
bool CParrotNutBowlActor::MouseButtonUpMsg(CMouseButtonUpMsg *msg) {
|
||||
if (!_state) {
|
||||
CActMsg actMsg("Jiggle");
|
||||
actMsg.execute("BowlNutsRustler");
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool CParrotNutBowlActor::BowlStateChangeMsg(CBowlStateChangeMsg *msg) {
|
||||
_state = msg->_state;
|
||||
if (msg->_state == 3) {
|
||||
if (!_puzzleDone) {
|
||||
CReplaceBowlAndNutsMsg replaceMsg;
|
||||
replaceMsg.execute(findRoom(), nullptr, MSGFLAG_SCAN);
|
||||
playSound(TRANSLATE("z#47.wav", "z#578.wav"));
|
||||
}
|
||||
|
||||
_puzzleDone = true;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool CParrotNutBowlActor::IsEarBowlPuzzleDone(CIsEarBowlPuzzleDone *msg) {
|
||||
msg->_value = _puzzleDone;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool CParrotNutBowlActor::MouseButtonDownMsg(CMouseButtonDownMsg *msg) {
|
||||
return true;
|
||||
}
|
||||
|
||||
bool CParrotNutBowlActor::ReplaceBowlAndNutsMsg(CReplaceBowlAndNutsMsg *msg) {
|
||||
if (!_puzzleDone)
|
||||
_state = 0;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool CParrotNutBowlActor::LeaveViewMsg(CLeaveViewMsg *msg) {
|
||||
if (!_puzzleDone && _state) {
|
||||
CReplaceBowlAndNutsMsg replaceMsg;
|
||||
replaceMsg.execute(findRoom(), nullptr, MSGFLAG_SCAN);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool CParrotNutBowlActor::NutPuzzleMsg(CNutPuzzleMsg *msg) {
|
||||
if (msg->_action == "NutsGone")
|
||||
_state = 1;
|
||||
else if (msg->_action == "BowlUnlocked")
|
||||
_state = 2;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
} // End of namespace Titanic
|
||||
58
engines/titanic/game/parrot/parrot_nut_bowl_actor.h
Normal file
58
engines/titanic/game/parrot/parrot_nut_bowl_actor.h
Normal file
@@ -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 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_PARROT_NUT_BOWL_ACTOR_H
|
||||
#define TITANIC_PARROT_NUT_BOWL_ACTOR_H
|
||||
|
||||
#include "titanic/core/game_object.h"
|
||||
|
||||
namespace Titanic {
|
||||
|
||||
class CParrotNutBowlActor : public CGameObject {
|
||||
DECLARE_MESSAGE_MAP;
|
||||
bool MouseButtonUpMsg(CMouseButtonUpMsg *msg);
|
||||
bool BowlStateChangeMsg(CBowlStateChangeMsg *msg);
|
||||
bool IsEarBowlPuzzleDone(CIsEarBowlPuzzleDone *msg);
|
||||
bool MouseButtonDownMsg(CMouseButtonDownMsg *msg);
|
||||
bool ReplaceBowlAndNutsMsg(CReplaceBowlAndNutsMsg *msg);
|
||||
bool LeaveViewMsg(CLeaveViewMsg *msg);
|
||||
bool NutPuzzleMsg(CNutPuzzleMsg *msg);
|
||||
public:
|
||||
bool _puzzleDone;
|
||||
int _state;
|
||||
public:
|
||||
CLASSDEF;
|
||||
CParrotNutBowlActor();
|
||||
|
||||
/**
|
||||
* 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_PARROT_NUT_BOWL_ACTOR_H */
|
||||
100
engines/titanic/game/parrot/parrot_nut_eater.cpp
Normal file
100
engines/titanic/game/parrot/parrot_nut_eater.cpp
Normal file
@@ -0,0 +1,100 @@
|
||||
/* ScummVM - Graphic Adventure Engine
|
||||
*
|
||||
* ScummVM is the legal property of its developers, whose names
|
||||
* are too numerous to list here. Please refer to the COPYRIGHT
|
||||
* file distributed with this source distribution.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "titanic/game/parrot/parrot_nut_eater.h"
|
||||
#include "titanic/core/room_item.h"
|
||||
#include "titanic/translation.h"
|
||||
|
||||
namespace Titanic {
|
||||
|
||||
BEGIN_MESSAGE_MAP(CParrotNutEater, CGameObject)
|
||||
ON_MESSAGE(MovieEndMsg)
|
||||
ON_MESSAGE(ReplaceBowlAndNutsMsg)
|
||||
ON_MESSAGE(NutPuzzleMsg)
|
||||
ON_MESSAGE(MovieFrameMsg)
|
||||
END_MESSAGE_MAP()
|
||||
|
||||
CParrotNutEater::CParrotNutEater() : CGameObject(), _fieldBC(0),
|
||||
_fieldC0(69), _fieldC4(132), _fieldC8(0), _fieldCC(68) {
|
||||
}
|
||||
|
||||
void CParrotNutEater::save(SimpleFile *file, int indent) {
|
||||
file->writeNumberLine(1, indent);
|
||||
file->writeNumberLine(_fieldBC, indent);
|
||||
|
||||
CGameObject::save(file, indent);
|
||||
}
|
||||
|
||||
void CParrotNutEater::load(SimpleFile *file) {
|
||||
file->readNumber();
|
||||
_fieldBC = file->readNumber();
|
||||
|
||||
CGameObject::load(file);
|
||||
}
|
||||
|
||||
bool CParrotNutEater::MovieEndMsg(CMovieEndMsg *msg) {
|
||||
setVisible(false);
|
||||
CNutPuzzleMsg nutMsg("NutsGone");
|
||||
nutMsg.execute(getRoom(), nullptr, MSGFLAG_SCAN);
|
||||
|
||||
playSound(TRANSLATE("z#47.wav", "z#578.wav"));
|
||||
return true;
|
||||
}
|
||||
|
||||
bool CParrotNutEater::ReplaceBowlAndNutsMsg(CReplaceBowlAndNutsMsg *msg) {
|
||||
setVisible(false);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool CParrotNutEater::NutPuzzleMsg(CNutPuzzleMsg *msg) {
|
||||
if (msg->_action == "Jiggle") {
|
||||
setVisible(true);
|
||||
playMovie(MOVIE_NOTIFY_OBJECT | MOVIE_WAIT_FOR_FINISH);
|
||||
movieEvent(68);
|
||||
movieEvent(132);
|
||||
playSound(TRANSLATE("z#215.wav", "z#6.wav"));
|
||||
|
||||
CTrueTalkTriggerActionMsg triggerMsg;
|
||||
triggerMsg._param1 = triggerMsg._param2 = 0;
|
||||
triggerMsg.execute("PerchedParrot");
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool CParrotNutEater::MovieFrameMsg(CMovieFrameMsg *msg) {
|
||||
CProximity prox(Audio::Mixer::kSpeechSoundType);
|
||||
|
||||
switch (msg->_frameNumber) {
|
||||
case 68:
|
||||
playSound(TRANSLATE("z#214.wav", "z#5.wav"), prox);
|
||||
break;
|
||||
case 132:
|
||||
playSound(TRANSLATE("z#216.wav", "z#7.wav"), prox);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
} // End of namespace Titanic
|
||||
58
engines/titanic/game/parrot/parrot_nut_eater.h
Normal file
58
engines/titanic/game/parrot/parrot_nut_eater.h
Normal file
@@ -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 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_PARROT_NUT_EATER_H
|
||||
#define TITANIC_PARROT_NUT_EATER_H
|
||||
|
||||
#include "titanic/core/game_object.h"
|
||||
|
||||
namespace Titanic {
|
||||
|
||||
class CParrotNutEater : public CGameObject {
|
||||
DECLARE_MESSAGE_MAP;
|
||||
bool MovieEndMsg(CMovieEndMsg *msg);
|
||||
bool ReplaceBowlAndNutsMsg(CReplaceBowlAndNutsMsg *msg);
|
||||
bool NutPuzzleMsg(CNutPuzzleMsg *msg);
|
||||
bool MovieFrameMsg(CMovieFrameMsg *msg);
|
||||
public:
|
||||
int _fieldBC;
|
||||
int _fieldC0;
|
||||
int _fieldC4;
|
||||
int _fieldC8;
|
||||
int _fieldCC;
|
||||
public:
|
||||
CLASSDEF;
|
||||
CParrotNutEater();
|
||||
|
||||
/**
|
||||
* 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_CREDITS_H */
|
||||
81
engines/titanic/game/parrot/parrot_perch_holder.cpp
Normal file
81
engines/titanic/game/parrot/parrot_perch_holder.cpp
Normal file
@@ -0,0 +1,81 @@
|
||||
/* ScummVM - Graphic Adventure Engine
|
||||
*
|
||||
* ScummVM is the legal property of its developers, whose names
|
||||
* are too numerous to list here. Please refer to the COPYRIGHT
|
||||
* file distributed with this source distribution.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "titanic/game/parrot/parrot_perch_holder.h"
|
||||
#include "titanic/game/cage.h"
|
||||
#include "titanic/core/project_item.h"
|
||||
#include "titanic/npcs/parrot.h"
|
||||
|
||||
namespace Titanic {
|
||||
|
||||
BEGIN_MESSAGE_MAP(CParrotPerchHolder, CMultiDropTarget)
|
||||
ON_MESSAGE(MouseButtonDownMsg)
|
||||
ON_MESSAGE(StatusChangeMsg)
|
||||
ON_MESSAGE(DropObjectMsg)
|
||||
ON_MESSAGE(ActMsg)
|
||||
END_MESSAGE_MAP()
|
||||
|
||||
void CParrotPerchHolder::save(SimpleFile *file, int indent) {
|
||||
file->writeNumberLine(1, indent);
|
||||
CMultiDropTarget::save(file, indent);
|
||||
}
|
||||
|
||||
void CParrotPerchHolder::load(SimpleFile *file) {
|
||||
file->readNumber();
|
||||
CMultiDropTarget::load(file);
|
||||
}
|
||||
|
||||
bool CParrotPerchHolder::MouseButtonDownMsg(CMouseButtonDownMsg *msg) {
|
||||
if (!CParrot::_eatingChicken) {
|
||||
if (CCage::_open) {
|
||||
petDisplayMessage(CANNOT_TAKE_CAGE_LOCKED);
|
||||
} else if (CParrot::_state == PARROT_IN_CAGE) {
|
||||
CTrueTalkTriggerActionMsg triggerMsg(280252, 0, 0);
|
||||
triggerMsg.execute(getRoot(), CParrot::_type,
|
||||
MSGFLAG_CLASS_DEF | MSGFLAG_BREAK_IF_HANDLED | MSGFLAG_SCAN);
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool CParrotPerchHolder::StatusChangeMsg(CStatusChangeMsg *msg) {
|
||||
_dropEnabled = msg->_newStatus;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool CParrotPerchHolder::DropObjectMsg(CDropObjectMsg *msg) {
|
||||
if (CCage::_open)
|
||||
return false;
|
||||
else
|
||||
return CMultiDropTarget::DropObjectMsg(msg);
|
||||
}
|
||||
|
||||
bool CParrotPerchHolder::ActMsg(CActMsg *msg) {
|
||||
if (msg->_action == "FlashCore") {
|
||||
playMovie(2, 2, 0);
|
||||
playMovie(1, 1, 0);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
} // End of namespace Titanic
|
||||
51
engines/titanic/game/parrot/parrot_perch_holder.h
Normal file
51
engines/titanic/game/parrot/parrot_perch_holder.h
Normal file
@@ -0,0 +1,51 @@
|
||||
/* ScummVM - Graphic Adventure Engine
|
||||
*
|
||||
* ScummVM is the legal property of its developers, whose names
|
||||
* are too numerous to list here. Please refer to the COPYRIGHT
|
||||
* file distributed with this source distribution.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef TITANIC_PARROT_PERCH_HOLDER_H
|
||||
#define TITANIC_PARROT_PERCH_HOLDER_H
|
||||
|
||||
#include "titanic/core/multi_drop_target.h"
|
||||
|
||||
namespace Titanic {
|
||||
|
||||
class CParrotPerchHolder : public CMultiDropTarget {
|
||||
DECLARE_MESSAGE_MAP;
|
||||
bool MouseButtonDownMsg(CMouseButtonDownMsg *msg);
|
||||
bool StatusChangeMsg(CStatusChangeMsg *msg);
|
||||
bool DropObjectMsg(CDropObjectMsg *msg);
|
||||
bool ActMsg(CActMsg *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_PARROT_PERCH_HOLDER_H */
|
||||
51
engines/titanic/game/parrot/parrot_trigger.cpp
Normal file
51
engines/titanic/game/parrot/parrot_trigger.cpp
Normal file
@@ -0,0 +1,51 @@
|
||||
/* ScummVM - Graphic Adventure Engine
|
||||
*
|
||||
* ScummVM is the legal property of its developers, whose names
|
||||
* are too numerous to list here. Please refer to the COPYRIGHT
|
||||
* file distributed with this source distribution.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "titanic/game/parrot/parrot_trigger.h"
|
||||
#include "titanic/npcs/parrot.h"
|
||||
#include "titanic/core/project_item.h"
|
||||
|
||||
namespace Titanic {
|
||||
|
||||
BEGIN_MESSAGE_MAP(CParrotTrigger, CGameObject)
|
||||
ON_MESSAGE(MouseButtonDownMsg)
|
||||
END_MESSAGE_MAP()
|
||||
|
||||
void CParrotTrigger::save(SimpleFile *file, int indent) {
|
||||
file->writeNumberLine(1, indent);
|
||||
file->writeNumberLine(_value, indent);
|
||||
CGameObject::save(file, indent);
|
||||
}
|
||||
|
||||
void CParrotTrigger::load(SimpleFile *file) {
|
||||
file->readNumber();
|
||||
_value = file->readNumber();
|
||||
CGameObject::load(file);
|
||||
}
|
||||
|
||||
bool CParrotTrigger::MouseButtonDownMsg(CMouseButtonDownMsg *msg) {
|
||||
CTrueTalkTriggerActionMsg triggerMsg(_value, 0, 0);
|
||||
triggerMsg.execute(getRoot(), CParrot::_type,
|
||||
MSGFLAG_CLASS_DEF | MSGFLAG_BREAK_IF_HANDLED | MSGFLAG_SCAN);
|
||||
return true;
|
||||
}
|
||||
|
||||
} // End of namespace Titanic
|
||||
51
engines/titanic/game/parrot/parrot_trigger.h
Normal file
51
engines/titanic/game/parrot/parrot_trigger.h
Normal file
@@ -0,0 +1,51 @@
|
||||
/* ScummVM - Graphic Adventure Engine
|
||||
*
|
||||
* ScummVM is the legal property of its developers, whose names
|
||||
* are too numerous to list here. Please refer to the COPYRIGHT
|
||||
* file distributed with this source distribution.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef TITANIC_PARROT_TRIGGER_H
|
||||
#define TITANIC_PARROT_TRIGGER_H
|
||||
|
||||
#include "titanic/core/game_object.h"
|
||||
|
||||
namespace Titanic {
|
||||
|
||||
class CParrotTrigger : public CGameObject {
|
||||
DECLARE_MESSAGE_MAP;
|
||||
bool MouseButtonDownMsg(CMouseButtonDownMsg *msg);
|
||||
public:
|
||||
int _value;
|
||||
public:
|
||||
CLASSDEF;
|
||||
CParrotTrigger() : CGameObject(), _value(0x446AB) {}
|
||||
|
||||
/**
|
||||
* 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_PARROT_TRIGGER_H */
|
||||
45
engines/titanic/game/parrot/player_meets_parrot.cpp
Normal file
45
engines/titanic/game/parrot/player_meets_parrot.cpp
Normal file
@@ -0,0 +1,45 @@
|
||||
/* ScummVM - Graphic Adventure Engine
|
||||
*
|
||||
* ScummVM is the legal property of its developers, whose names
|
||||
* are too numerous to list here. Please refer to the COPYRIGHT
|
||||
* file distributed with this source distribution.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "titanic/game/parrot/player_meets_parrot.h"
|
||||
|
||||
namespace Titanic {
|
||||
|
||||
BEGIN_MESSAGE_MAP(CPlayerMeetsParrot, CGameObject)
|
||||
ON_MESSAGE(EnterRoomMsg)
|
||||
END_MESSAGE_MAP()
|
||||
|
||||
void CPlayerMeetsParrot::save(SimpleFile *file, int indent) {
|
||||
file->writeNumberLine(1, indent);
|
||||
CGameObject::save(file, indent);
|
||||
}
|
||||
|
||||
void CPlayerMeetsParrot::load(SimpleFile *file) {
|
||||
file->readNumber();
|
||||
CGameObject::load(file);
|
||||
}
|
||||
|
||||
bool CPlayerMeetsParrot::EnterRoomMsg(CEnterRoomMsg *msg) {
|
||||
stateSetParrotMet();
|
||||
return true;
|
||||
}
|
||||
|
||||
} // End of namespace Titanic
|
||||
50
engines/titanic/game/parrot/player_meets_parrot.h
Normal file
50
engines/titanic/game/parrot/player_meets_parrot.h
Normal 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_PLAYER_MEETS_PARROT_H
|
||||
#define TITANIC_PLAYER_MEETS_PARROT_H
|
||||
|
||||
#include "titanic/core/game_object.h"
|
||||
#include "titanic/messages/messages.h"
|
||||
|
||||
namespace Titanic {
|
||||
|
||||
class CPlayerMeetsParrot : public CGameObject {
|
||||
DECLARE_MESSAGE_MAP;
|
||||
protected:
|
||||
bool EnterRoomMsg(CEnterRoomMsg *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_PLAYER_MEETS_PARROT_H */
|
||||
Reference in New Issue
Block a user