mirror of
https://github.com/libretro/scummvm.git
synced 2025-02-23 04:33:09 +00:00
TITANIC: Renamings and cleanup for chicken, sauce, and dispensor
This commit is contained in:
parent
480532c209
commit
70dc84e383
@ -40,18 +40,20 @@ BEGIN_MESSAGE_MAP(CChicken, CCarry)
|
||||
ON_MESSAGE(PETLostObjectMsg)
|
||||
END_MESSAGE_MAP()
|
||||
|
||||
int CChicken::_v1;
|
||||
int CChicken::_temperature;
|
||||
|
||||
#define HOT_TEMPERATURE 120
|
||||
|
||||
CChicken::CChicken() : CCarry(), _condiment("None"),
|
||||
_field12C(1), _field13C(0), _timerId(0) {
|
||||
_greasy(true), _inactive(false), _timerId(0) {
|
||||
}
|
||||
|
||||
void CChicken::save(SimpleFile *file, int indent) {
|
||||
file->writeNumberLine(1, indent);
|
||||
file->writeNumberLine(_field12C, indent);
|
||||
file->writeNumberLine(_greasy, indent);
|
||||
file->writeQuotedLine(_condiment, indent);
|
||||
file->writeNumberLine(_v1, indent);
|
||||
file->writeNumberLine(_field13C, indent);
|
||||
file->writeNumberLine(_temperature, indent);
|
||||
file->writeNumberLine(_inactive, indent);
|
||||
file->writeNumberLine(_timerId, indent);
|
||||
|
||||
CCarry::save(file, indent);
|
||||
@ -59,10 +61,10 @@ void CChicken::save(SimpleFile *file, int indent) {
|
||||
|
||||
void CChicken::load(SimpleFile *file) {
|
||||
file->readNumber();
|
||||
_field12C = file->readNumber();
|
||||
_greasy = file->readNumber();
|
||||
_condiment = file->readString();
|
||||
_v1 = file->readNumber();
|
||||
_field13C = file->readNumber();
|
||||
_temperature = file->readNumber();
|
||||
_inactive = file->readNumber();
|
||||
_timerId = file->readNumber();
|
||||
|
||||
CCarry::load(file);
|
||||
@ -70,7 +72,7 @@ void CChicken::load(SimpleFile *file) {
|
||||
|
||||
bool CChicken::UseWithOtherMsg(CUseWithOtherMsg *msg) {
|
||||
if (msg->_other->getName() == "Napkin") {
|
||||
if (_field12C || _condiment == "None") {
|
||||
if (_greasy || _condiment != "None") {
|
||||
CActMsg actMsg("Clean");
|
||||
actMsg.execute(this);
|
||||
petAddToInventory();
|
||||
@ -129,21 +131,21 @@ bool CChicken::ActMsg(CActMsg *msg) {
|
||||
} else if (msg->_action == "Clean") {
|
||||
_condiment = "None";
|
||||
loadFrame(3);
|
||||
_field12C = 0;
|
||||
_greasy = false;
|
||||
_visibleFrame = 3;
|
||||
} else if (msg->_action == "Dispense Chicken") {
|
||||
_condiment = "None";
|
||||
_field13C = 0;
|
||||
_field12C = 1;
|
||||
_inactive = false;
|
||||
_greasy = true;
|
||||
loadFrame(1);
|
||||
_visibleFrame = 1;
|
||||
_v1 = 120;
|
||||
_temperature = HOT_TEMPERATURE;
|
||||
} else if (msg->_action == "Hot") {
|
||||
_v1 = 120;
|
||||
_temperature = HOT_TEMPERATURE;
|
||||
} else if (msg->_action == "Eaten") {
|
||||
setVisible(false);
|
||||
petMoveToHiddenRoom();
|
||||
_field13C = 1;
|
||||
_inactive = true;
|
||||
}
|
||||
|
||||
return true;
|
||||
@ -164,10 +166,10 @@ bool CChicken::TimerMsg(CTimerMsg *msg) {
|
||||
|
||||
bool flag = false;
|
||||
if (obj) {
|
||||
flag = _v1;
|
||||
} else if (_v1 > 0) {
|
||||
--_v1;
|
||||
flag = _v1;
|
||||
flag = _temperature;
|
||||
} else if (_temperature > 0) {
|
||||
--_temperature;
|
||||
flag = _temperature;
|
||||
}
|
||||
|
||||
if (flag) {
|
||||
@ -185,7 +187,7 @@ bool CChicken::PETGainedObjectMsg(CPETGainedObjectMsg *msg) {
|
||||
}
|
||||
|
||||
bool CChicken::ParrotTriesChickenMsg(CParrotTriesChickenMsg *msg) {
|
||||
if (_v1 > 0)
|
||||
if (_temperature > 0)
|
||||
msg->_value1 = 1;
|
||||
|
||||
if (_condiment == "Tomato") {
|
||||
@ -200,7 +202,7 @@ bool CChicken::ParrotTriesChickenMsg(CParrotTriesChickenMsg *msg) {
|
||||
}
|
||||
|
||||
bool CChicken::MouseDragEndMsg(CMouseDragEndMsg *msg) {
|
||||
if (_field13C) {
|
||||
if (_inactive) {
|
||||
showMouse();
|
||||
return true;
|
||||
} else {
|
||||
@ -209,7 +211,7 @@ bool CChicken::MouseDragEndMsg(CMouseDragEndMsg *msg) {
|
||||
}
|
||||
|
||||
bool CChicken::PETObjectStateMsg(CPETObjectStateMsg *msg) {
|
||||
if (_v1 > 0)
|
||||
if (_temperature > 0)
|
||||
msg->_value = 2;
|
||||
|
||||
return true;
|
||||
|
@ -42,11 +42,11 @@ class CChicken : public CCarry {
|
||||
bool PETObjectStateMsg(CPETObjectStateMsg *msg);
|
||||
bool PETLostObjectMsg(CPETLostObjectMsg *msg);
|
||||
public:
|
||||
static int _v1;
|
||||
static int _temperature;
|
||||
public:
|
||||
int _field12C;
|
||||
bool _greasy;
|
||||
CString _condiment;
|
||||
int _field13C;
|
||||
bool _inactive;
|
||||
int _timerId;
|
||||
public:
|
||||
CLASSDEF;
|
||||
|
@ -60,7 +60,7 @@ bool CGlass::UseWithOtherMsg(CUseWithOtherMsg *msg) {
|
||||
useMsg.execute(dispensor);
|
||||
} else if (msg->_other->isEquals("Chicken") && _condiment == "None") {
|
||||
if (chicken->_condiment != "None") {
|
||||
if (!chicken->_field12C) {
|
||||
if (!chicken->_greasy) {
|
||||
CActMsg actMsg(_condiment);
|
||||
actMsg.execute("Chicken");
|
||||
}
|
||||
|
@ -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->_condiment == "None" || chicken->_field12C) {
|
||||
if (chicken->_condiment != "None" || chicken->_greasy) {
|
||||
CActMsg actMsg("Clean");
|
||||
actMsg.execute("Chicken");
|
||||
} else {
|
||||
|
@ -32,29 +32,26 @@ END_MESSAGE_MAP()
|
||||
|
||||
void CChickenCooler::save(SimpleFile *file, int indent) {
|
||||
file->writeNumberLine(1, indent);
|
||||
file->writeNumberLine(_fieldBC, indent);
|
||||
file->writeNumberLine(_fieldC0, indent);
|
||||
file->writeNumberLine(_newTemperature, indent);
|
||||
file->writeNumberLine(_triggerOnRoomEntry, indent);
|
||||
|
||||
CGameObject::save(file, indent);
|
||||
}
|
||||
|
||||
void CChickenCooler::load(SimpleFile *file) {
|
||||
file->readNumber();
|
||||
_fieldBC = file->readNumber();
|
||||
_fieldC0 = file->readNumber();
|
||||
_newTemperature = file->readNumber();
|
||||
_triggerOnRoomEntry = file->readNumber();
|
||||
|
||||
CGameObject::load(file);
|
||||
}
|
||||
|
||||
bool CChickenCooler::EnterRoomMsg(CEnterRoomMsg *msg) {
|
||||
if (_fieldC0) {
|
||||
if (_triggerOnRoomEntry) {
|
||||
CGameObject *obj = getMailManFirstObject();
|
||||
if (obj) {
|
||||
// WORKAROUND: Redundant loop for chicken in originalhere
|
||||
} else {
|
||||
getNextMail(nullptr);
|
||||
if (CChicken::_v1 > _fieldBC)
|
||||
CChicken::_v1 = _fieldBC;
|
||||
if (!obj) {
|
||||
if (CChicken::_temperature > _newTemperature)
|
||||
CChicken::_temperature = _newTemperature;
|
||||
}
|
||||
}
|
||||
|
||||
@ -62,15 +59,15 @@ bool CChickenCooler::EnterRoomMsg(CEnterRoomMsg *msg) {
|
||||
}
|
||||
|
||||
bool CChickenCooler::EnterViewMsg(CEnterViewMsg *msg) {
|
||||
if (!_fieldC0) {
|
||||
if (!_triggerOnRoomEntry) {
|
||||
for (CGameObject *obj = getMailManFirstObject(); obj;
|
||||
obj = getNextMail(obj)) {
|
||||
if (obj->isEquals("Chicken"))
|
||||
return true;
|
||||
}
|
||||
|
||||
if (CChicken::_v1 > _fieldBC)
|
||||
CChicken::_v1 = _fieldBC;
|
||||
if (CChicken::_temperature > _newTemperature)
|
||||
CChicken::_temperature = _newTemperature;
|
||||
}
|
||||
|
||||
return true;
|
||||
|
@ -33,11 +33,11 @@ class CChickenCooler : public CGameObject {
|
||||
bool EnterRoomMsg(CEnterRoomMsg *msg);
|
||||
bool EnterViewMsg(CEnterViewMsg *msg);
|
||||
private:
|
||||
int _fieldBC;
|
||||
int _fieldC0;
|
||||
int _newTemperature;
|
||||
bool _triggerOnRoomEntry;
|
||||
public:
|
||||
CLASSDEF;
|
||||
CChickenCooler() : CGameObject(), _fieldBC(0), _fieldC0(0) {}
|
||||
CChickenCooler() : CGameObject(), _newTemperature(0), _triggerOnRoomEntry(false) {}
|
||||
|
||||
/**
|
||||
* Save the data for the class to file
|
||||
|
@ -77,16 +77,16 @@ bool CChickenDispensor::StatusChangeMsg(CStatusChangeMsg *msg) {
|
||||
}
|
||||
}
|
||||
|
||||
if (dispenseMode != DISPENSE_NONE)
|
||||
_dispensed = true;
|
||||
|
||||
switch (dispenseMode) {
|
||||
case DISPENSE_NONE:
|
||||
petDisplayMessage(1, ONE_ALLOCATED_CHICKEN_PER_CUSTOMER);
|
||||
break;
|
||||
|
||||
case DISPENSE_HOT:
|
||||
case DISPENSE_COLD:
|
||||
_dispensed = true;
|
||||
setVisible(true);
|
||||
|
||||
if (_disabled) {
|
||||
playMovie(0, 12, MOVIE_NOTIFY_OBJECT | MOVIE_GAMESTATE);
|
||||
playSound("z#400.wav");
|
||||
@ -97,17 +97,6 @@ bool CChickenDispensor::StatusChangeMsg(CStatusChangeMsg *msg) {
|
||||
_dispenseMode = DISPENSE_NONE;
|
||||
break;
|
||||
|
||||
case DISPENSE_COLD:
|
||||
setVisible(true);
|
||||
if (_disabled) {
|
||||
playMovie(0, 12, MOVIE_NOTIFY_OBJECT | MOVIE_GAMESTATE);
|
||||
playSound("z#400.wav");
|
||||
} else {
|
||||
playMovie(12, 16, MOVIE_NOTIFY_OBJECT | MOVIE_GAMESTATE);
|
||||
_dispensed = true;
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
@ -36,14 +36,15 @@ BEGIN_MESSAGE_MAP(CSauceDispensor, CBackground)
|
||||
END_MESSAGE_MAP()
|
||||
|
||||
CSauceDispensor::CSauceDispensor() : CBackground(),
|
||||
_pouringCondiment(false), _fieldF0(0), _field104(0), _field108(0) {
|
||||
_pouringCondiment(false), _starlingsDead(false),
|
||||
_field104(0), _field108(0) {
|
||||
}
|
||||
|
||||
void CSauceDispensor::save(SimpleFile *file, int indent) {
|
||||
file->writeNumberLine(1, indent);
|
||||
file->writeQuotedLine(_string3, indent);
|
||||
file->writeQuotedLine(_condimentName, indent);
|
||||
file->writeNumberLine(_pouringCondiment, indent);
|
||||
file->writeNumberLine(_fieldF0, indent);
|
||||
file->writeNumberLine(_starlingsDead, indent);
|
||||
file->writePoint(_pos1, indent);
|
||||
file->writePoint(_pos2, indent);
|
||||
file->writeNumberLine(_field104, indent);
|
||||
@ -54,9 +55,9 @@ void CSauceDispensor::save(SimpleFile *file, int indent) {
|
||||
|
||||
void CSauceDispensor::load(SimpleFile *file) {
|
||||
file->readNumber();
|
||||
_string3 = file->readString();
|
||||
_condimentName = file->readString();
|
||||
_pouringCondiment = file->readNumber();
|
||||
_fieldF0 = file->readNumber();
|
||||
_starlingsDead = file->readNumber();
|
||||
_pos1 = file->readPoint();
|
||||
_pos2 = file->readPoint();
|
||||
_field104 = file->readNumber();
|
||||
@ -71,7 +72,7 @@ bool CSauceDispensor::Use(CUse *msg) {
|
||||
if (msg->_item->isEquals("Chicken")) {
|
||||
CChicken *chicken = static_cast<CChicken *>(msg->_item);
|
||||
_field104 = true;
|
||||
if (_fieldF0) {
|
||||
if (_starlingsDead) {
|
||||
playSound("b#15.wav", 50);
|
||||
|
||||
if (chicken->_condiment != "None") {
|
||||
@ -79,17 +80,17 @@ bool CSauceDispensor::Use(CUse *msg) {
|
||||
msg->execute("Chicken");
|
||||
} else {
|
||||
setVisible(true);
|
||||
if (chicken->_field12C) {
|
||||
if (chicken->_greasy) {
|
||||
_pouringCondiment = true;
|
||||
playMovie(_pos1.x, _pos1.y, MOVIE_NOTIFY_OBJECT);
|
||||
} else {
|
||||
CActMsg actMsg(_string3);
|
||||
CActMsg actMsg(_condimentName);
|
||||
actMsg.execute("Chicken");
|
||||
playMovie(_pos2.x, _pos2.y, MOVIE_NOTIFY_OBJECT);
|
||||
}
|
||||
}
|
||||
|
||||
if (_fieldF0)
|
||||
if (_starlingsDead)
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -103,7 +104,7 @@ bool CSauceDispensor::Use(CUse *msg) {
|
||||
assert(glass);
|
||||
_field108 = true;
|
||||
|
||||
if (_field104 != 1 || _fieldF0 != 1) {
|
||||
if (_field104 != 1 || !_starlingsDead) {
|
||||
glass->petAddToInventory();
|
||||
} else if (glass->_condiment != "None") {
|
||||
visibleMsg.execute("BeerGlass");
|
||||
@ -113,7 +114,7 @@ bool CSauceDispensor::Use(CUse *msg) {
|
||||
300));
|
||||
setVisible(true);
|
||||
|
||||
CActMsg actMsg(_string3);
|
||||
CActMsg actMsg(_condimentName);
|
||||
actMsg.execute("BeerGlass");
|
||||
}
|
||||
}
|
||||
@ -138,7 +139,7 @@ bool CSauceDispensor::MovieEndMsg(CMovieEndMsg *msg) {
|
||||
|
||||
bool CSauceDispensor::ActMsg(CActMsg *msg) {
|
||||
if (msg->_action == "StarlingsDead")
|
||||
_fieldF0 = true;
|
||||
_starlingsDead = true;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
@ -36,9 +36,9 @@ class CSauceDispensor : public CBackground {
|
||||
bool MouseButtonDownMsg(CMouseButtonDownMsg *msg);
|
||||
bool StatusChangeMsg(CStatusChangeMsg *msg);
|
||||
public:
|
||||
CString _string3;
|
||||
CString _condimentName;
|
||||
bool _pouringCondiment;
|
||||
int _fieldF0;
|
||||
bool _starlingsDead;
|
||||
Point _pos1;
|
||||
Point _pos2;
|
||||
int _field104;
|
||||
|
Loading…
x
Reference in New Issue
Block a user