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

tweak mob hear function

This commit is contained in:
tenplus1
2024-10-01 09:08:52 +01:00
parent 64c6085f09
commit 1dd81eb008
2 changed files with 19 additions and 23 deletions

View File

@ -348,13 +348,12 @@ 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 the sound originated,
'pos' position the sound originated (only sounds with pos detected),
'gain' original gain of sound,
'distance' distance of mob from sound source,
'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,
'loudness' how loud sound is to mob (percentage of gain heard at distance)
'player' player name sound originated, [NOT IN USE]
'object' object reference sound originated, [NOT IN USE]
'max_hear_distance' max distance sound can be heard from source.