# _PE_Abs
inline function _PE_Abs(v)Returns the non-negative magnitude of an enemy movement or distance scalar.
| Parameter | Type | Default | Description |
|---|---|---|---|
v | dynamic | — | Value consumed by the operation. |
src/p_enemy.mlImplements monster perception, chase movement, attack actions, resurrection, boss triggers, and Icon of Sin spawning.
doomdef.ml → src/doomdef.mldoomstat.ml → src/doomstat.mlg_game.ml → src/g_game.mli_system.ml → src/i_system.mlm_fixed.ml → src/m_fixed.mlm_random.ml → src/m_random.mlp_doors.ml → src/p_doors.mlp_floor.ml → src/p_floor.mlp_inter.ml → src/p_inter.mlp_local.ml → src/p_local.mlp_map.ml → src/p_map.mlp_maputl.ml → src/p_maputl.mlp_mobj.ml → src/p_mobj.mlp_sight.ml → src/p_sight.mlp_switch.ml → src/p_switch.mlr_main.ml → src/r_main.mlr_state.ml → src/r_state.mls_sound.ml → src/s_sound.mlsounds.ml → src/sounds.mlstd/math.ml → ../MiniLangCompilerOptimization/MiniLangCompilerPy/std/math.ml external dependencytables.ml → src/tables.mlinline function _PE_Abs(v)Returns the non-negative magnitude of an enemy movement or distance scalar.
| Parameter | Type | Default | Description |
|---|---|---|---|
v | dynamic | — | Value consumed by the operation. |
_PE_brain_easyTracks the mutable pe brain easy value used by the p enemy subsystem.
function _PE_HasOtherAliveType(exceptMo, moType)Scans registered thinkers for another living mobj of the requested type, excluding the supplied actor.
| Parameter | Type | Default | Description |
|---|---|---|---|
exceptMo | dynamic | — | Except mo value supplied to `_PE_HasOtherAliveType`. |
moType | dynamic | — | Mo type value supplied to `_PE_HasOtherAliveType`. |
inline function _PE_IDiv(a, b)Divides integer AI values with truncation toward zero, returning zero for invalid operands or a zero divisor.
| Parameter | Type | Default | Description |
|---|---|---|---|
a | dynamic | — | First input operand. |
b | dynamic | — | Second input operand. |
inline function _PE_IsNoTargetMobj(mo)Reports whether a player actor is hidden from monster sight and sound acquisition.
| Parameter | Type | Default | Description |
|---|---|---|---|
mo | dynamic | — | Map object affected by the operation. |
inline function _PE_JunkLineWithTag(tag)Constructs a minimal synthetic linedef carrying a tag for boss-death floor and door event APIs.
| Parameter | Type | Default | Description |
|---|---|---|---|
tag | dynamic | — | Zone-memory or resource-lifetime tag. |
function _PE_PainShootSkull(actor, angle)Enforces the Lost Soul population cap, validates a spawn point, creates a soul, and starts its charge at the target.
| Parameter | Type | Default | Description |
|---|---|---|---|
actor | dynamic | — | Actor value supplied to `_PE_PainShootSkull`. |
angle | dynamic | — | Doom binary-angle measurement. |
inline function _PE_ResolveThinkerMobj(cur)Resolves a thinker-list node to its registered mobj owner, accepting direct mobj-shaped nodes as fallback.
| Parameter | Type | Default | Description |
|---|---|---|---|
cur | dynamic | — | Cur value supplied to `_PE_ResolveThinkerMobj`. |
inline function _PE_StartSound(origin, sfx)Starts an actor sound when the audio subsystem is linked, otherwise leaves AI state unchanged.
| Parameter | Type | Default | Description |
|---|---|---|---|
origin | dynamic | — | Origin value supplied to `_PE_StartSound`. |
sfx | dynamic | — | Sound-effect descriptor to process. |
function A_BabyMetal(mo)Plays the Arachnotron walking sound and continues chase processing.
| Parameter | Type | Default | Description |
|---|---|---|---|
mo | dynamic | — | Map object affected by the operation. |
function A_BossDeath(mo)After validating map/type, living players, and last-boss status, triggers the canonical tagged floor/door action or exits.
| Parameter | Type | Default | Description |
|---|---|---|---|
mo | dynamic | — | Map object affected by the operation. |
function A_BrainAwake(mo)Collects all boss-target map objects, resets the target cursor, and starts the Icon of Sin wake sound.
| Parameter | Type | Default | Description |
|---|---|---|---|
mo | dynamic | — | Map object affected by the operation. |
function A_BrainDie(mo)Completes the Icon of Sin sequence by exiting the level.
| Parameter | Type | Default | Description |
|---|---|---|---|
mo | dynamic | — | Map object affected by the operation. |
function A_BrainExplode(mo)Spawns one randomized explosion/fireball above the Icon of Sin during its death sequence.
| Parameter | Type | Default | Description |
|---|---|---|---|
mo | dynamic | — | Map object affected by the operation. |
function A_BrainPain(mo)Plays the Icon of Sin pain sound globally.
| Parameter | Type | Default | Description |
|---|---|---|---|
mo | dynamic | — | Map object affected by the operation. |
function A_BrainScream(mo)Spawns a row of randomized explosions above the Icon of Sin and starts its death sound.
| Parameter | Type | Default | Description |
|---|---|---|---|
mo | dynamic | — | Map object affected by the operation. |
function A_BrainSpit(mo)Cycles boss targets, applies the easy-skill cadence, and launches a spawn cube timed to its destination.
| Parameter | Type | Default | Description |
|---|---|---|---|
mo | dynamic | — | Map object affected by the operation. |
function A_BruisAttack(actor)Faces the target, performs a Baron/Hell Knight melee strike, or launches a green plasma projectile.
| Parameter | Type | Default | Description |
|---|---|---|---|
actor | dynamic | — | Actor value supplied to `A_BruisAttack`. |
function A_BspiAttack(actor)Faces the target and launches an arachnotron plasma projectile.
| Parameter | Type | Default | Description |
|---|---|---|---|
actor | dynamic | — | Actor value supplied to `A_BspiAttack`. |
function A_Chase(actor)Turns and pursues the target, retargets when needed, selects melee/missile attacks, and chooses new paths when blocked.
| Parameter | Type | Default | Description |
|---|---|---|---|
actor | dynamic | — | Actor value supplied to `A_Chase`. |
function A_CloseShotgun2(player, psp)Plays the super-shotgun closing sound and immediately re-enters refire logic.
| Parameter | Type | Default | Description |
|---|---|---|---|
player | dynamic | — | Player state affected by the operation. |
psp | dynamic | — | Psp value supplied to `A_CloseShotgun2`. |
function A_CPosAttack(actor)Faces the target and fires one chaingunner hitscan with pistol audio, spread, and randomized damage.
| Parameter | Type | Default | Description |
|---|---|---|---|
actor | dynamic | — | Actor value supplied to `A_CPosAttack`. |
function A_CPosRefire(actor)Continues chaingunner fire while the random check and target visibility pass, otherwise returns to seestate.
| Parameter | Type | Default | Description |
|---|---|---|---|
actor | dynamic | — | Actor value supplied to `A_CPosRefire`. |
function A_CyberAttack(actor)Faces the target and launches one Cyberdemon rocket.
| Parameter | Type | Default | Description |
|---|---|---|---|
actor | dynamic | — | Actor value supplied to `A_CyberAttack`. |
function A_Explode(thingy)Applies the standard 128-damage, 128-radius explosion centered on the actor.
| Parameter | Type | Default | Description |
|---|---|---|---|
thingy | dynamic | — | Thingy value supplied to `A_Explode`. |
function A_FaceTarget(actor)Clears ambush, aims exactly at the target, and adds random angular jitter when the target is shadowed.
| Parameter | Type | Default | Description |
|---|---|---|---|
actor | dynamic | — | Actor value supplied to `A_FaceTarget`. |
function A_Fall(actor)Clears MF_SOLID from a dead actor so corpses no longer block movement.
| Parameter | Type | Default | Description |
|---|---|---|---|
actor | dynamic | — | Actor value supplied to `A_Fall`. |
function A_FatAttack1(actor)Turns slightly right and launches the first two-projectile Mancubus spread pair.
| Parameter | Type | Default | Description |
|---|---|---|---|
actor | dynamic | — | Actor value supplied to `A_FatAttack1`. |
function A_FatAttack2(actor)Turns left and launches the second two-projectile Mancubus spread pair.
| Parameter | Type | Default | Description |
|---|---|---|---|
actor | dynamic | — | Actor value supplied to `A_FatAttack2`. |
function A_FatAttack3(actor)Launches the final Mancubus pair on diverging angles around the target direction.
| Parameter | Type | Default | Description |
|---|---|---|---|
actor | dynamic | — | Actor value supplied to `A_FatAttack3`. |
function A_FatRaise(actor)Faces the target and plays the Mancubus weapon-raise sound before its volley.
| Parameter | Type | Default | Description |
|---|---|---|---|
actor | dynamic | — | Actor value supplied to `A_FatRaise`. |
function A_Fire(actor)Keeps an Arch-vile fire actor in front of its traced victim while the owner retains line of sight.
| Parameter | Type | Default | Description |
|---|---|---|---|
actor | dynamic | — | Actor value supplied to `A_Fire`. |
function A_FireCrackle(actor)Plays the Arch-vile flame crackle and updates the fire actor's attachment to its victim.
| Parameter | Type | Default | Description |
|---|---|---|---|
actor | dynamic | — | Actor value supplied to `A_FireCrackle`. |
function A_HeadAttack(actor)Faces the target, bites in melee, or launches a cacodemon projectile at range.
| Parameter | Type | Default | Description |
|---|---|---|---|
actor | dynamic | — | Actor value supplied to `A_HeadAttack`. |
function A_Hoof(mo)Plays the Cyberdemon hoofstep and continues chase processing.
| Parameter | Type | Default | Description |
|---|---|---|---|
mo | dynamic | — | Map object affected by the operation. |
function A_KeenDie(mo)Makes a Keen corpse non-solid and opens tagged door 666 only after the last living Keen dies.
| Parameter | Type | Default | Description |
|---|---|---|---|
mo | dynamic | — | Map object affected by the operation. |
function A_LoadShotgun2(player, psp)Plays the super-shotgun shell-loading sound during the player's reload animation.
| Parameter | Type | Default | Description |
|---|---|---|---|
player | dynamic | — | Player state affected by the operation. |
psp | dynamic | — | Psp value supplied to `A_LoadShotgun2`. |
function A_Look(actor)Leaves a monster idle until it hears a valid target or sees a player, then plays its wake sound and enters seestate.
| Parameter | Type | Default | Description |
|---|---|---|---|
actor | dynamic | — | Actor value supplied to `A_Look`. |
function A_Metal(mo)Plays the Spider Mastermind metal step and continues chase processing.
| Parameter | Type | Default | Description |
|---|---|---|---|
mo | dynamic | — | Map object affected by the operation. |
function A_OpenShotgun2(player, psp)Plays the super-shotgun breech-opening sound during the player's reload animation.
| Parameter | Type | Default | Description |
|---|---|---|---|
player | dynamic | — | Player state affected by the operation. |
psp | dynamic | — | Psp value supplied to `A_OpenShotgun2`. |
function A_Pain(actor)Plays the actor type's configured pain sound.
| Parameter | Type | Default | Description |
|---|---|---|---|
actor | dynamic | — | Actor value supplied to `A_Pain`. |
function A_PainAttack(actor)Faces the target and emits one Lost Soul straight ahead.
| Parameter | Type | Default | Description |
|---|---|---|---|
actor | dynamic | — | Actor value supplied to `A_PainAttack`. |
function A_PainDie(actor)Makes the Pain Elemental corpse non-solid and emits three Lost Souls in separated directions.
| Parameter | Type | Default | Description |
|---|---|---|---|
actor | dynamic | — | Actor value supplied to `A_PainDie`. |
function A_PainShootSkull(actor, angle)Public action wrapper that spawns and launches one Lost Soul at the requested angle.
| Parameter | Type | Default | Description |
|---|---|---|---|
actor | dynamic | — | Actor value supplied to `A_PainShootSkull`. |
angle | dynamic | — | Doom binary-angle measurement. |
function A_PlayerScream(mo)Selects the normal or commercial extreme player death scream from the victim's health and plays it at the corpse.
| Parameter | Type | Default | Description |
|---|---|---|---|
mo | dynamic | — | Map object affected by the operation. |
function A_PosAttack(actor)Faces the target, plays the pistol sound, and fires one spread hitscan with randomized bullet damage.
| Parameter | Type | Default | Description |
|---|---|---|---|
actor | dynamic | — | Actor value supplied to `A_PosAttack`. |
function A_SargAttack(actor)Faces the target and applies the demon's randomized melee bite when in range.
| Parameter | Type | Default | Description |
|---|---|---|---|
actor | dynamic | — | Actor value supplied to `A_SargAttack`. |
function A_Scream(actor)Selects variant death audio for certain monster families and plays boss deaths at full-volume origin.
| Parameter | Type | Default | Description |
|---|---|---|---|
actor | dynamic | — | Actor value supplied to `A_Scream`. |
function A_SkelFist(actor)Faces the target and applies the Revenant's randomized punch damage when still in melee range.
| Parameter | Type | Default | Description |
|---|---|---|---|
actor | dynamic | — | Actor value supplied to `A_SkelFist`. |
function A_SkelMissile(actor)Faces the target, launches a Revenant tracer missile, and advances it outward from the actor before homing begins.
| Parameter | Type | Default | Description |
|---|---|---|---|
actor | dynamic | — | Actor value supplied to `A_SkelMissile`. |
function A_SkelWhoosh(actor)Faces the target and plays the Revenant melee swing sound.
| Parameter | Type | Default | Description |
|---|---|---|---|
actor | dynamic | — | Actor value supplied to `A_SkelWhoosh`. |
function A_SkullAttack(actor)Faces the target, enters MF_SKULLFLY, plays attack audio, and sets charge momentum toward target center.
| Parameter | Type | Default | Description |
|---|---|---|---|
actor | dynamic | — | Actor value supplied to `A_SkullAttack`. |
function A_SpawnFly(mo)Advances a spawn cube's countdown, teleports in a weighted-random monster at its target, and removes the cube.
| Parameter | Type | Default | Description |
|---|---|---|---|
mo | dynamic | — | Map object affected by the operation. |
function A_SpawnSound(mo)Plays the spawn-cube travel sound and advances its spawn countdown/action.
| Parameter | Type | Default | Description |
|---|---|---|---|
mo | dynamic | — | Map object affected by the operation. |
function A_SpidRefire(actor)Continues Spider Mastermind fire while its randomized stop check and target visibility pass.
| Parameter | Type | Default | Description |
|---|---|---|---|
actor | dynamic | — | Actor value supplied to `A_SpidRefire`. |
function A_SPosAttack(actor)Faces the target, plays the shotgun sound, and fires three independent spread hitscans.
| Parameter | Type | Default | Description |
|---|---|---|---|
actor | dynamic | — | Actor value supplied to `A_SPosAttack`. |
function A_StartFire(actor)Starts the Arch-vile flame sound and immediately positions its fire actor relative to the victim.
| Parameter | Type | Default | Description |
|---|---|---|---|
actor | dynamic | — | Actor value supplied to `A_StartFire`. |
function A_Tracer(actor)Periodically spawns smoke and steers a Revenant missile's angle and vertical momentum toward its live tracer target.
| Parameter | Type | Default | Description |
|---|---|---|---|
actor | dynamic | — | Actor value supplied to `A_Tracer`. |
function A_TroopAttack(actor)Faces the target, performs an imp claw attack in melee, or launches an imp fireball at range.
| Parameter | Type | Default | Description |
|---|---|---|---|
actor | dynamic | — | Actor value supplied to `A_TroopAttack`. |
function A_VileAttack(actor)Applies the Arch-vile blast, vertical thrust, radius damage, and final fire placement when sight remains clear.
| Parameter | Type | Default | Description |
|---|---|---|---|
actor | dynamic | — | Actor value supplied to `A_VileAttack`. |
function A_VileChase(actor)Searches the next movement block for a raisable corpse, resurrects it when found, otherwise runs normal chase logic.
| Parameter | Type | Default | Description |
|---|---|---|---|
actor | dynamic | — | Actor value supplied to `A_VileChase`. |
function A_VileStart(actor)Plays the Arch-vile's attack-start sound.
| Parameter | Type | Default | Description |
|---|---|---|---|
actor | dynamic | — | Actor value supplied to `A_VileStart`. |
function A_VileTarget(actor)Faces the victim, spawns the Arch-vile fire actor, and links owner/victim references used by later fire actions.
| Parameter | Type | Default | Description |
|---|---|---|---|
actor | dynamic | — | Actor value supplied to `A_VileTarget`. |
function A_XScream(actor)Plays the universal gib/slop sound for an extreme death animation.
| Parameter | Type | Default | Description |
|---|---|---|---|
actor | dynamic | — | Actor value supplied to `A_XScream`. |
braintargetonTracks the mutable braintargeton value used by the p enemy subsystem.
braintargetsStores the braintargets collection used by the p enemy subsystem.
corpsehitHolds the optional corpsehit resource used by the p enemy subsystem.
const DI_EAST = 0Defines di east for the p enemy subsystem.
const DI_NODIR = 8Defines di nodir for the p enemy subsystem.
const DI_NORTH = 2Defines di north for the p enemy subsystem.
const DI_NORTHEAST = 1Defines di northeast for the p enemy subsystem.
const DI_NORTHWEST = 3Defines di northwest for the p enemy subsystem.
const DI_SOUTH = 6Defines di south for the p enemy subsystem.
const DI_SOUTHEAST = 7Defines di southeast for the p enemy subsystem.
const DI_SOUTHWEST = 5Defines di southwest for the p enemy subsystem.
const DI_WEST = 4Defines di west for the p enemy subsystem.
diagsStores the diags collection used by the p enemy subsystem.
const FATSPREAD = ANG90 >> 3Defines fatspread for the p enemy subsystem.
numbraintargetsTracks the mutable numbraintargets value used by the p enemy subsystem.
oppositeStores the opposite collection used by the p enemy subsystem.
function P_CheckMeleeRange(actor)Requires a live target within radius-adjusted melee distance, modest vertical separation, and line of sight.
| Parameter | Type | Default | Description |
|---|---|---|---|
actor | dynamic | — | Actor value supplied to `P_CheckMeleeRange`. |
function P_CheckMissileRange(actor)Applies sight, reaction, distance, melee-capability, and randomized aggression rules before a monster fires.
| Parameter | Type | Default | Description |
|---|---|---|---|
actor | dynamic | — | Actor value supplied to `P_CheckMissileRange`. |
function P_ForgetPlayerTarget(playerMo)Makes active monsters and sector sound emitters immediately forget one newly hidden player.
| Parameter | Type | Default | Description |
|---|---|---|---|
playerMo | dynamic | — | Player mo value supplied to `P_ForgetPlayerTarget`. |
function P_LookForPlayers(actor, allaround)Cycles active living players, enforcing field-of-view unless allaround, and acquires the first visible target.
| Parameter | Type | Default | Description |
|---|---|---|---|
actor | dynamic | — | Actor value supplied to `P_LookForPlayers`. |
allaround | dynamic | — | Allaround value supplied to `P_LookForPlayers`. |
function P_Move(actor)Attempts one movedir step, adjusts floating monsters, and activates crossed special lines when blocked.
| Parameter | Type | Default | Description |
|---|---|---|---|
actor | dynamic | — | Actor value supplied to `P_Move`. |
function P_NewChaseDir(actor)Chooses diagonal or cardinal movement toward the target while avoiding immediate turnaround and blocked directions.
| Parameter | Type | Default | Description |
|---|---|---|---|
actor | dynamic | — | Actor value supplied to `P_NewChaseDir`. |
function P_NoiseAlert(target, emmiter)Starts a new sound-validity flood from the emitter's sector so monsters acquire target as their sound target.
| Parameter | Type | Default | Description |
|---|---|---|---|
target | dynamic | — | Target value supplied to `P_NoiseAlert`. |
emmiter | dynamic | — | Emmiter value supplied to `P_NoiseAlert`. |
function P_RecursiveSound(sec, soundblocks)Floods a noise target through open two-sided sectors, crossing at most one sound-blocking line.
| Parameter | Type | Default | Description |
|---|---|---|---|
sec | dynamic | — | Sec value supplied to `P_RecursiveSound`. |
soundblocks | dynamic | — | Soundblocks value supplied to `P_RecursiveSound`. |
function P_TryWalk(actor)Performs one monster move and randomizes the number of tics before its next chase-direction choice.
| Parameter | Type | Default | Description |
|---|---|---|---|
actor | dynamic | — | Actor value supplied to `P_TryWalk`. |
const PE_FRACUNIT = 65536Defines pe fracunit for the p enemy subsystem.
function PIT_VileCheck(thing)Tests whether a nearby corpse is raiseable at the Arch-vile destination and records the first valid resurrection candidate.
| Parameter | Type | Default | Description |
|---|---|---|---|
thing | dynamic | — | World object affected by the operation. |
const SKULLSPEED = 20 * PE_FRACUNITDefines skullspeed for the p enemy subsystem.
soundtargetHolds the optional soundtarget resource used by the p enemy subsystem.
const TRACEANGLE = 201326592Defines traceangle for the p enemy subsystem.
vileobjHolds the optional vileobj resource used by the p enemy subsystem.
viletryxTracks the mutable viletryx value used by the p enemy subsystem.
viletryyTracks the mutable viletryy value used by the p enemy subsystem.
xspeedStores the xspeed collection used by the p enemy subsystem.
yspeedStores the yspeed collection used by the p enemy subsystem.