MiniDoom

src/p_spec.ml

Defines and updates sector/line specials, animated surfaces, buttons, movers, environmental damage, and tag searches.

Package
(global)
Reachable
Yes

Imports

Declarations

_P_NumLines

inline function _P_NumLines()

Returns the loaded linedef count for either supported sequence representation.

View source

_P_NumSectors

inline function _P_NumSectors()

Returns the loaded sector count for either supported sequence representation.

View source

_PS_animdefs

_PS_animdefs

Stores the ps animdefs collection used by the p spec subsystem.

View source

_PS_IDiv

inline function _PS_IDiv(a, b)

Returns a signed quotient truncated toward zero, or zero for invalid operands and a zero divisor in `_PS_IDiv`

ParameterTypeDefaultDescription
adynamic—First input operand.
bdynamic—Second input operand.

View source

_PS_IsProjectileType

inline function _PS_IsProjectileType(t)

Identifies player and monster missile types allowed to trigger projectile-sensitive line specials.

ParameterTypeDefaultDescription
tdynamic—T value supplied to `_PS_IsProjectileType`.

View source

_PS_IsSeq

inline function _PS_IsSeq(v)

Recognizes array and list containers used by level geometry and animation tables.

ParameterTypeDefaultDescription
vdynamic—Value consumed by the operation.

View source

_PS_LineSideSector

function _PS_LineSideSector(line, side)

Resolves a line's requested side to its front/back sector through direct references or sidedef indices.

ParameterTypeDefaultDescription
linedynamic—Map line or text line affected by the operation.
sidedynamic—Map side affected by the operation.

View source

_PS_ParseInt

function _PS_ParseInt(v)

Parses an integer or numeric string with truncation toward zero, returning void when conversion fails.

ParameterTypeDefaultDescription
vdynamic—Value consumed by the operation.

View source

_PS_ResetButtons

function _PS_ResetButtons()

Reinitializes the fixed timed-button registry or clears existing entries when the helper is unavailable.

View source

_PS_SectorIndex

function _PS_SectorIndex(sec)

Finds a sector by object identity in the loaded sector table, returning -1 when absent.

ParameterTypeDefaultDescription
secdynamic—Sec value supplied to `_PS_SectorIndex`.

View source

_PSpec_GetPower

function _PSpec_GetPower(player, pw)

Reads a validated player power duration/value, treating legacy booleans as zero or one.

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

View source

_PSpec_PowerIndex

function _PSpec_PowerIndex(pw)

Maps a supported player-power enum or integer to its powers-array slot.

ParameterTypeDefaultDescription
pwdynamic—Pw value supplied to `_PSpec_PowerIndex`.

View source

anims

anims

Stores the anims collection used by the p spec subsystem.

View source

button_t struct

BUTTONTIME

const BUTTONTIME = 35

Defines buttontime for the p spec subsystem.

View source

bwhere_e enum

ceiling_e enum

ceiling_t struct

CEILSPEED

const CEILSPEED = 65536

Defines ceilspeed for the p spec subsystem.

View source

CEILWAIT

const CEILWAIT = 150

Defines ceilwait for the p spec subsystem.

View source

EV_DoDonut

function EV_DoDonut(line)

Starts the coupled donut action: lower the tagged pillar while raising its surrounding ring to the outer sector.

ParameterTypeDefaultDescription
linedynamic—Map line or text line affected by the operation.

View source

FASTDARK

const FASTDARK = 15

Defines fastdark for the p spec subsystem.

View source

fireflicker_t struct

floor_e enum

floormove_t struct

FLOORSPEED

const FLOORSPEED = 65536

Defines floorspeed for the p spec subsystem.

View source

getNextSector

function getNextSector(line, sec)

Given one sector on a two-sided line, returns the opposite adjacent sector.

ParameterTypeDefaultDescription
linedynamic—Map line or text line affected by the operation.
secdynamic—Sec value supplied to `getNextSector`.

View source

getSector

function getSector(currentSector, lineIndex, side)

Returns the sector referenced by a resolved sidedef, or void when the side is missing.

ParameterTypeDefaultDescription
currentSectordynamic—Current sector value supplied to `getSector`.
lineIndexdynamic—Index identifying line.
sidedynamic—Map side affected by the operation.

View source

getSide

function getSide(currentSector, lineIndex, side)

Resolves a sector-local line and side number to the corresponding sidedef with index validation.

ParameterTypeDefaultDescription
currentSectordynamic—Current sector value supplied to `getSide`.
lineIndexdynamic—Index identifying line.
sidedynamic—Map side affected by the operation.

View source

glow_t struct

GLOWSPEED

const GLOWSPEED = 8

Defines glowspeed for the p spec subsystem.

View source

lastanim

lastanim

Tracks the mutable lastanim value used by the p spec subsystem.

View source

levelTimeCount

levelTimeCount

Tracks the mutable level time count value used by the p spec subsystem.

View source

levelTimer

levelTimer

Tracks whether level timer is active in the p spec subsystem.

View source

lightflash_t struct

linespeciallist

linespeciallist

Stores the linespeciallist collection used by the p spec subsystem.

View source

MAXANIMS

const MAXANIMS = 32

Defines the maximum maxanims accepted by the p spec subsystem.

View source

MAXBUTTONS

const MAXBUTTONS = 16

Defines the maximum maxbuttons accepted by the p spec subsystem.

View source

MAXCEILINGS

const MAXCEILINGS = 30

Defines the maximum maxceilings accepted by the p spec subsystem.

View source

MAXLINEANIMS

const MAXLINEANIMS = 64

Defines the maximum maxlineanims accepted by the p spec subsystem.

View source

MAXPLATS

const MAXPLATS = 30

Defines the maximum maxplats accepted by the p spec subsystem.

View source

MAXSWITCHES

const MAXSWITCHES = 50

Defines the maximum maxswitches accepted by the p spec subsystem.

View source

MO_TELEPORTMAN

const MO_TELEPORTMAN = 14

Defines mo teleportman for the p spec subsystem.

View source

numlinespecials

numlinespecials

Tracks the mutable numlinespecials value used by the p spec subsystem.

View source

P_CrossSpecialLine

function P_CrossSpecialLine(linenum, side, thing)

Dispatches one-shot and repeatable walkover specials after validating line index, side, actor, and projectile rules.

ParameterTypeDefaultDescription
linenumdynamic—Index identifying line.
sidedynamic—Map side affected by the operation.
thingdynamic—World object affected by the operation.

View source

P_FindHighestCeilingSurrounding

function P_FindHighestCeilingSurrounding(sec)

Returns the maximum ceiling height among all valid sectors adjacent to the supplied sector.

ParameterTypeDefaultDescription
secdynamic—Sec value supplied to `P_FindHighestCeilingSurrounding`.

View source

P_FindHighestFloorSurrounding

function P_FindHighestFloorSurrounding(sec)

Returns the maximum floor height among all valid sectors adjacent to the supplied sector.

ParameterTypeDefaultDescription
secdynamic—Sec value supplied to `P_FindHighestFloorSurrounding`.

View source

P_FindLowestCeilingSurrounding

function P_FindLowestCeilingSurrounding(sec)

Returns the minimum ceiling height among all valid sectors adjacent to the supplied sector.

ParameterTypeDefaultDescription
secdynamic—Sec value supplied to `P_FindLowestCeilingSurrounding`.

View source

P_FindLowestFloorSurrounding

function P_FindLowestFloorSurrounding(sec)

Returns the minimum floor height among all valid sectors adjacent to the supplied sector.

ParameterTypeDefaultDescription
secdynamic—Sec value supplied to `P_FindLowestFloorSurrounding`.

View source

P_FindMinSurroundingLight

function P_FindMinSurroundingLight(sector, max)

Finds the lowest adjacent sector light level without exceeding the caller-provided starting maximum.

ParameterTypeDefaultDescription
sectordynamic—Map sector affected by the operation.
maxdynamic—Maximum permitted value.

View source

P_FindNextHighestFloor

function P_FindNextHighestFloor(sec, currentheight)

Returns the lowest adjacent floor strictly above currentheight, or currentheight when none exists.

ParameterTypeDefaultDescription
secdynamic—Sec value supplied to `P_FindNextHighestFloor`.
currentheightdynamic—Height of current in pixels or map units.

View source

P_FindSectorFromLineTag

function P_FindSectorFromLineTag(line, start)

Continues a linear search after start for the next sector whose tag matches the triggering line.

ParameterTypeDefaultDescription
linedynamic—Map line or text line affected by the operation.
startdynamic—Start value supplied to `P_FindSectorFromLineTag`.

View source

P_InitPicAnims

function P_InitPicAnims()

Resolves built-in flat/texture animation name ranges, validates contiguity, and records runtime frame cycles.

View source

p_picanim_revision

p_picanim_revision

Tracks the mutable p picanim revision value used by the p spec subsystem.

View source

P_PlayerInSpecialSector

function P_PlayerInSpecialSector(player)

Applies floor-contact damage, secret discovery, and exit effects for the player's current sector special.

ParameterTypeDefaultDescription
playerdynamic—Player state affected by the operation.

View source

P_ShootSpecialLine

function P_ShootSpecialLine(thing, line)

Dispatches gun-triggered line types to floor, door, or switch actions while enforcing monster restrictions.

ParameterTypeDefaultDescription
thingdynamic—World object affected by the operation.
linedynamic—Map line or text line affected by the operation.

View source

P_SpawnSpecials

function P_SpawnSpecials()

Parses the level timer, spawns sector lighting/door effects, collects scrolling lines, and resets active movers/buttons.

View source

P_UpdateSpecials

function P_UpdateSpecials()

Advances level timeout, surface animation translations, scrolling walls, and timed button restoration each tic.

View source

plat_e enum

plat_t struct

PLATSPEED

const PLATSPEED = 65536

Defines platspeed for the p spec subsystem.

View source

plattype_e enum

PLATWAIT

const PLATWAIT = 3

Defines platwait for the p spec subsystem.

View source

ps_anim_t struct

ps_animdef_t struct

result_e enum

SLOWDARK

const SLOWDARK = 35

Defines slowdark for the p spec subsystem.

View source

stair_e enum

strobe_t struct

STROBEBRIGHT

const STROBEBRIGHT = 5

Defines strobebright for the p spec subsystem.

View source

switchlist_t struct

twoSided

function twoSided(sectorIndex, lineIndex)

Tests whether a sector-owned line index references a valid ML_TWOSIDED linedef.

ParameterTypeDefaultDescription
sectorIndexdynamic—Index identifying sector.
lineIndexdynamic—Index identifying line.

View source

VDOORSPEED

const VDOORSPEED = 131072

Defines vdoorspeed for the p spec subsystem.

View source

VDOORWAIT

const VDOORWAIT = 150

Defines vdoorwait for the p spec subsystem.

View source

vldoor_e enum

vldoor_t struct