diff --git a/modular_nova/master_files/code/modules/mob/living/carbon/human/species_type/ethereal.dm b/modular_nova/master_files/code/modules/mob/living/carbon/human/species_type/ethereal.dm index 731ab660551..8d8d5e7edeb 100644 --- a/modular_nova/master_files/code/modules/mob/living/carbon/human/species_type/ethereal.dm +++ b/modular_nova/master_files/code/modules/mob/living/carbon/human/species_type/ethereal.dm @@ -1,3 +1,8 @@ +/datum/species/ethereal/on_species_gain(mob/living/carbon/human/new_ethereal, datum/species/old_species, pref_load) + . = ..() + var/datum/action/sing_tones/sing_action = new + sing_action.Grant(new_ethereal) + /datum/species/ethereal/create_pref_unique_perks() var/list/to_add = list() @@ -14,6 +19,12 @@ SPECIES_PERK_NAME = "Disco Ball", SPECIES_PERK_DESC = "Ethereals passively generate their own light.", ), + list( + SPECIES_PERK_TYPE = SPECIES_POSITIVE_PERK, + SPECIES_PERK_ICON = "music", + SPECIES_PERK_NAME = "Musical Discharger", + SPECIES_PERK_DESC = "Ethereals can sing musical tones using their electric discharger.", + ), list( SPECIES_PERK_TYPE = SPECIES_NEUTRAL_PERK, SPECIES_PERK_ICON = "gem", diff --git a/modular_nova/modules/species_synthesizer/README.md b/modular_nova/modules/species_synthesizer/README.md new file mode 100644 index 00000000000..2de304bec9d --- /dev/null +++ b/modular_nova/modules/species_synthesizer/README.md @@ -0,0 +1,22 @@ +https://github.com/NovaSector/NovaSector/pull/4531 + +## Title: All the emotes. + +MODULE ID: species_synthesizer + +### Description: + +Adds an action to Synthetic and Ethereal species that allows them to synthesize music. + +- Added to `modular_nova/modules/synths/code/species/synthetic.dm`: + - Edited `/datum/species/synthetic/on_species_gain()` to add the action to the mob. + - Added to `/datum/species/ethereal/create_pref_unique_perks()` to add the "Musical Discharger" species perk. + +### Master File Additions + +- Added to `modular_nova/master_files/code/modules/mob/living/carbon/human/species_type/ethereal.dm`: + - Overrode `/datum/species/ethereal/on_species_gain()` to add the action to the mob. + - Added to `/datum/species/synthetic/create_pref_unique_perks()` to add the "Tone Synthesizer" species perk. + +### Credits: +- [@Floofies](https://github.com/Floofies) diff --git a/modular_nova/modules/species_synthesizer/sing_tones.dm b/modular_nova/modules/species_synthesizer/sing_tones.dm new file mode 100644 index 00000000000..c3e57e5d5f8 --- /dev/null +++ b/modular_nova/modules/species_synthesizer/sing_tones.dm @@ -0,0 +1,48 @@ +/datum/action/sing_tones + name = "Sing Tones" + desc = "Use your internal synthesizer to sing!" + button_icon = 'icons/obj/art/musician.dmi' + button_icon_state = "xylophone" + var/datum/song/song + /// What instruments can be used. + var/allowed_instrument_ids = list("spaceman", "meowsynth", "square", "sine", "saw") + /// Instruments added after being emagged. + var/emag_instrument_ids = list("honk") + /// Set to TRUE if already emagged. + var/emagged = FALSE + +/datum/action/sing_tones/Grant(mob/grant_to) + ..() + RegisterSignal(grant_to, COMSIG_SPECIES_LOSS, PROC_REF(on_species_loss)) + RegisterSignal(grant_to, COMSIG_ATOM_EMAG_ACT, PROC_REF(on_emag_act)) + song = new(grant_to, allowed_instrument_ids, 15) + if(isethereal(grant_to)) + desc = "Use your electric discharger to sing!" + +/datum/action/sing_tones/Remove(mob/remove_from) + ..() + QDEL_NULL(song) + UnregisterSignal(remove_from, list( + COMSIG_SPECIES_LOSS, + COMSIG_ATOM_EMAG_ACT, + )) + +/datum/action/sing_tones/proc/on_species_loss(mob/living/carbon/human/human) + SIGNAL_HANDLER + + qdel(src) + +/datum/action/sing_tones/proc/on_emag_act(mob/living/carbon/human/source, mob/user) + SIGNAL_HANDLER + + if(emagged) + return + emagged = TRUE + song.allowed_instrument_ids += emag_instrument_ids + song.set_instrument("honk") + +/datum/action/sing_tones/Trigger(trigger_flags) + . = ..() + if(!.) + return + song.ui_interact(owner) diff --git a/modular_nova/modules/synths/code/species/synthetic.dm b/modular_nova/modules/synths/code/species/synthetic.dm index f2c1fd33d0a..b3328ee40ad 100644 --- a/modular_nova/modules/synths/code/species/synthetic.dm +++ b/modular_nova/modules/synths/code/species/synthetic.dm @@ -52,6 +52,8 @@ var/datum/action/innate/monitor_change/screen /// This is the screen that is given to the user after they get revived. On death, their screen is temporarily set to BSOD before it turns off, hence the need for this var. var/saved_screen = "Blank" + /// Set to TRUE if the species was emagged before + var/emag_effect = FALSE /datum/species/synthetic/allows_food_preferences() return FALSE @@ -87,6 +89,11 @@ /datum/species/synthetic/on_species_gain(mob/living/carbon/human/transformer) . = ..() + RegisterSignal(transformer, COMSIG_ATOM_EMAG_ACT, PROC_REF(on_emag_act)) + + var/datum/action/sing_tones/sing_action = new + sing_action.Grant(transformer) + var/screen_mutant_bodypart = transformer.dna.mutant_bodyparts[MUTANT_SYNTH_SCREEN] var/obj/item/organ/internal/eyes/eyes = transformer.get_organ_slot(ORGAN_SLOT_EYES) @@ -142,6 +149,8 @@ /datum/species/synthetic/on_species_loss(mob/living/carbon/human/human) . = ..() + UnregisterSignal(human, COMSIG_ATOM_EMAG_ACT) + var/obj/item/organ/internal/eyes/eyes = human.get_organ_slot(ORGAN_SLOT_EYES) if(eyes) @@ -166,6 +175,15 @@ old_stomach.moveToNullspace() STOP_PROCESSING(SSobj, old_stomach) +/datum/species/synthetic/proc/on_emag_act(mob/living/carbon/human/source, mob/user) + SIGNAL_HANDLER + + if(emag_effect) + return + emag_effect = TRUE + playsound(source.loc, 'sound/misc/interference.ogg', 50) + to_chat(source, span_warning("Alert: Security breach detected in central processing unit. Error Code: 540-EXO")) + /** * Makes the IPC screen switch to BSOD followed by a blank screen * @@ -219,6 +237,13 @@ SPECIES_PERK_DESC = "[plural_form] can't be husked, disappointing changelings galaxy-wide.", )) + perk_descriptions += list(list( + SPECIES_PERK_TYPE = SPECIES_POSITIVE_PERK, + SPECIES_PERK_ICON = "music", + SPECIES_PERK_NAME = "Tone Synthesizer", + SPECIES_PERK_DESC = "[plural_form] can sing musical tones using an internal synthesizer.", + )) + perk_descriptions += list(list( SPECIES_PERK_TYPE = SPECIES_NEUTRAL_PERK, SPECIES_PERK_ICON = "robot", diff --git a/tgstation.dme b/tgstation.dme index 485b2dbbdeb..c4876d9c094 100644 --- a/tgstation.dme +++ b/tgstation.dme @@ -8560,6 +8560,7 @@ #include "modular_nova\modules\specialist_armor\code\hardened.dm" #include "modular_nova\modules\specialist_armor\code\peacekeeper.dm" #include "modular_nova\modules\specialist_armor\code\sacrificial.dm" +#include "modular_nova\modules\species_synthesizer\sing_tones.dm" #include "modular_nova\modules\stasisrework\code\all_nodes.dm" #include "modular_nova\modules\stasisrework\code\bodybag.dm" #include "modular_nova\modules\stasisrework\code\bodybag_structure.dm"