Merge pull request #12969 from silicons/e
someone asked i code holoparasites playing music so here we are???
This commit is contained in:
@@ -303,3 +303,19 @@
|
||||
return TRUE
|
||||
var/obj/structure/musician/M = parent
|
||||
return M.should_stop_playing(user)
|
||||
|
||||
/datum/song/holoparasite
|
||||
var/mob/living/simple_animal/hostile/guardian/stand
|
||||
|
||||
/datum/song/holoparasite/New(atom/parent, list/instrument_ids)
|
||||
. = ..()
|
||||
stand = istype(parent, /mob/living/simple_animal/hostile/guardian) && parent
|
||||
|
||||
/datum/song/holoparasite/updateDialog()
|
||||
stand.ui_interact(src)
|
||||
|
||||
/datum/song/holoparasite/should_stop_playing(mob/user)
|
||||
return FALSE
|
||||
|
||||
/datum/song/holoparasite/check_can_use(mob/user)
|
||||
return (user == stand)
|
||||
|
||||
@@ -109,8 +109,11 @@
|
||||
linenum++
|
||||
updateDialog(usr) // make sure updates when complete
|
||||
|
||||
/datum/song/proc/check_can_use(mob/user)
|
||||
return user.canUseTopic(parent, TRUE, FALSE, FALSE, FALSE)
|
||||
|
||||
/datum/song/Topic(href, href_list)
|
||||
if(!usr.canUseTopic(parent, TRUE, FALSE, FALSE, FALSE))
|
||||
if(!check_can_use(usr))
|
||||
usr << browse(null, "window=instrument")
|
||||
usr.unset_machine()
|
||||
return
|
||||
|
||||
@@ -60,11 +60,13 @@ GLOBAL_LIST_EMPTY(parasites) //all currently existing/living guardians
|
||||
var/magic_fluff_string = "<span class='holoparasite'>You draw the Coder, symbolizing bugs and errors. This shouldn't happen! Submit a bug report!</span>"
|
||||
var/tech_fluff_string = "<span class='holoparasite'>BOOT SEQUENCE COMPLETE. ERROR MODULE LOADED. THIS SHOULDN'T HAPPEN. Submit a bug report!</span>"
|
||||
var/carp_fluff_string = "<span class='holoparasite'>CARP CARP CARP SOME SORT OF HORRIFIC BUG BLAME THE CODERS CARP CARP CARP</span>"
|
||||
/// sigh, fine.
|
||||
var/datum/song/holoparasite/music_datum
|
||||
|
||||
/mob/living/simple_animal/hostile/guardian/Initialize(mapload, theme)
|
||||
GLOB.parasites += src
|
||||
updatetheme(theme)
|
||||
|
||||
music_datum = new(src, get_allowed_instrument_ids())
|
||||
. = ..()
|
||||
|
||||
/mob/living/simple_animal/hostile/guardian/med_hud_set_health()
|
||||
@@ -84,8 +86,16 @@ GLOBAL_LIST_EMPTY(parasites) //all currently existing/living guardians
|
||||
|
||||
/mob/living/simple_animal/hostile/guardian/Destroy()
|
||||
GLOB.parasites -= src
|
||||
QDEL_NULL(music_datum)
|
||||
return ..()
|
||||
|
||||
/mob/living/simple_animal/hostile/guardian/verb/music_interact()
|
||||
set name = "Access Internal Synthesizer"
|
||||
set desc = "Access your internal musical synthesizer"
|
||||
set category = "IC"
|
||||
|
||||
music_datum.ui_interact(src)
|
||||
|
||||
/mob/living/simple_animal/hostile/guardian/proc/updatetheme(theme) //update the guardian's theme
|
||||
if(!theme)
|
||||
theme = pick("magic", "tech", "carp")
|
||||
|
||||
Reference in New Issue
Block a user