Apply item-specific spatial range to use sounds

This commit is contained in:
Jage9
2026-02-27 01:10:32 -05:00
parent 4ed52649f1
commit 47a7aa0a83
7 changed files with 15 additions and 6 deletions

View File

@@ -1657,8 +1657,8 @@ const onAppMessage = createOnMessageHandler({
shouldAnnounceItemPropertyEcho: () => Date.now() >= suppressItemPropertyEchoUntilMs,
playLocateToneAt: (x, y) => audio.sfxLocate({ x: x - state.player.x, y: y - state.player.y }),
resolveIncomingSoundUrl,
playIncomingItemUseSound: (url, x, y) => {
void audio.playSpatialSample(url, { x, y }, { x: state.player.x, y: state.player.y }, 1);
playIncomingItemUseSound: (url, x, y, range) => {
void audio.playSpatialSample(url, { x, y }, { x: state.player.x, y: state.player.y }, 1, range ?? HEARING_RADIUS);
},
playClockAnnouncement: (sounds, x, y) => {
void clockAnnouncer.playSequence(sounds.map(resolveIncomingSoundUrl), x, y);