ScummVM API documentation
true_talk_npc.h
1 /* ScummVM - Graphic Adventure Engine
2  *
3  * ScummVM is the legal property of its developers, whose names
4  * are too numerous to list here. Please refer to the COPYRIGHT
5  * file distributed with this source distribution.
6  *
7  * This program is free software: you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation, either version 3 of the License, or
10  * (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program. If not, see <http://www.gnu.org/licenses/>.
19  *
20  */
21 
22 #ifndef TITANIC_TRUE_TALK_NPC_H
23 #define TITANIC_TRUE_TALK_NPC_H
24 
25 #include "titanic/npcs/character.h"
26 #include "titanic/messages/messages.h"
27 #include "titanic/true_talk/tt_talker.h"
28 
29 namespace Titanic {
30 
31 enum NpcFlag {
32  NPCFLAG_SPEAKING = 1, NPCFLAG_IDLING = 2, NPCFLAG_START_IDLING = 4,
33  NPCFLAG_DOORBOT_IN_HOME = 8, NPCFLAG_MOVING = 0x10000, NPCFLAG_MOVE_START = 0x20000,
34  NPCFLAG_MOVE_LOOP = 0x40000, NPCFLAG_MOVE_FINISH = 0x80000,
35  NPCFLAG_MOVE_LEFT = 0x100000, NPCFLAG_MOVE_RIGHT = 0x200000,
36  NPCFLAG_MOVE_END = 0x400000, NPCFLAG_PECKING = 0x800000,
37  NPCFLAG_CHICKEN_OUTSIDE_CAGE = 0x1000000, NPCFLAG_TAKE_OFF = 0x2000000,
38  NPCFLAG_SUMMON_BELLBOT = 0x4000000, NPCFLAG_DOORBOT_INTRO = 0x8000000
39 };
40 
41 class CViewItem;
42 
43 class CTrueTalkNPC : public CCharacter {
44  DECLARE_MESSAGE_MAP;
45  bool TextInputMsg(CTextInputMsg *msg);
46  bool TrueTalkGetAssetDetailsMsg(CTrueTalkGetAssetDetailsMsg *msg);
47  bool DismissBotMsg(CDismissBotMsg *msg);
48  bool TrueTalkNotifySpeechStartedMsg(CTrueTalkNotifySpeechStartedMsg *msg);
49  bool TrueTalkNotifySpeechEndedMsg(CTrueTalkNotifySpeechEndedMsg *msg);
50  bool MovieEndMsg(CMovieEndMsg *msg);
51  bool NPCQueueIdleAnimMsg(CNPCQueueIdleAnimMsg *msg);
52  bool TimerMsg(CTimerMsg *msg);
53  bool NPCPlayAnimationMsg(CNPCPlayAnimationMsg *msg);
54 protected:
55  int _assetNumber;
56  CString _assetName;
57  int _fieldE4;
58  uint _npcFlags;
59  uint _speechDuration;
60  uint _startTicks;
61  int _fieldF4;
62  int _fieldF8;
63  int _speechTimerId;
64  int _field104;
65 protected:
66  void processInput(CTextInputMsg *msg, CViewItem *view);
67 public:
68  int _speechCounter;
69 public:
70  CLASSDEF;
71  CTrueTalkNPC();
72 
76  void save(SimpleFile *file, int indent) override;
77 
81  void load(SimpleFile *file) override;
82 
86  void setView(CViewItem *view);
87 
91  void startTalker(CViewItem *view);
92 
96  void performAction(bool startTalking, CViewItem *view = nullptr);
97 };
98 
99 } // End of namespace Titanic
100 
101 #endif /* TITANIC_TRUE_TALK_NPC_H */
void startTalking(CTrueTalkNPC *npc, uint id, CViewItem *view=nullptr)
Definition: true_talk_npc.h:43
Definition: character.h:29
Definition: simple_file.h:49
Definition: messages.h:387
Definition: messages.h:188
Definition: messages.h:327
Definition: messages.h:319
Definition: messages.h:398
Definition: messages.h:396
Definition: messages.h:324
Definition: arm.h:30
void setView(CViewItem *view)
Definition: string.h:40
void performAction(bool startTalking, CViewItem *view=nullptr)
void load(SimpleFile *file) override
Definition: messages.h:275
void save(SimpleFile *file, int indent) override
void startTalker(CViewItem *view)
Definition: view_item.h:32