diff options
Diffstat (limited to 'apps/plugins/doom/p_spec.h')
-rw-r--r-- | apps/plugins/doom/p_spec.h | 1148 |
1 files changed, 1148 insertions, 0 deletions
diff --git a/apps/plugins/doom/p_spec.h b/apps/plugins/doom/p_spec.h new file mode 100644 index 0000000000..7a13ad8aa0 --- /dev/null +++ b/apps/plugins/doom/p_spec.h | |||
@@ -0,0 +1,1148 @@ | |||
1 | /* Emacs style mode select -*- C++ -*- | ||
2 | *----------------------------------------------------------------------------- | ||
3 | * | ||
4 | * | ||
5 | * PrBoom a Doom port merged with LxDoom and LSDLDoom | ||
6 | * based on BOOM, a modified and improved DOOM engine | ||
7 | * Copyright (C) 1999 by | ||
8 | * id Software, Chi Hoang, Lee Killough, Jim Flynn, Rand Phares, Ty Halderman | ||
9 | * Copyright (C) 1999-2000 by | ||
10 | * Jess Haas, Nicolas Kalkhof, Colin Phipps, Florian Schulze | ||
11 | * | ||
12 | * This program is free software; you can redistribute it and/or | ||
13 | * modify it under the terms of the GNU General Public License | ||
14 | * as published by the Free Software Foundation; either version 2 | ||
15 | * of the License, or (at your option) any later version. | ||
16 | * | ||
17 | * This program is distributed in the hope that it will be useful, | ||
18 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
19 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
20 | * GNU General Public License for more details. | ||
21 | * | ||
22 | * You should have received a copy of the GNU General Public License | ||
23 | * along with this program; if not, write to the Free Software | ||
24 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA | ||
25 | * 02111-1307, USA. | ||
26 | * | ||
27 | * DESCRIPTION: definitions, declarations and prototypes for specials | ||
28 | * | ||
29 | *-----------------------------------------------------------------------------*/ | ||
30 | |||
31 | #ifndef __P_SPEC__ | ||
32 | #define __P_SPEC__ | ||
33 | |||
34 | #include "r_defs.h" | ||
35 | #include "d_player.h" | ||
36 | |||
37 | // Define values for map objects | ||
38 | #define MO_TELEPORTMAN 14 | ||
39 | |||
40 | // p_floor | ||
41 | |||
42 | #define ELEVATORSPEED (FRACUNIT*4) | ||
43 | #define FLOORSPEED FRACUNIT | ||
44 | |||
45 | // p_ceilng | ||
46 | |||
47 | #define CEILSPEED FRACUNIT | ||
48 | #define CEILWAIT 150 | ||
49 | |||
50 | // p_doors | ||
51 | |||
52 | #define VDOORSPEED (FRACUNIT*2) | ||
53 | #define VDOORWAIT 150 | ||
54 | |||
55 | // p_plats | ||
56 | |||
57 | #define PLATWAIT 3 | ||
58 | #define PLATSPEED FRACUNIT | ||
59 | |||
60 | // p_switch | ||
61 | |||
62 | // 4 players, 4 buttons each at once, max. | ||
63 | // killough 2/14/98: redefine in terms of MAXPLAYERS | ||
64 | #define MAXBUTTONS (MAXPLAYERS*4) | ||
65 | |||
66 | // 1 second, in ticks. | ||
67 | #define BUTTONTIME TICRATE | ||
68 | |||
69 | // p_lights | ||
70 | |||
71 | #define GLOWSPEED 8 | ||
72 | #define STROBEBRIGHT 5 | ||
73 | #define FASTDARK 15 | ||
74 | #define SLOWDARK 35 | ||
75 | |||
76 | //jff 3/14/98 add bits and shifts for generalized sector types | ||
77 | |||
78 | #define DAMAGE_MASK 0x60 | ||
79 | #define DAMAGE_SHIFT 5 | ||
80 | #define SECRET_MASK 0x80 | ||
81 | #define SECRET_SHIFT 7 | ||
82 | #define FRICTION_MASK 0x100 | ||
83 | #define FRICTION_SHIFT 8 | ||
84 | #define PUSH_MASK 0x200 | ||
85 | #define PUSH_SHIFT 9 | ||
86 | |||
87 | //jff 02/04/98 Define masks, shifts, for fields in | ||
88 | // generalized linedef types | ||
89 | |||
90 | #define GenEnd 0x8000 | ||
91 | #define GenFloorBase 0x6000 | ||
92 | #define GenCeilingBase 0x4000 | ||
93 | #define GenDoorBase 0x3c00 | ||
94 | #define GenLockedBase 0x3800 | ||
95 | #define GenLiftBase 0x3400 | ||
96 | #define GenStairsBase 0x3000 | ||
97 | #define GenCrusherBase 0x2F80 | ||
98 | |||
99 | #define TriggerType 0x0007 | ||
100 | #define TriggerTypeShift 0 | ||
101 | |||
102 | // define masks and shifts for the floor type fields | ||
103 | |||
104 | #define FloorCrush 0x1000 | ||
105 | #define FloorChange 0x0c00 | ||
106 | #define FloorTarget 0x0380 | ||
107 | #define FloorDirection 0x0040 | ||
108 | #define FloorModel 0x0020 | ||
109 | #define FloorSpeed 0x0018 | ||
110 | |||
111 | #define FloorCrushShift 12 | ||
112 | #define FloorChangeShift 10 | ||
113 | #define FloorTargetShift 7 | ||
114 | #define FloorDirectionShift 6 | ||
115 | #define FloorModelShift 5 | ||
116 | #define FloorSpeedShift 3 | ||
117 | |||
118 | // define masks and shifts for the ceiling type fields | ||
119 | |||
120 | #define CeilingCrush 0x1000 | ||
121 | #define CeilingChange 0x0c00 | ||
122 | #define CeilingTarget 0x0380 | ||
123 | #define CeilingDirection 0x0040 | ||
124 | #define CeilingModel 0x0020 | ||
125 | #define CeilingSpeed 0x0018 | ||
126 | |||
127 | #define CeilingCrushShift 12 | ||
128 | #define CeilingChangeShift 10 | ||
129 | #define CeilingTargetShift 7 | ||
130 | #define CeilingDirectionShift 6 | ||
131 | #define CeilingModelShift 5 | ||
132 | #define CeilingSpeedShift 3 | ||
133 | |||
134 | // define masks and shifts for the lift type fields | ||
135 | |||
136 | #define LiftTarget 0x0300 | ||
137 | #define LiftDelay 0x00c0 | ||
138 | #define LiftMonster 0x0020 | ||
139 | #define LiftSpeed 0x0018 | ||
140 | |||
141 | #define LiftTargetShift 8 | ||
142 | #define LiftDelayShift 6 | ||
143 | #define LiftMonsterShift 5 | ||
144 | #define LiftSpeedShift 3 | ||
145 | |||
146 | // define masks and shifts for the stairs type fields | ||
147 | |||
148 | #define StairIgnore 0x0200 | ||
149 | #define StairDirection 0x0100 | ||
150 | #define StairStep 0x00c0 | ||
151 | #define StairMonster 0x0020 | ||
152 | #define StairSpeed 0x0018 | ||
153 | |||
154 | #define StairIgnoreShift 9 | ||
155 | #define StairDirectionShift 8 | ||
156 | #define StairStepShift 6 | ||
157 | #define StairMonsterShift 5 | ||
158 | #define StairSpeedShift 3 | ||
159 | |||
160 | // define masks and shifts for the crusher type fields | ||
161 | |||
162 | #define CrusherSilent 0x0040 | ||
163 | #define CrusherMonster 0x0020 | ||
164 | #define CrusherSpeed 0x0018 | ||
165 | |||
166 | #define CrusherSilentShift 6 | ||
167 | #define CrusherMonsterShift 5 | ||
168 | #define CrusherSpeedShift 3 | ||
169 | |||
170 | // define masks and shifts for the door type fields | ||
171 | |||
172 | #define DoorDelay 0x0300 | ||
173 | #define DoorMonster 0x0080 | ||
174 | #define DoorKind 0x0060 | ||
175 | #define DoorSpeed 0x0018 | ||
176 | |||
177 | #define DoorDelayShift 8 | ||
178 | #define DoorMonsterShift 7 | ||
179 | #define DoorKindShift 5 | ||
180 | #define DoorSpeedShift 3 | ||
181 | |||
182 | // define masks and shifts for the locked door type fields | ||
183 | |||
184 | #define LockedNKeys 0x0200 | ||
185 | #define LockedKey 0x01c0 | ||
186 | #define LockedKind 0x0020 | ||
187 | #define LockedSpeed 0x0018 | ||
188 | |||
189 | #define LockedNKeysShift 9 | ||
190 | #define LockedKeyShift 6 | ||
191 | #define LockedKindShift 5 | ||
192 | #define LockedSpeedShift 3 | ||
193 | |||
194 | // define names for the TriggerType field of the general linedefs | ||
195 | |||
196 | typedef enum | ||
197 | { | ||
198 | WalkOnce, | ||
199 | WalkMany, | ||
200 | SwitchOnce, | ||
201 | SwitchMany, | ||
202 | GunOnce, | ||
203 | GunMany, | ||
204 | PushOnce, | ||
205 | PushMany, | ||
206 | } triggertype_e; | ||
207 | |||
208 | // define names for the Speed field of the general linedefs | ||
209 | |||
210 | typedef enum | ||
211 | { | ||
212 | SpeedSlow, | ||
213 | SpeedNormal, | ||
214 | SpeedFast, | ||
215 | SpeedTurbo, | ||
216 | } motionspeed_e; | ||
217 | |||
218 | // define names for the Target field of the general floor | ||
219 | |||
220 | typedef enum | ||
221 | { | ||
222 | FtoHnF, | ||
223 | FtoLnF, | ||
224 | FtoNnF, | ||
225 | FtoLnC, | ||
226 | FtoC, | ||
227 | FbyST, | ||
228 | Fby24, | ||
229 | Fby32, | ||
230 | } floortarget_e; | ||
231 | |||
232 | // define names for the Changer Type field of the general floor | ||
233 | |||
234 | typedef enum | ||
235 | { | ||
236 | FNoChg, | ||
237 | FChgZero, | ||
238 | FChgTxt, | ||
239 | FChgTyp, | ||
240 | } floorchange_e; | ||
241 | |||
242 | // define names for the Change Model field of the general floor | ||
243 | |||
244 | typedef enum | ||
245 | { | ||
246 | FTriggerModel, | ||
247 | FNumericModel, | ||
248 | } floormodel_t; | ||
249 | |||
250 | // define names for the Target field of the general ceiling | ||
251 | |||
252 | typedef enum | ||
253 | { | ||
254 | CtoHnC, | ||
255 | CtoLnC, | ||
256 | CtoNnC, | ||
257 | CtoHnF, | ||
258 | CtoF, | ||
259 | CbyST, | ||
260 | Cby24, | ||
261 | Cby32, | ||
262 | } ceilingtarget_e; | ||
263 | |||
264 | // define names for the Changer Type field of the general ceiling | ||
265 | |||
266 | typedef enum | ||
267 | { | ||
268 | CNoChg, | ||
269 | CChgZero, | ||
270 | CChgTxt, | ||
271 | CChgTyp, | ||
272 | } ceilingchange_e; | ||
273 | |||
274 | // define names for the Change Model field of the general ceiling | ||
275 | |||
276 | typedef enum | ||
277 | { | ||
278 | CTriggerModel, | ||
279 | CNumericModel, | ||
280 | } ceilingmodel_t; | ||
281 | |||
282 | // define names for the Target field of the general lift | ||
283 | |||
284 | typedef enum | ||
285 | { | ||
286 | F2LnF, | ||
287 | F2NnF, | ||
288 | F2LnC, | ||
289 | LnF2HnF, | ||
290 | } lifttarget_e; | ||
291 | |||
292 | // define names for the door Kind field of the general ceiling | ||
293 | |||
294 | typedef enum | ||
295 | { | ||
296 | OdCDoor, | ||
297 | ODoor, | ||
298 | CdODoor, | ||
299 | CDoor, | ||
300 | } doorkind_e; | ||
301 | |||
302 | // define names for the locked door Kind field of the general ceiling | ||
303 | |||
304 | typedef enum | ||
305 | { | ||
306 | AnyKey, | ||
307 | RCard, | ||
308 | BCard, | ||
309 | YCard, | ||
310 | RSkull, | ||
311 | BSkull, | ||
312 | YSkull, | ||
313 | AllKeys, | ||
314 | } keykind_e; | ||
315 | |||
316 | ////////////////////////////////////////////////////////////////// | ||
317 | // | ||
318 | // enums for classes of linedef triggers | ||
319 | // | ||
320 | ////////////////////////////////////////////////////////////////// | ||
321 | |||
322 | //jff 2/23/98 identify the special classes that can share sectors | ||
323 | |||
324 | typedef enum | ||
325 | { | ||
326 | floor_special, | ||
327 | ceiling_special, | ||
328 | lighting_special, | ||
329 | } special_e; | ||
330 | |||
331 | //jff 3/15/98 pure texture/type change for better generalized support | ||
332 | typedef enum | ||
333 | { | ||
334 | trigChangeOnly, | ||
335 | numChangeOnly, | ||
336 | } change_e; | ||
337 | |||
338 | // p_plats | ||
339 | |||
340 | typedef enum | ||
341 | { | ||
342 | up, | ||
343 | down, | ||
344 | waiting, | ||
345 | in_stasis | ||
346 | } plat_e; | ||
347 | |||
348 | typedef enum | ||
349 | { | ||
350 | perpetualRaise, | ||
351 | downWaitUpStay, | ||
352 | raiseAndChange, | ||
353 | raiseToNearestAndChange, | ||
354 | blazeDWUS, | ||
355 | genLift, //jff added to support generalized Plat types | ||
356 | genPerpetual, | ||
357 | toggleUpDn, //jff 3/14/98 added to support instant toggle type | ||
358 | |||
359 | } plattype_e; | ||
360 | |||
361 | // p_doors | ||
362 | |||
363 | typedef enum | ||
364 | { | ||
365 | normal, | ||
366 | close30ThenOpen, | ||
367 | p_close, | ||
368 | p_open, | ||
369 | raiseIn5Mins, | ||
370 | blazeRaise, | ||
371 | blazeOpen, | ||
372 | blazeClose, | ||
373 | |||
374 | //jff 02/05/98 add generalize door types | ||
375 | genRaise, | ||
376 | genBlazeRaise, | ||
377 | genOpen, | ||
378 | genBlazeOpen, | ||
379 | genClose, | ||
380 | genBlazeClose, | ||
381 | genCdO, | ||
382 | genBlazeCdO, | ||
383 | } vldoor_e; | ||
384 | |||
385 | // p_ceilng | ||
386 | |||
387 | typedef enum | ||
388 | { | ||
389 | lowerToFloor, | ||
390 | raiseToHighest, | ||
391 | lowerToLowest, | ||
392 | lowerToMaxFloor, | ||
393 | lowerAndCrush, | ||
394 | crushAndRaise, | ||
395 | fastCrushAndRaise, | ||
396 | silentCrushAndRaise, | ||
397 | |||
398 | //jff 02/04/98 add types for generalized ceiling mover | ||
399 | genCeiling, | ||
400 | genCeilingChg, | ||
401 | genCeilingChg0, | ||
402 | genCeilingChgT, | ||
403 | |||
404 | //jff 02/05/98 add types for generalized ceiling mover | ||
405 | genCrusher, | ||
406 | genSilentCrusher, | ||
407 | |||
408 | } ceiling_e; | ||
409 | |||
410 | // p_floor | ||
411 | |||
412 | typedef enum | ||
413 | { | ||
414 | // lower floor to highest surrounding floor | ||
415 | lowerFloor, | ||
416 | |||
417 | // lower floor to lowest surrounding floor | ||
418 | lowerFloorToLowest, | ||
419 | |||
420 | // lower floor to highest surrounding floor VERY FAST | ||
421 | turboLower, | ||
422 | |||
423 | // raise floor to lowest surrounding CEILING | ||
424 | raiseFloor, | ||
425 | |||
426 | // raise floor to next highest surrounding floor | ||
427 | raiseFloorToNearest, | ||
428 | |||
429 | //jff 02/03/98 lower floor to next lowest neighbor | ||
430 | lowerFloorToNearest, | ||
431 | |||
432 | //jff 02/03/98 lower floor 24 absolute | ||
433 | lowerFloor24, | ||
434 | |||
435 | //jff 02/03/98 lower floor 32 absolute | ||
436 | lowerFloor32Turbo, | ||
437 | |||
438 | // raise floor to shortest height texture around it | ||
439 | raiseToTexture, | ||
440 | |||
441 | // lower floor to lowest surrounding floor | ||
442 | // and change floorpic | ||
443 | lowerAndChange, | ||
444 | |||
445 | raiseFloor24, | ||
446 | |||
447 | //jff 02/03/98 raise floor 32 absolute | ||
448 | raiseFloor32Turbo, | ||
449 | |||
450 | raiseFloor24AndChange, | ||
451 | raiseFloorCrush, | ||
452 | |||
453 | // raise to next highest floor, turbo-speed | ||
454 | raiseFloorTurbo, | ||
455 | donutRaise, | ||
456 | raiseFloor512, | ||
457 | |||
458 | //jff 02/04/98 add types for generalized floor mover | ||
459 | genFloor, | ||
460 | genFloorChg, | ||
461 | genFloorChg0, | ||
462 | genFloorChgT, | ||
463 | |||
464 | //new types for stair builders | ||
465 | buildStair, | ||
466 | genBuildStair, | ||
467 | } floor_e; | ||
468 | |||
469 | typedef enum | ||
470 | { | ||
471 | build8, // slowly build by 8 | ||
472 | turbo16 // quickly build by 16 | ||
473 | |||
474 | } stair_e; | ||
475 | |||
476 | typedef enum | ||
477 | { | ||
478 | elevateUp, | ||
479 | elevateDown, | ||
480 | elevateCurrent, | ||
481 | } elevator_e; | ||
482 | |||
483 | ////////////////////////////////////////////////////////////////// | ||
484 | // | ||
485 | // general enums | ||
486 | // | ||
487 | ////////////////////////////////////////////////////////////////// | ||
488 | |||
489 | // texture type enum | ||
490 | typedef enum | ||
491 | { | ||
492 | top, | ||
493 | middle, | ||
494 | bottom | ||
495 | |||
496 | } bwhere_e; | ||
497 | |||
498 | // crush check returns | ||
499 | typedef enum | ||
500 | { | ||
501 | ok, | ||
502 | crushed, | ||
503 | pastdest | ||
504 | } result_e; | ||
505 | |||
506 | ////////////////////////////////////////////////////////////////// | ||
507 | // | ||
508 | // linedef and sector special data types | ||
509 | // | ||
510 | ////////////////////////////////////////////////////////////////// | ||
511 | |||
512 | // p_switch | ||
513 | |||
514 | // switch animation structure type | ||
515 | |||
516 | #if defined(__MWERKS__) | ||
517 | #pragma options align=packed | ||
518 | #endif | ||
519 | |||
520 | typedef struct | ||
521 | { | ||
522 | char name1[9]; | ||
523 | char name2[9]; | ||
524 | short episode; | ||
525 | } PACKEDATTR switchlist_t; //jff 3/23/98 pack to read from memory | ||
526 | |||
527 | #if defined(__MWERKS__) | ||
528 | #pragma options align=reset | ||
529 | #endif | ||
530 | |||
531 | typedef struct | ||
532 | { | ||
533 | line_t* line; | ||
534 | bwhere_e where; | ||
535 | int btexture; | ||
536 | int btimer; | ||
537 | mobj_t* soundorg; | ||
538 | |||
539 | } button_t; | ||
540 | |||
541 | // p_lights | ||
542 | |||
543 | typedef struct | ||
544 | { | ||
545 | thinker_t thinker; | ||
546 | sector_t* sector; | ||
547 | int count; | ||
548 | int maxlight; | ||
549 | int minlight; | ||
550 | |||
551 | } fireflicker_t; | ||
552 | |||
553 | typedef struct | ||
554 | { | ||
555 | thinker_t thinker; | ||
556 | sector_t* sector; | ||
557 | int count; | ||
558 | int maxlight; | ||
559 | int minlight; | ||
560 | int maxtime; | ||
561 | int mintime; | ||
562 | |||
563 | } lightflash_t; | ||
564 | |||
565 | typedef struct | ||
566 | { | ||
567 | thinker_t thinker; | ||
568 | sector_t* sector; | ||
569 | int count; | ||
570 | int minlight; | ||
571 | int maxlight; | ||
572 | int darktime; | ||
573 | int brighttime; | ||
574 | |||
575 | } strobe_t; | ||
576 | |||
577 | typedef struct | ||
578 | { | ||
579 | thinker_t thinker; | ||
580 | sector_t* sector; | ||
581 | int minlight; | ||
582 | int maxlight; | ||
583 | int direction; | ||
584 | |||
585 | } glow_t; | ||
586 | |||
587 | // p_plats | ||
588 | |||
589 | typedef struct | ||
590 | { | ||
591 | thinker_t thinker; | ||
592 | sector_t* sector; | ||
593 | fixed_t speed; | ||
594 | fixed_t low; | ||
595 | fixed_t high; | ||
596 | int wait; | ||
597 | int count; | ||
598 | plat_e status; | ||
599 | plat_e oldstatus; | ||
600 | boolean crush; | ||
601 | int tag; | ||
602 | plattype_e type; | ||
603 | |||
604 | struct platlist *list; // killough | ||
605 | } plat_t; | ||
606 | |||
607 | // New limit-free plat structure -- killough | ||
608 | |||
609 | typedef struct platlist { | ||
610 | plat_t *plat; | ||
611 | struct platlist *next,**prev; | ||
612 | } platlist_t; | ||
613 | |||
614 | // p_ceilng | ||
615 | |||
616 | typedef struct | ||
617 | { | ||
618 | thinker_t thinker; | ||
619 | vldoor_e type; | ||
620 | sector_t* sector; | ||
621 | fixed_t topheight; | ||
622 | fixed_t speed; | ||
623 | |||
624 | // 1 = up, 0 = waiting at top, -1 = down | ||
625 | int direction; | ||
626 | |||
627 | // tics to wait at the top | ||
628 | int topwait; | ||
629 | // (keep in case a door going down is reset) | ||
630 | // when it reaches 0, start going down | ||
631 | int topcountdown; | ||
632 | |||
633 | //jff 1/31/98 keep track of line door is triggered by | ||
634 | line_t *line; | ||
635 | |||
636 | /* killough 10/98: sector tag for gradual lighting effects */ | ||
637 | int lighttag; | ||
638 | } vldoor_t; | ||
639 | |||
640 | // p_doors | ||
641 | |||
642 | typedef struct | ||
643 | { | ||
644 | thinker_t thinker; | ||
645 | ceiling_e type; | ||
646 | sector_t* sector; | ||
647 | fixed_t bottomheight; | ||
648 | fixed_t topheight; | ||
649 | fixed_t speed; | ||
650 | fixed_t oldspeed; | ||
651 | boolean crush; | ||
652 | |||
653 | //jff 02/04/98 add these to support ceiling changers | ||
654 | int newspecial; | ||
655 | int oldspecial; //jff 3/14/98 add to fix bug in change transfers | ||
656 | short texture; | ||
657 | |||
658 | // 1 = up, 0 = waiting, -1 = down | ||
659 | int direction; | ||
660 | |||
661 | // ID | ||
662 | int tag; | ||
663 | int olddirection; | ||
664 | struct ceilinglist *list; // jff 2/22/98 copied from killough's plats | ||
665 | } ceiling_t; | ||
666 | |||
667 | typedef struct ceilinglist { | ||
668 | ceiling_t *ceiling; | ||
669 | struct ceilinglist *next,**prev; | ||
670 | } ceilinglist_t; | ||
671 | |||
672 | // p_floor | ||
673 | |||
674 | typedef struct | ||
675 | { | ||
676 | thinker_t thinker; | ||
677 | floor_e type; | ||
678 | boolean crush; | ||
679 | sector_t* sector; | ||
680 | int direction; | ||
681 | int newspecial; | ||
682 | int oldspecial; //jff 3/14/98 add to fix bug in change transfers | ||
683 | short texture; | ||
684 | fixed_t floordestheight; | ||
685 | fixed_t speed; | ||
686 | |||
687 | } floormove_t; | ||
688 | |||
689 | typedef struct | ||
690 | { | ||
691 | thinker_t thinker; | ||
692 | elevator_e type; | ||
693 | sector_t* sector; | ||
694 | int direction; | ||
695 | fixed_t floordestheight; | ||
696 | fixed_t ceilingdestheight; | ||
697 | fixed_t speed; | ||
698 | } elevator_t; | ||
699 | |||
700 | // p_spec | ||
701 | |||
702 | // killough 3/7/98: Add generalized scroll effects | ||
703 | |||
704 | typedef struct { | ||
705 | thinker_t thinker; // Thinker structure for scrolling | ||
706 | fixed_t dx, dy; // (dx,dy) scroll speeds | ||
707 | int affectee; // Number of affected sidedef, sector, tag, or whatever | ||
708 | int control; // Control sector (-1 if none) used to control scrolling | ||
709 | fixed_t last_height; // Last known height of control sector | ||
710 | fixed_t vdx, vdy; // Accumulated velocity if accelerative | ||
711 | int accel; // Whether it's accelerative | ||
712 | enum | ||
713 | { | ||
714 | sc_side, | ||
715 | sc_floor, | ||
716 | sc_ceiling, | ||
717 | sc_carry, | ||
718 | sc_carry_ceiling, // killough 4/11/98: carry objects hanging on ceilings | ||
719 | } type; // Type of scroll effect | ||
720 | } scroll_t; | ||
721 | |||
722 | // phares 3/12/98: added new model of friction for ice/sludge effects | ||
723 | |||
724 | typedef struct { | ||
725 | thinker_t thinker; // Thinker structure for friction | ||
726 | int friction; // friction value (E800 = normal) | ||
727 | int movefactor; // inertia factor when adding to momentum | ||
728 | int affectee; // Number of affected sector | ||
729 | } friction_t; | ||
730 | |||
731 | // phares 3/20/98: added new model of Pushers for push/pull effects | ||
732 | |||
733 | typedef struct { | ||
734 | thinker_t thinker; // Thinker structure for Pusher | ||
735 | enum | ||
736 | { | ||
737 | p_push, | ||
738 | p_pull, | ||
739 | p_wind, | ||
740 | p_current, | ||
741 | } type; | ||
742 | mobj_t* source; // Point source if point pusher | ||
743 | int x_mag; // X Strength | ||
744 | int y_mag; // Y Strength | ||
745 | int magnitude; // Vector strength for point pusher | ||
746 | int radius; // Effective radius for point pusher | ||
747 | int x; // X of point source if point pusher | ||
748 | int y; // Y of point source if point pusher | ||
749 | int affectee; // Number of affected sector | ||
750 | } pusher_t; | ||
751 | |||
752 | ////////////////////////////////////////////////////////////////// | ||
753 | // | ||
754 | // external data declarations | ||
755 | // | ||
756 | ////////////////////////////////////////////////////////////////// | ||
757 | |||
758 | // | ||
759 | // End-level timer (-TIMER option) | ||
760 | // | ||
761 | extern boolean levelTimer; | ||
762 | extern int levelTimeCount; | ||
763 | |||
764 | // list of retriggerable buttons active | ||
765 | extern button_t buttonlist[MAXBUTTONS]; | ||
766 | |||
767 | extern platlist_t *activeplats; // killough 2/14/98 | ||
768 | |||
769 | extern ceilinglist_t *activeceilings; // jff 2/22/98 | ||
770 | |||
771 | //////////////////////////////////////////////////////////////// | ||
772 | // | ||
773 | // Linedef and sector special utility function prototypes | ||
774 | // | ||
775 | //////////////////////////////////////////////////////////////// | ||
776 | |||
777 | int twoSided | ||
778 | ( int sector, | ||
779 | int line ); | ||
780 | |||
781 | sector_t* getSector | ||
782 | ( int currentSector, | ||
783 | int line, | ||
784 | int side ); | ||
785 | |||
786 | side_t* getSide | ||
787 | ( int currentSector, | ||
788 | int line, | ||
789 | int side ); | ||
790 | |||
791 | fixed_t P_FindLowestFloorSurrounding | ||
792 | ( sector_t* sec ); | ||
793 | |||
794 | fixed_t P_FindHighestFloorSurrounding | ||
795 | ( sector_t* sec ); | ||
796 | |||
797 | fixed_t P_FindNextHighestFloor | ||
798 | ( sector_t* sec, | ||
799 | int currentheight ); | ||
800 | |||
801 | fixed_t P_FindNextLowestFloor | ||
802 | ( sector_t* sec, | ||
803 | int currentheight ); | ||
804 | |||
805 | fixed_t P_FindLowestCeilingSurrounding | ||
806 | ( sector_t* sec ); // jff 2/04/98 | ||
807 | |||
808 | fixed_t P_FindHighestCeilingSurrounding | ||
809 | ( sector_t* sec ); // jff 2/04/98 | ||
810 | |||
811 | fixed_t P_FindNextLowestCeiling | ||
812 | ( sector_t *sec, | ||
813 | int currentheight ); // jff 2/04/98 | ||
814 | |||
815 | fixed_t P_FindNextHighestCeiling | ||
816 | ( sector_t *sec, | ||
817 | int currentheight ); // jff 2/04/98 | ||
818 | |||
819 | fixed_t P_FindShortestTextureAround | ||
820 | ( int secnum ); // jff 2/04/98 | ||
821 | |||
822 | fixed_t P_FindShortestUpperAround | ||
823 | ( int secnum ); // jff 2/04/98 | ||
824 | |||
825 | sector_t* P_FindModelFloorSector | ||
826 | ( fixed_t floordestheight, | ||
827 | int secnum ); //jff 02/04/98 | ||
828 | |||
829 | sector_t* P_FindModelCeilingSector | ||
830 | ( fixed_t ceildestheight, | ||
831 | int secnum ); //jff 02/04/98 | ||
832 | |||
833 | int P_FindSectorFromLineTag | ||
834 | ( const line_t *line, | ||
835 | int start ); // killough 4/17/98 | ||
836 | |||
837 | int P_FindLineFromLineTag | ||
838 | ( const line_t *line, | ||
839 | int start ); // killough 4/17/98 | ||
840 | |||
841 | int P_FindMinSurroundingLight | ||
842 | ( sector_t* sector, | ||
843 | int max ); | ||
844 | |||
845 | sector_t* getNextSector | ||
846 | ( line_t* line, | ||
847 | sector_t* sec ); | ||
848 | |||
849 | int P_CheckTag | ||
850 | (line_t *line); // jff 2/27/98 | ||
851 | |||
852 | boolean P_CanUnlockGenDoor | ||
853 | ( line_t* line, | ||
854 | player_t* player); | ||
855 | |||
856 | int P_SectorActive | ||
857 | ( special_e t, | ||
858 | sector_t* s ); | ||
859 | |||
860 | boolean P_IsSecret | ||
861 | ( sector_t *sec ); | ||
862 | |||
863 | boolean P_WasSecret | ||
864 | ( sector_t *sec ); | ||
865 | |||
866 | void P_ChangeSwitchTexture | ||
867 | ( line_t* line, | ||
868 | int useAgain ); | ||
869 | |||
870 | //////////////////////////////////////////////////////////////// | ||
871 | // | ||
872 | // Linedef and sector special action function prototypes | ||
873 | // | ||
874 | //////////////////////////////////////////////////////////////// | ||
875 | |||
876 | // p_lights | ||
877 | |||
878 | void T_LightFlash | ||
879 | ( lightflash_t* flash ); | ||
880 | |||
881 | void T_StrobeFlash | ||
882 | ( strobe_t* flash ); | ||
883 | |||
884 | // jff 8/8/98 add missing thinker for flicker | ||
885 | void T_FireFlicker | ||
886 | ( fireflicker_t* flick ); | ||
887 | |||
888 | void T_Glow | ||
889 | ( glow_t* g ); | ||
890 | |||
891 | // p_plats | ||
892 | |||
893 | void T_PlatRaise | ||
894 | ( plat_t* plat ); | ||
895 | |||
896 | // p_doors | ||
897 | |||
898 | void T_VerticalDoor | ||
899 | ( vldoor_t* door ); | ||
900 | |||
901 | // p_ceilng | ||
902 | |||
903 | void T_MoveCeiling | ||
904 | ( ceiling_t* ceiling ); | ||
905 | |||
906 | // p_floor | ||
907 | |||
908 | result_e T_MovePlane | ||
909 | ( sector_t* sector, | ||
910 | fixed_t speed, | ||
911 | fixed_t dest, | ||
912 | boolean crush, | ||
913 | int floorOrCeiling, | ||
914 | int direction ); | ||
915 | |||
916 | void T_MoveFloor | ||
917 | ( floormove_t* floor ); | ||
918 | |||
919 | void T_MoveElevator | ||
920 | ( elevator_t* elevator ); | ||
921 | |||
922 | // p_spec | ||
923 | |||
924 | void T_Scroll | ||
925 | ( scroll_t * ); // killough 3/7/98: scroll effect thinker | ||
926 | |||
927 | void T_Friction | ||
928 | ( friction_t * ); // phares 3/12/98: friction thinker | ||
929 | |||
930 | void T_Pusher | ||
931 | ( pusher_t * ); // phares 3/20/98: Push thinker | ||
932 | |||
933 | //////////////////////////////////////////////////////////////// | ||
934 | // | ||
935 | // Linedef and sector special handler prototypes | ||
936 | // | ||
937 | //////////////////////////////////////////////////////////////// | ||
938 | |||
939 | // p_telept | ||
940 | |||
941 | int EV_Teleport | ||
942 | ( line_t* line, | ||
943 | int side, | ||
944 | mobj_t* thing ); | ||
945 | |||
946 | // killough 2/14/98: Add silent teleporter | ||
947 | int EV_SilentTeleport | ||
948 | ( line_t* line, | ||
949 | int side, | ||
950 | mobj_t* thing ); | ||
951 | |||
952 | // killough 1/31/98: Add silent line teleporter | ||
953 | int EV_SilentLineTeleport | ||
954 | ( line_t* line, | ||
955 | int side, | ||
956 | mobj_t* thing, | ||
957 | boolean reverse); | ||
958 | |||
959 | // p_floor | ||
960 | |||
961 | int | ||
962 | EV_DoElevator | ||
963 | ( line_t* line, | ||
964 | elevator_e type ); | ||
965 | |||
966 | int EV_BuildStairs | ||
967 | ( line_t* line, | ||
968 | stair_e type ); | ||
969 | |||
970 | int EV_DoFloor | ||
971 | ( line_t* line, | ||
972 | floor_e floortype ); | ||
973 | |||
974 | // p_ceilng | ||
975 | |||
976 | int EV_DoCeiling | ||
977 | ( line_t* line, | ||
978 | ceiling_e type ); | ||
979 | |||
980 | int EV_CeilingCrushStop | ||
981 | ( line_t* line ); | ||
982 | |||
983 | // p_doors | ||
984 | |||
985 | int EV_VerticalDoor | ||
986 | ( line_t* line, | ||
987 | mobj_t* thing ); | ||
988 | |||
989 | int EV_DoDoor | ||
990 | ( line_t* line, | ||
991 | vldoor_e type ); | ||
992 | |||
993 | int EV_DoLockedDoor | ||
994 | ( line_t* line, | ||
995 | vldoor_e type, | ||
996 | mobj_t* thing ); | ||
997 | |||
998 | // p_lights | ||
999 | |||
1000 | int EV_StartLightStrobing | ||
1001 | ( line_t* line ); | ||
1002 | |||
1003 | int EV_TurnTagLightsOff | ||
1004 | ( line_t* line ); | ||
1005 | |||
1006 | int EV_LightTurnOn | ||
1007 | ( line_t* line, | ||
1008 | int bright ); | ||
1009 | |||
1010 | int EV_LightTurnOnPartway(line_t* line, fixed_t level); // killough 10/10/98 | ||
1011 | |||
1012 | // p_floor | ||
1013 | |||
1014 | int EV_DoChange | ||
1015 | ( line_t* line, | ||
1016 | change_e changetype ); | ||
1017 | |||
1018 | int EV_DoDonut | ||
1019 | ( line_t* line ); | ||
1020 | |||
1021 | // p_plats | ||
1022 | |||
1023 | int EV_DoPlat | ||
1024 | ( line_t* line, | ||
1025 | plattype_e type, | ||
1026 | int amount ); | ||
1027 | |||
1028 | int EV_StopPlat | ||
1029 | ( line_t* line ); | ||
1030 | |||
1031 | // p_genlin | ||
1032 | |||
1033 | int EV_DoGenFloor | ||
1034 | ( line_t* line ); | ||
1035 | |||
1036 | int EV_DoGenCeiling | ||
1037 | ( line_t* line ); | ||
1038 | |||
1039 | int EV_DoGenLift | ||
1040 | ( line_t* line ); | ||
1041 | |||
1042 | int EV_DoGenStairs | ||
1043 | ( line_t* line ); | ||
1044 | |||
1045 | int EV_DoGenCrusher | ||
1046 | ( line_t* line ); | ||
1047 | |||
1048 | int EV_DoGenDoor | ||
1049 | ( line_t* line ); | ||
1050 | |||
1051 | int EV_DoGenLockedDoor | ||
1052 | ( line_t* line ); | ||
1053 | |||
1054 | //////////////////////////////////////////////////////////////// | ||
1055 | // | ||
1056 | // Linedef and sector special thinker spawning | ||
1057 | // | ||
1058 | //////////////////////////////////////////////////////////////// | ||
1059 | |||
1060 | // at game start | ||
1061 | void P_InitPicAnims | ||
1062 | ( void ); | ||
1063 | |||
1064 | void P_InitSwitchList | ||
1065 | ( void ); | ||
1066 | |||
1067 | // at map load | ||
1068 | void P_SpawnSpecials | ||
1069 | ( void ); | ||
1070 | |||
1071 | // every tic | ||
1072 | void P_UpdateSpecials | ||
1073 | ( void ); | ||
1074 | |||
1075 | // when needed | ||
1076 | boolean P_UseSpecialLine | ||
1077 | ( mobj_t* thing, | ||
1078 | line_t* line, | ||
1079 | int side ); | ||
1080 | |||
1081 | void P_ShootSpecialLine | ||
1082 | ( mobj_t* thing, | ||
1083 | line_t* line ); | ||
1084 | |||
1085 | void P_CrossSpecialLine(line_t *line, int side, mobj_t *thing); | ||
1086 | |||
1087 | void P_PlayerInSpecialSector | ||
1088 | ( player_t* player ); | ||
1089 | |||
1090 | // p_lights | ||
1091 | |||
1092 | void P_SpawnFireFlicker | ||
1093 | ( sector_t* sector ); | ||
1094 | |||
1095 | void P_SpawnLightFlash | ||
1096 | ( sector_t* sector ); | ||
1097 | |||
1098 | void P_SpawnStrobeFlash | ||
1099 | ( sector_t* sector, | ||
1100 | int fastOrSlow, | ||
1101 | int inSync ); | ||
1102 | |||
1103 | void P_SpawnGlowingLight | ||
1104 | ( sector_t* sector ); | ||
1105 | |||
1106 | // p_plats | ||
1107 | |||
1108 | void P_AddActivePlat | ||
1109 | ( plat_t* plat ); | ||
1110 | |||
1111 | void P_RemoveActivePlat | ||
1112 | ( plat_t* plat ); | ||
1113 | |||
1114 | void P_RemoveAllActivePlats | ||
1115 | ( void ); // killough | ||
1116 | |||
1117 | void P_ActivateInStasis | ||
1118 | ( int tag ); | ||
1119 | |||
1120 | // p_doors | ||
1121 | |||
1122 | void P_SpawnDoorCloseIn30 | ||
1123 | ( sector_t* sec ); | ||
1124 | |||
1125 | void P_SpawnDoorRaiseIn5Mins | ||
1126 | ( sector_t* sec, | ||
1127 | int secnum ); | ||
1128 | |||
1129 | // p_ceilng | ||
1130 | |||
1131 | void P_RemoveActiveCeiling | ||
1132 | ( ceiling_t* ceiling ); //jff 2/22/98 | ||
1133 | |||
1134 | void P_RemoveAllActiveCeilings | ||
1135 | ( void ); //jff 2/22/98 | ||
1136 | |||
1137 | void P_AddActiveCeiling | ||
1138 | ( ceiling_t* c ); | ||
1139 | |||
1140 | void P_RemoveActiveCeiling | ||
1141 | ( ceiling_t* c ); | ||
1142 | |||
1143 | int P_ActivateInStasisCeiling | ||
1144 | ( line_t* line ); | ||
1145 | |||
1146 | mobj_t* P_GetPushThing(int); // phares 3/23/98 | ||
1147 | |||
1148 | #endif | ||