|
|
1.1.1.2 root 1: 1.1.1.3 ! root 2: //************************************************************************** ! 3: //** ! 4: //** p_local.h : Heretic 2 : Raven Software, Corp. ! 5: //** ! 6: //** $RCSfile: p_local.h,v $ ! 7: //** $Revision: 1.64 $ ! 8: //** $Date: 95/10/13 03:00:16 $ ! 9: //** $Author: cjr $ ! 10: //** ! 11: //************************************************************************** 1.1 root 12: 13: #ifndef __P_LOCAL__ 14: #define __P_LOCAL__ 15: 16: #ifndef __R_LOCAL__ 1.1.1.3 ! root 17: #include "r_local.h" 1.1 root 18: #endif 19: 1.1.1.3 ! root 20: #define STARTREDPALS 1 ! 21: #define STARTBONUSPALS 9 ! 22: #define STARTPOISONPALS 13 ! 23: #define STARTICEPAL 21 ! 24: #define STARTHOLYPAL 22 ! 25: #define STARTSCOURGEPAL 25 ! 26: #define NUMREDPALS 8 ! 27: #define NUMBONUSPALS 4 ! 28: #define NUMPOISONPALS 8 1.1 root 29: 1.1.1.2 root 30: #define TOCENTER -8 1.1.1.3 ! root 31: #define FLOATSPEED (FRACUNIT*4) 1.1 root 32: 1.1.1.3 ! root 33: #define MAXHEALTH 100 ! 34: #define MAXMORPHHEALTH 30 ! 35: #define VIEWHEIGHT (48*FRACUNIT) 1.1 root 36: 1.1.1.2 root 37: // mapblocks are used to check movement against lines and things 1.1.1.3 ! root 38: #define MAPBLOCKUNITS 128 ! 39: #define MAPBLOCKSIZE (MAPBLOCKUNITS*FRACUNIT) ! 40: #define MAPBLOCKSHIFT (FRACBITS+7) ! 41: #define MAPBMASK (MAPBLOCKSIZE-1) ! 42: #define MAPBTOFRAC (MAPBLOCKSHIFT-FRACBITS) 1.1 root 43: 1.1.1.2 root 44: // player radius for movement checking 45: #define PLAYERRADIUS 16*FRACUNIT 1.1 root 46: 1.1.1.2 root 47: // MAXRADIUS is for precalculated sector block boxes 48: // the spider demon is larger, but we don't have any moving sectors 49: // nearby 50: #define MAXRADIUS 32*FRACUNIT 51: 1.1.1.3 ! root 52: #define GRAVITY FRACUNIT ! 53: #define MAXMOVE (30*FRACUNIT) 1.1.1.2 root 54: 1.1.1.3 ! root 55: #define USERANGE (64*FRACUNIT) ! 56: #define MELEERANGE (64*FRACUNIT) ! 57: #define MISSILERANGE (32*64*FRACUNIT) 1.1 root 58: 59: typedef enum 60: { 61: DI_EAST, 62: DI_NORTHEAST, 63: DI_NORTH, 64: DI_NORTHWEST, 65: DI_WEST, 66: DI_SOUTHWEST, 67: DI_SOUTH, 68: DI_SOUTHEAST, 69: DI_NODIR, 70: NUMDIRS 71: } dirtype_t; 72: 1.1.1.2 root 73: #define BASETHRESHOLD 100 // follow a player exlusively for 3 seconds 1.1 root 74: 1.1.1.2 root 75: // ***** P_TICK ***** 1.1 root 76: 1.1.1.2 root 77: extern thinker_t thinkercap; // both the head and tail of the thinker list 78: extern int TimerGame; // tic countdown for deathmatch 1.1 root 79: 1.1.1.2 root 80: void P_InitThinkers(void); 81: void P_AddThinker(thinker_t *thinker); 82: void P_RemoveThinker(thinker_t *thinker); 83: 84: // ***** P_PSPR ***** 85: 1.1.1.3 ! root 86: #define USE_MANA1 1 ! 87: #define USE_MANA2 1 ! 88: 1.1.1.2 root 89: void P_SetPsprite(player_t *player, int position, statenum_t stnum); 1.1.1.3 ! root 90: void P_SetPspriteNF(player_t *player, int position, statenum_t stnum); 1.1.1.2 root 91: void P_SetupPsprites(player_t *curplayer); 92: void P_MovePsprites(player_t *curplayer); 93: void P_DropWeapon(player_t *player); 1.1.1.3 ! root 94: void P_ActivateMorphWeapon(player_t *player); ! 95: void P_PostMorphWeapon(player_t *player, weapontype_t weapon); 1.1.1.2 root 96: 97: // ***** P_USER ***** 98: 1.1.1.3 ! root 99: extern int PStateNormal[NUMCLASSES]; ! 100: extern int PStateRun[NUMCLASSES]; ! 101: extern int PStateAttack[NUMCLASSES]; ! 102: extern int PStateAttackEnd[NUMCLASSES]; ! 103: 1.1.1.2 root 104: void P_PlayerThink(player_t *player); 105: void P_Thrust(player_t *player, angle_t angle, fixed_t move); 106: void P_PlayerRemoveArtifact(player_t *player, int slot); 107: void P_PlayerUseArtifact(player_t *player, artitype_t arti); 108: boolean P_UseArtifact(player_t *player, artitype_t arti); 109: int P_GetPlayerNum(player_t *player); 1.1.1.3 ! root 110: void P_TeleportOther(mobj_t *victim); ! 111: void ResetBlasted(mobj_t *mo); 1.1.1.2 root 112: 113: // ***** P_MOBJ ***** 114: 1.1.1.3 ! root 115: // Any floor type >= FLOOR_LIQUID will floorclip sprites ! 116: enum ! 117: { ! 118: FLOOR_SOLID, ! 119: FLOOR_ICE, ! 120: FLOOR_LIQUID, ! 121: FLOOR_WATER, ! 122: FLOOR_LAVA, ! 123: FLOOR_SLUDGE ! 124: }; 1.1.1.2 root 125: 126: #define ONFLOORZ MININT 127: #define ONCEILINGZ MAXINT 128: #define FLOATRANDZ (MAXINT-1) 1.1.1.3 ! root 129: #define FROMCEILINGZ128 (MAXINT-2) 1.1.1.2 root 130: 131: extern mobjtype_t PuffType; 132: extern mobj_t *MissileMobj; 133: 134: mobj_t *P_SpawnMobj(fixed_t x, fixed_t y, fixed_t z, mobjtype_t type); 135: void P_RemoveMobj(mobj_t *th); 1.1.1.3 ! root 136: boolean P_SetMobjState(mobj_t *mobj, statenum_t state); ! 137: boolean P_SetMobjStateNF(mobj_t *mobj, statenum_t state); 1.1.1.2 root 138: void P_ThrustMobj(mobj_t *mo, angle_t angle, fixed_t move); 139: int P_FaceMobj(mobj_t *source, mobj_t *target, angle_t *delta); 140: boolean P_SeekerMissile(mobj_t *actor, angle_t thresh, angle_t turnMax); 141: void P_MobjThinker(mobj_t *mobj); 142: void P_BlasterMobjThinker(mobj_t *mobj); 143: void P_SpawnPuff(fixed_t x, fixed_t y, fixed_t z); 144: void P_SpawnBlood(fixed_t x, fixed_t y, fixed_t z, int damage); 145: void P_BloodSplatter(fixed_t x, fixed_t y, fixed_t z, mobj_t *originator); 1.1.1.3 ! root 146: void P_BloodSplatter2(fixed_t x, fixed_t y, fixed_t z, mobj_t *originator); 1.1.1.2 root 147: void P_RipperBlood(mobj_t *mo); 148: int P_GetThingFloorType(mobj_t *thing); 149: int P_HitFloor(mobj_t *thing); 150: boolean P_CheckMissileSpawn(mobj_t *missile); 151: mobj_t *P_SpawnMissile(mobj_t *source, mobj_t *dest, mobjtype_t type); 1.1.1.3 ! root 152: mobj_t *P_SpawnMissileXYZ(fixed_t x, fixed_t y, fixed_t z, ! 153: mobj_t *source, mobj_t *dest, mobjtype_t type); 1.1.1.2 root 154: mobj_t *P_SpawnMissileAngle(mobj_t *source, mobjtype_t type, 155: angle_t angle, fixed_t momz); 1.1.1.3 ! root 156: mobj_t *P_SpawnMissileAngleSpeed(mobj_t *source, mobjtype_t type, ! 157: angle_t angle, fixed_t momz, fixed_t speed); 1.1.1.2 root 158: mobj_t *P_SpawnPlayerMissile(mobj_t *source, mobjtype_t type); 159: mobj_t *P_SPMAngle(mobj_t *source, mobjtype_t type, angle_t angle); 1.1.1.3 ! root 160: mobj_t *P_SPMAngleXYZ(mobj_t *source, fixed_t x, fixed_t y, ! 161: fixed_t z, mobjtype_t type, angle_t angle); ! 162: void P_CreateTIDList(void); ! 163: void P_RemoveMobjFromTIDList(mobj_t *mobj); ! 164: void P_InsertMobjIntoTIDList(mobj_t *mobj, int tid); ! 165: mobj_t *P_FindMobjFromTID(int tid, int *searchPosition); ! 166: mobj_t *P_SpawnKoraxMissile(fixed_t x, fixed_t y, fixed_t z, ! 167: mobj_t *source, mobj_t *dest, mobjtype_t type); 1.1.1.2 root 168: 169: // ***** P_ENEMY ***** 170: 171: void P_NoiseAlert (mobj_t *target, mobj_t *emmiter); 1.1.1.3 ! root 172: int P_Massacre(void); ! 173: boolean A_RaiseMobj(mobj_t *actor); ! 174: boolean A_SinkMobj(mobj_t *actor); ! 175: void A_NoBlocking(mobj_t *actor); ! 176: boolean P_LookForMonsters(mobj_t *actor); ! 177: void P_InitCreatureCorpseQueue(boolean corpseScan); ! 178: void A_DeQueueCorpse(mobj_t *actor); ! 179: 1.1 root 180: 1.1.1.2 root 181: // ***** P_MAPUTL ***** 1.1 root 182: 183: typedef struct 184: { 1.1.1.2 root 185: fixed_t x, y, dx, dy; 1.1 root 186: } divline_t; 187: 1.1.1.2 root 188: typedef struct 189: { 1.1.1.3 ! root 190: fixed_t frac; // along trace line ! 191: boolean isaline; 1.1.1.2 root 192: union { 1.1.1.3 ! root 193: mobj_t *thing; ! 194: line_t *line; ! 195: } d; 1.1.1.2 root 196: } intercept_t; 197: 1.1.1.3 ! root 198: #define MAXINTERCEPTS 128 ! 199: extern intercept_t intercepts[MAXINTERCEPTS], *intercept_p; 1.1.1.2 root 200: typedef boolean (*traverser_t) (intercept_t *in); 201: 1.1 root 202: 203: fixed_t P_AproxDistance (fixed_t dx, fixed_t dy); 1.1.1.3 ! root 204: int P_PointOnLineSide (fixed_t x, fixed_t y, line_t *line); ! 205: int P_PointOnDivlineSide (fixed_t x, fixed_t y, divline_t *line); ! 206: void P_MakeDivline (line_t *li, divline_t *dl); 1.1 root 207: fixed_t P_InterceptVector (divline_t *v2, divline_t *v1); 1.1.1.3 ! root 208: int P_BoxOnLineSide (fixed_t *tmbox, line_t *ld); 1.1 root 209: 1.1.1.3 ! root 210: extern fixed_t opentop, openbottom, openrange; ! 211: extern fixed_t lowfloor; ! 212: void P_LineOpening (line_t *linedef); 1.1 root 213: 214: boolean P_BlockLinesIterator (int x, int y, boolean(*func)(line_t*) ); 215: boolean P_BlockThingsIterator (int x, int y, boolean(*func)(mobj_t*) ); 216: 1.1.1.3 ! root 217: #define PT_ADDLINES 1 ! 218: #define PT_ADDTHINGS 2 ! 219: #define PT_EARLYOUT 4 1.1.1.2 root 220: 1.1.1.3 ! root 221: extern divline_t trace; 1.1.1.2 root 222: boolean P_PathTraverse (fixed_t x1, fixed_t y1, fixed_t x2, fixed_t y2, 223: int flags, boolean (*trav) (intercept_t *)); 1.1 root 224: 1.1.1.3 ! root 225: void P_UnsetThingPosition (mobj_t *thing); ! 226: void P_SetThingPosition (mobj_t *thing); ! 227: mobj_t *P_RoughMonsterSearch(mobj_t *mo, int distance); 1.1 root 228: 1.1.1.2 root 229: // ***** P_MAP ***** 1.1 root 230: 1.1.1.3 ! root 231: extern boolean floatok; // if true, move would be ok if ! 232: extern fixed_t tmfloorz, tmceilingz; // within tmfloorz - tmceilingz ! 233: extern int tmfloorpic; ! 234: extern mobj_t *BlockingMobj; 1.1 root 235: 1.1.1.2 root 236: extern line_t *ceilingline; 237: boolean P_TestMobjLocation(mobj_t *mobj); 238: boolean P_CheckPosition(mobj_t *thing, fixed_t x, fixed_t y); 239: mobj_t *P_CheckOnmobj(mobj_t *thing); 240: void P_FakeZMovement(mobj_t *mo); 241: boolean P_TryMove(mobj_t *thing, fixed_t x, fixed_t y); 242: boolean P_TeleportMove(mobj_t *thing, fixed_t x, fixed_t y); 243: void P_SlideMove(mobj_t *mo); 1.1.1.3 ! root 244: void P_BounceWall(mobj_t *mo); 1.1.1.2 root 245: boolean P_CheckSight(mobj_t *t1, mobj_t *t2); 246: void P_UseLines(player_t *player); 1.1.1.3 ! root 247: boolean P_UsePuzzleItem(player_t *player, int itemType); ! 248: void PIT_ThrustSpike(mobj_t *actor); 1.1 root 249: 1.1.1.3 ! root 250: boolean P_ChangeSector (sector_t *sector, int crunch); 1.1 root 251: 1.1.1.3 ! root 252: extern mobj_t *PuffSpawned; // true if a puff was spawned ! 253: extern mobj_t *linetarget; // who got hit (or NULL) 1.1 root 254: fixed_t P_AimLineAttack (mobj_t *t1, angle_t angle, fixed_t distance); 255: 256: void P_LineAttack (mobj_t *t1, angle_t angle, fixed_t distance, fixed_t slope, int damage); 257: 1.1.1.3 ! root 258: void P_RadiusAttack (mobj_t *spot, mobj_t *source, int damage, int distance, ! 259: boolean damageSource); 1.1 root 260: 1.1.1.2 root 261: // ***** P_SETUP ***** 1.1 root 262: 1.1.1.3 ! root 263: extern byte *rejectmatrix; // for fast sight rejection ! 264: extern short *blockmaplump; // offsets in blockmap are from here 1.1.1.2 root 265: extern short *blockmap; 1.1.1.3 ! root 266: extern int bmapwidth, bmapheight; // in mapblocks ! 267: extern fixed_t bmaporgx, bmaporgy; // origin of block map ! 268: extern mobj_t **blocklinks; // for thing chains 1.1 root 269: 1.1.1.2 root 270: // ***** P_INTER ***** 1.1 root 271: 1.1.1.3 ! root 272: extern int clipmana[NUMMANA]; 1.1 root 273: 1.1.1.2 root 274: void P_SetMessage(player_t *player, char *message, boolean ultmsg); 1.1.1.3 ! root 275: void P_SetYellowMessage(player_t *player, char *message, boolean ultmsg); ! 276: void P_ClearMessage(player_t *player); 1.1.1.2 root 277: void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher); 278: void P_DamageMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, 279: int damage); 1.1.1.3 ! root 280: void P_FallingDamage(player_t *player); ! 281: void P_PoisonPlayer(player_t *player, mobj_t *poisoner, int poison); ! 282: void P_PoisonDamage(player_t *player, mobj_t *source, int damage, ! 283: boolean playPainSound); ! 284: boolean P_GiveMana(player_t *player, manatype_t mana, int count); 1.1.1.2 root 285: boolean P_GiveArtifact(player_t *player, artitype_t arti, mobj_t *mo); 1.1.1.3 ! root 286: boolean P_GiveArmor(player_t *player, armortype_t armortype, int amount); 1.1.1.2 root 287: boolean P_GiveBody(player_t *player, int num); 288: boolean P_GivePower(player_t *player, powertype_t power); 1.1.1.3 ! root 289: boolean P_MorphPlayer(player_t *player); 1.1 root 290: 1.1.1.2 root 291: // ***** AM_MAP ***** 1.1 root 292: 1.1.1.2 root 293: boolean AM_Responder(event_t *ev); 294: void AM_Ticker(void); 295: void AM_Drawer(void); 1.1 root 296: 1.1.1.3 ! root 297: // ***** A_ACTION ***** ! 298: boolean A_LocalQuake(byte *args, mobj_t *victim); ! 299: void P_SpawnDirt(mobj_t *actor, fixed_t radius); ! 300: void A_BridgeRemove(mobj_t *actor); ! 301: 1.1.1.2 root 302: // ***** SB_BAR ***** 1.1 root 303: 1.1.1.2 root 304: extern int SB_state; 305: extern int ArtifactFlash; 1.1.1.3 ! root 306: void SB_PaletteFlash(boolean forceChange); ! 307: ! 308: // ===== PO_MAN ===== ! 309: ! 310: typedef enum ! 311: { ! 312: PODOOR_NONE, ! 313: PODOOR_SLIDE, ! 314: PODOOR_SWING, ! 315: } podoortype_t; ! 316: ! 317: typedef struct ! 318: { ! 319: thinker_t thinker; ! 320: int polyobj; ! 321: int speed; ! 322: unsigned int dist; ! 323: int angle; ! 324: fixed_t xSpeed; // for sliding walls ! 325: fixed_t ySpeed; ! 326: } polyevent_t; ! 327: ! 328: typedef struct ! 329: { ! 330: thinker_t thinker; ! 331: int polyobj; ! 332: int speed; ! 333: int dist; ! 334: int totalDist; ! 335: int direction; ! 336: fixed_t xSpeed, ySpeed; ! 337: int tics; ! 338: int waitTics; ! 339: podoortype_t type; ! 340: boolean close; ! 341: } polydoor_t; ! 342: ! 343: enum ! 344: { ! 345: PO_ANCHOR_TYPE = 3000, ! 346: PO_SPAWN_TYPE, ! 347: PO_SPAWNCRUSH_TYPE ! 348: }; ! 349: ! 350: #define PO_LINE_START 1 // polyobj line start special ! 351: #define PO_LINE_EXPLICIT 5 ! 352: ! 353: extern polyobj_t *polyobjs; // list of all poly-objects on the level ! 354: extern int po_NumPolyobjs; ! 355: ! 356: void T_PolyDoor(polydoor_t *pd); ! 357: void T_RotatePoly(polyevent_t *pe); ! 358: boolean EV_RotatePoly(line_t *line, byte *args, int direction, boolean ! 359: overRide); ! 360: void T_MovePoly(polyevent_t *pe); ! 361: boolean EV_MovePoly(line_t *line, byte *args, boolean timesEight, boolean ! 362: overRide); ! 363: boolean EV_OpenPolyDoor(line_t *line, byte *args, podoortype_t type); ! 364: ! 365: boolean PO_MovePolyobj(int num, int x, int y); ! 366: boolean PO_RotatePolyobj(int num, angle_t angle); ! 367: void PO_Init(int lump); ! 368: boolean PO_Busy(int polyobj); 1.1 root 369: 1.1.1.3 ! root 370: #include "p_spec.h" 1.1 root 371: 1.1.1.2 root 372: #endif // __P_LOCAL__
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.