Skip to content

Commit

Permalink
TITANIC: Added a SuccUBusAction enum
Browse files Browse the repository at this point in the history
  • Loading branch information
dreammaster committed Jan 22, 2017
1 parent 5e61ea8 commit fac2679
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 19 deletions.
18 changes: 9 additions & 9 deletions engines/titanic/npcs/bilge_succubus.cpp
Expand Up @@ -127,12 +127,12 @@ bool CBilgeSuccUBus::PETDeliverMsg(CPETDeliverMsg *msg) {

_isChicken = mailObject->getName() == "Chicken";
_isFeathers = mailObject->getName() == "Feathers";
_field158 = 0;
_sendAction = SA_SENT;

if (_v2) {
if (_isFeathers) {
startTalking(this, 230022);
_field158 = 1;
_sendAction = SA_FEATHERS;

if (_sendStartFrame >= 0)
playMovie(_sendStartFrame, _sendEndFrame, MOVIE_NOTIFY_OBJECT);
Expand All @@ -145,7 +145,7 @@ bool CBilgeSuccUBus::PETDeliverMsg(CPETDeliverMsg *msg) {
}
} else {
startTalking(this, 230012);
_field158 = 2;
_sendAction = SA_EATEN;
if (_sendStartFrame >= 0)
playMovie(_sendStartFrame, _sendEndFrame, MOVIE_NOTIFY_OBJECT | MOVIE_GAMESTATE);
if (_receiveStartFrame >= 0)
Expand All @@ -156,7 +156,7 @@ bool CBilgeSuccUBus::PETDeliverMsg(CPETDeliverMsg *msg) {
} else {
if (_isFeathers) {
startTalking(this, 230022);
_field158 = 3;
_sendAction = SA_BILGE_FEATHERS;

if (_sendStartFrame >= 0)
playMovie(_sendStartFrame, _sendEndFrame, MOVIE_NOTIFY_OBJECT | MOVIE_GAMESTATE);
Expand All @@ -168,7 +168,7 @@ bool CBilgeSuccUBus::PETDeliverMsg(CPETDeliverMsg *msg) {
sendMail(petRoomFlags, roomFlags);
startTalking(this, 230012);
if (_sendStartFrame >= 0) {
_field158 = 4;
_sendAction = SA_BILGE_SENT;
playMovie(_sendStartFrame, _sendEndFrame, MOVIE_NOTIFY_OBJECT | MOVIE_GAMESTATE);
}
}
Expand Down Expand Up @@ -207,7 +207,7 @@ bool CBilgeSuccUBus::MovieEndMsg(CMovieEndMsg *msg) {
}

} else if (msg->_endFrame == _sendEndFrame) {
switch (_field158) {
switch (_sendAction) {
case 1:
stopSound(_soundHandle);
_soundHandle = playSound("z#3.wav");
Expand Down Expand Up @@ -269,10 +269,10 @@ bool CBilgeSuccUBus::MovieEndMsg(CMovieEndMsg *msg) {
CBodyInBilgeRoomMsg bodyMsg;
bodyMsg.execute("Service Elevator Entity");
decTransitions();
_field158 = 0;
_sendAction = SA_SENT;

} else {
_field158 = 0;
_sendAction = SA_SENT;
}
}

Expand Down Expand Up @@ -346,7 +346,7 @@ bool CBilgeSuccUBus::SubAcceptCCarryMsg(CSubAcceptCCarryMsg *msg) {
}

if (_sendStartFrame >= 0) {
_field158 = 5;
_sendAction = SA_BILGE_EATEN;
playMovie(_sendStartFrame, _sendEndFrame, MOVIE_NOTIFY_OBJECT);
}

Expand Down
18 changes: 9 additions & 9 deletions engines/titanic/npcs/succubus.cpp
Expand Up @@ -73,7 +73,7 @@ CSuccUBus::CSuccUBus() : CTrueTalkNPC() {
_afterReceiveEndFrame = 0;
_trayOutStartFrame = 224;
_trayOutEndFrame = 248;
_field158 = 0;
_sendAction = SA_SENT;
_field15C = 0;
_string2 = "NULL";
_startFrame1 = 28;
Expand Down Expand Up @@ -125,7 +125,7 @@ void CSuccUBus::save(SimpleFile *file, int indent) {
file->writeNumberLine(_afterReceiveEndFrame, indent);
file->writeNumberLine(_trayOutStartFrame, indent);
file->writeNumberLine(_trayOutEndFrame, indent);
file->writeNumberLine(_field158, indent);
file->writeNumberLine(_sendAction, indent);
file->writeNumberLine(_field15C, indent);

file->writeQuotedLine(_string2, indent);
Expand Down Expand Up @@ -189,7 +189,7 @@ void CSuccUBus::load(SimpleFile *file) {
_afterReceiveEndFrame = file->readNumber();
_trayOutStartFrame = file->readNumber();
_trayOutEndFrame = file->readNumber();
_field158 = file->readNumber();
_sendAction = (SuccUBusAction)file->readNumber();
_field15C = file->readNumber();

_string2 = file->readString();
Expand Down Expand Up @@ -307,7 +307,7 @@ bool CSuccUBus::SubAcceptCCarryMsg(CSubAcceptCCarryMsg *msg) {

if (_sendStartFrame >= 0) {
playMovie(_sendStartFrame, _sendEndFrame, MOVIE_NOTIFY_OBJECT);
_field158 = 2;
_sendAction = SA_EATEN;
}

// WORKAROUND: The original had code below to return the chicken
Expand Down Expand Up @@ -417,7 +417,7 @@ bool CSuccUBus::PETDeliverMsg(CPETDeliverMsg *msg) {

_isFeathers = mailObject->getName() == "Feathers";
_isChicken = mailObject->getName() == "Chicken";
_field158 = 0;
_sendAction = SA_SENT;
_field188 = 0;
_inProgress = true;
incTransitions();
Expand All @@ -433,7 +433,7 @@ bool CSuccUBus::PETDeliverMsg(CPETDeliverMsg *msg) {
startTalking(this, 230022, findView());
}

_field158 = 1;
_sendAction = SA_FEATHERS;
if (_sendStartFrame >= 0)
playMovie(_sendStartFrame, _sendEndFrame, 0);

Expand Down Expand Up @@ -509,7 +509,7 @@ bool CSuccUBus::PETReceiveMsg(CPETReceiveMsg *msg) {
startTalking(this, 230004, findView());

if (_receiveStartFrame >= 0) {
_field158 = 1;
_sendAction = SA_FEATHERS;
_inProgress = true;
incTransitions();
playMovie(_receiveStartFrame, _receiveEndFrame, MOVIE_NOTIFY_OBJECT);
Expand Down Expand Up @@ -599,9 +599,9 @@ bool CSuccUBus::MovieEndMsg(CMovieEndMsg *msg) {
}

if (msg->_endFrame == _sendEndFrame) {
if (_field158 == 1) {
if (_sendAction == SA_FEATHERS) {
startTalking(this, 230022, findView());
} else if (_field158 == 2) {
} else if (_sendAction == SA_EATEN) {
startTalking(this, 230017, findView());
} else if (_sendLost) {
startTalking(this, 230019, findView());
Expand Down
5 changes: 4 additions & 1 deletion engines/titanic/npcs/succubus.h
Expand Up @@ -28,6 +28,9 @@

namespace Titanic {

enum SuccUBusAction { SA_SENT = 0, SA_FEATHERS = 1, SA_EATEN = 2,
SA_BILGE_FEATHERS = 3, SA_BILGE_SENT = 4, SA_BILGE_EATEN = 5 };

class CSuccUBus : public CTrueTalkNPC {
DECLARE_MESSAGE_MAP;
bool MouseButtonDownMsg(CMouseButtonDownMsg *msg);
Expand Down Expand Up @@ -72,7 +75,7 @@ class CSuccUBus : public CTrueTalkNPC {
int _afterReceiveEndFrame;
int _trayOutStartFrame;
int _trayOutEndFrame;
int _field158;
SuccUBusAction _sendAction;
bool _field15C;
CString _string2;
int _startFrame1;
Expand Down

0 comments on commit fac2679

Please sign in to comment.