Files
src/miniquake2/game/player/view.ml
Provides miniquake2 game player view facilities for this project.
- Package
miniquake2.game.player.view- Reachable
- Yes
Imports
Declarations
# ApplyDamage
function ApplyDamage(context, player, amount, damageFlags, meansOfDeath)
A custom callback may apply armor/team/death rules and returns actual health damage. The default keeps the environment layer useful before full wiring.
| Parameter | Type | Default | Description |
|---|
context | dynamic | — | Context that carries state for the operation. |
player | dynamic | — | player value consumed by this operation. |
amount | dynamic | — | amount value consumed by this operation. |
damageFlags | dynamic | — | damageFlags value consumed by this operation. |
meansOfDeath | dynamic | — | meansOfDeath value consumed by this operation. |
View source
# clamp
function clamp(value, minimum, maximum)
Clamp state.
| Parameter | Type | Default | Description |
|---|
value | dynamic | — | Value consumed or transformed by the operation. |
minimum | dynamic | — | minimum value consumed by this operation. |
maximum | dynamic | — | maximum value consumed by this operation. |
View source
# ClientViewFrame
function ClientViewFrame(context, player)
Return the client view frame value.
| Parameter | Type | Default | Description |
|---|
context | dynamic | — | Context that carries state for the operation. |
player | dynamic | — | player value consumed by this operation. |
View source
# emitSound
function emitSound(context, player, channel, name, attenuation)
Emit sound.
| Parameter | Type | Default | Description |
|---|
context | dynamic | — | Context that carries state for the operation. |
player | dynamic | — | player value consumed by this operation. |
channel | dynamic | — | channel value consumed by this operation. |
name | dynamic | — | Name of the affected item. |
attenuation | dynamic | — | attenuation value consumed by this operation. |
View source
# G_SetClientEffects
function G_SetClientEffects(context, player)
Set g client effects.
| Parameter | Type | Default | Description |
|---|
context | dynamic | — | Context that carries state for the operation. |
player | dynamic | — | player value consumed by this operation. |
View source
# G_SetClientEvent
function G_SetClientEvent(player)
Set g client event.
| Parameter | Type | Default | Description |
|---|
player | dynamic | — | player value consumed by this operation. |
View source
# G_SetClientFrame
function G_SetClientFrame(player)
Set g client frame.
| Parameter | Type | Default | Description |
|---|
player | dynamic | — | player value consumed by this operation. |
View source
# G_SetClientSound
function G_SetClientSound(context, player)
Set g client sound.
| Parameter | Type | Default | Description |
|---|
context | dynamic | — | Context that carries state for the operation. |
player | dynamic | — | player value consumed by this operation. |
View source
# P_DamageFeedback
function P_DamageFeedback(context, player, forward, right)
Return the p damage feedback value.
| Parameter | Type | Default | Description |
|---|
context | dynamic | — | Context that carries state for the operation. |
player | dynamic | — | player value consumed by this operation. |
forward | dynamic | — | forward value consumed by this operation. |
right | dynamic | — | right value consumed by this operation. |
View source
# P_FallingDamage
function P_FallingDamage(context, player)
Return the p falling damage value.
| Parameter | Type | Default | Description |
|---|
context | dynamic | — | Context that carries state for the operation. |
player | dynamic | — | player value consumed by this operation. |
View source
# P_WorldEffects
function P_WorldEffects(context, player)
Return the p world effects value.
| Parameter | Type | Default | Description |
|---|
context | dynamic | — | Context that carries state for the operation. |
player | dynamic | — | player value consumed by this operation. |
View source
# pointVector
function pointVector(point)
Return the point vector value.
| Parameter | Type | Default | Description |
|---|
point | dynamic | — | point value consumed by this operation. |
View source
# randomIndex
function randomIndex(context, count)
Return the random index.
| Parameter | Type | Default | Description |
|---|
context | dynamic | — | Context that carries state for the operation. |
count | dynamic | — | Number of items or units to process. |
View source
# RecordDamage
function RecordDamage(player, blood, armor, powerArmor, knockback, point)
Public adapter for the damage accumulators normally filled by T_Damage.
| Parameter | Type | Default | Description |
|---|
player | dynamic | — | player value consumed by this operation. |
blood | dynamic | — | blood value consumed by this operation. |
armor | dynamic | — | armor value consumed by this operation. |
powerArmor | dynamic | — | powerArmor value consumed by this operation. |
knockback | dynamic | — | knockback value consumed by this operation. |
point | dynamic | — | point value consumed by this operation. |
View source
# SV_AddBlend
function SV_AddBlend(red, green, blue, alpha, blend)
Add sv blend.
| Parameter | Type | Default | Description |
|---|
red | dynamic | — | red value consumed by this operation. |
green | dynamic | — | green value consumed by this operation. |
blue | dynamic | — | blue value consumed by this operation. |
alpha | dynamic | — | alpha value consumed by this operation. |
blend | dynamic | — | blend value consumed by this operation. |
View source
# SV_CalcBlend
function SV_CalcBlend(context, player)
Return the sv calc blend value.
| Parameter | Type | Default | Description |
|---|
context | dynamic | — | Context that carries state for the operation. |
player | dynamic | — | player value consumed by this operation. |
View source
# SV_CalcGunOffset
function SV_CalcGunOffset(context, player, forward, right, up)
Return the sv calc gun offset.
| Parameter | Type | Default | Description |
|---|
context | dynamic | — | Context that carries state for the operation. |
player | dynamic | — | player value consumed by this operation. |
forward | dynamic | — | forward value consumed by this operation. |
right | dynamic | — | right value consumed by this operation. |
up | dynamic | — | up value consumed by this operation. |
View source
# SV_CalcRoll
function SV_CalcRoll(context, player, right)
Return the sv calc roll value.
| Parameter | Type | Default | Description |
|---|
context | dynamic | — | Context that carries state for the operation. |
player | dynamic | — | player value consumed by this operation. |
right | dynamic | — | right value consumed by this operation. |
View source
# SV_CalcViewOffset
function SV_CalcViewOffset(context, player, forward, right)
Return the sv calc view offset.
| Parameter | Type | Default | Description |
|---|
context | dynamic | — | Context that carries state for the operation. |
player | dynamic | — | player value consumed by this operation. |
forward | dynamic | — | forward value consumed by this operation. |
right | dynamic | — | right value consumed by this operation. |
View source
# UpdateBob
function UpdateBob(player)
Update bob.
| Parameter | Type | Default | Description |
|---|
player | dynamic | — | player value consumed by this operation. |
View source