Jukeboxes Finally Work

This commit is contained in:
Dip
2020-10-13 14:55:34 -03:00
parent 0b29c76fe5
commit 417a0d9d4a
2 changed files with 9 additions and 5 deletions
+6 -4
View File
@@ -65,6 +65,7 @@ SUBSYSTEM_DEF(jukeboxes)
/datum/controller/subsystem/jukeboxes/Initialize()
var/list/tracks = flist("config/jukebox_music/sounds/")
var/songID = 1
for(var/S in tracks)
var/datum/track/T = new()
T.song_path = file("config/jukebox_music/sounds/[S]")
@@ -72,8 +73,9 @@ SUBSYSTEM_DEF(jukeboxes)
T.song_name = L[1]
T.song_length = text2num(L[2])
T.song_beat = text2num(L[3])
T.song_associated_id = L[4]
T.song_associated_id = songID
songs |= T
songID++
for(var/i in CHANNEL_JUKEBOX_START to CHANNEL_JUKEBOX)
freejukeboxchannels |= i
return ..()
@@ -83,15 +85,15 @@ SUBSYSTEM_DEF(jukeboxes)
return
for(var/list/jukeinfo in activejukeboxes)
if(!jukeinfo.len)
EXCEPTION("Active jukebox without any associated metadata.")
stack_trace("Active jukebox without any associated metadata.")
continue
var/datum/track/juketrack = jukeinfo[1]
if(!istype(juketrack))
EXCEPTION("Invalid jukebox track datum.")
stack_trace("Invalid jukebox track datum.")
continue
var/obj/jukebox = jukeinfo[3]
if(!istype(jukebox))
EXCEPTION("Nonexistant or invalid object associated with jukebox.")
stack_trace("Nonexistant or invalid object associated with jukebox.")
continue
var/sound/song_played = sound(juketrack.song_path)
var/area/currentarea = get_area(jukebox)
+3 -1
View File
@@ -202,6 +202,8 @@
for(var/i in 1 to 10)
spawn_atom_to_turf(/obj/effect/temp_visual/hierophant/telegraph/edge, src, 1, FALSE)
sleep(5)
if(QDELETED(src))
return
#define DISCO_INFENO_RANGE (rand(85, 115)*0.01)
@@ -364,7 +366,7 @@
//for(var/mob/living/carbon/NS in rangers)
// NS.resting = !NS.resting
// NS.update_canmove()
time--
time--
/obj/machinery/jukebox/disco/proc/dance5(var/mob/living/M)
animate(M, transform = matrix(180, MATRIX_ROTATE), time = 1, loop = 0)