MiniQuake2

src/miniquake2/game/gameplay/combat.ml

Provides miniquake2 game gameplay combat facilities for this project.

Package
miniquake2.game.gameplay.combat
Reachable
Yes

Imports

Declarations

applyKnockback

function applyKnockback(target, direction, knockback, selfDamage)

Apply knockback.

ParameterTypeDefaultDescription
targetdynamic—target value consumed by this operation.
directiondynamic—direction value consumed by this operation.
knockbackdynamic—knockback value consumed by this operation.
selfDamagedynamic—selfDamage value consumed by this operation.

View source

armorSave

function armorSave(target, damage, damageFlags)

Save armor.

ParameterTypeDefaultDescription
targetdynamic—target value consumed by this operation.
damagedynamic—damage value consumed by this operation.
damageFlagsdynamic—damageFlags value consumed by this operation.

View source

distance

function distance(first, second)

Return the distance value.

ParameterTypeDefaultDescription
firstdynamic—first value consumed by this operation.
seconddynamic—second value consumed by this operation.

View source

normalized

function normalized(value)

Performs the normalized operation for the miniquake2 game gameplay combat module.

ParameterTypeDefaultDescription
valuedynamic—Value consumed or transformed by the operation.

View source

T_Damage

function T_Damage(target, request)

Return the t damage value.

ParameterTypeDefaultDescription
targetdynamic—target value consumed by this operation.
requestdynamic—request value consumed by this operation.

View source

T_RadiusDamage

function T_RadiusDamage(targets, inflictorOrigin, attackerNumber, baseDamage, radius, ignoreNumber, canDamageCallback, meansOfDeath)

Visibility/CanDamage is intentionally supplied as a callback so this layer stays independent of a concrete collision world while retaining game logic.

ParameterTypeDefaultDescription
targetsdynamic—targets value consumed by this operation.
inflictorOrigindynamic—inflictorOrigin value consumed by this operation.
attackerNumberdynamic—attackerNumber value consumed by this operation.
baseDamagedynamic—baseDamage value consumed by this operation.
radiusdynamic—radius value consumed by this operation.
ignoreNumberdynamic—ignoreNumber value consumed by this operation.
canDamageCallbackdynamic—canDamageCallback value consumed by this operation.
meansOfDeathdynamic—meansOfDeath value consumed by this operation.

View source

validateVector

function validateVector(value, name)

Validate vector.

ParameterTypeDefaultDescription
valuedynamic—Value consumed or transformed by the operation.
namedynamic—Name of the affected item.

View source