From deeeb92628344011651548372e7e27dca780dfc3 Mon Sep 17 00:00:00 2001 From: Vito Caputo Date: Thu, 8 Dec 2022 10:15:52 -0800 Subject: sfx,game: introduce sfx_t.tv_talk[10] for talking head There can be assets/talk/[0-9].wav now, one of which will be played along with adult-captivated.wav Intended to match the new talking head .ans --- src/game.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/game.c') diff --git a/src/game.c b/src/game.c index 84b1a85..0f14465 100644 --- a/src/game.c +++ b/src/game.c @@ -882,6 +882,12 @@ static ix2_search_status_t adult_search(void *cb_context, ix2_object_t *ix2_obje game->adult->captivated = 1; sfx_play(sfx.adult_captivated); + /* shifted because rand() tends to have more activity in the upper bits, + * but this could be more careful about avoiding repetition by randomizing + * a 0-9 list every time it stepped through said list. TODO + */ + sfx_play(sfx.tv_talk[(rand() >> 8) % NELEMS(sfx.tv_talk)]); + return IX2_SEARCH_STOP_HIT; case ENTITY_TYPE_MASK: -- cgit v1.2.3