User:Monster Iestyn/Source Code Documentation/p_enemy.c
Jump to navigation
Jump to search
This article or section is incomplete. It doesn't have all of the necessary core information on this topic. Please help the SRB2 Wiki by finishing this article. |
Online link | GitHub entry |
---|---|
File type | C source file |
Includes
- doomdef.h
- g_game.h
- p_local.h
- r_main.h
- r_state.h
- s_sound.h
- m_random.h
- m_misc.h
- r_things.h
- lua_hook.h
- hardware/hw3sound.h (if
HW3SOUND
is defined)
Global variables
Data name | Data type | Description |
---|---|---|
*stplyr
|
player_t
|
Player to display HUD for (used in st_stuff.c )
|
var1
|
INT32 | Variable #1 for action functions |
var2
|
INT32 | Variable #2 for action functions |
Static variables
Data name | Data type | Attributes | Description |
---|---|---|---|
opposite[]
|
dirtype_t
|
static
|
Array storing opposites for each direction, used by P_NewChaseDir . See Movement directions
|
diags[]
|
dirtype_t
|
static
|
Array storing a list of the diagonal directions, used by P_NewChaseDir . See Movement directions
|
xspeed[NUMDIRS]
|
const fixed_t
|
static
|
Array storing normalised X speeds for each direction, used by P_Move . See Movement directions
|
yspeed[NUMDIRS]
|
const fixed_t
|
static
|
Array storing normalised Y speeds for each direction, used by P_Move . See Movement directions
|
Movement directions
Direction # | Direction name (dirtype_t) |
Description | Opposite direction ( opposite[] )
|
Entry # in diags[]
|
xspeed[]
|
yspeed[]
|
---|---|---|---|---|---|---|
-1 | DI_NODIR | No direction | - | - | - | - |
0 | DI_EAST | Eastwards (+x, y=0) | DI_WEST (4) | - | FRACUNIT
|
0 |
1 | DI_NORTHEAST | North-eastwards (+x, +y) | DI_SOUTHWEST (5) | 1 | 46341 | 46341 |
2 | DI_NORTH | Northwards (x=0, +y) | DI_SOUTH (6) | - | 0 | FRACUNIT
|
3 | DI_NORTHWEST | North-westwards (-x, +y) | DI_SOUTHEAST (7) | 0 | -46341 | 46341 |
4 | DI_WEST | Westwards (-x, y=0) | DI_EAST (0) | - | -FRACUNIT
|
0 |
5 | DI_SOUTHWEST | South-westwards (-x, -y) | DI_NORTHEAST (1) | 2 | -46341 | -46341 |
6 | DI_SOUTH | Southwards (x=0, -y) | DI_NORTH (2) | - | 0 | -FRACUNIT
|
7 | DI_SOUTHEAST | South-eastwards (+x, -y) | DI_NORTHWEST (3) | 3 | 46341 | -46341 |
8 | NUMDIRS | Number of directions | DI_NODIR (-1) | - | - | - |
Functions
(Should the actions be listed here?)
Function name | Return type | Params | Attributes | Description |
---|---|---|---|---|
P_CheckMeleeRange
|
boolean | mobj_t *actor
|
||
P_JetbCheckMeleeRange
|
boolean | mobj_t *actor
|
||
P_FaceStabCheckMeleeRange
|
boolean | mobj_t *actor
|
||
P_SkimCheckMeleeRange
|
boolean | mobj_t *actor
|
||
P_CheckMissileRange
|
boolean | mobj_t *actor
|
||
P_WaterInSector
|
boolean | mobj_t *mobj ,fixed_t x ,fixed_t y
|
static
|
|
P_Move
|
boolean | mobj_t *actor ,fixed_t speed
|
||
P_TryWalk
|
boolean | mobj_t *actor
|
static
|
|
P_NewChaseDir
|
void | mobj_t *actor
|
||
P_LookForPlayers
|
boolean | mobj_t *actor ,boolean allaround ,boolean tracer ,fixed_t dist
|
||
P_LookForShield
|
boolean | mobj_t *actor
|
static
|
|
P_RecycleCompare
|
int | const void *p1 ,const void *p2
|
static
|
Defined only if WEIGHTEDRECYCLER is defined
|