2014-03-15 16:59:03 +00:00
|
|
|
|
// SONIC ROBO BLAST 2
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
// Copyright (C) 1993-1996 by id Software, Inc.
|
|
|
|
|
// Copyright (C) 1998-2000 by DooM Legacy Team.
|
2019-12-06 18:49:42 +00:00
|
|
|
|
// Copyright (C) 1999-2019 by Sonic Team Junior.
|
2014-03-15 16:59:03 +00:00
|
|
|
|
//
|
|
|
|
|
// This program is free software distributed under the
|
|
|
|
|
// terms of the GNU General Public License, version 2.
|
|
|
|
|
// See the 'LICENSE' file for more details.
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
/// \file p_local.h
|
|
|
|
|
/// \brief Play functions, animation, global header
|
|
|
|
|
|
|
|
|
|
#ifndef __P_LOCAL__
|
|
|
|
|
#define __P_LOCAL__
|
|
|
|
|
|
|
|
|
|
#include "command.h"
|
|
|
|
|
#include "d_player.h"
|
|
|
|
|
#include "d_think.h"
|
|
|
|
|
#include "m_fixed.h"
|
|
|
|
|
#include "m_bbox.h"
|
|
|
|
|
#include "p_tick.h"
|
|
|
|
|
#include "r_defs.h"
|
|
|
|
|
#include "p_maputl.h"
|
|
|
|
|
|
|
|
|
|
#define FLOATSPEED (FRACUNIT*4)
|
|
|
|
|
|
|
|
|
|
// Maximum player score.
|
2017-09-25 19:35:04 +00:00
|
|
|
|
#define MAXSCORE 99999990 // 999999990
|
2014-03-15 16:59:03 +00:00
|
|
|
|
|
|
|
|
|
// mapblocks are used to check movement
|
|
|
|
|
// against lines and things
|
|
|
|
|
#define MAPBLOCKUNITS 128
|
|
|
|
|
#define MAPBLOCKSIZE (MAPBLOCKUNITS*FRACUNIT)
|
|
|
|
|
#define MAPBLOCKSHIFT (FRACBITS+7)
|
|
|
|
|
#define MAPBMASK (MAPBLOCKSIZE-1)
|
|
|
|
|
#define MAPBTOFRAC (MAPBLOCKSHIFT-FRACBITS)
|
|
|
|
|
|
2015-04-09 02:32:07 +00:00
|
|
|
|
// Convenience macro to fix issue with collision along bottom/left edges of blockmap -Red
|
|
|
|
|
#define BMBOUNDFIX(xl, xh, yl, yh) {if (xl > xh) xl = 0; if (yl > yh) yl = 0;}
|
|
|
|
|
|
2014-03-15 16:59:03 +00:00
|
|
|
|
// MAXRADIUS is for precalculated sector block boxes
|
|
|
|
|
// the spider demon is larger,
|
|
|
|
|
// but we do not have any moving sectors nearby
|
|
|
|
|
#define MAXRADIUS (32*FRACUNIT)
|
|
|
|
|
|
|
|
|
|
// max Z move up or down without jumping
|
|
|
|
|
// above this, a height difference is considered as a 'dropoff'
|
|
|
|
|
#define MAXSTEPMOVE (24*FRACUNIT)
|
|
|
|
|
|
|
|
|
|
#define USERANGE (64*FRACUNIT)
|
|
|
|
|
#define MELEERANGE (64*FRACUNIT)
|
|
|
|
|
#define MISSILERANGE (32*64*FRACUNIT)
|
|
|
|
|
|
|
|
|
|
#define AIMINGTOSLOPE(aiming) FINESINE((aiming>>ANGLETOFINESHIFT) & FINEMASK)
|
|
|
|
|
|
|
|
|
|
#define twodlevel (maptol & TOL_2D)
|
|
|
|
|
|
2016-10-11 22:35:31 +00:00
|
|
|
|
#define mariomode (maptol & TOL_MARIO)
|
|
|
|
|
|
2016-10-24 11:35:40 +00:00
|
|
|
|
#define P_GetPlayerHeight(player) FixedMul(player->height, player->mo->scale)
|
|
|
|
|
#define P_GetPlayerSpinHeight(player) FixedMul(player->spinheight, player->mo->scale)
|
2016-09-25 17:21:52 +00:00
|
|
|
|
|
2019-07-12 23:42:03 +00:00
|
|
|
|
typedef enum
|
|
|
|
|
{
|
2019-04-20 20:37:19 +00:00
|
|
|
|
THINK_POLYOBJ,
|
|
|
|
|
THINK_MAIN,
|
2019-04-20 21:29:20 +00:00
|
|
|
|
THINK_MOBJ,
|
2019-04-21 15:16:35 +00:00
|
|
|
|
#ifdef ESLOPE
|
|
|
|
|
THINK_DYNSLOPE,
|
|
|
|
|
#endif
|
2019-04-21 12:58:13 +00:00
|
|
|
|
THINK_PRECIP,
|
2019-04-20 20:37:19 +00:00
|
|
|
|
NUM_THINKERLISTS
|
|
|
|
|
} thinklistnum_t; /**< Thinker lists. */
|
|
|
|
|
extern thinker_t thlist[];
|
2014-03-15 16:59:03 +00:00
|
|
|
|
|
|
|
|
|
void P_InitThinkers(void);
|
2019-04-20 20:37:19 +00:00
|
|
|
|
void P_AddThinker(const thinklistnum_t n, thinker_t *thinker);
|
2014-03-15 16:59:03 +00:00
|
|
|
|
void P_RemoveThinker(thinker_t *thinker);
|
|
|
|
|
|
|
|
|
|
//
|
|
|
|
|
// P_USER
|
|
|
|
|
//
|
|
|
|
|
typedef struct camera_s
|
|
|
|
|
{
|
|
|
|
|
boolean chase;
|
|
|
|
|
angle_t aiming;
|
|
|
|
|
|
|
|
|
|
// Things used by FS cameras.
|
|
|
|
|
fixed_t viewheight;
|
|
|
|
|
angle_t startangle;
|
|
|
|
|
|
|
|
|
|
// Camera demobjerization
|
|
|
|
|
// Info for drawing: position.
|
|
|
|
|
fixed_t x, y, z;
|
|
|
|
|
|
|
|
|
|
//More drawing info: to determine current sprite.
|
|
|
|
|
angle_t angle; // orientation
|
|
|
|
|
|
|
|
|
|
struct subsector_s *subsector;
|
|
|
|
|
|
|
|
|
|
// The closest interval over all contacted Sectors (or Things).
|
|
|
|
|
fixed_t floorz;
|
|
|
|
|
fixed_t ceilingz;
|
|
|
|
|
|
|
|
|
|
// For movement checking.
|
|
|
|
|
fixed_t radius;
|
|
|
|
|
fixed_t height;
|
|
|
|
|
|
|
|
|
|
fixed_t relativex;
|
|
|
|
|
|
|
|
|
|
// Momentums, used to update position.
|
|
|
|
|
fixed_t momx, momy, momz;
|
|
|
|
|
} camera_t;
|
|
|
|
|
|
|
|
|
|
extern camera_t camera, camera2;
|
|
|
|
|
extern consvar_t cv_cam_dist, cv_cam_still, cv_cam_height;
|
2019-12-10 00:30:03 +00:00
|
|
|
|
extern consvar_t cv_cam_speed, cv_cam_rotate, cv_cam_rotspeed, cv_cam_turnmultiplier, cv_cam_orbit, cv_cam_adjust;
|
2014-03-15 16:59:03 +00:00
|
|
|
|
|
|
|
|
|
extern consvar_t cv_cam2_dist, cv_cam2_still, cv_cam2_height;
|
2019-12-10 00:30:03 +00:00
|
|
|
|
extern consvar_t cv_cam2_speed, cv_cam2_rotate, cv_cam2_rotspeed, cv_cam2_turnmultiplier, cv_cam2_orbit, cv_cam2_adjust;
|
2014-03-15 16:59:03 +00:00
|
|
|
|
|
|
|
|
|
extern fixed_t t_cam_dist, t_cam_height, t_cam_rotate;
|
|
|
|
|
extern fixed_t t_cam2_dist, t_cam2_height, t_cam2_rotate;
|
|
|
|
|
|
|
|
|
|
INT32 P_GetPlayerControlDirection(player_t *player);
|
|
|
|
|
void P_AddPlayerScore(player_t *player, UINT32 amount);
|
2015-10-01 19:02:44 +00:00
|
|
|
|
void P_StealPlayerScore(player_t *player, UINT32 amount);
|
2014-03-15 16:59:03 +00:00
|
|
|
|
void P_ResetCamera(player_t *player, camera_t *thiscam);
|
|
|
|
|
boolean P_TryCameraMove(fixed_t x, fixed_t y, camera_t *thiscam);
|
|
|
|
|
void P_SlideCameraMove(camera_t *thiscam);
|
|
|
|
|
boolean P_MoveChaseCamera(player_t *player, camera_t *thiscam, boolean resetcalled);
|
2017-04-03 17:28:02 +00:00
|
|
|
|
pflags_t P_GetJumpFlags(player_t *player);
|
2014-03-15 16:59:03 +00:00
|
|
|
|
boolean P_PlayerInPain(player_t *player);
|
|
|
|
|
void P_DoPlayerPain(player_t *player, mobj_t *source, mobj_t *inflictor);
|
|
|
|
|
void P_ResetPlayer(player_t *player);
|
2019-06-19 11:09:02 +00:00
|
|
|
|
boolean P_PlayerCanDamage(player_t *player, mobj_t *thing);
|
2014-03-15 16:59:03 +00:00
|
|
|
|
boolean P_IsLocalPlayer(player_t *player);
|
2014-08-04 03:49:33 +00:00
|
|
|
|
|
|
|
|
|
boolean P_IsObjectInGoop(mobj_t *mo);
|
2014-03-15 16:59:03 +00:00
|
|
|
|
boolean P_IsObjectOnGround(mobj_t *mo);
|
|
|
|
|
boolean P_IsObjectOnGroundIn(mobj_t *mo, sector_t *sec);
|
2014-08-04 03:49:33 +00:00
|
|
|
|
boolean P_InSpaceSector(mobj_t *mo);
|
|
|
|
|
boolean P_InQuicksand(mobj_t *mo);
|
2019-07-17 20:33:18 +00:00
|
|
|
|
boolean P_PlayerHitFloor(player_t *player, boolean dorollstuff);
|
2014-08-04 03:49:33 +00:00
|
|
|
|
|
2014-03-15 16:59:03 +00:00
|
|
|
|
void P_SetObjectMomZ(mobj_t *mo, fixed_t value, boolean relative);
|
|
|
|
|
void P_RestoreMusic(player_t *player);
|
|
|
|
|
void P_SpawnShieldOrb(player_t *player);
|
2016-10-24 11:35:40 +00:00
|
|
|
|
void P_SwitchShield(player_t *player, UINT16 shieldtype);
|
2014-03-15 16:59:03 +00:00
|
|
|
|
mobj_t *P_SpawnGhostMobj(mobj_t *mobj);
|
|
|
|
|
void P_GivePlayerRings(player_t *player, INT32 num_rings);
|
2018-06-03 21:41:54 +00:00
|
|
|
|
void P_GivePlayerSpheres(player_t *player, INT32 num_spheres);
|
2014-03-15 16:59:03 +00:00
|
|
|
|
void P_GivePlayerLives(player_t *player, INT32 numlives);
|
2017-05-29 21:18:02 +00:00
|
|
|
|
void P_GiveCoopLives(player_t *player, INT32 numlives, boolean sound);
|
2014-03-15 16:59:03 +00:00
|
|
|
|
UINT8 P_GetNextEmerald(void);
|
|
|
|
|
void P_GiveEmerald(boolean spawnObj);
|
2017-03-20 16:57:24 +00:00
|
|
|
|
#if 0
|
2014-03-15 16:59:03 +00:00
|
|
|
|
void P_ResetScore(player_t *player);
|
2017-03-20 16:57:24 +00:00
|
|
|
|
#else
|
|
|
|
|
#define P_ResetScore(player) player->scoreadd = 0
|
|
|
|
|
#endif
|
2015-01-01 19:50:31 +00:00
|
|
|
|
boolean P_AutoPause(void);
|
2014-03-15 16:59:03 +00:00
|
|
|
|
|
2014-08-04 03:49:33 +00:00
|
|
|
|
void P_DoJumpShield(player_t *player);
|
2016-10-24 12:33:10 +00:00
|
|
|
|
void P_DoBubbleBounce(player_t *player);
|
2016-12-24 00:11:54 +00:00
|
|
|
|
void P_DoAbilityBounce(player_t *player, boolean changemomz);
|
2019-06-26 22:26:05 +00:00
|
|
|
|
void P_TwinSpinRejuvenate(player_t *player, mobjtype_t type);
|
2014-03-15 16:59:03 +00:00
|
|
|
|
void P_BlackOw(player_t *player);
|
2016-07-08 21:56:17 +00:00
|
|
|
|
void P_ElementalFire(player_t *player, boolean cropcircle);
|
2014-08-04 03:49:33 +00:00
|
|
|
|
|
2014-03-15 16:59:03 +00:00
|
|
|
|
void P_DoPityCheck(player_t *player);
|
|
|
|
|
void P_PlayerThink(player_t *player);
|
|
|
|
|
void P_PlayerAfterThink(player_t *player);
|
2019-11-15 14:35:28 +00:00
|
|
|
|
void P_DoPlayerFinish(player_t *player);
|
2014-03-15 16:59:03 +00:00
|
|
|
|
void P_DoPlayerExit(player_t *player);
|
|
|
|
|
void P_NightserizePlayer(player_t *player, INT32 ptime);
|
|
|
|
|
|
|
|
|
|
void P_InstaThrust(mobj_t *mo, angle_t angle, fixed_t move);
|
|
|
|
|
fixed_t P_ReturnThrustX(mobj_t *mo, angle_t angle, fixed_t move);
|
|
|
|
|
fixed_t P_ReturnThrustY(mobj_t *mo, angle_t angle, fixed_t move);
|
|
|
|
|
void P_InstaThrustEvenIn2D(mobj_t *mo, angle_t angle, fixed_t move);
|
|
|
|
|
|
2017-03-22 18:51:30 +00:00
|
|
|
|
mobj_t *P_LookForEnemies(player_t *player, boolean nonenemies, boolean bullet);
|
2014-03-15 16:59:03 +00:00
|
|
|
|
void P_NukeEnemies(mobj_t *inflictor, mobj_t *source, fixed_t radius);
|
2019-07-02 23:58:02 +00:00
|
|
|
|
boolean P_HomingAttack(mobj_t *source, mobj_t *enemy); /// \todo doesn't belong in p_user
|
2014-03-15 16:59:03 +00:00
|
|
|
|
boolean P_SuperReady(player_t *player);
|
|
|
|
|
void P_DoJump(player_t *player, boolean soundandstate);
|
2017-03-20 16:57:24 +00:00
|
|
|
|
#if 0
|
2016-04-05 19:56:48 +00:00
|
|
|
|
boolean P_AnalogMove(player_t *player);
|
2017-03-20 16:57:24 +00:00
|
|
|
|
#else
|
|
|
|
|
#define P_AnalogMove(player) (player->pflags & PF_ANALOGMODE)
|
|
|
|
|
#endif
|
2014-03-15 16:59:03 +00:00
|
|
|
|
boolean P_TransferToNextMare(player_t *player);
|
|
|
|
|
UINT8 P_FindLowestMare(void);
|
|
|
|
|
void P_FindEmerald(void);
|
|
|
|
|
void P_TransferToAxis(player_t *player, INT32 axisnum);
|
|
|
|
|
boolean P_PlayerMoving(INT32 pnum);
|
2014-05-23 20:39:04 +00:00
|
|
|
|
void P_SpawnThokMobj(player_t *player);
|
2014-05-23 21:55:16 +00:00
|
|
|
|
void P_SpawnSpinMobj(player_t *player, mobjtype_t type);
|
2014-05-26 02:41:05 +00:00
|
|
|
|
void P_Telekinesis(player_t *player, fixed_t thrust, fixed_t range);
|
2014-03-15 16:59:03 +00:00
|
|
|
|
|
|
|
|
|
void P_PlayLivesJingle(player_t *player);
|
|
|
|
|
#define P_PlayRinglossSound(s) S_StartSound(s, (mariomode) ? sfx_mario8 : sfx_altow1 + P_RandomKey(4));
|
|
|
|
|
#define P_PlayDeathSound(s) S_StartSound(s, sfx_altdi1 + P_RandomKey(4));
|
|
|
|
|
#define P_PlayVictorySound(s) S_StartSound(s, sfx_victr1 + P_RandomKey(4));
|
|
|
|
|
|
2017-05-28 20:55:41 +00:00
|
|
|
|
boolean P_GetLives(player_t *player);
|
2017-05-29 20:23:00 +00:00
|
|
|
|
boolean P_SpectatorJoinGame(player_t *player);
|
2017-06-01 17:44:19 +00:00
|
|
|
|
void P_RestoreMultiMusic(player_t *player);
|
2014-03-15 16:59:03 +00:00
|
|
|
|
|
2019-08-04 11:03:57 +00:00
|
|
|
|
/// ------------------------
|
|
|
|
|
/// Jingle stuff
|
|
|
|
|
/// ------------------------
|
|
|
|
|
|
|
|
|
|
typedef enum
|
|
|
|
|
{
|
|
|
|
|
JT_NONE, // Null state
|
|
|
|
|
JT_OTHER, // Other state
|
|
|
|
|
JT_MASTER, // Main level music
|
|
|
|
|
JT_1UP, // Extra life
|
|
|
|
|
JT_SHOES, // Speed shoes
|
|
|
|
|
JT_INV, // Invincibility
|
|
|
|
|
JT_MINV, // Mario Invincibility
|
|
|
|
|
JT_DROWN, // Drowning
|
|
|
|
|
JT_SUPER, // Super Sonic
|
|
|
|
|
JT_GOVER, // Game Over
|
|
|
|
|
JT_NIGHTSTIMEOUT, // NiGHTS Time Out (10 seconds)
|
|
|
|
|
JT_SSTIMEOUT, // NiGHTS Special Stage Time Out (10 seconds)
|
|
|
|
|
|
|
|
|
|
// these are not jingles
|
|
|
|
|
// JT_LCLEAR, // Level Clear
|
|
|
|
|
// JT_RACENT, // Multiplayer Intermission
|
|
|
|
|
// JT_CONTSC, // Continue
|
|
|
|
|
|
|
|
|
|
NUMJINGLES
|
|
|
|
|
} jingletype_t;
|
|
|
|
|
|
|
|
|
|
typedef struct
|
|
|
|
|
{
|
|
|
|
|
char musname[7];
|
|
|
|
|
boolean looping;
|
|
|
|
|
} jingle_t;
|
|
|
|
|
|
|
|
|
|
extern jingle_t jingleinfo[NUMJINGLES];
|
|
|
|
|
|
|
|
|
|
#define JINGLEPOSTFADE 1000
|
|
|
|
|
|
|
|
|
|
void P_PlayJingle(player_t *player, jingletype_t jingletype);
|
|
|
|
|
boolean P_EvaluateMusicStatus(UINT16 status);
|
|
|
|
|
void P_PlayJingleMusic(player_t *player, const char *musname, UINT16 musflags, boolean looping, UINT16 status);
|
|
|
|
|
|
2014-03-15 16:59:03 +00:00
|
|
|
|
//
|
|
|
|
|
// P_MOBJ
|
|
|
|
|
//
|
|
|
|
|
#define ONFLOORZ INT32_MIN
|
|
|
|
|
#define ONCEILINGZ INT32_MAX
|
|
|
|
|
|
|
|
|
|
// Time interval for item respawning.
|
|
|
|
|
// WARNING MUST be a power of 2
|
|
|
|
|
#define ITEMQUESIZE 1024
|
|
|
|
|
|
|
|
|
|
extern mapthing_t *itemrespawnque[ITEMQUESIZE];
|
|
|
|
|
extern tic_t itemrespawntime[ITEMQUESIZE];
|
|
|
|
|
extern size_t iquehead, iquetail;
|
2017-10-14 20:11:08 +00:00
|
|
|
|
extern consvar_t cv_gravity, cv_movebob;
|
2014-03-15 16:59:03 +00:00
|
|
|
|
|
|
|
|
|
void P_RespawnSpecials(void);
|
|
|
|
|
|
|
|
|
|
mobj_t *P_SpawnMobj(fixed_t x, fixed_t y, fixed_t z, mobjtype_t type);
|
|
|
|
|
|
|
|
|
|
void P_RecalcPrecipInSector(sector_t *sector);
|
|
|
|
|
void P_PrecipitationEffects(void);
|
|
|
|
|
|
|
|
|
|
void P_RemoveMobj(mobj_t *th);
|
|
|
|
|
boolean P_MobjWasRemoved(mobj_t *th);
|
|
|
|
|
void P_RemoveSavegameMobj(mobj_t *th);
|
|
|
|
|
boolean P_SetPlayerMobjState(mobj_t *mobj, statenum_t state);
|
|
|
|
|
boolean P_SetMobjState(mobj_t *mobj, statenum_t state);
|
|
|
|
|
void P_RunShields(void);
|
2016-02-09 10:39:16 +00:00
|
|
|
|
void P_RunOverlays(void);
|
2019-06-14 19:19:52 +00:00
|
|
|
|
void P_HandleMinecartSegments(mobj_t *mobj);
|
2014-03-15 16:59:03 +00:00
|
|
|
|
void P_MobjThinker(mobj_t *mobj);
|
|
|
|
|
boolean P_RailThinker(mobj_t *mobj);
|
|
|
|
|
void P_PushableThinker(mobj_t *mobj);
|
|
|
|
|
void P_SceneryThinker(mobj_t *mobj);
|
|
|
|
|
|
2015-05-24 16:27:52 +00:00
|
|
|
|
|
|
|
|
|
fixed_t P_MobjFloorZ(mobj_t *mobj, sector_t *sector, sector_t *boundsec, fixed_t x, fixed_t y, line_t *line, boolean lowest, boolean perfect);
|
|
|
|
|
fixed_t P_MobjCeilingZ(mobj_t *mobj, sector_t *sector, sector_t *boundsec, fixed_t x, fixed_t y, line_t *line, boolean lowest, boolean perfect);
|
|
|
|
|
#define P_GetFloorZ(mobj, sector, x, y, line) P_MobjFloorZ(mobj, sector, NULL, x, y, line, false, false)
|
|
|
|
|
#define P_GetCeilingZ(mobj, sector, x, y, line) P_MobjCeilingZ(mobj, sector, NULL, x, y, line, true, false)
|
|
|
|
|
#define P_GetFOFTopZ(mobj, sector, fof, x, y, line) P_MobjCeilingZ(mobj, sectors + fof->secnum, sector, x, y, line, false, false)
|
|
|
|
|
#define P_GetFOFBottomZ(mobj, sector, fof, x, y, line) P_MobjFloorZ(mobj, sectors + fof->secnum, sector, x, y, line, true, false)
|
|
|
|
|
#define P_GetSpecialBottomZ(mobj, src, bound) P_MobjFloorZ(mobj, src, bound, mobj->x, mobj->y, NULL, src != bound, true)
|
|
|
|
|
#define P_GetSpecialTopZ(mobj, src, bound) P_MobjCeilingZ(mobj, src, bound, mobj->x, mobj->y, NULL, src == bound, true)
|
|
|
|
|
|
|
|
|
|
fixed_t P_CameraFloorZ(camera_t *mobj, sector_t *sector, sector_t *boundsec, fixed_t x, fixed_t y, line_t *line, boolean lowest, boolean perfect);
|
|
|
|
|
fixed_t P_CameraCeilingZ(camera_t *mobj, sector_t *sector, sector_t *boundsec, fixed_t x, fixed_t y, line_t *line, boolean lowest, boolean perfect);
|
|
|
|
|
#define P_CameraGetFloorZ(mobj, sector, x, y, line) P_CameraFloorZ(mobj, sector, NULL, x, y, line, false, false)
|
|
|
|
|
#define P_CameraGetCeilingZ(mobj, sector, x, y, line) P_CameraCeilingZ(mobj, sector, NULL, x, y, line, true, false)
|
|
|
|
|
#define P_CameraGetFOFTopZ(mobj, sector, fof, x, y, line) P_CameraCeilingZ(mobj, sectors + fof->secnum, sector, x, y, line, false, false)
|
|
|
|
|
#define P_CameraGetFOFBottomZ(mobj, sector, fof, x, y, line) P_CameraFloorZ(mobj, sectors + fof->secnum, sector, x, y, line, true, false)
|
2015-05-21 14:36:20 +00:00
|
|
|
|
|
2014-03-15 16:59:03 +00:00
|
|
|
|
boolean P_InsideANonSolidFFloor(mobj_t *mobj, ffloor_t *rover);
|
|
|
|
|
boolean P_CheckDeathPitCollide(mobj_t *mo);
|
2019-10-01 19:58:18 +00:00
|
|
|
|
boolean P_CheckSolidLava(ffloor_t *rover);
|
2018-04-28 14:13:44 +00:00
|
|
|
|
void P_AdjustMobjFloorZ_FFloors(mobj_t *mo, sector_t *sector, UINT8 motype);
|
2014-03-15 16:59:03 +00:00
|
|
|
|
|
2015-12-31 16:38:23 +00:00
|
|
|
|
mobj_t *P_SpawnMobjFromMobj(mobj_t *mobj, fixed_t xofs, fixed_t yofs, fixed_t zofs, mobjtype_t type);
|
|
|
|
|
|
2014-03-15 16:59:03 +00:00
|
|
|
|
mobj_t *P_SpawnMissile(mobj_t *source, mobj_t *dest, mobjtype_t type);
|
|
|
|
|
mobj_t *P_SpawnXYZMissile(mobj_t *source, mobj_t *dest, mobjtype_t type, fixed_t x, fixed_t y, fixed_t z);
|
|
|
|
|
mobj_t *P_SpawnPointMissile(mobj_t *source, fixed_t xa, fixed_t ya, fixed_t za, mobjtype_t type, fixed_t x, fixed_t y, fixed_t z);
|
|
|
|
|
mobj_t *P_SpawnAlteredDirectionMissile(mobj_t *source, mobjtype_t type, fixed_t x, fixed_t y, fixed_t z, INT32 shiftingAngle);
|
|
|
|
|
mobj_t *P_SPMAngle(mobj_t *source, mobjtype_t type, angle_t angle, UINT8 aimtype, UINT32 flags2);
|
|
|
|
|
#define P_SpawnPlayerMissile(s,t,f) P_SPMAngle(s,t,s->angle,true,f)
|
|
|
|
|
#ifdef SEENAMES
|
|
|
|
|
#define P_SpawnNameFinder(s,t) P_SPMAngle(s,t,s->angle,true,0)
|
|
|
|
|
#endif
|
|
|
|
|
void P_ColorTeamMissile(mobj_t *missile, player_t *source);
|
|
|
|
|
SINT8 P_MobjFlip(mobj_t *mobj);
|
2016-06-09 17:16:13 +00:00
|
|
|
|
fixed_t P_GetMobjGravity(mobj_t *mo);
|
2016-06-12 19:58:03 +00:00
|
|
|
|
FUNCMATH boolean P_WeaponOrPanel(mobjtype_t type);
|
2014-03-15 16:59:03 +00:00
|
|
|
|
|
2019-11-27 13:37:03 +00:00
|
|
|
|
void P_CalcChasePostImg(player_t *player, camera_t *thiscam);
|
2014-03-15 16:59:03 +00:00
|
|
|
|
boolean P_CameraThinker(player_t *player, camera_t *thiscam, boolean resetcalled);
|
|
|
|
|
|
|
|
|
|
void P_Attract(mobj_t *source, mobj_t *enemy, boolean nightsgrab);
|
|
|
|
|
mobj_t *P_GetClosestAxis(mobj_t *source);
|
|
|
|
|
|
|
|
|
|
boolean P_CanRunOnWater(player_t *player, ffloor_t *rover);
|
|
|
|
|
|
2018-04-01 19:54:19 +00:00
|
|
|
|
void P_MaceRotate(mobj_t *center, INT32 baserot, INT32 baseprevrot);
|
|
|
|
|
|
2014-03-15 16:59:03 +00:00
|
|
|
|
void P_FlashPal(player_t *pl, UINT16 type, UINT16 duration);
|
|
|
|
|
#define PAL_WHITE 1
|
|
|
|
|
#define PAL_MIXUP 2
|
|
|
|
|
#define PAL_RECYCLE 3
|
|
|
|
|
#define PAL_NUKE 4
|
|
|
|
|
|
|
|
|
|
//
|
|
|
|
|
// P_ENEMY
|
|
|
|
|
//
|
|
|
|
|
|
|
|
|
|
// main player in game
|
|
|
|
|
extern player_t *stplyr; // for splitscreen correct palette changes and overlay
|
|
|
|
|
|
|
|
|
|
// Is there a better place for these?
|
|
|
|
|
extern INT32 var1;
|
|
|
|
|
extern INT32 var2;
|
|
|
|
|
|
|
|
|
|
boolean P_CheckMeleeRange(mobj_t *actor);
|
|
|
|
|
boolean P_JetbCheckMeleeRange(mobj_t *actor);
|
|
|
|
|
boolean P_FaceStabCheckMeleeRange(mobj_t *actor);
|
|
|
|
|
boolean P_SkimCheckMeleeRange(mobj_t *actor);
|
|
|
|
|
boolean P_CheckMissileRange(mobj_t *actor);
|
|
|
|
|
|
|
|
|
|
void P_NewChaseDir(mobj_t *actor);
|
|
|
|
|
boolean P_LookForPlayers(mobj_t *actor, boolean allaround, boolean tracer, fixed_t dist);
|
|
|
|
|
|
2019-11-13 20:14:08 +00:00
|
|
|
|
mobj_t *P_InternalFlickySpawn(mobj_t *actor, mobjtype_t flickytype, fixed_t momz, boolean lookforplayers, SINT8 moveforward);
|
2018-09-06 17:09:45 +00:00
|
|
|
|
void P_InternalFlickySetColor(mobj_t *actor, UINT8 extrainfo);
|
2018-08-09 17:35:36 +00:00
|
|
|
|
#define P_IsFlickyCenter(type) (type > MT_FLICKY_01 && type < MT_SEED && (type - MT_FLICKY_01) % 2 ? 1 : 0)
|
2016-12-30 19:16:20 +00:00
|
|
|
|
void P_InternalFlickyBubble(mobj_t *actor);
|
|
|
|
|
void P_InternalFlickyFly(mobj_t *actor, fixed_t flyspeed, fixed_t targetdist, fixed_t chasez);
|
|
|
|
|
void P_InternalFlickyHop(mobj_t *actor, fixed_t momz, fixed_t momh, angle_t angle);
|
2016-12-30 14:04:04 +00:00
|
|
|
|
|
2014-03-15 16:59:03 +00:00
|
|
|
|
//
|
|
|
|
|
// P_MAP
|
|
|
|
|
//
|
|
|
|
|
|
|
|
|
|
// If "floatok" true, move would be ok
|
|
|
|
|
// if within "tmfloorz - tmceilingz".
|
|
|
|
|
extern boolean floatok;
|
|
|
|
|
extern fixed_t tmfloorz;
|
|
|
|
|
extern fixed_t tmceilingz;
|
2018-09-10 04:35:40 +00:00
|
|
|
|
extern ffloor_t *tmfloorrover, *tmceilingrover;
|
2015-05-31 12:57:27 +00:00
|
|
|
|
extern mobj_t *tmfloorthing, *tmhitthing, *tmthing;
|
2014-03-15 16:59:03 +00:00
|
|
|
|
extern camera_t *mapcampointer;
|
2015-04-29 05:29:51 +00:00
|
|
|
|
extern fixed_t tmx;
|
|
|
|
|
extern fixed_t tmy;
|
2015-04-29 05:33:04 +00:00
|
|
|
|
#ifdef ESLOPE
|
|
|
|
|
extern pslope_t *tmfloorslope, *tmceilingslope;
|
|
|
|
|
#endif
|
2014-03-15 16:59:03 +00:00
|
|
|
|
|
|
|
|
|
/* cphipps 2004/08/30 */
|
|
|
|
|
extern void P_MapStart(void);
|
|
|
|
|
extern void P_MapEnd(void);
|
|
|
|
|
|
|
|
|
|
extern line_t *ceilingline;
|
|
|
|
|
extern line_t *blockingline;
|
|
|
|
|
extern msecnode_t *sector_list;
|
|
|
|
|
|
|
|
|
|
extern mprecipsecnode_t *precipsector_list;
|
|
|
|
|
|
|
|
|
|
void P_UnsetThingPosition(mobj_t *thing);
|
|
|
|
|
void P_SetThingPosition(mobj_t *thing);
|
|
|
|
|
void P_SetUnderlayPosition(mobj_t *thing);
|
|
|
|
|
|
|
|
|
|
boolean P_CheckPosition(mobj_t *thing, fixed_t x, fixed_t y);
|
|
|
|
|
boolean P_CheckCameraPosition(fixed_t x, fixed_t y, camera_t *thiscam);
|
|
|
|
|
boolean P_TryMove(mobj_t *thing, fixed_t x, fixed_t y, boolean allowdropoff);
|
|
|
|
|
boolean P_Move(mobj_t *actor, fixed_t speed);
|
|
|
|
|
boolean P_TeleportMove(mobj_t *thing, fixed_t x, fixed_t y, fixed_t z);
|
|
|
|
|
void P_SlideMove(mobj_t *mo);
|
|
|
|
|
void P_BounceMove(mobj_t *mo);
|
|
|
|
|
boolean P_CheckSight(mobj_t *t1, mobj_t *t2);
|
|
|
|
|
void P_CheckHoopPosition(mobj_t *hoopthing, fixed_t x, fixed_t y, fixed_t z, fixed_t radius);
|
|
|
|
|
|
|
|
|
|
boolean P_CheckSector(sector_t *sector, boolean crunch);
|
|
|
|
|
|
|
|
|
|
void P_DelSeclist(msecnode_t *node);
|
|
|
|
|
void P_DelPrecipSeclist(mprecipsecnode_t *node);
|
|
|
|
|
|
|
|
|
|
void P_CreateSecNodeList(mobj_t *thing, fixed_t x, fixed_t y);
|
|
|
|
|
void P_Initsecnode(void);
|
|
|
|
|
|
2018-05-08 22:26:36 +00:00
|
|
|
|
void P_RadiusAttack(mobj_t *spot, mobj_t *source, fixed_t damagedist, UINT8 damagetype);
|
2014-03-15 16:59:03 +00:00
|
|
|
|
|
|
|
|
|
fixed_t P_FloorzAtPos(fixed_t x, fixed_t y, fixed_t z, fixed_t height);
|
|
|
|
|
boolean PIT_PushableMoved(mobj_t *thing);
|
|
|
|
|
|
2015-07-28 18:28:51 +00:00
|
|
|
|
boolean P_DoSpring(mobj_t *spring, mobj_t *object);
|
2014-05-23 22:58:14 +00:00
|
|
|
|
|
2014-03-15 16:59:03 +00:00
|
|
|
|
//
|
|
|
|
|
// P_SETUP
|
|
|
|
|
//
|
|
|
|
|
extern UINT8 *rejectmatrix; // for fast sight rejection
|
|
|
|
|
extern INT32 *blockmaplump; // offsets in blockmap are from here
|
|
|
|
|
extern INT32 *blockmap; // Big blockmap
|
|
|
|
|
extern INT32 bmapwidth;
|
|
|
|
|
extern INT32 bmapheight; // in mapblocks
|
|
|
|
|
extern fixed_t bmaporgx;
|
|
|
|
|
extern fixed_t bmaporgy; // origin of block map
|
|
|
|
|
extern mobj_t **blocklinks; // for thing chains
|
|
|
|
|
|
|
|
|
|
//
|
|
|
|
|
// P_INTER
|
|
|
|
|
//
|
|
|
|
|
typedef struct BasicFF_s
|
|
|
|
|
{
|
|
|
|
|
INT32 ForceX; ///< The X of the Force's Vel
|
|
|
|
|
INT32 ForceY; ///< The Y of the Force's Vel
|
|
|
|
|
const player_t *player; ///< Player of Rumble
|
|
|
|
|
//All
|
|
|
|
|
UINT32 Duration; ///< The total duration of the effect, in microseconds
|
|
|
|
|
INT32 Gain; ///< /The gain to be applied to the effect, in the range from 0 through 10,000.
|
|
|
|
|
//All, CONSTANTFORCE <20>10,000 to 10,000
|
|
|
|
|
INT32 Magnitude; ///< Magnitude of the effect, in the range from 0 through 10,000.
|
|
|
|
|
} BasicFF_t;
|
|
|
|
|
|
2015-02-13 16:15:58 +00:00
|
|
|
|
/* Damage/death types, for P_DamageMobj and related */
|
|
|
|
|
//// Damage types
|
|
|
|
|
//#define DMG_NORMAL 0 (unneeded?)
|
|
|
|
|
#define DMG_WATER 1
|
|
|
|
|
#define DMG_FIRE 2
|
|
|
|
|
#define DMG_ELECTRIC 3
|
|
|
|
|
#define DMG_SPIKE 4
|
2016-04-07 21:02:52 +00:00
|
|
|
|
#define DMG_NUKE 5 // bomb shield
|
|
|
|
|
//#define DMG_SPECIALSTAGE 6
|
2015-02-13 16:15:58 +00:00
|
|
|
|
//// Death types - cannot be combined with damage types
|
|
|
|
|
#define DMG_INSTAKILL 0x80
|
|
|
|
|
#define DMG_DROWNED 0x80+1
|
|
|
|
|
#define DMG_SPACEDROWN 0x80+2
|
|
|
|
|
#define DMG_DEATHPIT 0x80+3
|
|
|
|
|
#define DMG_CRUSHED 0x80+4
|
|
|
|
|
#define DMG_SPECTATOR 0x80+5
|
2018-05-08 22:26:36 +00:00
|
|
|
|
// Masks
|
|
|
|
|
#define DMG_CANHURTSELF 0x40 // Flag - can hurt self/team indirectly, such as through mines
|
2015-02-13 16:15:58 +00:00
|
|
|
|
#define DMG_DEATHMASK DMG_INSTAKILL // if bit 7 is set, this is a death type instead of a damage type
|
|
|
|
|
|
2014-03-15 16:59:03 +00:00
|
|
|
|
void P_ForceFeed(const player_t *player, INT32 attack, INT32 fade, tic_t duration, INT32 period);
|
|
|
|
|
void P_ForceConstant(const BasicFF_t *FFInfo);
|
|
|
|
|
void P_RampConstant(const BasicFF_t *FFInfo, INT32 Start, INT32 End);
|
|
|
|
|
void P_RemoveShield(player_t *player);
|
2017-08-06 21:10:29 +00:00
|
|
|
|
void P_SpecialStageDamage(player_t *player, mobj_t *inflictor, mobj_t *source);
|
2015-02-13 16:15:58 +00:00
|
|
|
|
boolean P_DamageMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32 damage, UINT8 damagetype);
|
|
|
|
|
void P_KillMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, UINT8 damagetype);
|
2014-03-15 16:59:03 +00:00
|
|
|
|
void P_PlayerRingBurst(player_t *player, INT32 num_rings); /// \todo better fit in p_user.c
|
|
|
|
|
void P_PlayerWeaponPanelBurst(player_t *player);
|
|
|
|
|
void P_PlayerWeaponAmmoBurst(player_t *player);
|
2015-05-27 04:45:34 +00:00
|
|
|
|
void P_PlayerWeaponPanelOrAmmoBurst(player_t *player);
|
2014-03-15 16:59:03 +00:00
|
|
|
|
void P_PlayerEmeraldBurst(player_t *player, boolean toss);
|
|
|
|
|
|
|
|
|
|
void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck);
|
|
|
|
|
void P_PlayerFlagBurst(player_t *player, boolean toss);
|
2015-10-11 20:01:04 +00:00
|
|
|
|
void P_CheckTimeLimit(void);
|
2014-03-15 16:59:03 +00:00
|
|
|
|
void P_CheckPointLimit(void);
|
|
|
|
|
void P_CheckSurvivors(void);
|
|
|
|
|
boolean P_CheckRacers(void);
|
|
|
|
|
|
|
|
|
|
void P_ClearStarPost(INT32 postnum);
|
|
|
|
|
void P_ResetStarposts(void);
|
|
|
|
|
|
|
|
|
|
boolean P_CanPickupItem(player_t *player, boolean weapon);
|
|
|
|
|
void P_DoNightsScore(player_t *player);
|
2015-05-27 06:08:18 +00:00
|
|
|
|
void P_DoMatchSuper(player_t *player);
|
2014-03-15 16:59:03 +00:00
|
|
|
|
|
|
|
|
|
//
|
|
|
|
|
// P_SPEC
|
|
|
|
|
//
|
|
|
|
|
#include "p_spec.h"
|
|
|
|
|
|
|
|
|
|
extern INT32 ceilmovesound;
|
|
|
|
|
|
2014-11-12 00:55:07 +00:00
|
|
|
|
// Factor to scale scrolling effect into mobj-carrying properties = 3/32.
|
|
|
|
|
// (This is so scrolling floors and objects on them can move at same speed.)
|
|
|
|
|
#define CARRYFACTOR ((3*FRACUNIT)/32)
|
|
|
|
|
|
2014-03-15 16:59:03 +00:00
|
|
|
|
void P_MixUp(mobj_t *thing, fixed_t x, fixed_t y, fixed_t z, angle_t angle,
|
|
|
|
|
INT16 starpostx, INT16 starposty, INT16 starpostz,
|
|
|
|
|
INT32 starpostnum, tic_t starposttime, angle_t starpostangle,
|
2019-09-07 21:11:33 +00:00
|
|
|
|
fixed_t starpostscale, angle_t drawangle, INT32 flags2);
|
2014-03-15 16:59:03 +00:00
|
|
|
|
boolean P_Teleport(mobj_t *thing, fixed_t x, fixed_t y, fixed_t z, angle_t angle, boolean flash, boolean dontstopmove);
|
|
|
|
|
boolean P_SetMobjStateNF(mobj_t *mobj, statenum_t state);
|
|
|
|
|
boolean P_CheckMissileSpawn(mobj_t *th);
|
|
|
|
|
void P_Thrust(mobj_t *mo, angle_t angle, fixed_t move);
|
|
|
|
|
void P_DoSuperTransformation(player_t *player, boolean giverings);
|
|
|
|
|
void P_ExplodeMissile(mobj_t *mo);
|
|
|
|
|
void P_CheckGravity(mobj_t *mo, boolean affect);
|
|
|
|
|
|
|
|
|
|
#endif // __P_LOCAL__
|