|
|
1.1 root 1: /* P_local.h */
2:
3: #ifndef __P_LOCAL__
4: #define __P_LOCAL__
5:
6: #ifndef __R_LOCAL__
7: #include "r_local.h"
8: #endif
9:
10: #define FLOATSPEED (FRACUNIT*8)
11:
12: #define GRAVITY (FRACUNIT*4)
13: #define MAXMOVE (16*FRACUNIT)
14:
15:
16: #define MAXHEALTH 100
17: #define VIEWHEIGHT (41*FRACUNIT)
18:
19: /* mapblocks are used to check movement against lines and things */
20: #define MAPBLOCKUNITS 128
21: #define MAPBLOCKSIZE (MAPBLOCKUNITS*FRACUNIT)
22: #define MAPBLOCKSHIFT (FRACBITS+7)
23: #define MAPBMASK (MAPBLOCKSIZE-1)
24: #define MAPBTOFRAC (MAPBLOCKSHIFT-FRACBITS)
25:
26:
27: /* player radius for movement checking */
28: #define PLAYERRADIUS 16*FRACUNIT
29:
30: /* MAXRADIUS is for precalculated sector block boxes */
31: /* the spider demon is larger, but we don't have any moving sectors */
32: /* nearby */
33: #define MAXRADIUS 32*FRACUNIT
34:
35:
36: #define USERANGE (70*FRACUNIT)
37: #define MELEERANGE (70*FRACUNIT)
38: #define MISSILERANGE (32*64*FRACUNIT)
39:
40:
41: typedef enum
42: {
43: DI_EAST,
44: DI_NORTHEAST,
45: DI_NORTH,
46: DI_NORTHWEST,
47: DI_WEST,
48: DI_SOUTHWEST,
49: DI_SOUTH,
50: DI_SOUTHEAST,
51: DI_NODIR,
52: NUMDIRS
53: } dirtype_t;
54:
55: #define BASETHRESHOLD 100 /* follow a player exlusively for 3 seconds */
56:
57:
58:
59: /*
60: ===============================================================================
61:
62: P_TICK
63:
64: ===============================================================================
65: */
66:
67: extern thinker_t thinkercap; /* both the head and tail of the thinker list */
68:
69:
70: void P_InitThinkers (void);
71: void P_AddThinker (thinker_t *thinker);
72: void P_RemoveThinker (thinker_t *thinker);
73:
74: /*
75: ===============================================================================
76:
77: P_PSPR
78:
79: ===============================================================================
80: */
81:
82: void P_SetupPsprites (player_t *curplayer);
83: void P_MovePsprites (player_t *curplayer);
84:
85: void P_DropWeapon (player_t *player);
86:
87: /*
88: ===============================================================================
89:
90: P_USER
91:
92: ===============================================================================
93: */
94:
95: void P_PlayerThink (player_t *player);
96:
97:
98: /*
99: ===============================================================================
100:
101: P_MOBJ
102:
103: ===============================================================================
104: */
105:
106: extern mobj_t mobjhead;
107:
108: extern int activethinkers; /* debug count */
109: extern int activemobjs; /* debug count */
110:
111: #define ONFLOORZ MININT
112: #define ONCEILINGZ MAXINT
113:
114: mobj_t *P_SpawnMobj (fixed_t x, fixed_t y, fixed_t z, mobjtype_t type);
115:
116: void P_RemoveMobj (mobj_t *th);
117: boolean P_SetMobjState (mobj_t *mobj, statenum_t state);
118: void P_MobjThinker (mobj_t *mobj);
119:
120: void P_SpawnPuff (fixed_t x, fixed_t y, fixed_t z);
121: void P_SpawnBlood (fixed_t x, fixed_t y, fixed_t z, int damage);
122: void P_SpawnMissile (mobj_t *source, mobj_t *dest, mobjtype_t type);
123: void P_SpawnPlayerMissile (mobj_t *source, mobjtype_t type);
124:
125: void P_RunMobjBase2 (void);
126: void P_RunMobjExtra (void);
127:
128: void L_SkullBash (mobj_t *mo);
129: void L_MissileHit (mobj_t *mo);
130: void L_CrossSpecial (mobj_t *mo);
131:
132: void P_ExplodeMissile (mobj_t *mo);
133:
134: /*
135: ===============================================================================
136:
137: P_ENEMY
138:
139: ===============================================================================
140: */
141:
142: void A_MissileExplode (mobj_t *mo);
143: void A_SkullBash (mobj_t *mo);
144:
145: /*
146: ===============================================================================
147:
148: P_MAPUTL
149:
150: ===============================================================================
151: */
152:
153: typedef struct
154: {
155: fixed_t x,y, dx, dy;
156: } divline_t;
157:
158:
159: fixed_t P_AproxDistance (fixed_t dx, fixed_t dy);
160: int P_PointOnLineSide (fixed_t x, fixed_t y, line_t *line);
161: int P_PointOnDivlineSide (fixed_t x, fixed_t y, divline_t *line);
162: void P_MakeDivline (line_t *li, divline_t *dl);
163: fixed_t P_InterceptVector (divline_t *v2, divline_t *v1);
164: int P_BoxOnLineSide (fixed_t *tmbox, line_t *ld);
165:
166: extern fixed_t opentop, openbottom, openrange;
167: extern fixed_t lowfloor;
168: void P_LineOpening (line_t *linedef);
169:
170: boolean P_BlockLinesIterator (int x, int y, boolean(*func)(line_t*) );
171: boolean P_BlockThingsIterator (int x, int y, boolean(*func)(mobj_t*) );
172:
173: extern divline_t trace;
174:
175: void P_UnsetThingPosition (mobj_t *thing);
176: void P_SetThingPosition (mobj_t *thing);
177:
178: void P_PlayerLand (mobj_t *mo);
179:
180: /*
181: ===============================================================================
182:
183: P_MAP
184:
185: ===============================================================================
186: */
187:
188: extern boolean floatok; /* if true, move would be ok if */
189: extern fixed_t tmfloorz, tmceilingz; /* within tmfloorz - tmceilingz */
190:
191: extern line_t *specialline;
192: extern mobj_t *movething;
193:
194:
195: boolean P_CheckPosition (mobj_t *thing, fixed_t x, fixed_t y);
196: boolean P_TryMove (mobj_t *thing, fixed_t x, fixed_t y);
197: boolean P_CheckSight (mobj_t *t1, mobj_t *t2);
198: void P_UseLines (player_t *player);
199:
200: boolean P_ChangeSector (sector_t *sector, boolean crunch);
201:
202: extern mobj_t *linetarget; /* who got hit (or NULL) */
203: fixed_t P_AimLineAttack (mobj_t *t1, angle_t angle, fixed_t distance);
204:
205: void P_LineAttack (mobj_t *t1, angle_t angle, fixed_t distance, fixed_t slope, int damage);
206:
207: void P_RadiusAttack (mobj_t *spot, mobj_t *source, int damage);
208:
209: /*
210: ===============================================================================
211:
212: P_SETUP
213:
214: ===============================================================================
215: */
216:
217: extern byte *rejectmatrix; /* for fast sight rejection */
218: extern short *blockmaplump; /* offsets in blockmap are from here */
219: extern short *blockmap;
220: extern int bmapwidth, bmapheight; /* in mapblocks */
221: extern fixed_t bmaporgx, bmaporgy; /* origin of block map */
222: extern mobj_t **blocklinks; /* for thing chains */
223:
224: /*
225: ===============================================================================
226:
227: P_INTER
228:
229: ===============================================================================
230: */
231:
232: extern int maxammo[NUMAMMO];
233: extern int clipammo[NUMAMMO];
234:
235: void P_TouchSpecialThing (mobj_t *special, mobj_t *toucher);
236:
237: void P_DamageMobj (mobj_t *target, mobj_t *inflictor, mobj_t *source, int damage);
238:
239: #include "p_spec.h"
240:
241: extern int iquehead, iquetail;
242:
243: extern int playernum;
244:
245: void P_RespawnSpecials (void);
246:
247: #endif /* __P_LOCAL__ */
248:
249:
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.