diff options
-rw-r--r-- | engines/titanic/carry/hammer.cpp | 23 | ||||
-rw-r--r-- | engines/titanic/carry/hammer.h | 3 | ||||
-rw-r--r-- | engines/titanic/game/bottom_of_well_monitor.cpp | 18 | ||||
-rw-r--r-- | engines/titanic/game/brain_slot.cpp | 6 | ||||
-rw-r--r-- | engines/titanic/game/brain_slot.h | 3 | ||||
-rw-r--r-- | engines/titanic/game/hammer_clip.cpp | 44 | ||||
-rw-r--r-- | engines/titanic/game/hammer_clip.h | 4 | ||||
-rw-r--r-- | engines/titanic/game/hammer_dispensor.cpp | 61 | ||||
-rw-r--r-- | engines/titanic/game/hammer_dispensor.h | 11 | ||||
-rw-r--r-- | engines/titanic/game/hammer_dispensor_button.cpp | 101 | ||||
-rw-r--r-- | engines/titanic/game/hammer_dispensor_button.h | 12 | ||||
-rw-r--r-- | engines/titanic/game/head_slot.cpp | 120 | ||||
-rw-r--r-- | engines/titanic/game/head_slot.h | 11 | ||||
-rw-r--r-- | engines/titanic/game/television.cpp | 8 | ||||
-rw-r--r-- | engines/titanic/npcs/liftbot.cpp | 2 | ||||
-rw-r--r-- | engines/titanic/npcs/parrot.cpp | 4 | ||||
-rw-r--r-- | engines/titanic/room_flags.cpp | 6 |
17 files changed, 397 insertions, 40 deletions
diff --git a/engines/titanic/carry/hammer.cpp b/engines/titanic/carry/hammer.cpp index d3b912184c..88c766d564 100644 --- a/engines/titanic/carry/hammer.cpp +++ b/engines/titanic/carry/hammer.cpp @@ -24,6 +24,11 @@ namespace Titanic { +BEGIN_MESSAGE_MAP(CHammer, CCarry) + ON_MESSAGE(PuzzleSolvedMsg) + ON_MESSAGE(UseWithOtherMsg) +END_MESSAGE_MAP() + CHammer::CHammer() : CCarry() { } @@ -37,4 +42,22 @@ void CHammer::load(SimpleFile *file) { CCarry::load(file); } +bool CHammer::PuzzleSolvedMsg(CPuzzleSolvedMsg *msg) { + _fieldE0 = 1; + return true; +} + +bool CHammer::UseWithOtherMsg(CUseWithOtherMsg *msg) { + CString name = msg->_other->getName(); + if (name == "LongStickDispenser") { + CPuzzleSolvedMsg solvedMsg; + solvedMsg.execute("LongStickDispenser"); + } else if (name == "Bomb") { + CActMsg actMsg("Hit"); + actMsg.execute("Bomb"); + } + + return CCarry::UseWithOtherMsg(msg); +} + } // End of namespace Titanic diff --git a/engines/titanic/carry/hammer.h b/engines/titanic/carry/hammer.h index a455d71434..8cc86f3db1 100644 --- a/engines/titanic/carry/hammer.h +++ b/engines/titanic/carry/hammer.h @@ -28,6 +28,9 @@ namespace Titanic { class CHammer : public CCarry { + DECLARE_MESSAGE_MAP; + bool PuzzleSolvedMsg(CPuzzleSolvedMsg *msg); + bool UseWithOtherMsg(CUseWithOtherMsg *msg); public: CLASSDEF; CHammer(); diff --git a/engines/titanic/game/bottom_of_well_monitor.cpp b/engines/titanic/game/bottom_of_well_monitor.cpp index 373fe4cbdc..38211040d8 100644 --- a/engines/titanic/game/bottom_of_well_monitor.cpp +++ b/engines/titanic/game/bottom_of_well_monitor.cpp @@ -77,12 +77,12 @@ bool CBottomOfWellMonitor::ActMsg(CActMsg *msg) { } bool CBottomOfWellMonitor::MouseButtonDownMsg(CMouseButtonDownMsg *msg) { - if (!compareTo("BOWTelevisionMonitor")) { - if (_v2) - changeView("BottomOfWell.Node 8.N", ""); - } else { + if (isEquals("BOWTelevisionMonitor")) { if (_v1) changeView("BottomOfWell.Node 7.N", ""); + } else { + if (_v2) + changeView("BottomOfWell.Node 8.N", ""); } return true; @@ -90,14 +90,14 @@ bool CBottomOfWellMonitor::MouseButtonDownMsg(CMouseButtonDownMsg *msg) { bool CBottomOfWellMonitor::EnterViewMsg(CEnterViewMsg *msg) { if (_flag) { - if (!compareTo("BOWTelevisionMonitor")) { - if (_v2) { - changeView("BottomOfWell.Node 8.N", ""); + if (isEquals("BOWTelevisionMonitor")) { + if (_v1) { + changeView("BottomOfWell.Node 7.N", ""); _flag = false; } } else { - if (_v1) { - changeView("BottomOfWell.Node 7.N", ""); + if (_v2) { + changeView("BottomOfWell.Node 8.N", ""); _flag = false; } } diff --git a/engines/titanic/game/brain_slot.cpp b/engines/titanic/game/brain_slot.cpp index 57521ead88..1518d9b0b3 100644 --- a/engines/titanic/game/brain_slot.cpp +++ b/engines/titanic/game/brain_slot.cpp @@ -33,7 +33,7 @@ BEGIN_MESSAGE_MAP(CBrainSlot, CGameObject) ON_MESSAGE(MouseDragStartMsg) END_MESSAGE_MAP() -bool CBrainSlot::_added; +int CBrainSlot::_added; bool CBrainSlot::_woken; void CBrainSlot::save(SimpleFile *file, int indent) { @@ -63,7 +63,7 @@ bool CBrainSlot::SetFrameMsg(CSetFrameMsg *msg) { } bool CBrainSlot::AddHeadPieceMsg(CAddHeadPieceMsg *msg) { - _added = true; + _added = 1; _cursorId = CURSOR_HAND; CAddHeadPieceMsg addMsg("NULL"); @@ -141,7 +141,7 @@ bool CBrainSlot::MouseDragStartMsg(CMouseDragStartMsg *msg) { passMsg.execute(_target); msg->_dragItem = getRoot()->findByName(_target); - _added = false; + _added = 0; return true; } diff --git a/engines/titanic/game/brain_slot.h b/engines/titanic/game/brain_slot.h index fce9ab02c7..4d500cc59a 100644 --- a/engines/titanic/game/brain_slot.h +++ b/engines/titanic/game/brain_slot.h @@ -35,7 +35,8 @@ class CBrainSlot : public CGameObject { bool ActMsg(CActMsg *msg); bool MouseDragStartMsg(CMouseDragStartMsg *msg); public: - static bool _added, _woken; + static int _added; + static bool _woken; public: int _value1; CString _target; diff --git a/engines/titanic/game/hammer_clip.cpp b/engines/titanic/game/hammer_clip.cpp index e3f3a09a90..7fb64350af 100644 --- a/engines/titanic/game/hammer_clip.cpp +++ b/engines/titanic/game/hammer_clip.cpp @@ -21,9 +21,16 @@ */ #include "titanic/game/hammer_clip.h" +#include "titanic/core/project_item.h" namespace Titanic { +BEGIN_MESSAGE_MAP(CHammerClip, CGameObject) + ON_MESSAGE(MouseButtonDownMsg) + ON_MESSAGE(StatusChangeMsg) + ON_MESSAGE(MouseDragStartMsg) +END_MESSAGE_MAP() + void CHammerClip::save(SimpleFile *file, int indent) { file->writeNumberLine(1, indent); file->writeNumberLine(_value, indent); @@ -36,4 +43,41 @@ void CHammerClip::load(SimpleFile *file) { CGameObject::load(file); } +bool CHammerClip::MouseButtonDownMsg(CMouseButtonDownMsg *msg) { + return true; +} + +bool CHammerClip::StatusChangeMsg(CStatusChangeMsg *msg) { + _value = msg->_newStatus == 1; + if (_value) { + CPuzzleSolvedMsg solvedMsg; + solvedMsg.execute("BigHammer"); + _cursorId = CURSOR_HAND; + } + + return true; +} + +bool CHammerClip::MouseDragStartMsg(CMouseDragStartMsg *msg) { + if (!checkStartDragging(msg)) + return false; + + if (_value) { + CVisibleMsg visibleMsg(true); + visibleMsg.execute("BigHammer"); + CPassOnDragStartMsg passMsg(msg->_mousePos, 1); + passMsg.execute("BigHammer"); + + msg->_dragItem = getRoot()->findByName("BigHammer"); + + CActMsg actMsg("HammerTaken"); + actMsg.execute("HammerDispensor"); + actMsg.execute("HammerDispensorButton"); + _cursorId = CURSOR_ARROW; + _value = 0; + } + + return true; +} + } // End of namespace Titanic diff --git a/engines/titanic/game/hammer_clip.h b/engines/titanic/game/hammer_clip.h index 7f5c5ab5f8..4af58c22a5 100644 --- a/engines/titanic/game/hammer_clip.h +++ b/engines/titanic/game/hammer_clip.h @@ -28,6 +28,10 @@ namespace Titanic { class CHammerClip : public CGameObject { + DECLARE_MESSAGE_MAP; + bool MouseButtonDownMsg(CMouseButtonDownMsg *msg); + bool StatusChangeMsg(CStatusChangeMsg *msg); + bool MouseDragStartMsg(CMouseDragStartMsg *msg); public: int _value; public: diff --git a/engines/titanic/game/hammer_dispensor.cpp b/engines/titanic/game/hammer_dispensor.cpp index 440fe1bc7b..bc6a3d5ad8 100644 --- a/engines/titanic/game/hammer_dispensor.cpp +++ b/engines/titanic/game/hammer_dispensor.cpp @@ -24,15 +24,22 @@ namespace Titanic { +BEGIN_MESSAGE_MAP(CHammerDispensor, CBackground) + ON_MESSAGE(ActMsg) + ON_MESSAGE(EnterViewMsg) + ON_MESSAGE(LeaveViewMsg) + ON_MESSAGE(MovieEndMsg) +END_MESSAGE_MAP() + CHammerDispensor::CHammerDispensor() : CBackground(), - _fieldE0(0), _fieldE4(0), _fieldE8(0) { + _fieldE0(false), _fieldE4(true), _state(0) { } void CHammerDispensor::save(SimpleFile *file, int indent) { file->writeNumberLine(1, indent); file->writeNumberLine(_fieldE0, indent); file->writeNumberLine(_fieldE4, indent); - file->writeNumberLine(_fieldE8, indent); + file->writeNumberLine(_state, indent); CBackground::save(file, indent); } @@ -41,9 +48,57 @@ void CHammerDispensor::load(SimpleFile *file) { file->readNumber(); _fieldE0 = file->readNumber(); _fieldE4 = file->readNumber(); - _fieldE8 = file->readNumber(); + _state = file->readNumber(); CBackground::load(file); } +bool CHammerDispensor::ActMsg(CActMsg *msg) { + if (msg->_action == "DispenseHammer" && !_fieldE0) { + _state = 1; + playMovie(15, 31, MOVIE_NOTIFY_OBJECT); + _fieldE0 = true; + } + + if (msg->_action == "HammerTaken" && _fieldE0) + loadFrame(32); + + return true; +} + +bool CHammerDispensor::EnterViewMsg(CEnterViewMsg *msg) { + if (_fieldE4) { + playMovie(7, 14, 0); + _fieldE4 = false; + } + + return true; +} + +bool CHammerDispensor::LeaveViewMsg(CLeaveViewMsg *msg) { + _fieldE4 = true; + _fieldE0 = 0; + _state = 2; + + if (_fieldE0) + playMovie(32, 50, MOVIE_NOTIFY_OBJECT | MOVIE_GAMESTATE); + else + playMovie(0, 7, MOVIE_NOTIFY_OBJECT | MOVIE_GAMESTATE); + return true; +} + +bool CHammerDispensor::MovieEndMsg(CMovieEndMsg *msg) { + if (_state == 1) { + CStatusChangeMsg statusMsg; + statusMsg._newStatus = 1; + statusMsg.execute("HammerClip"); + } else if (_state == 2) { + CStatusChangeMsg statusMsg; + statusMsg._newStatus = 2; + statusMsg.execute("HammerClip"); + } + + return true; +} + } // End of namespace Titanic diff --git a/engines/titanic/game/hammer_dispensor.h b/engines/titanic/game/hammer_dispensor.h index e1b30d9045..2383a3349e 100644 --- a/engines/titanic/game/hammer_dispensor.h +++ b/engines/titanic/game/hammer_dispensor.h @@ -28,10 +28,15 @@ namespace Titanic { class CHammerDispensor : public CBackground { + DECLARE_MESSAGE_MAP; + bool ActMsg(CActMsg *msg); + bool EnterViewMsg(CEnterViewMsg *msg); + bool LeaveViewMsg(CLeaveViewMsg *msg); + bool MovieEndMsg(CMovieEndMsg *msg); private: - int _fieldE0; - int _fieldE4; - int _fieldE8; + bool _fieldE0; + bool _fieldE4; + int _state; public: CLASSDEF; CHammerDispensor(); diff --git a/engines/titanic/game/hammer_dispensor_button.cpp b/engines/titanic/game/hammer_dispensor_button.cpp index 3346498623..fbda501a24 100644 --- a/engines/titanic/game/hammer_dispensor_button.cpp +++ b/engines/titanic/game/hammer_dispensor_button.cpp @@ -24,9 +24,18 @@ namespace Titanic { +BEGIN_MESSAGE_MAP(CHammerDispensorButton, CStartAction) + ON_MESSAGE(PuzzleSolvedMsg) + ON_MESSAGE(MouseButtonUpMsg) + ON_MESSAGE(ActMsg) + ON_MESSAGE(FrameMsg) + ON_MESSAGE(LeaveViewMsg) + ON_MESSAGE(EnterViewMsg) +END_MESSAGE_MAP() + CHammerDispensorButton::CHammerDispensorButton() : CStartAction(), - _fieldF8(0), _fieldFC(0), _field100(0), _field104(56), - _field108(6), _field10C(0), _field110(0) { + _fieldF8(0), _fieldFC(0), _field100(0), _btnPos(Point(56, 6)), + _field10C(nullptr), _field110(0) { } void CHammerDispensorButton::save(SimpleFile *file, int indent) { @@ -34,8 +43,8 @@ void CHammerDispensorButton::save(SimpleFile *file, int indent) { file->writeNumberLine(_fieldF8, indent); file->writeNumberLine(_fieldFC, indent); file->writeNumberLine(_field100, indent); - file->writeNumberLine(_field104, indent); - file->writeNumberLine(_field108, indent); + file->writeNumberLine(_btnPos.x, indent); + file->writeNumberLine(_btnPos.y, indent); file->writeNumberLine(_field110, indent); CStartAction::save(file, indent); @@ -46,11 +55,91 @@ void CHammerDispensorButton::load(SimpleFile *file) { _fieldF8 = file->readNumber(); _fieldFC = file->readNumber(); _field100 = file->readNumber(); - _field104 = file->readNumber(); - _field108 = file->readNumber(); + _btnPos.x = file->readNumber(); + _btnPos.y = file->readNumber(); _field110 = file->readNumber(); CStartAction::load(file); } +bool CHammerDispensorButton::PuzzleSolvedMsg(CPuzzleSolvedMsg *msg) { + _fieldF8 = 1; + return true; +} + +bool CHammerDispensorButton::MouseButtonUpMsg(CMouseButtonUpMsg *msg) { + playSound("z#93.wav"); + petDisplayMessage(1, "In case of emergency hammer requirement, poke with long stick."); + return true; +} + +bool CHammerDispensorButton::ActMsg(CActMsg *msg) { + if (msg->_action == "HammerTaken") + _field110 = true; + return true; +} + +bool CHammerDispensorButton::FrameMsg(CFrameMsg *msg) { + if (!_fieldF8) + return true; + + if (!_field10C) { + CGameObject *obj = getDraggingObject(); + if (obj) { + if (obj->isEquals("Perch") && getView() == findView()) + _field10C = obj; + } + } + + if (_field10C) { + Point pt(_btnPos.x + _bounds.left, _btnPos.y + _bounds.top); + bool flag = checkPoint(pt, true); + + switch (_fieldFC) { + case 0: + if (flag) { + playSound("z#93.wav"); + if (++_field100 == 5) { + if (!_field110) { + CActMsg actMsg(_msgAction); + actMsg.execute(_msgTarget); + } + + setVisible(false); + _fieldF8 = 0; + _field100 = 0; + } + + _fieldFC = 1; + } + break; + + case 1: + if (!flag) { + _fieldFC = 0; + ++_field100; + } + break; + + default: + break; + } + } + + return true; +} + +bool CHammerDispensorButton::LeaveViewMsg(CLeaveViewMsg *msg) { + _field10C = nullptr; + _field100 = 0; + _fieldFC = 0; + return true; +} + +bool CHammerDispensorButton::EnterViewMsg(CEnterViewMsg *msg) { + setVisible(true); + _fieldF8 = 1; + return true; +} + } // End of namespace Titanic diff --git a/engines/titanic/game/hammer_dispensor_button.h b/engines/titanic/game/hammer_dispensor_button.h index 36732adb2d..f497b9dae1 100644 --- a/engines/titanic/game/hammer_dispensor_button.h +++ b/engines/titanic/game/hammer_dispensor_button.h @@ -28,13 +28,19 @@ namespace Titanic { class CHammerDispensorButton : public CStartAction { + DECLARE_MESSAGE_MAP; + bool PuzzleSolvedMsg(CPuzzleSolvedMsg *msg); + bool MouseButtonUpMsg(CMouseButtonUpMsg *msg); + bool ActMsg(CActMsg *msg); + bool FrameMsg(CFrameMsg *msg); + bool LeaveViewMsg(CLeaveViewMsg *msg); + bool EnterViewMsg(CEnterViewMsg *msg); private: int _fieldF8; int _fieldFC; int _field100; - int _field104; - int _field108; - int _field10C; + Point _btnPos; + CGameObject *_field10C; int _field110; public: CLASSDEF; diff --git a/engines/titanic/game/head_slot.cpp b/engines/titanic/game/head_slot.cpp index 32650b75e4..f7df02d364 100644 --- a/engines/titanic/game/head_slot.cpp +++ b/engines/titanic/game/head_slot.cpp @@ -21,14 +21,27 @@ */ #include "titanic/game/head_slot.h" +#include "titanic/core/project_item.h" +#include "titanic/game/brain_slot.h" namespace Titanic { +BEGIN_MESSAGE_MAP(CHeadSlot, CGameObject) + ON_MESSAGE(AddHeadPieceMsg) + ON_MESSAGE(SenseWorkingMsg) + ON_MESSAGE(EnterViewMsg) + ON_MESSAGE(LeaveViewMsg) + ON_MESSAGE(LoadSuccessMsg) + ON_MESSAGE(TimerMsg) + ON_MESSAGE(ActMsg) + ON_MESSAGE(MouseDragStartMsg) +END_MESSAGE_MAP() + int CHeadSlot::_v1; CHeadSlot::CHeadSlot() : CGameObject(), _string1("NotWorking"), _string2("NULL"), _fieldBC(0), _fieldD8(0), _fieldDC(27), _fieldE0(56), - _fieldE4(82), _fieldE8(112), _fieldEC(0) { + _fieldE4(82), _fieldE8(112), _fieldEC(false) { } void CHeadSlot::save(SimpleFile *file, int indent) { @@ -63,4 +76,109 @@ void CHeadSlot::load(SimpleFile *file) { CGameObject::load(file); } +bool CHeadSlot::AddHeadPieceMsg(CAddHeadPieceMsg *msg) { + setVisible(true); + _fieldBC = 1; + _string2 = msg->_value; + playMovie(_fieldDC, _fieldE8, 0); + _cursorId = CURSOR_HAND; + msg->execute("TitaniaControl"); + return true; +} + +bool CHeadSlot::SenseWorkingMsg(CSenseWorkingMsg *msg) { + if (_fieldEC) + playMovie(_fieldE4, _fieldE8, 0); + + _string1 = msg->_value; + _fieldEC = false; + return true; +} + +bool CHeadSlot::EnterViewMsg(CEnterViewMsg *msg) { + setVisible(true); + if (_v1) + _cursorId = CURSOR_ARROW; + + if (_v1 == 1 || _string1 == "Working") { + playMovie(_fieldE0, _fieldE4, MOVIE_GAMESTATE); + _fieldEC = true; + } else if (_fieldBC) { + playMovie(_fieldE0, _fieldE8, MOVIE_GAMESTATE); + _fieldEC = false; + } else { + playMovie(0, _fieldDC, MOVIE_GAMESTATE); + } + + addTimer(5000 + getRandomNumber(3000)); + return true; +} + +bool CHeadSlot::LeaveViewMsg(CLeaveViewMsg *msg) { + if (getName() == "YepItsASlot") { + stopMovie(); + + if (_fieldBC) { + loadFrame(_fieldE0); + playMovie(_fieldE0, _fieldE8, MOVIE_GAMESTATE); + _fieldEC = false; + } else { + loadFrame(_fieldDC); + playMovie(_fieldDC, _fieldE0, MOVIE_GAMESTATE); + } + + _fieldEC = false; + } + + return true; +} + +bool CHeadSlot::LoadSuccessMsg(CLoadSuccessMsg *msg) { + return true; +} + +bool CHeadSlot::TimerMsg(CTimerMsg *msg) { + if (compareViewNameTo("Titania.Node 15.S") && CBrainSlot::_added == 5 + && _fieldBC == 1) { + if (_string1 == "Working" && !_fieldEC) { + playMovie(_fieldE0, _fieldE4, 0); + _fieldEC = true; + } else if (_string1 == "Random") { + playMovie(_fieldE0, _fieldE8, 0); + } + } + + if (compareViewNameTo("Titania.Node 15.S")) { + _fieldD8 = 7000 + getRandomNumber(5000); + addTimer(_fieldD8); + } + + return true; +} + +bool CHeadSlot::ActMsg(CActMsg *msg) { + if (msg->_action == "Woken") + _v1 = 1; + return true; +} + +bool CHeadSlot::MouseDragStartMsg(CMouseDragStartMsg *msg) { + if (_fieldBC && !_v1 && checkPoint(msg->_mousePos, false, true)) { + CPassOnDragStartMsg passMsg; + passMsg._mousePos = msg->_mousePos; + passMsg.execute(_string2); + + msg->_dragItem = getRoot()->findByName(_string2); + _cursorId = CURSOR_ARROW; + _fieldBC = 0; + _fieldEC = false; + _string2 = "NULL"; + stopMovie(); + loadFrame(0); + playMovie(0, _fieldDC, 0); + } + + return true; +} + } // End of namespace Titanic diff --git a/engines/titanic/game/head_slot.h b/engines/titanic/game/head_slot.h index 0080411033..2767db3b61 100644 --- a/engines/titanic/game/head_slot.h +++ b/engines/titanic/game/head_slot.h @@ -28,6 +28,15 @@ namespace Titanic { class CHeadSlot : public CGameObject { + DECLARE_MESSAGE_MAP; + bool AddHeadPieceMsg(CAddHeadPieceMsg *msg); + bool SenseWorkingMsg(CSenseWorkingMsg *msg); + bool EnterViewMsg(CEnterViewMsg *msg); + bool LeaveViewMsg(CLeaveViewMsg *msg); + bool LoadSuccessMsg(CLoadSuccessMsg *msg); + bool TimerMsg(CTimerMsg *msg); + bool ActMsg(CActMsg *msg); + bool MouseDragStartMsg(CMouseDragStartMsg *msg); public: static int _v1; public: @@ -39,7 +48,7 @@ public: int _fieldE0; int _fieldE4; int _fieldE8; - int _fieldEC; + bool _fieldEC; public: CLASSDEF; CHeadSlot(); diff --git a/engines/titanic/game/television.cpp b/engines/titanic/game/television.cpp index b3c10d4ca4..235fc9c7b0 100644 --- a/engines/titanic/game/television.cpp +++ b/engines/titanic/game/television.cpp @@ -121,16 +121,16 @@ bool CTelevision::LeaveViewMsg(CLeaveViewMsg *msg) { } bool CTelevision::ChangeSeasonMsg(CChangeSeasonMsg *msg) { - if (msg->_season.compareTo("Autumn")) { + if (msg->_season == "Autumn") { _v1 = 545; _v3 = 0; - } else if (msg->_season.compareTo("Winter")) { + } else if (msg->_season == "Winter") { _v1 = 503; _v3 = 0; - } else if (msg->_season.compareTo("Spring")) { + } else if (msg->_season == "Spring") { _v1 = 517; _v3 = 0; - } else if (msg->_season.compareTo("Winter")) { + } else if (msg->_season == "Summer") { _v1 = 531; _v3 = 0; } diff --git a/engines/titanic/npcs/liftbot.cpp b/engines/titanic/npcs/liftbot.cpp index 3d6321bfb5..272617ee62 100644 --- a/engines/titanic/npcs/liftbot.cpp +++ b/engines/titanic/npcs/liftbot.cpp @@ -123,7 +123,7 @@ bool CLiftBot::TurnOff(CTurnOff *msg) { bool CLiftBot::TurnOn(CTurnOn *msg) { _enabled = true; if (!_flag) { - if (compareTo("LiftBotTalking", 0)) { + if (isEquals("LiftBotTalking")) { endTalking(this, MOVIE_REPEAT, findView()); petSetArea(PET_CONVERSATION); _flag = true; diff --git a/engines/titanic/npcs/parrot.cpp b/engines/titanic/npcs/parrot.cpp index 3ea9bc0625..62b070efa4 100644 --- a/engines/titanic/npcs/parrot.cpp +++ b/engines/titanic/npcs/parrot.cpp @@ -421,7 +421,7 @@ bool CParrot::ParrotSpeakMsg(CParrotSpeakMsg *msg) { // Check for rooms not to speak in for (const char *const *s = &ROOM_NAMES[0]; *s; ++s) { - if (compareTo(*s)) + if (isEquals(*s)) return true; } @@ -588,7 +588,7 @@ bool CParrot::FrameMsg(CFrameMsg *msg) { } } - bool chickenFlag = dragObject && dragObject->compareTo("Chicken"); + bool chickenFlag = dragObject && dragObject->isEquals("Chicken"); if (_npcFlags & NPCFLAG_1000000) { if (!chickenFlag || pt.x > 70 || pt.y < 90 || pt.y > 280) { diff --git a/engines/titanic/room_flags.cpp b/engines/titanic/room_flags.cpp index 4b3aeb424e..9be8ea3d33 100644 --- a/engines/titanic/room_flags.cpp +++ b/engines/titanic/room_flags.cpp @@ -339,12 +339,12 @@ bool CRoomFlags::getBit0() const { uint CRoomFlags::getSpecialRoomFlags(const CString &roomName) { for (int idx = 0; idx < SUCCUBUS_ROOMS_SIZE; ++idx) { - if (!roomName.compareTo(SUCCUBUS_ROOMS[idx]._roomName)) + if (roomName == SUCCUBUS_ROOMS[idx]._roomName) return SUCCUBUS_ROOMS[idx]._roomFlags; } for (int idx = 0; idx < TRANSPORT_ROOMS_SIZE; ++idx) { - if (!roomName.compareTo(TRANSPORT_ROOMS[idx]._roomName)) + if (roomName == TRANSPORT_ROOMS[idx]._roomName) return TRANSPORT_ROOMS[idx]._roomFlags; } @@ -353,7 +353,7 @@ uint CRoomFlags::getSpecialRoomFlags(const CString &roomName) { uint CRoomFlags::getSuccUBusNum(const CString &roomName) const { for (int idx = 0; idx < SUCCUBUS_ROOMS_SIZE; ++idx) { - if (!roomName.compareTo(SUCCUBUS_ROOMS[idx]._roomName)) + if (roomName == SUCCUBUS_ROOMS[idx]._roomName) return SUCCUBUS_ROOMS[idx]._succubusNum; } |