Skip to content

Commit

Permalink
[MIRROR] Fix split personality commune being unusable I think [MDB IG…
Browse files Browse the repository at this point in the history
…NORE] (#556)

* Fix split personality commune being unusable I think (#79631)
---------

Co-authored-by: SkyratBot <[email protected]>
Co-authored-by: MrMelbert <[email protected]>
  • Loading branch information
3 people authored Nov 11, 2023
1 parent 4d21275 commit e03f932
Show file tree
Hide file tree
Showing 4 changed files with 59 additions and 59 deletions.
56 changes: 56 additions & 0 deletions code/datums/actions/mobs/personality_commune.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
// This can probably be changed to use mind linker at some point
/datum/action/personality_commune
name = "Personality Commune"
desc = "Sends thoughts to your alternate consciousness."
background_icon_state = "bg_spell"
button_icon = 'icons/mob/actions/actions_spells.dmi'
button_icon_state = "telepathy"
overlay_icon_state = "bg_spell_border"

/// Fluff text shown when a message is sent to the pair
var/fluff_text = span_boldnotice("You hear an echoing voice in the back of your head...")

/datum/action/personality_commune/New(Target)
. = ..()
if(!istype(target, /datum/brain_trauma/severe/split_personality))
stack_trace("[type] was created on a target that isn't a /datum/brain_trauma/severe/split_personality, this doesn't work.")
qdel(src)

/datum/action/personality_commune/Grant(mob/grant_to)
if(!istype(grant_to, /mob/living/split_personality))
return

return ..()

/datum/action/personality_commune/Trigger(trigger_flags)
. = ..()
if(!.)
return FALSE

var/datum/brain_trauma/severe/split_personality/trauma = target
var/mob/living/split_personality/non_controller = usr
var/client/non_controller_client = non_controller.client

var/to_send = tgui_input_text(non_controller, "What would you like to tell your other self?", "Commune")
if(QDELETED(src) || QDELETED(trauma) || !to_send)
return FALSE

var/mob/living/carbon/human/personality_body = trauma.owner
if(personality_body.client == non_controller_client) // We took control
return FALSE

var/user_message = span_boldnotice("You concentrate and send thoughts to your other self:")
var/user_message_body = span_notice("[to_send]")

to_chat(non_controller, "[user_message] [user_message_body]")

personality_body.balloon_alert(personality_body, "you hear a voice")
to_chat(personality_body, "[fluff_text] [user_message_body]")

log_directed_talk(non_controller, personality_body, to_send, LOG_SAY, "[name]")
for(var/dead_mob in GLOB.dead_mob_list)
if(!isobserver(dead_mob))
continue
to_chat(dead_mob, "[FOLLOW_LINK(dead_mob, non_controller)] [span_boldnotice("[non_controller] [name]:")] [span_notice("\"[to_send]\" to")] [span_name("[trauma]")]")

return TRUE
4 changes: 2 additions & 2 deletions code/datums/brain_damage/split_personality.dm
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@

/datum/brain_trauma/severe/split_personality/proc/make_backseats()
stranger_backseat = new(owner, src)
var/datum/action/cooldown/spell/personality_commune/stranger_spell = new(src)
var/datum/action/personality_commune/stranger_spell = new(src)
stranger_spell.Grant(stranger_backseat)

owner_backseat = new(owner, src)
var/datum/action/cooldown/spell/personality_commune/owner_spell = new(src)
var/datum/action/personality_commune/owner_spell = new(src)
owner_spell.Grant(owner_backseat)

/// Attempts to get a ghost to play the personality
Expand Down
56 changes: 0 additions & 56 deletions code/modules/spells/spell_types/self/personality_commune.dm

This file was deleted.

2 changes: 1 addition & 1 deletion tgstation.dme
Original file line number Diff line number Diff line change
Expand Up @@ -916,6 +916,7 @@
#include "code\datums\actions\mobs\meteors.dm"
#include "code\datums\actions\mobs\mobcooldown.dm"
#include "code\datums\actions\mobs\open_mob_commands.dm"
#include "code\datums\actions\mobs\personality_commune.dm"
#include "code\datums\actions\mobs\projectileattack.dm"
#include "code\datums\actions\mobs\sign_language.dm"
#include "code\datums\actions\mobs\sneak.dm"
Expand Down Expand Up @@ -5586,7 +5587,6 @@
#include "code\modules\spells\spell_types\self\lichdom.dm"
#include "code\modules\spells\spell_types\self\mime_vow.dm"
#include "code\modules\spells\spell_types\self\mutate.dm"
#include "code\modules\spells\spell_types\self\personality_commune.dm"
#include "code\modules\spells\spell_types\self\rod_form.dm"
#include "code\modules\spells\spell_types\self\sanguine_strike.dm"
#include "code\modules\spells\spell_types\self\smoke.dm"
Expand Down

0 comments on commit e03f932

Please sign in to comment.