aboutsummaryrefslogtreecommitdiff
path: root/engines/titanic/game/chicken_cooler.cpp
diff options
context:
space:
mode:
authorPaul Gilbert2016-08-18 22:45:58 -0400
committerPaul Gilbert2016-08-18 22:45:58 -0400
commitdc91d30b76ded7ed7a648a0b0b43d8fe99c00cf6 (patch)
tree12e445180f88ffdd5f9ad0a200f1b9c39faa6180 /engines/titanic/game/chicken_cooler.cpp
parentdf5f78037cc33fb63bdb5233a8ed378db77d9832 (diff)
downloadscummvm-rg350-dc91d30b76ded7ed7a648a0b0b43d8fe99c00cf6.tar.gz
scummvm-rg350-dc91d30b76ded7ed7a648a0b0b43d8fe99c00cf6.tar.bz2
scummvm-rg350-dc91d30b76ded7ed7a648a0b0b43d8fe99c00cf6.zip
TITANIC: Implementing game classes
Diffstat (limited to 'engines/titanic/game/chicken_cooler.cpp')
-rw-r--r--engines/titanic/game/chicken_cooler.cpp33
1 files changed, 32 insertions, 1 deletions
diff --git a/engines/titanic/game/chicken_cooler.cpp b/engines/titanic/game/chicken_cooler.cpp
index 29232e10bf..d10405de38 100644
--- a/engines/titanic/game/chicken_cooler.cpp
+++ b/engines/titanic/game/chicken_cooler.cpp
@@ -21,9 +21,15 @@
*/
#include "titanic/game/chicken_cooler.h"
+#include "titanic/carry/chicken.h"
namespace Titanic {
+BEGIN_MESSAGE_MAP(CChickenCooler, CGameObject)
+ ON_MESSAGE(EnterRoomMsg)
+ ON_MESSAGE(EnterViewMsg)
+END_MESSAGE_MAP()
+
void CChickenCooler::save(SimpleFile *file, int indent) {
file->writeNumberLine(1, indent);
file->writeNumberLine(_fieldBC, indent);
@@ -41,7 +47,32 @@ void CChickenCooler::load(SimpleFile *file) {
}
bool CChickenCooler::EnterRoomMsg(CEnterRoomMsg *msg) {
- warning("CChickenCoolor::handlEvent");
+ if (_fieldC0) {
+ CGameObject *obj = getMailManFirstObject();
+ if (obj) {
+ // WORKAROUND: Redundant loop for chicken in originalhere
+ } else {
+ getNextMail(nullptr);
+ if (CChicken::_v1 > _fieldBC)
+ CChicken::_v1 = _fieldBC;
+ }
+ }
+
+ return true;
+}
+
+bool CChickenCooler::EnterViewMsg(CEnterViewMsg *msg) {
+ if (!_fieldC0) {
+ for (CGameObject *obj = getMailManFirstObject(); obj;
+ obj = getNextMail(obj)) {
+ if (obj->isEquals("Chicken"))
+ return true;
+ }
+
+ if (CChicken::_v1 > _fieldBC)
+ CChicken::_v1 = _fieldBC;
+ }
+
return true;
}