Dance machine preference

Adds a verb that allows you to switch wheter you hear and dance to the
disco machine or not.
This commit is contained in:
Mars
2019-07-19 19:30:28 +02:00
parent 9d3b9fa0f2
commit ecb4c4132f
3 changed files with 25 additions and 7 deletions
+3 -2
View File
@@ -7,8 +7,9 @@
#define SOUND_BUZZ 64
#define SOUND_INSTRUMENTS 128
#define SOUND_MENTORHELP 256
#define SOUND_DISCO 512
#define SOUND_DEFAULT (SOUND_ADMINHELP|SOUND_MIDI|SOUND_AMBIENCE|SOUND_LOBBY|SOUND_HEARTBEAT|SOUND_BUZZ|SOUND_INSTRUMENTS|SOUND_MENTORHELP)
#define SOUND_DEFAULT (SOUND_ADMINHELP|SOUND_MIDI|SOUND_AMBIENCE|SOUND_LOBBY|SOUND_HEARTBEAT|SOUND_BUZZ|SOUND_INSTRUMENTS|SOUND_MENTORHELP|SOUND_DISCO)
#define CHAT_OOC 1
#define CHAT_DEAD 2
@@ -34,7 +35,7 @@
#define AMBIENT_OCCLUSION 2097152
#define CHAT_GHOSTPDA 4194304
#define NUMPAD_TARGET 8388608
#define TOGGLES_TOTAL 16777215 // If you add or remove a preference toggle above, make sure you update this define with the total value of the toggles combined.
#define TOGGLES_TOTAL 16777215 // If you add or remove a preference toggle above, make sure you update this define with the total value of the toggles combined.
#define TOGGLES_DEFAULT (CHAT_OOC|CHAT_DEAD|CHAT_GHOSTEARS|CHAT_GHOSTSIGHT|CHAT_PRAYER|CHAT_RADIO|CHAT_LOOC|MEMBER_PUBLIC|DONATOR_PUBLIC|AMBIENT_OCCLUSION|CHAT_GHOSTPDA|NUMPAD_TARGET)
+9 -5
View File
@@ -322,6 +322,9 @@
/obj/machinery/disco/proc/dance(mob/living/M) //Show your moves
set waitfor = FALSE
if(M.client && !(M.client.prefs.sound & SOUND_DISCO)) //We have a client that doesn't want to dance.
rangers -= M //Doing that here as it'll be checked less often than in processing.
return
switch(rand(0,9))
if(0 to 1)
dance2(M)
@@ -460,17 +463,18 @@
var/sound/song_played = sound(selection.song_path)
for(var/mob/M in range(10,src))
if(!(M in rangers))
rangers[M] = TRUE
M.playsound_local(get_turf(M), null, 100, channel = CHANNEL_JUKEBOX, S = song_played)
if(prob(5+(allowed(M) * 4)) && M.canmove && isliving(M))
dance(M)
if(!M.client || M.client.prefs.sound & SOUND_DISCO)
if(!(M in rangers))
rangers[M] = TRUE
M.playsound_local(get_turf(M), null, 100, channel = CHANNEL_JUKEBOX, S = song_played)
for(var/mob/L in rangers)
if(get_dist(src, L) > 10)
rangers -= L
if(!L || !L.client)
continue
L.stop_sound_channel(CHANNEL_JUKEBOX)
else if(prob(9) && L.canmove && isliving(L))
dance(L)
else if(active)
active = FALSE
STOP_PROCESSING(SSobj, src)
@@ -201,6 +201,19 @@
to_chat(src, "You will no longer hear musical instruments.")
feedback_add_details("admin_verb","TInstru") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
/client/verb/Toggle_disco() //to toggle off heartbeat sounds, in case they get too annoying
set name = "Hear/Silence Dance Machine"
set category = "Preferences"
set desc = "Toggles hearing and dancing to the radiant dance machine"
prefs.sound ^= SOUND_DISCO
prefs.save_preferences(src)
if(prefs.sound & SOUND_DISCO)
to_chat(src, "You will now hear and dance to the radiant dance machine.")
else
to_chat(src, "You will no longer hear or dance to the radiant dance machine.")
usr.stop_sound_channel(CHANNEL_JUKEBOX)
feedback_add_details("admin_verb","Tdd") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
/client/verb/setup_character()
set name = "Game Preferences"
set category = "Preferences"