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