aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engines/titanic/carry/arm.cpp20
-rw-r--r--engines/titanic/carry/carry.cpp7
-rw-r--r--engines/titanic/carry/carry.h5
-rw-r--r--engines/titanic/pet_control/pet_control.cpp4
-rw-r--r--engines/titanic/pet_control/pet_control.h5
-rw-r--r--engines/titanic/pet_control/pet_inventory.cpp4
-rw-r--r--engines/titanic/pet_control/pet_inventory.h5
7 files changed, 48 insertions, 2 deletions
diff --git a/engines/titanic/carry/arm.cpp b/engines/titanic/carry/arm.cpp
index 0098c6f4c6..b6e125aa10 100644
--- a/engines/titanic/carry/arm.cpp
+++ b/engines/titanic/carry/arm.cpp
@@ -158,8 +158,26 @@ bool CArm::MouseDragStartMsg(CMouseDragStartMsg *msg) {
}
bool CArm::MaitreDHappyMsg(CMaitreDHappyMsg *msg) {
+ CGameObject *petItem;
+ if (find(getName(), &petItem, FIND_PET)) {
+ if (!_field158)
+ playSound("z#47.wav", 100, 0, 0);
+ if (_string6 == "Key" || _string6 == "AuditoryCentre") {
+ CGameObject *child = static_cast<CGameObject *>(getFirstChild());
+ if (child) {
+ child->setVisible(true);
+ dropOnPet();
+ }
- // TODO
+ _visibleFrame = _field170;
+ loadFrame(_visibleFrame);
+ _string6 = "None";
+ addToInventory();
+ }
+ }
+
+ _field158 = 1;
+ _fieldE0 = 1;
return true;
}
diff --git a/engines/titanic/carry/carry.cpp b/engines/titanic/carry/carry.cpp
index 9968c523ee..1bb81fb4cb 100644
--- a/engines/titanic/carry/carry.cpp
+++ b/engines/titanic/carry/carry.cpp
@@ -24,6 +24,7 @@
#include "titanic/messages/messages.h"
#include "titanic/npcs/character.h"
#include "titanic/npcs/succubus.h"
+#include "titanic/pet_control/pet_control.h"
namespace Titanic {
@@ -241,4 +242,10 @@ void CCarry::dropOnPet() {
warning("TODO: dropOnPet");
}
+void CCarry::addToInventory() {
+ CPetControl *pet = getPetControl();
+ if (pet)
+ pet->addToInventory(this);
+}
+
} // End of namespace Titanic
diff --git a/engines/titanic/carry/carry.h b/engines/titanic/carry/carry.h
index b14ba05934..9fd7679463 100644
--- a/engines/titanic/carry/carry.h
+++ b/engines/titanic/carry/carry.h
@@ -62,7 +62,10 @@ protected:
bool _enterFrameSet;
int _visibleFrame;
protected:
-
+ /**
+ * Add the item to the PET inventory
+ */
+ void addToInventory();
public:
CLASSDEF
CCarry();
diff --git a/engines/titanic/pet_control/pet_control.cpp b/engines/titanic/pet_control/pet_control.cpp
index c7dc8d2c21..2f119be5d3 100644
--- a/engines/titanic/pet_control/pet_control.cpp
+++ b/engines/titanic/pet_control/pet_control.cpp
@@ -365,4 +365,8 @@ CGameObject *CPetControl::getNextObject(CGameObject *prior) const {
return static_cast<CGameObject *>(prior->getNextSibling());
}
+void CPetControl::addToInventory(CCarry *item) {
+ _inventory.addItem(item);
+}
+
} // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_control.h b/engines/titanic/pet_control/pet_control.h
index c22f555c31..73dc69b0ab 100644
--- a/engines/titanic/pet_control/pet_control.h
+++ b/engines/titanic/pet_control/pet_control.h
@@ -212,6 +212,11 @@ public:
* the passed game object
*/
CGameObject *getNextObject(CGameObject *prior) const;
+
+ /**
+ * Adds an item to the PET inventory
+ */
+ void addToInventory(CCarry *item);
};
} // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_inventory.cpp b/engines/titanic/pet_control/pet_inventory.cpp
index 1104b653b6..a073a376de 100644
--- a/engines/titanic/pet_control/pet_inventory.cpp
+++ b/engines/titanic/pet_control/pet_inventory.cpp
@@ -102,4 +102,8 @@ bool CPetInventory::setPetControl(CPetControl *petControl) {
return true;
}
+void CPetInventory::addItem(CCarry *item) {
+ warning("TODO: CPetInventory::addItem");
+}
+
} // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_inventory.h b/engines/titanic/pet_control/pet_inventory.h
index 16dfd227f1..3700854b8e 100644
--- a/engines/titanic/pet_control/pet_inventory.h
+++ b/engines/titanic/pet_control/pet_inventory.h
@@ -90,6 +90,11 @@ public:
* Returns true if the object is in a valid state
*/
virtual bool isValid(CPetControl *petControl);
+
+ /**
+ * Add an item to the inventory
+ */
+ void addItem(CCarry *item);
};
} // End of namespace Titanic