From 7af7838b863893b1a67dfc3a7d82fe0febff8b07 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Fri, 29 Apr 2016 20:25:19 -0400 Subject: TITANIC: Implement PET Conversations displayNPC --- engines/titanic/pet_control/pet_conversations.cpp | 42 +++++++++++++++++++++++ engines/titanic/pet_control/pet_conversations.h | 7 +++- engines/titanic/pet_control/pet_section.h | 6 +++- 3 files changed, 53 insertions(+), 2 deletions(-) (limited to 'engines') diff --git a/engines/titanic/pet_control/pet_conversations.cpp b/engines/titanic/pet_control/pet_conversations.cpp index 988df5de33..8f0450c4c5 100644 --- a/engines/titanic/pet_control/pet_conversations.cpp +++ b/engines/titanic/pet_control/pet_conversations.cpp @@ -138,6 +138,48 @@ void CPetConversations::leave() { stopNPCTimer(); } +void CPetConversations::displayNPC(CGameObject *npc) { + if (npc) { + displayMessage(CString()); + CString msg = "Talking to "; + CString name = npc->getName(); + int id = 1; + + if (name.contains("Doorbot")) { + msg += "the DoorBot"; + } else if (name.contains("DeskBot")) { + id = 2; + msg += "the DeskBot"; + } else if (name.contains("LiftBot")) { + id = 3; + msg += "a LiftBot"; + } else if (name.contains("Parrot")) { + id = 4; + msg += "the Parrot"; + } else if (name.contains("BarBot")) { + id = 5; + msg += "the BarBot"; + } else if (name.contains("ChatterBot")) { + id = 6; + msg += "a ChatterBot"; + } else if (name.contains("BellBot")) { + id = 7; + msg += "the BellBot"; + } else if (name.contains("Maitre")) { + id = 8; + msg += "the Maitre d'Bot"; + } else if (name.contains("Succubus") || name.contains("Sub")) { + id = 9; + msg += "a Succ-U-Bus"; + } else { + msg += "Unknown"; + } + + _log.setNPC(1, id); + displayMessage(msg); + } +} + bool CPetConversations::setupControl(CPetControl *petControl) { if (petControl) { _petControl = petControl; diff --git a/engines/titanic/pet_control/pet_conversations.h b/engines/titanic/pet_control/pet_conversations.h index c3eefa9e69..ad993ec3b2 100644 --- a/engines/titanic/pet_control/pet_conversations.h +++ b/engines/titanic/pet_control/pet_conversations.h @@ -171,7 +171,12 @@ public: /** * Called when a section is being left, to switch to another area */ - virtual void leave(); + virtual void leave(); + + /** + * Display a title for an NPC + */ + virtual void displayNPC(CGameObject *npc); }; } // End of namespace Titanic diff --git a/engines/titanic/pet_control/pet_section.h b/engines/titanic/pet_control/pet_section.h index d582f38f0d..995feee27b 100644 --- a/engines/titanic/pet_control/pet_section.h +++ b/engines/titanic/pet_control/pet_section.h @@ -153,7 +153,11 @@ public: virtual CGameObject *getBackground(int index) const { return nullptr; } - virtual void proc32() {} + /** + * Display a title for an NPC + */ + virtual void displayNPC(CGameObject *npc); + virtual void proc33() {} virtual void proc34() {} virtual void proc35() {} -- cgit v1.2.3