aboutsummaryrefslogtreecommitdiff
path: root/engines/titanic/npcs
diff options
context:
space:
mode:
Diffstat (limited to 'engines/titanic/npcs')
-rw-r--r--engines/titanic/npcs/doorbot.cpp9
-rw-r--r--engines/titanic/npcs/parrot.cpp6
-rw-r--r--engines/titanic/npcs/true_talk_npc.cpp16
-rw-r--r--engines/titanic/npcs/true_talk_npc.h2
4 files changed, 21 insertions, 12 deletions
diff --git a/engines/titanic/npcs/doorbot.cpp b/engines/titanic/npcs/doorbot.cpp
index d26f4bb828..4e08dda446 100644
--- a/engines/titanic/npcs/doorbot.cpp
+++ b/engines/titanic/npcs/doorbot.cpp
@@ -22,6 +22,7 @@
#include "titanic/npcs/doorbot.h"
#include "titanic/core/room_item.h"
+#include "titanic/titanic.h"
namespace Titanic {
@@ -81,6 +82,8 @@ void CDoorbot::load(SimpleFile *file) {
}
bool CDoorbot::MovieEndMsg(CMovieEndMsg *msg) {
+ debugC(ERROR_DETAILED, kDebugScripts, "CDoorbot MovieEndMsg flags=%x v=%d", _npcFlags, _field108);
+
if (_npcFlags & NPCFLAG_DOORBOT_INTRO) {
switch (_field108) {
case 3:
@@ -539,13 +542,15 @@ bool CDoorbot::EnterViewMsg(CEnterViewMsg *msg) {
}
bool CDoorbot::ActMsg(CActMsg *msg) {
+ debugC(ERROR_DETAILED, kDebugScripts, "CDoorbot ActMsg action=%s v108=%d v110=%d v114=%d",
+ msg->_action.c_str(), _field108, _field110, _field114);
+
if (msg->_action == "DoorbotPlayerPressedTopButton") {
disableMouse();
startTalking(this, 221471);
} else if (msg->_action == "DoorbotPlayerPressedMiddleButton") {
startTalking(this, 221470);
- }
- else if (msg->_action == "DoorbotPlayerPressedBottomButton") {
+ } else if (msg->_action == "DoorbotPlayerPressedBottomButton") {
startTalking(this, 221469);
} else if (msg->_action == "DoorbotReachedEmbLobby") {
startTalking(this, 221472);
diff --git a/engines/titanic/npcs/parrot.cpp b/engines/titanic/npcs/parrot.cpp
index 97a1944fef..7db0fbd0aa 100644
--- a/engines/titanic/npcs/parrot.cpp
+++ b/engines/titanic/npcs/parrot.cpp
@@ -202,7 +202,7 @@ bool CParrot::ActMsg(CActMsg *msg) {
}
bool CParrot::MouseButtonDownMsg(CMouseButtonDownMsg *msg) {
- if (!(_npcFlags & NPCFLAG_2000000) && _field100 <= 0) {
+ if (!(_npcFlags & NPCFLAG_2000000) && _speechCounter == 0) {
CTrueTalkTriggerActionMsg triggerMsg(280250, 280250, 1);
triggerMsg.execute(this);
}
@@ -354,7 +354,7 @@ bool CParrot::EnterViewMsg(CEnterViewMsg *msg) {
loadFrame(0);
endTalking(this, true, findView());
- if (_field100 > 0) {
+ if (_speechCounter > 0) {
playRandomClip(NAMES, MOVIE_NOTIFY_OBJECT);
} else {
startTalking(this, 280258, findView());
@@ -425,7 +425,7 @@ bool CParrot::ParrotSpeakMsg(CParrotSpeakMsg *msg) {
}
// Don't have the parrot speak too often
- if ((getTicksCount() - _field120) < 20000 || _field100)
+ if ((getTicksCount() - _field120) < 20000 || _speechCounter)
return true;
playSound("z#475.wav", 50);
diff --git a/engines/titanic/npcs/true_talk_npc.cpp b/engines/titanic/npcs/true_talk_npc.cpp
index 41186ac46c..b405ad42b6 100644
--- a/engines/titanic/npcs/true_talk_npc.cpp
+++ b/engines/titanic/npcs/true_talk_npc.cpp
@@ -24,6 +24,7 @@
#include "titanic/core/view_item.h"
#include "titanic/pet_control/pet_control.h"
#include "titanic/game_manager.h"
+#include "titanic/titanic.h"
namespace Titanic {
@@ -41,7 +42,7 @@ END_MESSAGE_MAP()
CTrueTalkNPC::CTrueTalkNPC() : _assetName("z451.dlg"),
_assetNumber(0x11170), _fieldE4(0), _npcFlags(0), _speechDuration(0), _startTicks(0),
- _fieldF4(0), _fieldF8(0), _speechTimerId(0), _field100(0), _field104(0) {
+ _fieldF4(0), _fieldF8(0), _speechTimerId(0), _speechCounter(0), _field104(0) {
}
void CTrueTalkNPC::save(SimpleFile *file, int indent) {
@@ -55,7 +56,7 @@ void CTrueTalkNPC::save(SimpleFile *file, int indent) {
file->writeNumberLine(_fieldF4, indent);
file->writeNumberLine(_fieldF8, indent);
file->writeNumberLine(_speechTimerId, indent);
- file->writeNumberLine(_field100, indent);
+ file->writeNumberLine(_speechCounter, indent);
file->writeNumberLine(_field104, indent);
CCharacter::save(file, indent);
@@ -72,7 +73,7 @@ void CTrueTalkNPC::load(SimpleFile *file) {
_fieldF4 = file->readNumber();
_fieldF8 = file->readNumber();
_speechTimerId = file->readNumber();
- _field100 = file->readNumber();
+ _speechCounter = file->readNumber();
_field104 = file->readNumber();
CCharacter::load(file);
@@ -95,8 +96,10 @@ bool CTrueTalkNPC::DismissBotMsg(CDismissBotMsg *msg) {
}
bool CTrueTalkNPC::TrueTalkNotifySpeechStartedMsg(CTrueTalkNotifySpeechStartedMsg *msg) {
+ debugC(ERROR_DETAILED, kDebugScripts, "%s TrueTalkNotifySpeechStartedMsg flags=%x", getName().c_str(), _npcFlags);
+
_npcFlags |= NPCFLAG_SPEAKING;
- ++_field100;
+ ++_speechCounter;
if (!(_npcFlags & NPCFLAG_8)) {
// Stop any previous animation
@@ -125,8 +128,9 @@ bool CTrueTalkNPC::TrueTalkNotifySpeechStartedMsg(CTrueTalkNotifySpeechStartedMs
}
bool CTrueTalkNPC::TrueTalkNotifySpeechEndedMsg(CTrueTalkNotifySpeechEndedMsg *msg) {
+ debugC(ERROR_DETAILED, kDebugScripts, "%s TrueTalkNotifySpeechEndedMsg flags=%x dialogId=%d", getName().c_str(), _npcFlags, msg->_dialogueId);
_npcFlags &= ~NPCFLAG_SPEAKING;
- --_field100;
+ --_speechCounter;
_speechDuration = 0;
if (!(_npcFlags & NPCFLAG_8)) {
@@ -171,7 +175,7 @@ bool CTrueTalkNPC::NPCQueueIdleAnimMsg(CNPCQueueIdleAnimMsg *msg) {
bool CTrueTalkNPC::TimerMsg(CTimerMsg *msg) {
if (_npcFlags & NPCFLAG_4) {
- if (_field100 > 0)
+ if (_speechCounter > 0)
return false;
CNPCPlayIdleAnimationMsg idleMsg;
diff --git a/engines/titanic/npcs/true_talk_npc.h b/engines/titanic/npcs/true_talk_npc.h
index 3adf055449..e044f10b15 100644
--- a/engines/titanic/npcs/true_talk_npc.h
+++ b/engines/titanic/npcs/true_talk_npc.h
@@ -66,7 +66,7 @@ protected:
protected:
void processInput(CTextInputMsg *msg, CViewItem *view);
public:
- int _field100;
+ int _speechCounter;
public:
CLASSDEF;
CTrueTalkNPC();