From 6f063c4703e5705edbba7ad39ef9c0656b74bc75 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sun, 26 Jun 2016 12:39:44 -0400 Subject: TITANIC: Fleshing out CGameObject and CPetControl methods --- engines/titanic/npcs/deskbot.cpp | 16 ++++++++-------- engines/titanic/npcs/true_talk_npc.cpp | 10 ++++++---- engines/titanic/npcs/true_talk_npc.h | 10 +++++----- 3 files changed, 19 insertions(+), 17 deletions(-) (limited to 'engines/titanic/npcs') diff --git a/engines/titanic/npcs/deskbot.cpp b/engines/titanic/npcs/deskbot.cpp index eb42a8e21d..3fe92367ce 100644 --- a/engines/titanic/npcs/deskbot.cpp +++ b/engines/titanic/npcs/deskbot.cpp @@ -80,7 +80,7 @@ bool CDeskbot::TurnOn(CTurnOn *msg) { setVisible(true); playClip("BellRinging", 4); playSound("b#69.wav"); - setPetArea(PET_CONVERSATION); + petSetArea(PET_CONVERSATION); _npcFlags |= NPCFLAG_20000; _deskbotActive = true; @@ -110,7 +110,7 @@ bool CDeskbot::MovieEndMsg(CMovieEndMsg *msg) { bool flag = false; if (_npcFlags & NPCFLAG_10000) { if (_classNum) { - setPetArea(PET_ROOMS); + petSetArea(PET_ROOMS); dec54(); unlockMouse(); playSound("z#47.wav", 100, 0, 0); @@ -169,25 +169,25 @@ bool CDeskbot::TrueTalkTriggerActionMsg(CTrueTalkTriggerActionMsg *msg) { case 19: inc54(); lockMouse(); - setPetArea(PET_CONVERSATION); + petSetArea(PET_CONVERSATION); playClip("ReprogramPETInHand", 4); _npcFlags |= NPCFLAG_10000; _classNum = msg->_param1; switch (_classNum) { case 1: - petDisplayMsg("You have been upgraded to 1st Class status. Enjoy hugely."); + petDisplayMessage("You have been upgraded to 1st Class status. Enjoy hugely."); setPassengerClass(_classNum); - reassignRoom(_classNum); + petReassignRoom(_classNum); break; case 2: - petDisplayMsg("You have been upgraded to 2nd Class status. Enjoy."); + petDisplayMessage("You have been upgraded to 2nd Class status. Enjoy."); setPassengerClass(_classNum); - reassignRoom(_classNum); + petReassignRoom(_classNum); break; case 3: setPassengerClass(3); - reassignRoom(_classNum); + petReassignRoom(_classNum); break; default: break; diff --git a/engines/titanic/npcs/true_talk_npc.cpp b/engines/titanic/npcs/true_talk_npc.cpp index 32c6412fef..00b68c2913 100644 --- a/engines/titanic/npcs/true_talk_npc.cpp +++ b/engines/titanic/npcs/true_talk_npc.cpp @@ -197,10 +197,6 @@ void CTrueTalkNPC::processInput(CTextInputMsg *msg, CViewItem *view) { talkManager->processInput(this, msg, view); } -void CTrueTalkNPC::performAction(int actionNum, CViewItem *view) { - // TODO -} - int CTrueTalkNPC::startAnimTimer(const CString &action, uint firstDuration, uint duration) { CTimeEventInfo *timer = new CTimeEventInfo(g_vm->_events->getTicksCount(), duration > 0, firstDuration, duration, this, 0, action); @@ -209,4 +205,10 @@ int CTrueTalkNPC::startAnimTimer(const CString &action, uint firstDuration, uint return timer->_id; } +void CTrueTalkNPC::setView(CViewItem *view) { + CTrueTalkManager *talkManager = getGameManager()->getTalkManager(); + if (talkManager) + talkManager->start3(this, view); +} + } // End of namespace Titanic diff --git a/engines/titanic/npcs/true_talk_npc.h b/engines/titanic/npcs/true_talk_npc.h index a1303c3e5d..1a10a0aa9b 100644 --- a/engines/titanic/npcs/true_talk_npc.h +++ b/engines/titanic/npcs/true_talk_npc.h @@ -63,11 +63,6 @@ protected: protected: void processInput(CTextInputMsg *msg, CViewItem *view); - /** - * Perform an action - */ - void performAction(int actionNum, CViewItem *view = nullptr); - /** * Start an animation timer */ @@ -85,6 +80,11 @@ public: * Load the data for the class from file */ virtual void load(SimpleFile *file); + + /** + * Set the view for the NPC + */ + void setView(CViewItem *view); }; } // End of namespace Titanic -- cgit v1.2.3