22 #ifndef TITANIC_TT_NPC_SCRIPT_H 23 #define TITANIC_TT_NPC_SCRIPT_H 25 #include "titanic/support/simple_file.h" 26 #include "titanic/true_talk/tt_script_base.h" 27 #include "titanic/true_talk/script_support.h" 31 #define DIALS_ARRAY_COUNT 10 42 int &operator[](
int idx) {
return _array[idx]; }
43 int *getSlot(
int idx) {
return &_array[16 + idx * 4]; }
57 const char *charName,
int v3,
int val2,
int v4,
58 int v5,
int v6,
int v7);
70 virtual int proc8()
const = 0;
75 virtual ScriptChangedResult scriptChanged(uint
id) = 0;
80 virtual ScriptChangedResult scriptChanged(
const TTroomScript *roomScript, uint
id) = 0;
82 virtual int proc11()
const = 0;
83 virtual int proc12()
const = 0;
85 int charId()
const {
return _charId; }
90 int translateByArray(
int id);
95 int _valuesPerResponse;
109 const char *_itemStringP;
110 int _dialValues[DIALS_ARRAY_COUNT];
117 void loadResponses(
const char *name,
int valuesPerResponse = 1);
122 void loadRanges(
const char *name);
132 void setupDials(
int dial1,
int dial2,
int dial3);
134 static int getRoom54(
int roomId);
139 int getValue(
int testNum)
const;
144 uint getRandomNumber(
int max)
const;
150 return getRandomNumber(2) - 1;
156 uint getDialogueId(uint tagId);
166 void addRange(uint
id,
const Common::Array<uint> &values,
bool isRandom,
bool isSequential);
182 return processEntries(&_entries, _entryCount, roomScript, sentence);
192 bool addRandomResponse(
bool flag);
197 void updateCurrentDial(
bool changeDial);
199 bool fn10(
bool flag);
201 static bool sentence2C(
const TTsentence *sentence);
206 bool getStateValue()
const;
211 void getAssignedRoom(
int *roomNum,
int *floorNum,
int *elevatorNum)
const;
216 void setResponseFromArray(
int index,
int id);
219 static void deinit();
221 TTnpcScript(
int charId,
const char *charClass,
int v2,
222 const char *charName,
int v3,
int val2,
int v4,
223 int v5,
int v6,
int v7);
225 void addResponse(
int id)
override;
239 int proc8()
const override;
255 int proc11()
const override;
256 int proc12()
const override;
262 virtual void selectResponse(
int id);
268 virtual bool handleWord(uint
id)
const;
271 uint tag1, uint tag2, uint remainder);
283 virtual uint getRangeValue(uint
id);
288 virtual void resetRange(
int id);
293 virtual int updateState(uint oldId, uint newId,
int index);
298 virtual int preResponse(uint
id);
306 virtual int doSentenceEntry(
int val1,
const int *srcIdP,
const TTroomScript *roomScript,
const TTsentence *sentence);
321 virtual int getRangesCount()
const;
326 virtual void setDialRegion(
int dialNum,
int region);
331 virtual void setDial(
int dialNum,
int value);
336 virtual int getDialRegion(
int dialNum)
const;
344 virtual int getDialLevel(uint dialNum,
bool randomizeFlag =
true);
349 virtual bool randomResponse(uint index);
351 virtual uint translateId(uint
id)
const;
359 return scriptChanged(roomScript,
id);
Definition: tt_npc_script.h:49
Definition: script_support.h:105
Definition: script_support.h:65
int processEntries(const TTroomScript *roomScript, const TTsentence *sentence)
Definition: tt_npc_script.h:181
Definition: tt_room_script.h:61
Definition: script_support.h:143
ScriptChangedResult scriptChanged(const TTroomScript *roomScript, uint id) override
Definition: tt_npc_script.h:251
virtual uint getDialsBitset() const
Definition: tt_npc_script.h:303
virtual void postResponse(int v1, const TTsentenceEntry *entry, const TTroomScript *roomScript, const TTsentence *sentence)
Definition: tt_npc_script.h:311
Definition: script_support.h:90
Definition: simple_file.h:49
uint getRandomBit() const
Definition: tt_npc_script.h:149
Definition: tt_sentence.h:49
Definition: tt_npc_script.h:88
Definition: script_support.h:98
Definition: tt_npc_script.h:37
ScriptChangedResult scriptChanged(uint id) override
Definition: tt_npc_script.h:244
Definition: game_manager.h:48
virtual bool isQuoteDialled() const
Definition: tt_npc_script.h:276
Definition: script_support.h:118
Definition: script_support.h:130
ScriptChangedResult notifyScript(TTroomScript *roomScript, int id)
Definition: tt_npc_script.h:358
Definition: tt_script_base.h:38
Definition: pet_control.h:45
Definition: script_support.h:52