aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Gilbert2017-07-05 18:23:23 -0400
committerPaul Gilbert2017-07-05 18:23:23 -0400
commit7ed7e022f1ef4cabb35cd38f8c04a1bb9bd6461f (patch)
tree1916bb54da9acca8519f3b286550355096584c0d
parent6f46b174df5f861220b935e16ce998b66062e4ca (diff)
downloadscummvm-rg350-7ed7e022f1ef4cabb35cd38f8c04a1bb9bd6461f.tar.gz
scummvm-rg350-7ed7e022f1ef4cabb35cd38f8c04a1bb9bd6461f.tar.bz2
scummvm-rg350-7ed7e022f1ef4cabb35cd38f8c04a1bb9bd6461f.zip
TITANIC: Fix parrot to only eat hot plain chickens
-rw-r--r--engines/titanic/carry/chicken.cpp8
-rw-r--r--engines/titanic/messages/messages.h2
-rw-r--r--engines/titanic/npcs/parrot.cpp26
-rw-r--r--engines/titanic/npcs/parrot.h2
4 files changed, 19 insertions, 19 deletions
diff --git a/engines/titanic/carry/chicken.cpp b/engines/titanic/carry/chicken.cpp
index 851b7b81e7..91d4c95fed 100644
--- a/engines/titanic/carry/chicken.cpp
+++ b/engines/titanic/carry/chicken.cpp
@@ -188,14 +188,14 @@ bool CChicken::PETGainedObjectMsg(CPETGainedObjectMsg *msg) {
bool CChicken::ParrotTriesChickenMsg(CParrotTriesChickenMsg *msg) {
if (_temperature > 0)
- msg->_value1 = 1;
+ msg->_isHot = true;
if (_condiment == "Tomato") {
- msg->_value2 = 1;
+ msg->_condiment = 1;
} else if (_condiment == "Mustard") {
- msg->_value2 = 2;
+ msg->_condiment = 2;
} else if (_condiment == "Bird") {
- msg->_value2 = 3;
+ msg->_condiment = 3;
}
return true;
diff --git a/engines/titanic/messages/messages.h b/engines/titanic/messages/messages.h
index 0b1da593e8..dfedfdb549 100644
--- a/engines/titanic/messages/messages.h
+++ b/engines/titanic/messages/messages.h
@@ -301,7 +301,7 @@ MESSAGE1(COnSummonBotMsg, int, value, 0);
MESSAGE0(COpeningCreditsMsg);
MESSAGE1(CPanningAwayFromParrotMsg, CMovePlayerTo *, target, nullptr);
MESSAGE2(CParrotSpeakMsg, CString, target, "", CString, action, "");
-MESSAGE2(CParrotTriesChickenMsg, int, value1, 0, int, value2, 0);
+MESSAGE2(CParrotTriesChickenMsg, bool, isHot, false, int, condiment, 0);
MESSAGE1(CPhonographPlayMsg, int, value, 0);
MESSAGE0(CPhonographReadyToPlayMsg);
MESSAGE1(CPhonographRecordMsg, bool, canRecord, false);
diff --git a/engines/titanic/npcs/parrot.cpp b/engines/titanic/npcs/parrot.cpp
index b46a9bce85..c8f833b3ec 100644
--- a/engines/titanic/npcs/parrot.cpp
+++ b/engines/titanic/npcs/parrot.cpp
@@ -60,7 +60,7 @@ CParrot::CParrot() : CTrueTalkNPC() {
_lastSpeakTime = 0;
_newXp = 73;
_newXc = 58;
- _canEatChicken = false;
+ _triedEatChicken = false;
_eatOffsetX = 0;
_panTarget = nullptr;
@@ -84,7 +84,7 @@ void CParrot::save(SimpleFile *file, int indent) {
file->writeNumberLine(_lastSpeakTime, indent);
file->writeNumberLine(_newXp, indent);
file->writeNumberLine(_newXc, indent);
- file->writeNumberLine(_canEatChicken, indent);
+ file->writeNumberLine(_triedEatChicken, indent);
file->writeNumberLine(_eatOffsetX, indent);
file->writeNumberLine(_state, indent);
file->writeNumberLine(_coreReplaced, indent);
@@ -108,7 +108,7 @@ void CParrot::load(SimpleFile *file) {
_lastSpeakTime = file->readNumber();
_newXp = file->readNumber();
_newXc = file->readNumber();
- _canEatChicken = file->readNumber();
+ _triedEatChicken = file->readNumber();
_eatOffsetX = file->readNumber();
_state = (ParrotState)file->readNumber();
_coreReplaced = file->readNumber();
@@ -133,7 +133,7 @@ bool CParrot::ActMsg(CActMsg *msg) {
if (_state == PARROT_IN_CAGE) {
stopMovie();
startTalking(this, 280275, findView());
- _canEatChicken = false;
+ _triedEatChicken = false;
}
} else if (msg->_action == "EnteringFromTOW" &&
(_state == PARROT_IN_CAGE || _state == PARROT_ESCAPED)) {
@@ -325,7 +325,7 @@ bool CParrot::EnterViewMsg(CEnterViewMsg *msg) {
}
petSetArea(PET_CONVERSATION);
- _canEatChicken = false;
+ _triedEatChicken = false;
_npcFlags |= NPCFLAG_START_IDLING;
}
@@ -590,28 +590,28 @@ bool CParrot::FrameMsg(CFrameMsg *msg) {
_npcFlags |= NPCFLAG_MOVE_LEFT;
playClip("Walk Left Intro", MOVIE_NOTIFY_OBJECT);
}
- } else if (chickenFlag && pt.y >= 90 && pt.y <= 280 && !_canEatChicken) {
+ } else if (chickenFlag && pt.y >= 90 && pt.y <= 280 && !_triedEatChicken) {
CParrotTriesChickenMsg triesMsg;
triesMsg.execute(dragObject);
CTrueTalkTriggerActionMsg triggerMsg;
int &action = triggerMsg._action;
- switch (triesMsg._value2) {
+ switch (triesMsg._condiment) {
case 1:
- action = 280056 + (triesMsg._value1 ? 234 : 0);
+ action = 280056 + (triesMsg._isHot ? 234 : 0);
break;
case 2:
- action = 280055 + (triesMsg._value1 ? 234 : 0);
+ action = 280055 + (triesMsg._isHot ? 234 : 0);
break;
case 3:
- action = 280054 + (triesMsg._value1 ? 234 : 0);
+ action = 280054 + (triesMsg._isHot ? 234 : 0);
break;
default:
- action = 280053 + (triesMsg._value1 ? 234 : 0);
+ action = 280053 + (triesMsg._isHot ? 213 : 0);
break;
}
- if (action != 280266) {
+ if (action == 280266) {
if (pt.x < 75) {
// Parrot needs to reach outside the cage
_npcFlags |= NPCFLAG_CHICKEN_OUTSIDE_CAGE;
@@ -637,7 +637,7 @@ bool CParrot::FrameMsg(CFrameMsg *msg) {
if (chickenFlag) {
triggerMsg._param2 = 1;
triggerMsg.execute(this);
- _canEatChicken = true;
+ _triedEatChicken = true;
}
}
diff --git a/engines/titanic/npcs/parrot.h b/engines/titanic/npcs/parrot.h
index d3558dfa3e..c3ba5a5fd6 100644
--- a/engines/titanic/npcs/parrot.h
+++ b/engines/titanic/npcs/parrot.h
@@ -66,7 +66,7 @@ private:
uint _lastSpeakTime;
int _newXp;
int _newXc;
- bool _canEatChicken;
+ bool _triedEatChicken;
int _eatOffsetX;
CMovePlayerTo *_panTarget;
public: