1
0
mirror of https://codeberg.org/tenplus1/mobs_redo.git synced 2025-06-28 06:30:18 +02:00

tweak loudness calculation for mod hearing

This commit is contained in:
tenplus1
2024-08-04 08:25:48 +01:00
parent 1f6867bf25
commit 57d6859b93
2 changed files with 29 additions and 21 deletions

View File

@ -348,12 +348,14 @@ enhance mob functionality and have them do many interesting things:
'on_sound' (self, def) called when mob is inside the hearing distance of
a sound, passes a def table containing:
'sound' the sound being played,
'pos' position sound originated,
'pos' position the sound originated,
'gain' original gain of sound,
'distance' distance of mob from sound source,
'loudness' how loud sound is to mob when calculating gain / distance,
'loudness' how loud sound is to mob (0 = cant hear, 1.0 = near sound), this
would be used as the main value inside on_sound function,
'player' player name sound originated,
'object' object reference sound originated
'object' object reference sound originated,
'max_hear_distance' max distance sound can be heard from source.
Internal Variables