Crossfire Server, Trunk
|
#include "global.h"
#include <assert.h>
#include <stdlib.h>
#include <string.h>
#include "sounds.h"
#include "sproto.h"
Go to the source code of this file.
Macros | |
#define | MAX_SOUND_DISTANCE 10 |
#define | POW2(x) ((x)*(x)) |
Functions | |
static char const * | pick_bg_music (mapstruct map[static 1]) |
void | play_sound_map (int8_t sound_type, object *emitter, int dir, const char *action) |
void | play_sound_player_only (player *pl, int8_t sound_type, object *emitter, int dir, const char *action) |
void | player_update_bg_music (object player[static 1]) |
void | send_background_music (player *pl, const char *music) |
#define MAX_SOUND_DISTANCE 10 |
|
static |
Definition at line 154 of file sounds.c.
References get_name_of_region_for_map(), and disinfect::map.
Referenced by player_update_bg_music().
void play_sound_map | ( | int8_t | sound_type, |
object * | emitter, | ||
int | dir, | ||
const char * | action | ||
) |
Plays a sound on a map.
sound_type | sound type, see the sound types. |
emitter | object emitting the sound. Must be on a map. |
dir | direction the sound is moving. |
action | sound name to play. |
Definition at line 113 of file sounds.c.
References convert::action, obj::env, first_player, isqrt(), obj::map, MAX_SOUND_DISTANCE, pl::next, pl::ob, altar_valkyrie::pl, play_sound_player_only(), POW2, obj::x, and obj::y.
Referenced by apply_by_living(), attack_message(), attack_ob_simple(), button_type_move_on(), cast_spell(), cf_handle_type_apply(), fire_bow(), food_type_apply(), gate_type_process(), hole_type_move_on(), kill_object(), move_ob(), move_player_attack(), player_attack_door(), polymorph_melt(), potion_type_apply(), recharge(), save_life(), trapdoor_type_move_on(), and trigger_type_apply().
void play_sound_player_only | ( | player * | pl, |
int8_t | sound_type, | ||
object * | emitter, | ||
int | dir, | ||
const char * | action | ||
) |
Plays a sound for specified player only.
pl | player to play sound to. |
sound_type | sound type, see the sound types. |
emitter | object emitting a sound. |
dir | direction the sound is moving into. |
action | sound name to play. |
Definition at line 51 of file sounds.c.
References convert::action, obj::arch, archt::clone, obj::env, EXIT, FABS, obj::map, MAX_SOUNDS_TICK, MIN, give::name, obj::name, pl::ob, PLAYER, obj::race, Send_With_Handling(), SND_EFFECTS, SND_MUTE, pl::socket, SockList_AddChar(), SockList_AddLen8Data(), SockList_AddString(), SockList_Init(), SockList_Term(), socket_struct::sound, socket_struct::sounds_this_tick, sstring, obj::type, obj::x, and obj::y.
Referenced by apply_manual(), cast_spell(), clock_type_apply(), do_learn_spell(), fire_misc_object(), kill_player(), play_sound_map(), poison_type_apply(), and spellbook_type_apply().
void player_update_bg_music | ( | object | player[static 1] | ) |
Definition at line 161 of file sounds.c.
References pick_bg_music(), PLAYER, and send_background_music().
void send_background_music | ( | player * | pl, |
const char * | music | ||
) |
Sends background music to client.
pl | player |
music | background music name. Can be NULL. |
Definition at line 141 of file sounds.c.
References Send_With_Handling(), SND_MUSIC, SND_MUTE, pl::socket, SockList_AddString(), SockList_Init(), SockList_Term(), and socket_struct::sound.
Referenced by player_update_bg_music().