diff options
author | Paul Gilbert | 2016-04-14 20:21:40 -0400 |
---|---|---|
committer | Paul Gilbert | 2016-07-10 16:11:08 -0400 |
commit | 7ddd5d1a8b97bda75e4eece9c91ff3286e3c3eca (patch) | |
tree | f226626c6989fec1db1dc2f32f21436b2b853e26 /engines/titanic | |
parent | f77a8a63cde7b40dd6fb4dfc23f11cc654c7e9a5 (diff) | |
download | scummvm-rg350-7ddd5d1a8b97bda75e4eece9c91ff3286e3c3eca.tar.gz scummvm-rg350-7ddd5d1a8b97bda75e4eece9c91ff3286e3c3eca.tar.bz2 scummvm-rg350-7ddd5d1a8b97bda75e4eece9c91ff3286e3c3eca.zip |
TITANIC: Finished CArm msg handlers, stubs for adding to inventory
Diffstat (limited to 'engines/titanic')
-rw-r--r-- | engines/titanic/carry/arm.cpp | 20 | ||||
-rw-r--r-- | engines/titanic/carry/carry.cpp | 7 | ||||
-rw-r--r-- | engines/titanic/carry/carry.h | 5 | ||||
-rw-r--r-- | engines/titanic/pet_control/pet_control.cpp | 4 | ||||
-rw-r--r-- | engines/titanic/pet_control/pet_control.h | 5 | ||||
-rw-r--r-- | engines/titanic/pet_control/pet_inventory.cpp | 4 | ||||
-rw-r--r-- | engines/titanic/pet_control/pet_inventory.h | 5 |
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 |