TITANIC: Fix using chicken on dispensors

This commit is contained in:
Paul Gilbert 2017-01-15 11:42:58 -05:00
parent 03765dbf18
commit 3327b9ce8d
8 changed files with 39 additions and 38 deletions

View File

@ -28,6 +28,7 @@
namespace Titanic {
BEGIN_MESSAGE_MAP(CChicken, CCarry)
ON_MESSAGE(UseWithOtherMsg)
ON_MESSAGE(UseWithCharMsg)
ON_MESSAGE(ActMsg)
ON_MESSAGE(VisibleMsg)
@ -41,14 +42,14 @@ END_MESSAGE_MAP()
int CChicken::_v1;
CChicken::CChicken() : CCarry(), _string6("None"),
CChicken::CChicken() : CCarry(), _condiment("None"),
_field12C(1), _field13C(0), _timerId(0) {
}
void CChicken::save(SimpleFile *file, int indent) {
file->writeNumberLine(1, indent);
file->writeNumberLine(_field12C, indent);
file->writeQuotedLine(_string6, indent);
file->writeQuotedLine(_condiment, indent);
file->writeNumberLine(_v1, indent);
file->writeNumberLine(_field13C, indent);
file->writeNumberLine(_timerId, indent);
@ -59,7 +60,7 @@ void CChicken::save(SimpleFile *file, int indent) {
void CChicken::load(SimpleFile *file) {
file->readNumber();
_field12C = file->readNumber();
_string6 = file->readString();
_condiment = file->readString();
_v1 = file->readNumber();
_field13C = file->readNumber();
_timerId = file->readNumber();
@ -69,7 +70,7 @@ void CChicken::load(SimpleFile *file) {
bool CChicken::UseWithOtherMsg(CUseWithOtherMsg *msg) {
if (msg->_other->getName() == "Napkin") {
if (_field12C || _string6 == "None") {
if (_field12C || _condiment == "None") {
CActMsg actMsg("Clean");
actMsg.execute(this);
petAddToInventory();
@ -81,12 +82,12 @@ bool CChicken::UseWithOtherMsg(CUseWithOtherMsg *msg) {
petAddToInventory();
} else {
CSauceDispensor *dispensor = dynamic_cast<CSauceDispensor *>(msg->_other);
if (!dispensor || _string6 == "None") {
return CCarry::UseWithOtherMsg(msg);
} else {
if (dispensor && _condiment == "None") {
setVisible(false);
CUse use(this);
use.execute(msg->_other);
} else {
return CCarry::UseWithOtherMsg(msg);
}
}
@ -112,27 +113,27 @@ bool CChicken::ActMsg(CActMsg *msg) {
setVisible(true);
petAddToInventory();
} else if (msg->_action == "Tomato") {
_string6 = "Tomato";
_condiment = "Tomato";
loadFrame(4);
_visibleFrame = 4;
} else if (msg->_action == "Mustard") {
_string6 = "Mustard";
_condiment = "Mustard";
loadFrame(5);
_visibleFrame = 5;
} else if (msg->_action == "Bird") {
_string6 = "Bird";
_condiment = "Bird";
loadFrame(2);
_visibleFrame = 2;
} else if (msg->_action == "None") {
setVisible(false);
} else if (msg->_action == "Clean") {
_string6 = "None";
_condiment = "None";
loadFrame(3);
_field12C = 0;
_visibleFrame = 3;
}
else if (msg->_action == "Dispense Chicken") {
_string6 = "None";
_condiment = "None";
_field13C = 0;
_field12C = 1;
loadFrame(1);
@ -188,11 +189,11 @@ bool CChicken::ParrotTriesChickenMsg(CParrotTriesChickenMsg *msg) {
if (_v1 > 0)
msg->_value1 = 1;
if (_string6 == "Tomato") {
if (_condiment == "Tomato") {
msg->_value2 = 1;
} else if (_string6 == "Mustard") {
} else if (_condiment == "Mustard") {
msg->_value2 = 2;
} else if (_string6 == "Bird") {
} else if (_condiment == "Bird") {
msg->_value2 = 3;
}

View File

@ -45,7 +45,7 @@ public:
static int _v1;
public:
int _field12C;
CString _string6;
CString _condiment;
int _field13C;
int _timerId;
public:

View File

@ -36,18 +36,18 @@ BEGIN_MESSAGE_MAP(CGlass, CCarry)
ON_MESSAGE(TurnOff)
END_MESSAGE_MAP()
CGlass::CGlass() : CCarry(), _string6("None") {
CGlass::CGlass() : CCarry(), _condiment("None") {
}
void CGlass::save(SimpleFile *file, int indent) {
file->writeNumberLine(1, indent);
file->writeQuotedLine(_string6, indent);
file->writeQuotedLine(_condiment, indent);
CCarry::save(file, indent);
}
void CGlass::load(SimpleFile *file) {
file->readNumber();
_string6 = file->readString();
_condiment = file->readString();
CCarry::load(file);
}
@ -55,25 +55,25 @@ bool CGlass::UseWithOtherMsg(CUseWithOtherMsg *msg) {
CSauceDispensor *dispensor = dynamic_cast<CSauceDispensor *>(msg->_other);
CChicken *chicken = dynamic_cast<CChicken *>(msg->_other);
if (dispensor && _string6 != "None") {
if (dispensor && _condiment == "None") {
CUse useMsg(this);
useMsg.execute(dispensor);
} else if (msg->_other->isEquals("Chicken") && _string6 != "None") {
if (chicken->_string6 != "None") {
} else if (msg->_other->isEquals("Chicken") && _condiment == "None") {
if (chicken->_condiment != "None") {
if (!chicken->_field12C) {
CActMsg actMsg(_string6);
CActMsg actMsg(_condiment);
actMsg.execute("Chicken");
}
_string6 = "None";
_condiment = "None";
loadFrame(0);
_visibleFrame = 0;
}
petAddToInventory();
} else if (msg->_other->isEquals("Napkin") && _string6 != "None") {
} else if (msg->_other->isEquals("Napkin") && _condiment == "None") {
petAddToInventory();
_string6 = "None";
_condiment = "None";
loadFrame(0);
_visibleFrame = 0;
} else {
@ -85,10 +85,10 @@ bool CGlass::UseWithOtherMsg(CUseWithOtherMsg *msg) {
bool CGlass::UseWithCharMsg(CUseWithCharMsg *msg) {
if (msg->_character->isEquals("Barbot") && msg->_character->_visible) {
CActMsg actMsg(_string6);
CActMsg actMsg(_condiment);
setVisible(false);
if (_string6 != "Bird")
if (_condiment != "Bird")
setPosition(_origPos);
actMsg.execute(msg->_character);
@ -104,19 +104,19 @@ bool CGlass::ActMsg(CActMsg *msg) {
setVisible(true);
petAddToInventory();
} else if (msg->_action == "Mustard") {
_string6 = "Mustard";
_condiment = "Mustard";
loadFrame(1);
_visibleFrame = 1;
} else if (msg->_action == "Tomato") {
_string6 = "Tomato";
_condiment = "Tomato";
loadFrame(2);
_visibleFrame = 2;
} else if (msg->_action == "Bird") {
_string6 = "Bird";
_condiment = "Bird";
loadFrame(3);
_visibleFrame = 3;
} else if (msg->_action == "InTitilator") {
_string6 = "None";
_condiment = "None";
loadFrame(0);
_visibleFrame = 0;
}

View File

@ -36,7 +36,7 @@ class CGlass : public CCarry {
bool TurnOn(CTurnOn *msg);
bool TurnOff(CTurnOff *msg);
public:
CString _string6;
CString _condiment;
public:
CLASSDEF;
CGlass();

View File

@ -45,7 +45,7 @@ void CNapkin::load(SimpleFile *file) {
bool CNapkin::UseWithOtherMsg(CUseWithOtherMsg *msg) {
CChicken *chicken = dynamic_cast<CChicken *>(msg->_other);
if (chicken) {
if (chicken->_string6 == "None" || chicken->_field12C) {
if (chicken->_condiment == "None" || chicken->_field12C) {
CActMsg actMsg("Clean");
actMsg.execute("Chicken");
} else {

View File

@ -74,7 +74,7 @@ bool CSauceDispensor::Use(CUse *msg) {
if (_fieldF0) {
playSound("b#15.wav", 50);
if (chicken->_string6 != "None") {
if (chicken->_condiment != "None") {
petDisplayMessage(1, FOODSTUFF_ALREADY_GARNISHED);
msg->execute("Chicken");
} else {
@ -103,7 +103,7 @@ bool CSauceDispensor::Use(CUse *msg) {
if (_field104 || _fieldF0) {
petAddToInventory();
} else if (glass->_string6 != "None") {
} else if (glass->_condiment != "None") {
visibleMsg.execute("BeerGlass");
} else if (_fieldEC) {
glass->setPosition(Point(

View File

@ -337,7 +337,7 @@ bool CBilgeSuccUBus::SubAcceptCCarryMsg(CSubAcceptCCarryMsg *msg) {
playSound("z#23.wav");
CChicken *chicken = dynamic_cast<CChicken *>(item);
bool chickenFlag = chicken ? chicken->_string6 == "None" : false;
bool chickenFlag = chicken ? chicken->_condiment == "None" : false;
if (chickenFlag) {
if (_okStartFrame >= 0) {

View File

@ -281,7 +281,7 @@ bool CSuccUBus::SubAcceptCCarryMsg(CSubAcceptCCarryMsg *msg) {
pet->phonographAction("");
CChicken *chicken = dynamic_cast<CChicken *>(item);
bool chickenFlag = chicken ? chicken->_string6 != "None" : false;
bool chickenFlag = chicken ? chicken->_condiment != "None" : false;
item->setVisible(false);
if (_startFrame1 >= 0) {