MiniDoom

src/p_user.ml

Applies player commands to turning, thrust, view height, jumping, weapon use, and power timers.

Package
(global)
Reachable
Yes

Imports

Declarations

_P_ANG5

const _P_ANG5 = 59652323

Defines p ang5 for the p user subsystem.

View source

_P_BOBANGLESTEP

const _P_BOBANGLESTEP = 409

Defines p bobanglestep for the p user subsystem.

View source

_P_FineIndexFromAngle

inline function _P_FineIndexFromAngle(angle)

Converts a Doom binary angle to a wrapped fine-angle table index.

ParameterTypeDefaultDescription
angledynamic—Doom binary-angle measurement.

View source

_PU_GetPower

function _PU_GetPower(player, pw)

Resolves a power enum safely and returns the player's remaining counter, defaulting to zero for malformed state.

ParameterTypeDefaultDescription
playerdynamic—Player state affected by the operation.
pwdynamic—Pw value supplied to `_PU_GetPower`.

View source

_PU_HasWeapon

inline function _PU_HasWeapon(player, w)

Resolves a weapon enum and reports ownership without indexing malformed player tables.

ParameterTypeDefaultDescription
playerdynamic—Player state affected by the operation.
wdynamic—W value supplied to `_PU_HasWeapon`.

View source

_PU_PowerIndex

function _PU_PowerIndex(pw)

Validates a power-up identifier before indexing the player's power timer array.

ParameterTypeDefaultDescription
pwdynamic—Pw value supplied to `_PU_PowerIndex`.

View source

_PU_SetPower

function _PU_SetPower(player, pw, value)

Resolves a power enum safely and replaces its counter only when the player's power table can hold it.

ParameterTypeDefaultDescription
playerdynamic—Player state affected by the operation.
pwdynamic—Pw value supplied to `_PU_SetPower`.
valuedynamic—Value consumed by the operation.

View source

_PU_WeaponIndex

function _PU_WeaponIndex(w)

Validates and clamps an arbitrary weapon identifier to the player weapon-array range.

ParameterTypeDefaultDescription
wdynamic—W value supplied to `_PU_WeaponIndex`.

View source

INVERSECOLORMAP

const INVERSECOLORMAP = 32

Defines the Doom palette selection for inversecolormap.

View source

MAXBOB

const MAXBOB = 1048576

Defines the maximum maxbob accepted by the p user subsystem.

View source

onground

onground

Tracks whether onground is active in the p user subsystem.

View source

P_CalcHeight

function P_CalcHeight(player)

Derives weapon bob and eye height from horizontal momentum, stance, airborne state, and ceiling clearance.

ParameterTypeDefaultDescription
playerdynamic—Player state affected by the operation.

View source

P_DeathThink

function P_DeathThink(player)

Lowers the dead player's view, turns toward the attacker, and requests rebirth when use is pressed.

ParameterTypeDefaultDescription
playerdynamic—Player state affected by the operation.

View source

P_MovePlayer

function P_MovePlayer(player)

Applies command turning and grounded forward/side thrust, then enters the run animation when movement is requested.

ParameterTypeDefaultDescription
playerdynamic—Player state affected by the operation.

View source

P_PlayerThink

function P_PlayerThink(player)

Applies one tic command to player movement, view, weapon, use, power timers, and death or live-state transitions.

ParameterTypeDefaultDescription
playerdynamic—Player state affected by the operation.

View source

P_Thrust

function P_Thrust(player, angle, move)

Projects a movement magnitude through fine-angle sine/cosine tables and adds it to player horizontal momentum.

ParameterTypeDefaultDescription
playerdynamic—Player state affected by the operation.
angledynamic—Doom binary-angle measurement.
movedynamic—Move value supplied to `P_Thrust`.

View source