|
|
1.1 root 1: /* P_spec.h */
2:
3: /*
4: ===============================================================================
5:
6: P_SPEC
7:
8: ===============================================================================
9: */
10:
11: /* */
12: /* Animating textures and planes */
13: /* */
14: typedef struct
15: {
16: boolean istexture;
17: int picnum;
18: int basepic;
19: int numpics;
20: int current;
21: } anim_t;
22:
23: /* */
24: /* source animation definition */
25: /* */
26: typedef struct
27: {
28: boolean istexture; /* if false, it's a flat */
29: char endname[9];
30: char startname[9];
31: int speed;
32: } animdef_t;
33:
34: #define MAXANIMS 32
35:
36: extern anim_t anims[MAXANIMS], *lastanim;
37:
38:
39: /* */
40: /* Animating line specials */
41: /* */
42: #define MAXLINEANIMS 64
43: extern int numlinespecials;
44: extern line_t *linespeciallist[MAXLINEANIMS];
45:
46:
47: /* Define values for map objects */
48: #define MO_TELEPORTMAN 14
49:
50:
51: /* at game start */
52: void P_InitPicAnims (void);
53:
54: /* at map load */
55: void P_SpawnSpecials (void);
56:
57: /* every tic */
58: void P_UpdateSpecials (void);
59:
60: /* when needed */
61: boolean P_UseSpecialLine ( mobj_t *thing, line_t *line);
62: void P_ShootSpecialLine ( mobj_t *thing, line_t *line);
63: void P_CrossSpecialLine (line_t *line,mobj_t *thing);
64:
65: void P_PlayerInSpecialSector (player_t *player);
66:
67: int twoSided(int sector,int line);
68: sector_t *getSector(int currentSector,int line,int side);
69: side_t *getSide(int currentSector,int line, int side);
70: fixed_t P_FindLowestFloorSurrounding(sector_t *sec);
71: fixed_t P_FindHighestFloorSurrounding(sector_t *sec);
72: fixed_t P_FindNextHighestFloor(sector_t *sec,int currentheight);
73: fixed_t P_FindLowestCeilingSurrounding(sector_t *sec);
74: fixed_t P_FindHighestCeilingSurrounding(sector_t *sec);
75: int P_FindSectorFromLineTag(line_t *line,int start);
76: int P_FindMinSurroundingLight(sector_t *sector,int max);
77: sector_t *getNextSector(line_t *line,sector_t *sec);
78:
79: /* */
80: /* SPECIAL */
81: /* */
82: int EV_DoDonut(line_t *line);
83:
84: /*
85: ===============================================================================
86:
87: P_LIGHTS
88:
89: ===============================================================================
90: */
91: typedef struct
92: {
93: thinker_t thinker;
94: sector_t *sector;
95: int count;
96: int maxlight;
97: int minlight;
98: int maxtime;
99: int mintime;
100: } lightflash_t;
101:
102: typedef struct
103: {
104: thinker_t thinker;
105: sector_t *sector;
106: int count;
107: int minlight;
108: int maxlight;
109: int darktime;
110: int brighttime;
111: } strobe_t;
112:
113: typedef struct
114: {
115: thinker_t thinker;
116: sector_t *sector;
117: int minlight;
118: int maxlight;
119: int direction;
120: } glow_t;
121:
122: #define GLOWSPEED 16
123: #define STROBEBRIGHT 3
124: #define FASTDARK 8
125: #define SLOWDARK 15
126:
127: void T_LightFlash (lightflash_t *flash);
128: void P_SpawnLightFlash (sector_t *sector);
129: void T_StrobeFlash (strobe_t *flash);
130: void P_SpawnStrobeFlash (sector_t *sector, int fastOrSlow, int inSync);
131: void EV_StartLightStrobing(line_t *line);
132: void EV_TurnTagLightsOff(line_t *line);
133: void EV_LightTurnOn(line_t *line, int bright);
134: void T_Glow(glow_t *g);
135: void P_SpawnGlowingLight(sector_t *sector);
136:
137: /*
138: ===============================================================================
139:
140: P_SWITCH
141:
142: ===============================================================================
143: */
144: typedef struct
145: {
146: char name1[9];
147: char name2[9];
148: } switchlist_t;
149:
150: typedef enum
151: {
152: top,
153: middle,
154: bottom
155: } bwhere_e;
156:
157: typedef struct
158: {
159: line_t *line;
160: bwhere_e where;
161: int btexture;
162: int btimer;
163: mobj_t *soundorg;
164: } button_t;
165:
166: #define MAXSWITCHES 50 /* max # of wall switches in a level */
167: #define MAXBUTTONS 16 /* 4 players, 4 buttons each at once, max. */
168: #define BUTTONTIME 15 /* 1 second */
169:
170: extern button_t buttonlist[MAXBUTTONS];
171:
172: void P_ChangeSwitchTexture(line_t *line,int useAgain);
173: void P_InitSwitchList(void);
174:
175: /*
176: ===============================================================================
177:
178: P_PLATS
179:
180: ===============================================================================
181: */
182: typedef enum
183: {
184: up,
185: down,
186: waiting,
187: in_stasis
188: } plat_e;
189:
190: typedef enum
191: {
192: perpetualRaise,
193: downWaitUpStay,
194: raiseAndChange,
195: raiseToNearestAndChange
196: } plattype_e;
197:
198: typedef struct
199: {
200: thinker_t thinker;
201: sector_t *sector;
202: fixed_t speed;
203: fixed_t low;
204: fixed_t high;
205: int wait;
206: int count;
207: plat_e status;
208: plat_e oldstatus;
209: boolean crush;
210: int tag;
211: plattype_e type;
212: } plat_t;
213:
214: #define PLATWAIT 3 /* seconds */
215: #define PLATSPEED (FRACUNIT*2)
216: #define MAXPLATS 30
217:
218: extern plat_t *activeplats[MAXPLATS];
219:
220: void T_PlatRaise(plat_t *plat);
221: int EV_DoPlat(line_t *line,plattype_e type,int amount);
222: void P_AddActivePlat(plat_t *plat);
223: void P_RemoveActivePlat(plat_t *plat);
224: void EV_StopPlat(line_t *line);
225: void P_ActivateInStasis(int tag);
226:
227: /*
228: ===============================================================================
229:
230: P_DOORS
231:
232: ===============================================================================
233: */
234: typedef enum
235: {
236: normal,
237: close30ThenOpen,
238: close,
239: open,
240: raiseIn5Mins
241: } vldoor_e;
242:
243: typedef struct
244: {
245: thinker_t thinker;
246: vldoor_e type;
247: sector_t *sector;
248: fixed_t topheight;
249: fixed_t speed;
250: int direction; /* 1 = up, 0 = waiting at top, -1 = down */
251: int topwait; /* tics to wait at the top */
252: /* (keep in case a door going down is reset) */
253: int topcountdown; /* when it reaches 0, start going down */
254: } vldoor_t;
255:
256: #define VDOORSPEED FRACUNIT*6
257: #define VDOORWAIT 70
258:
259: void EV_VerticalDoor (line_t *line, mobj_t *thing);
260: int EV_DoDoor (line_t *line, vldoor_e type);
261: void T_VerticalDoor (vldoor_t *door);
262: void P_SpawnDoorCloseIn30 (sector_t *sec);
263: void P_SpawnDoorRaiseIn5Mins (sector_t *sec, int secnum);
264:
265: /*
266: ===============================================================================
267:
268: P_CEILNG
269:
270: ===============================================================================
271: */
272: typedef enum
273: {
274: lowerToFloor,
275: raiseToHighest,
276: lowerAndCrush,
277: crushAndRaise,
278: fastCrushAndRaise
279: } ceiling_e;
280:
281: typedef struct
282: {
283: thinker_t thinker;
284: ceiling_e type;
285: sector_t *sector;
286: fixed_t bottomheight, topheight;
287: fixed_t speed;
288: boolean crush;
289: int direction; /* 1 = up, 0 = waiting, -1 = down */
290: int tag; /* ID */
291: int olddirection;
292: } ceiling_t;
293:
294: #define CEILSPEED FRACUNIT*2
295: #define MAXCEILINGS 30
296:
297: extern ceiling_t *activeceilings[MAXCEILINGS];
298:
299: int EV_DoCeiling (line_t *line, ceiling_e type);
300: void T_MoveCeiling (ceiling_t *ceiling);
301: void P_AddActiveCeiling(ceiling_t *c);
302: void P_RemoveActiveCeiling(ceiling_t *c);
303: int EV_CeilingCrushStop(line_t *line);
304: void P_ActivateInStasisCeiling(line_t *line);
305:
306: /*
307: ===============================================================================
308:
309: P_FLOOR
310:
311: ===============================================================================
312: */
313: typedef enum
314: {
315: lowerFloor, /* lower floor to highest surrounding floor */
316: lowerFloorToLowest, /* lower floor to lowest surrounding floor */
317: turboLower, /* lower floor to highest surrounding floor VERY FAST */
318: raiseFloor, /* raise floor to lowest surrounding CEILING */
319: raiseFloorToNearest, /* raise floor to next highest surrounding floor */
320: raiseToTexture, /* raise floor to shortest height texture around it */
321: lowerAndChange, /* lower floor to lowest surrounding floor and change */
322: /* floorpic */
323: raiseFloor24,
324: raiseFloor24AndChange,
325: raiseFloorCrush,
326: donutRaise
327: } floor_e;
328:
329: typedef struct
330: {
331: thinker_t thinker;
332: floor_e type;
333: boolean crush;
334: sector_t *sector;
335: int direction;
336: int newspecial;
337: short texture;
338: fixed_t floordestheight;
339: fixed_t speed;
340: } floormove_t;
341:
342: #define FLOORSPEED FRACUNIT*3
343:
344: typedef enum
345: {
346: ok,
347: crushed,
348: pastdest
349: } result_e;
350:
351: result_e T_MovePlane(sector_t *sector,fixed_t speed,
352: fixed_t dest,boolean crush,int floorOrCeiling,int direction);
353:
354: int EV_BuildStairs(line_t *line);
355: int EV_DoFloor(line_t *line,floor_e floortype);
356: void T_MoveFloor(floormove_t *floor);
357:
358: /*
359: ===============================================================================
360:
361: P_TELEPT
362:
363: ===============================================================================
364: */
365: int EV_Teleport( line_t *line,mobj_t *thing );
366:
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.