diff --git a/code/__DEFINES/components.dm b/code/__DEFINES/components.dm index 7b2dd8663c..b0cc9030cb 100644 --- a/code/__DEFINES/components.dm +++ b/code/__DEFINES/components.dm @@ -177,6 +177,7 @@ #define COMSIG_MOB_PRE_PLAYER_CHANGE "mob_pre_player_change" //sent to the target mob from base of /mob/transfer_ckey() and /mind/transfer_to(): (our_character, their_character) // #define COMPONENT_STOP_MIND_TRANSFER 1 #define COMSIG_MOB_UPDATE_SIGHT "mob_update_sight" //from base of /mob/update_sight(): () +#define COMSIG_MOB_ON_NEW_MIND "mob_on_new_mind" //called when a new mind is assigned to a mob: () #define COMSIG_MOB_SAY "mob_say" // from /mob/living/say(): (proc args list) #define COMPONENT_UPPERCASE_SPEECH 1 // used to access COMSIG_MOB_SAY argslist diff --git a/code/datums/mind.dm b/code/datums/mind.dm index a0aa729a8d..5c92c83fb5 100644 --- a/code/datums/mind.dm +++ b/code/datums/mind.dm @@ -140,6 +140,7 @@ L.client.prefs.chat_toggles ^= CHAT_OOC SEND_SIGNAL(src, COMSIG_MIND_TRANSFER, new_character, old_character) + SEND_SIGNAL(new_character, COMSIG_MOB_ON_NEW_MIND) /datum/mind/proc/store_memory(new_text) if((length(memory) + length(new_text)) <= MAX_MESSAGE_LEN) @@ -747,6 +748,7 @@ else mind = new /datum/mind(key) SSticker.minds += mind + SEND_SIGNAL(src, COMSIG_MOB_ON_NEW_MIND) if(!mind.name) mind.name = real_name mind.current = src diff --git a/code/modules/mob/living/carbon/human/species_types/mushpeople.dm b/code/modules/mob/living/carbon/human/species_types/mushpeople.dm index ceadb28115..7744a65464 100644 --- a/code/modules/mob/living/carbon/human/species_types/mushpeople.dm +++ b/code/modules/mob/living/carbon/human/species_types/mushpeople.dm @@ -37,11 +37,16 @@ H.dna.features["caps"] = "Round" handle_mutant_bodyparts(H) H.faction |= "mushroom" - mush = new(null) - mush.teach(H) + mush = new() + mush.teach(H, TRUE) + RegisterSignal(C, COMSIG_MOB_ON_NEW_MIND, .proc/on_new_mind) + +/datum/species/mush/proc/on_new_mind(mob/owner) + mush.teach(owner, TRUE) //make_temporary TRUE as it shouldn't carry over to other mobs on mind transfer_to. /datum/species/mush/on_species_loss(mob/living/carbon/C) . = ..() + UnregisterSignal(C, COMSIG_MOB_ON_NEW_MIND) C.faction -= "mushroom" mush.remove(C) QDEL_NULL(mush)