aboutsummaryrefslogtreecommitdiff
path: root/engines/tsage/blue_force/blueforce_logic.h
blob: d756d85cb3ec4422dab0935472d24513a049c953 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
/* ScummVM - Graphic Adventure Engine
 *
 * ScummVM is the legal property of its developers, whose names
 * are too numerous to list here. Please refer to the COPYRIGHT
 * file distributed with this source distribution.
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version 2
 * of the License, or (at your option) any later version.

 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.	 See the
 * GNU General Public License for more details.

 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
 *
 */

#ifndef TSAGE_BLUEFORCE_LOGIC_H
#define TSAGE_BLUEFORCE_LOGIC_H

#include "common/scummsys.h"
#include "tsage/events.h"
#include "tsage/core.h"
#include "tsage/scenes.h"
#include "tsage/globals.h"

namespace TsAGE {

namespace BlueForce {

using namespace TsAGE;

#define BLUE_INVENTORY (*((::TsAGE::BlueForce::BlueForceInvObjectList *)_globals->_inventory))

class BlueForceGame: public Game {
public:
	virtual void start();
	virtual Scene *createScene(int sceneNumber);
};

#define OBJ_ARRAY_SIZE 10
class AObjectArray: public EventHandler {
public:
	EventHandler *_objList[OBJ_ARRAY_SIZE];
	bool _inUse;
	int getNewIndex();
public:
	AObjectArray();
	void clear();

	virtual Common::String getClassName() { return "AObjectArray"; }
	virtual void synchronize(Serializer &s);
	virtual void process(Event &event);
	virtual void dispatch();

	void add(EventHandler *obj);
	void remove(EventHandler *obj);
};

class Timer: public EventHandler {
public:
	Action *_tickAction;
	Action *_endAction;
	uint32 _endFrame;
public:
	Timer();
	void set(uint32 delay, Action *endAction);

	virtual Common::String getClassName() { return "Timer"; }
	virtual void synchronize(Serializer &s);
	virtual void remove();
	virtual void signal();
	virtual void dispatch();
};

class TimerExt: public Timer {
public:
	Action *_newAction;
public:	
	TimerExt();
	void set(uint32 delay, Action *endAction, Action *action);

	virtual Common::String getClassName() { return "TimerExt"; }
	virtual void synchronize(Serializer &s);
	virtual void remove();
	virtual void signal();
	virtual void dispatch();
};	

class SceneItemType2: public SceneHotspot {
public:
	virtual void startMove(SceneObject *sceneObj, va_list va);
};

class NamedObject: public SceneObject {
public:
	int _resNum;
	int _lookLineNum, _talkLineNum, _useLineNum;

	virtual Common::String getClassName() { return "NamedObject"; }
	virtual void synchronize(Serializer &s);
	virtual void postInit(SceneObjectList *OwnerList = NULL);

	void setup(int resNum, int lookLineNum, int talkLineNum, int useLineNum, int mode, SceneItem *item);
};

class CountdownObject: public NamedObject {
public:
	int _countDown;
	CountdownObject();
	void fixCountdown(int mode, ...);

	virtual Common::String getClassName() { return "CountdownObject"; }
	virtual void synchronize(Serializer &s);
	virtual void dispatch();
};

class FollowerObject: public NamedObject {
public:
	SceneObject *_object;
	FollowerObject();

	virtual Common::String getClassName() { return "SceneObjectExt4"; }
	virtual void synchronize(Serializer &s);
	virtual void remove();
	virtual void dispatch();
	virtual void reposition();

	void setup(SceneObject *object, int visage, int frameNum, int yDiff);
};

class SceneExt: public Scene {
public:
	AObjectArray _timerList, _objArray2;
	int _field372;
	int _field37A;
	EventHandler *_eventHandler;

	Rect _v51C34;
public:
	SceneExt();

	virtual Common::String getClassName() { return "SceneExt"; }
	virtual void postInit(SceneObjectList *OwnerList = NULL);
	virtual void process(Event &event);
	virtual void dispatch();
	virtual void loadScene(int sceneNum);
	virtual void proc13() { warning("TODO: SceneExt::proc13"); }

	void addTimer(Timer *timer) { _timerList.add(timer); }
	void removeTimer(Timer *timer) { _timerList.remove(timer); }
};

class GameScene: public SceneExt {
public:
	int _field412;
	int _field794;
public:
	GameScene();

	virtual void postInit(SceneObjectList *OwnerList = NULL);
	virtual void remove();
};

class SceneHandlerExt: public SceneHandler {
public:
	virtual void postInit(SceneObjectList *OwnerList = NULL);
	virtual void process(Event &event);
};

class VisualSpeaker: public Speaker {
public:
	NamedObject _object1;
	CountdownObject _object2;
	bool _removeObject1, _removeObject2;
	int _field20C, _field20E;
	int _numFrames;
	Common::Point _offsetPos;
public:
	VisualSpeaker();

	virtual Common::String getClassName() { return "VisualSpeaker"; }
	virtual void synchronize(Serializer &s);
	virtual void remove();
	virtual void proc12(Action *action);
	virtual void setText(const Common::String &msg);
};

class SpeakerSutter: public VisualSpeaker {
public:
	SpeakerSutter();

	virtual Common::String getClassName() { return "SpeakerSutter"; }
	virtual void setText(const Common::String &msg);
};

class SpeakerDoug: public VisualSpeaker {
public:
	SpeakerDoug();

	virtual Common::String getClassName() { return "SpeakerDoug"; }
};

class SpeakerJakeNoHead: public VisualSpeaker {
public:
	SpeakerJakeNoHead();

	virtual Common::String getClassName() { return "SpeakerJakeNoHead"; }
};

class BlueForceInvObjectList : public InvObjectList {
public:
	InvObject _business_card;
	InvObject _lauras_sweater;
	InvObject _handcuffs;
	InvObject _magnum;
	InvObject _ticket_book;
	InvObject _miranda_card;
	InvObject _forest_follet;
	InvObject _bradford_id;
	InvObject _baseball_card;
	InvObject _slip_bradford;
	InvObject _flare;
	InvObject _rap_sheet;
	InvObject _cartridges;
	InvObject _rifle;
	InvObject _wig;
	InvObject _frankies_id;
	InvObject _tyrones_id;
	InvObject _pistol22;
	InvObject _unused;
	InvObject _slip_frankie;
	InvObject _slip_tyrone;
	InvObject _atf_teletype;
	InvObject _da_note;
	InvObject _blueprints;
	InvObject _planter_key; 
	InvObject _center_punch;
	InvObject _tranquilizer;
	InvObject _boat_hook;
	InvObject _oily_rags;
	InvObject _fuel_jar;
	InvObject _screwdriver;
	InvObject _floppy_disk1;
	InvObject _floppy_disk2;
	InvObject _driftwood;
	InvObject _crate_piece1;
	InvObject _crate_piece2;
	InvObject _shoebox;
	InvObject _badge;
	InvObject _unused2;
	InvObject _rental_coupons;
	InvObject _nickel;
	InvObject _calendar;
	InvObject _dixon_note;
	InvObject _cobb_mugshot;
	InvObject _murder_article;
	InvObject _microfiche;
	InvObject _future_wave_keys;
	InvObject _rental_boat_keys;
	InvObject _napkin;
	InvObject _cobb_printout;
	InvObject _fishing_net;
	InvObject _id;
	InvObject _rounds_9mm;
	InvObject _dates_note;
	InvObject _hand_grenade;
	InvObject _cord_110;
	InvObject _cord_110_plug;
	InvObject _cord_220;
	InvObject _unused3;
	InvObject _cord_220_plug;
	InvObject _official_document;
	InvObject _red_sweater;
	InvObject _jackknife;
	InvObject _whistle;
	InvObject _gun;
	InvObject _alley_cat_key;

	BlueForceInvObjectList();

	virtual Common::String getClassName() { return "BlueForceInvObjectList"; }
};

} // End of namespace BlueForce

} // End of namespace TsAGE

#endif