]> icculus.org git repositories - icculus/iodoom3.git/blob - neo/d3xp/Target.h
hello world
[icculus/iodoom3.git] / neo / d3xp / Target.h
1 /*
2 ===========================================================================
3
4 Doom 3 GPL Source Code
5 Copyright (C) 1999-2011 id Software LLC, a ZeniMax Media company. 
6
7 This file is part of the Doom 3 GPL Source Code (?Doom 3 Source Code?).  
8
9 Doom 3 Source Code is free software: you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by
11 the Free Software Foundation, either version 3 of the License, or
12 (at your option) any later version.
13
14 Doom 3 Source Code is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17 GNU General Public License for more details.
18
19 You should have received a copy of the GNU General Public License
20 along with Doom 3 Source Code.  If not, see <http://www.gnu.org/licenses/>.
21
22 In addition, the Doom 3 Source Code is also subject to certain additional terms. You should have received a copy of these additional terms immediately following the terms and conditions of the GNU General Public License which accompanied the Doom 3 Source Code.  If not, please request a copy in writing from id Software at the address below.
23
24 If you have questions concerning this license or the applicable additional terms, you may contact in writing id Software LLC, c/o ZeniMax Media Inc., Suite 120, Rockville, Maryland 20850 USA.
25
26 ===========================================================================
27 */
28
29 #ifndef __GAME_TARGET_H__
30 #define __GAME_TARGET_H__
31
32
33 /*
34 ===============================================================================
35
36 idTarget
37
38 ===============================================================================
39 */
40
41 class idTarget : public idEntity {
42 public:
43         CLASS_PROTOTYPE( idTarget );
44 };
45
46
47 /*
48 ===============================================================================
49
50 idTarget_Remove
51
52 ===============================================================================
53 */
54
55 class idTarget_Remove : public idTarget {
56 public:
57         CLASS_PROTOTYPE( idTarget_Remove );
58
59 private:
60         void                            Event_Activate( idEntity *activator );
61 };
62
63
64 /*
65 ===============================================================================
66
67 idTarget_Show
68
69 ===============================================================================
70 */
71
72 class idTarget_Show : public idTarget {
73 public:
74         CLASS_PROTOTYPE( idTarget_Show );
75
76 private:
77         void                            Event_Activate( idEntity *activator );
78 };
79
80
81 /*
82 ===============================================================================
83
84 idTarget_Damage
85
86 ===============================================================================
87 */
88
89 class idTarget_Damage : public idTarget {
90 public:
91         CLASS_PROTOTYPE( idTarget_Damage );
92
93 private:
94         void                            Event_Activate( idEntity *activator );
95 };
96
97
98 /*
99 ===============================================================================
100
101 idTarget_SessionCommand
102
103 ===============================================================================
104 */
105
106 class idTarget_SessionCommand : public idTarget {
107 public:
108         CLASS_PROTOTYPE( idTarget_SessionCommand );
109
110 private:
111         void                            Event_Activate( idEntity *activator );
112 };
113
114
115 /*
116 ===============================================================================
117
118 idTarget_EndLevel
119
120 ===============================================================================
121 */
122
123 class idTarget_EndLevel : public idTarget {
124 public:
125         CLASS_PROTOTYPE( idTarget_EndLevel );
126
127 private:
128         void                            Event_Activate( idEntity *activator );
129
130 };
131
132
133 /*
134 ===============================================================================
135
136 idTarget_WaitForButton
137
138 ===============================================================================
139 */
140
141 class idTarget_WaitForButton : public idTarget {
142 public:
143         CLASS_PROTOTYPE( idTarget_WaitForButton );
144
145         void                            Think( void );
146
147 private:
148         void                            Event_Activate( idEntity *activator );
149 };
150
151 /*
152 ===============================================================================
153
154 idTarget_SetGlobalShaderTime
155
156 ===============================================================================
157 */
158
159 class idTarget_SetGlobalShaderTime : public idTarget {
160 public:
161         CLASS_PROTOTYPE( idTarget_SetGlobalShaderTime );
162
163 private:
164         void                            Event_Activate( idEntity *activator );
165 };
166
167
168 /*
169 ===============================================================================
170
171 idTarget_SetShaderParm
172
173 ===============================================================================
174 */
175
176 class idTarget_SetShaderParm : public idTarget {
177 public:
178         CLASS_PROTOTYPE( idTarget_SetShaderParm );
179
180 private:
181         void                            Event_Activate( idEntity *activator );
182 };
183
184
185 /*
186 ===============================================================================
187
188 idTarget_SetShaderTime
189
190 ===============================================================================
191 */
192
193 class idTarget_SetShaderTime : public idTarget {
194 public:
195         CLASS_PROTOTYPE( idTarget_SetShaderTime );
196
197 private:
198         void                            Event_Activate( idEntity *activator );
199 };
200
201 /*
202 ===============================================================================
203
204 idTarget_FadeEntity
205
206 ===============================================================================
207 */
208
209 class idTarget_FadeEntity : public idTarget {
210 public:
211         CLASS_PROTOTYPE( idTarget_FadeEntity );
212
213                                                 idTarget_FadeEntity( void );
214
215         void                            Save( idSaveGame *savefile ) const;
216         void                            Restore( idRestoreGame *savefile );
217
218         void                            Think( void );
219
220 private:
221         idVec4                          fadeFrom;
222         int                                     fadeStart;
223         int                                     fadeEnd;
224
225         void                            Event_Activate( idEntity *activator );
226 };
227
228 /*
229 ===============================================================================
230
231 idTarget_LightFadeIn
232
233 ===============================================================================
234 */
235
236 class idTarget_LightFadeIn : public idTarget {
237 public:
238         CLASS_PROTOTYPE( idTarget_LightFadeIn );
239
240 private:
241         void                            Event_Activate( idEntity *activator );
242 };
243
244 /*
245 ===============================================================================
246
247 idTarget_LightFadeOut
248
249 ===============================================================================
250 */
251
252 class idTarget_LightFadeOut : public idTarget {
253 public:
254         CLASS_PROTOTYPE( idTarget_LightFadeOut );
255
256 private:
257         void                            Event_Activate( idEntity *activator );
258 };
259
260 /*
261 ===============================================================================
262
263 idTarget_Give
264
265 ===============================================================================
266 */
267
268 class idTarget_Give : public idTarget {
269 public:
270         CLASS_PROTOTYPE( idTarget_Give );
271
272         void                            Spawn( void );
273
274 private:
275         void                            Event_Activate( idEntity *activator );
276 };
277
278
279 /*
280 ===============================================================================
281
282 idTarget_GiveEmail
283
284 ===============================================================================
285 */
286
287 class idTarget_GiveEmail : public idTarget {
288 public:
289         CLASS_PROTOTYPE( idTarget_GiveEmail );
290
291         void                            Spawn( void );
292
293 private:
294         void                            Event_Activate( idEntity *activator );
295 };
296
297 /*
298 ===============================================================================
299
300 idTarget_SetModel
301
302 ===============================================================================
303 */
304
305 class idTarget_SetModel : public idTarget {
306 public:
307         CLASS_PROTOTYPE( idTarget_SetModel );
308
309         void                            Spawn( void );
310
311 private:
312         void                            Event_Activate( idEntity *activator );
313 };
314
315
316 /*
317 ===============================================================================
318
319 idTarget_SetInfluence
320
321 ===============================================================================
322 */
323
324 #ifdef _D3XP
325 typedef struct SavedGui_s {
326         SavedGui_s() {memset(gui, 0, sizeof(idUserInterface*)*MAX_RENDERENTITY_GUI); };
327         idUserInterface*        gui[MAX_RENDERENTITY_GUI];
328 } SavedGui_t;
329 #endif
330
331 class idTarget_SetInfluence : public idTarget {
332 public:
333         CLASS_PROTOTYPE( idTarget_SetInfluence );
334
335                                                 idTarget_SetInfluence( void );
336
337         void                            Save( idSaveGame *savefile ) const;
338         void                            Restore( idRestoreGame *savefile );
339
340         void                            Spawn( void );
341
342 private:
343         void                            Event_Activate( idEntity *activator );
344         void                            Event_RestoreInfluence();
345         void                            Event_GatherEntities();
346         void                            Event_Flash( float flash, int out );
347         void                            Event_ClearFlash( float flash );
348         void                            Think( void );
349
350         idList<int>                     lightList;
351         idList<int>                     guiList;
352         idList<int>                     soundList;
353         idList<int>                     genericList;
354         float                           flashIn;
355         float                           flashOut;
356         float                           delay;
357         idStr                           flashInSound;
358         idStr                           flashOutSound;
359         idEntity *                      switchToCamera;
360         idInterpolate<float>fovSetting;
361         bool                            soundFaded;
362         bool                            restoreOnTrigger;
363
364 #ifdef _D3XP
365         idList<SavedGui_t>      savedGuiList;
366 #endif
367 };
368
369
370 /*
371 ===============================================================================
372
373 idTarget_SetKeyVal
374
375 ===============================================================================
376 */
377
378 class idTarget_SetKeyVal : public idTarget {
379 public:
380         CLASS_PROTOTYPE( idTarget_SetKeyVal );
381
382 private:
383         void                            Event_Activate( idEntity *activator );
384 };
385
386
387 /*
388 ===============================================================================
389
390 idTarget_SetFov
391
392 ===============================================================================
393 */
394
395 class idTarget_SetFov : public idTarget {
396 public:
397         CLASS_PROTOTYPE( idTarget_SetFov );
398
399         void                            Save( idSaveGame *savefile ) const;
400         void                            Restore( idRestoreGame *savefile );
401
402         void                            Think( void );
403
404 private:
405         idInterpolate<int>      fovSetting;
406
407         void                            Event_Activate( idEntity *activator );
408 };
409
410
411 /*
412 ===============================================================================
413
414 idTarget_SetPrimaryObjective
415
416 ===============================================================================
417 */
418
419 class idTarget_SetPrimaryObjective : public idTarget {
420 public:
421         CLASS_PROTOTYPE( idTarget_SetPrimaryObjective );
422
423 private:
424         void                            Event_Activate( idEntity *activator );
425 };
426
427 /*
428 ===============================================================================
429
430 idTarget_LockDoor
431
432 ===============================================================================
433 */
434
435 class idTarget_LockDoor: public idTarget {
436 public:
437         CLASS_PROTOTYPE( idTarget_LockDoor );
438
439 private:
440         void                            Event_Activate( idEntity *activator );
441 };
442
443 /*
444 ===============================================================================
445
446 idTarget_CallObjectFunction
447
448 ===============================================================================
449 */
450
451 class idTarget_CallObjectFunction : public idTarget {
452 public:
453         CLASS_PROTOTYPE( idTarget_CallObjectFunction );
454
455 private:
456         void                            Event_Activate( idEntity *activator );
457 };
458
459
460 /*
461 ===============================================================================
462
463 idTarget_LockDoor
464
465 ===============================================================================
466 */
467
468 class idTarget_EnableLevelWeapons : public idTarget {
469 public:
470         CLASS_PROTOTYPE( idTarget_EnableLevelWeapons );
471
472 private:
473         void                            Event_Activate( idEntity *activator );
474 };
475
476
477 /*
478 ===============================================================================
479
480 idTarget_Tip
481
482 ===============================================================================
483 */
484
485 class idTarget_Tip : public idTarget {
486 public:
487         CLASS_PROTOTYPE( idTarget_Tip );
488
489                                                 idTarget_Tip( void );
490
491         void                            Spawn( void );
492
493         void                            Save( idSaveGame *savefile ) const;
494         void                            Restore( idRestoreGame *savefile );
495
496 private:
497         idVec3                          playerPos;
498
499         void                            Event_Activate( idEntity *activator );
500         void                            Event_TipOff( void );
501         void                            Event_GetPlayerPos( void );
502 };
503
504 /*
505 ===============================================================================
506
507 idTarget_GiveSecurity
508
509 ===============================================================================
510 */
511 class idTarget_GiveSecurity : public idTarget {
512 public:
513         CLASS_PROTOTYPE( idTarget_GiveSecurity );
514 private:
515         void                            Event_Activate( idEntity *activator );
516 };
517
518
519 /*
520 ===============================================================================
521
522 idTarget_RemoveWeapons
523
524 ===============================================================================
525 */
526 class idTarget_RemoveWeapons : public idTarget {
527 public:
528         CLASS_PROTOTYPE( idTarget_RemoveWeapons );
529 private:
530         void                            Event_Activate( idEntity *activator );
531 };
532
533
534 /*
535 ===============================================================================
536
537 idTarget_LevelTrigger
538
539 ===============================================================================
540 */
541 class idTarget_LevelTrigger : public idTarget {
542 public:
543         CLASS_PROTOTYPE( idTarget_LevelTrigger );
544 private:
545         void                            Event_Activate( idEntity *activator );
546 };
547
548 /*
549 ===============================================================================
550
551 idTarget_EnableStamina
552
553 ===============================================================================
554 */
555 class idTarget_EnableStamina : public idTarget {
556 public:
557         CLASS_PROTOTYPE( idTarget_EnableStamina );
558 private:
559         void                            Event_Activate( idEntity *activator );
560 };
561
562 /*
563 ===============================================================================
564
565 idTarget_FadeSoundClass
566
567 ===============================================================================
568 */
569 class idTarget_FadeSoundClass : public idTarget {
570 public:
571         CLASS_PROTOTYPE( idTarget_FadeSoundClass );
572 private:
573         void                            Event_Activate( idEntity *activator );
574         void                            Event_RestoreVolume();
575 };
576
577
578 #endif /* !__GAME_TARGET_H__ */