Files
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.
| Parameter | Type | Default | Description |
|---|
target | dynamic | — | target value consumed by this operation. |
direction | dynamic | — | direction value consumed by this operation. |
knockback | dynamic | — | knockback value consumed by this operation. |
selfDamage | dynamic | — | selfDamage value consumed by this operation. |
View source
# armorSave
function armorSave(target, damage, damageFlags)
Save armor.
| Parameter | Type | Default | Description |
|---|
target | dynamic | — | target value consumed by this operation. |
damage | dynamic | — | damage value consumed by this operation. |
damageFlags | dynamic | — | damageFlags value consumed by this operation. |
View source
# distance
function distance(first, second)
Return the distance value.
| Parameter | Type | Default | Description |
|---|
first | dynamic | — | first value consumed by this operation. |
second | dynamic | — | second value consumed by this operation. |
View source
# normalized
function normalized(value)
Performs the normalized operation for the miniquake2 game gameplay combat module.
| Parameter | Type | Default | Description |
|---|
value | dynamic | — | Value consumed or transformed by the operation. |
View source
# T_Damage
function T_Damage(target, request)
Return the t damage value.
| Parameter | Type | Default | Description |
|---|
target | dynamic | — | target value consumed by this operation. |
request | dynamic | — | 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.
| Parameter | Type | Default | Description |
|---|
targets | dynamic | — | targets value consumed by this operation. |
inflictorOrigin | dynamic | — | inflictorOrigin value consumed by this operation. |
attackerNumber | dynamic | — | attackerNumber value consumed by this operation. |
baseDamage | dynamic | — | baseDamage value consumed by this operation. |
radius | dynamic | — | radius value consumed by this operation. |
ignoreNumber | dynamic | — | ignoreNumber value consumed by this operation. |
canDamageCallback | dynamic | — | canDamageCallback value consumed by this operation. |
meansOfDeath | dynamic | — | meansOfDeath value consumed by this operation. |
View source
# validateVector
function validateVector(value, name)
Validate vector.
| Parameter | Type | Default | Description |
|---|
value | dynamic | — | Value consumed or transformed by the operation. |
name | dynamic | — | Name of the affected item. |
View source