ScummVM API documentation
sergeant_dialogue.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 HARVESTER_NPC_SERGEANT_DIALOGUE_H
23#define HARVESTER_NPC_SERGEANT_DIALOGUE_H
24
25#include "harvester/npc/dialogue_handler.h"
26
27namespace Harvester {
28
30public:
32 bool talkStateBlock = false;
33 bool dialogueStateD2d50 = false;
34 bool postApplicationBriefingCompleted = false;
35 bool dialogueStateD2d58 = false;
36 bool dialogueStateD2d5c = false;
37 bool dialogueStateD2d60 = false;
38 bool dialogueStateD2d64 = false;
39 bool dialogueStateD2d68 = false;
40 bool dialogueStateD2d6c = false;
41 bool completedFirstTaskState = false;
42 bool day5ExitLinePlayed = false;
43 };
44
45 void resetState() override { _state = SergeantRoomDialogueState(); }
46 void syncState(Common::Serializer &s) override {
47 syncDialogueBool(s, _state.talkStateBlock);
48 syncDialogueBool(s, _state.dialogueStateD2d50);
49 syncDialogueBool(s, _state.postApplicationBriefingCompleted);
50 syncDialogueBool(s, _state.dialogueStateD2d58);
51 syncDialogueBool(s, _state.dialogueStateD2d5c);
52 syncDialogueBool(s, _state.dialogueStateD2d60);
53 syncDialogueBool(s, _state.dialogueStateD2d64);
54 syncDialogueBool(s, _state.dialogueStateD2d68);
55 syncDialogueBool(s, _state.dialogueStateD2d6c);
56 syncDialogueBool(s, _state.completedFirstTaskState);
57 syncDialogueBool(s, _state.day5ExitLinePlayed);
58 }
59 void migrateSharedState(DialogueSharedState &sharedState) override {
60 if (sharedState.sergeantCompletedFirstTaskState == 0 && _state.completedFirstTaskState)
61 sharedState.sergeantCompletedFirstTaskState = 1;
62 }
63 Common::Error handleDialogue(DialogueRuntime &runtime,
64 const Common::String &usedItemName, DialogueSharedState &sharedState) override;
65
66private:
67 Common::Error runDay5ExitIfNeeded(DialogueRuntime &runtime);
68 Common::Error handleRemainsBranch(DialogueRuntime &runtime, DialogueSharedState &sharedState);
69 Common::Error handleInviteBranch(DialogueRuntime &runtime, DialogueSharedState &sharedState);
70 Common::Error handleBarberPoleBranch(DialogueRuntime &runtime, DialogueSharedState &sharedState);
71 Common::Error handleBoltClothBranch(DialogueRuntime &runtime, DialogueSharedState &sharedState);
72 Common::Error handleCompletedFirstTaskBranch(DialogueRuntime &runtime, DialogueSharedState &sharedState);
73 Common::Error handleCompletedApplicationBranch(DialogueRuntime &runtime, DialogueSharedState &sharedState);
74 Common::Error runIntroOrReminderBranch(DialogueRuntime &runtime, DialogueSharedState &sharedState);
75
76 SergeantRoomDialogueState _state;
77};
78
79} // End of namespace Harvester
80
81#endif // HARVESTER_NPC_SERGEANT_DIALOGUE_H
Definition: error.h:81
Definition: serializer.h:80
Definition: str.h:59
Definition: dialogue_handler.h:99
Definition: sergeant_dialogue.h:29