aboutsummaryrefslogtreecommitdiff
path: root/engines/titanic/game/sauce_dispensor.cpp
diff options
context:
space:
mode:
authorPaul Gilbert2016-08-27 20:44:44 -0400
committerPaul Gilbert2016-08-27 20:44:44 -0400
commit67be58f56204d6662a56f902b0a0f017c176b643 (patch)
tree9a95bf73bdc01556734064ca8afd1c30cbcd51dd /engines/titanic/game/sauce_dispensor.cpp
parent311006c84cd85897cb9c536e948bc6f5d36b3805 (diff)
downloadscummvm-rg350-67be58f56204d6662a56f902b0a0f017c176b643.tar.gz
scummvm-rg350-67be58f56204d6662a56f902b0a0f017c176b643.tar.bz2
scummvm-rg350-67be58f56204d6662a56f902b0a0f017c176b643.zip
TITANIC: Implemented more game classes, fleshed out season handling
Diffstat (limited to 'engines/titanic/game/sauce_dispensor.cpp')
-rw-r--r--engines/titanic/game/sauce_dispensor.cpp112
1 files changed, 112 insertions, 0 deletions
diff --git a/engines/titanic/game/sauce_dispensor.cpp b/engines/titanic/game/sauce_dispensor.cpp
index 8dc818d917..29f0be7ee4 100644
--- a/engines/titanic/game/sauce_dispensor.cpp
+++ b/engines/titanic/game/sauce_dispensor.cpp
@@ -21,9 +21,20 @@
*/
#include "titanic/game/sauce_dispensor.h"
+#include "titanic/carry/chicken.h"
+#include "titanic/carry/glass.h"
namespace Titanic {
+BEGIN_MESSAGE_MAP(CSauceDispensor, CBackground)
+ ON_MESSAGE(Use)
+ ON_MESSAGE(MovieEndMsg)
+ ON_MESSAGE(ActMsg)
+ ON_MESSAGE(LeaveViewMsg)
+ ON_MESSAGE(MouseButtonDownMsg)
+ ON_MESSAGE(StatusChangeMsg)
+END_MESSAGE_MAP()
+
CSauceDispensor::CSauceDispensor() : CBackground(),
_fieldEC(0), _fieldF0(0), _field104(0), _field108(0) {
}
@@ -54,4 +65,105 @@ void CSauceDispensor::load(SimpleFile *file) {
CBackground::load(file);
}
+bool CSauceDispensor::Use(CUse *msg) {
+ CVisibleMsg visibleMsg(true);
+
+ if (msg->_item->isEquals("Chicken")) {
+ CChicken *chicken = static_cast<CChicken *>(msg->_item);
+ _field104 = true;
+ if (_fieldF0) {
+ playSound("b#15.wav", 50);
+
+ if (chicken->_string6 != "None") {
+ petDisplayMessage(1, "This foodstuff is already sufficiently garnished.");
+ msg->execute("Chicken");
+ } else {
+ setVisible(true);
+ if (chicken->_field12C) {
+ playMovie(_pos1.x, _pos1.y, MOVIE_NOTIFY_OBJECT);
+ } else {
+ CActMsg actMsg(_string3);
+ actMsg.execute("Chicken");
+ playMovie(_pos2.x, _pos2.y, MOVIE_NOTIFY_OBJECT);
+ }
+ }
+
+ if (_fieldF0)
+ return true;
+ }
+
+ CMovieEndMsg endMsg(0, 0);
+ endMsg.execute(this);
+ playSound("z#120.wav");
+
+ petDisplayMessage(1, "Sadly, this dispenser is currently empty.");
+ } else if (msg->_item->isEquals("BeerGlass")) {
+ CGlass *glass = static_cast<CGlass *>(msg->_item);
+ _field108 = true;
+
+ if (_field104 || _fieldF0) {
+ petAddToInventory();
+ } else if (glass->_string6 != "None") {
+ visibleMsg.execute("BeerGlass");
+ } else if (_fieldEC) {
+ glass->setPosition(Point(
+ _bounds.left + (_bounds.width() / 2) - (glass->_bounds.width() / 2),
+ 300));
+ setVisible(true);
+
+ CActMsg actMsg(_string3);
+ actMsg.execute("BeerGlass");
+ }
+ }
+
+ return true;
+}
+
+bool CSauceDispensor::MovieEndMsg(CMovieEndMsg *msg) {
+ setVisible(false);
+ _fieldEC = false;
+
+ CActMsg actMsg("GoToPET");
+ if (_field104)
+ actMsg.execute("Chicken");
+ if (_field108)
+ actMsg.execute("BeerGlass");
+
+ _field104 = false;
+ _field108 = false;
+ return true;
+}
+
+bool CSauceDispensor::ActMsg(CActMsg *msg) {
+ if (msg->_action == "StarlingsDead")
+ _fieldF0 = true;
+
+ return true;
+}
+
+bool CSauceDispensor::LeaveViewMsg(CLeaveViewMsg *msg) {
+ setVisible(false);
+ loadFrame(0);
+
+ if (_field108) {
+ CGameObject *glass = findRoomObject("Beerglass");
+ if (glass)
+ glass->petAddToInventory();
+ }
+
+ _field104 = false;
+ _field108 = false;
+ return true;
+}
+
+bool CSauceDispensor::MouseButtonDownMsg(CMouseButtonDownMsg *msg) {
+ petDisplayMessage(1, "Please place food source beneath dispenser for sauce delivery.");
+ return true;
+}
+
+bool CSauceDispensor::StatusChangeMsg(CStatusChangeMsg *msg) {
+ petDisplayMessage(1, "Please place food source beneath dispenser for sauce delivery.");
+ return true;
+}
+
} // End of namespace Titanic