Skip to content

Commit

Permalink
Lobotomizes the brain from /mob/living/carbon (#23320)
Browse files Browse the repository at this point in the history
* find and replace. this causes zero errors.

* there was one error

* repathing

* minor emote repathing as well
  • Loading branch information
lewcc authored Nov 29, 2023
1 parent d286d20 commit 5d5f83d
Show file tree
Hide file tree
Showing 27 changed files with 80 additions and 96 deletions.
2 changes: 1 addition & 1 deletion code/__DEFINES/is_helpers.dm
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

#define isliving(A) (istype(A, /mob/living))

#define isbrain(A) (istype(A, /mob/living/carbon/brain))
#define isbrain(A) (istype(A, /mob/living/brain))

// Carbon mobs
#define iscarbon(A) (istype(A, /mob/living/carbon))
Expand Down
2 changes: 1 addition & 1 deletion code/__DEFINES/mob_defines.dm
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@

// For the tcomms monitor
#define ispathhuman(A) (ispath(A, /mob/living/carbon/human))
#define ispathbrain(A) (ispath(A, /mob/living/carbon/brain))
#define ispathbrain(A) (ispath(A, /mob/living/brain))
#define ispathslime(A) (ispath(A, /mob/living/simple_animal/slime))
#define ispathbot(A) (ispath(A, /mob/living/simple_animal/bot))
#define ispathsilicon(A) (ispath(A, /mob/living/silicon))
Expand Down
2 changes: 1 addition & 1 deletion code/__HELPERS/unsorted.dm
Original file line number Diff line number Diff line change
Expand Up @@ -410,7 +410,7 @@ Turf and target are seperate in case you want to teleport some distance from a t
moblist.Add(M)
for(var/mob/living/carbon/human/M in sortmob)
moblist.Add(M)
for(var/mob/living/carbon/brain/M in sortmob)
for(var/mob/living/brain/M in sortmob)
moblist.Add(M)
for(var/mob/living/carbon/alien/M in sortmob)
moblist.Add(M)
Expand Down
14 changes: 7 additions & 7 deletions code/datums/keybindings/emote_keybinds.dm
Original file line number Diff line number Diff line change
Expand Up @@ -296,31 +296,31 @@
return isbrain(M) && ..()

/datum/keybinding/emote/carbon/brain/alarm
linked_emote = /datum/emote/living/carbon/brain/alarm
linked_emote = /datum/emote/living/brain/alarm
name = "Alarm"

/datum/keybinding/emote/carbon/brain/alert
linked_emote = /datum/emote/living/carbon/brain/alert
linked_emote = /datum/emote/living/brain/alert
name = "Alert"

/datum/keybinding/emote/carbon/brain/notice
linked_emote = /datum/emote/living/carbon/brain/notice
linked_emote = /datum/emote/living/brain/notice
name = "Notice"

/datum/keybinding/emote/carbon/brain/flash
linked_emote = /datum/emote/living/carbon/brain/flash
linked_emote = /datum/emote/living/brain/flash
name = "Flash"

/datum/keybinding/emote/carbon/brain/whistle
linked_emote = /datum/emote/living/carbon/brain/whistle
linked_emote = /datum/emote/living/brain/whistle
name = "Whistle"

/datum/keybinding/emote/carbon/brain/beep
linked_emote = /datum/emote/living/carbon/brain/beep
linked_emote = /datum/emote/living/brain/beep
name = "Beep"

/datum/keybinding/emote/carbon/brain/boop
linked_emote = /datum/emote/living/carbon/brain/boop
linked_emote = /datum/emote/living/brain/boop
name = "Boop"

/datum/keybinding/emote/carbon/human
Expand Down
2 changes: 1 addition & 1 deletion code/datums/radio_frequency.dm
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@
var/mob/living/carbon/human/H = M
. = H.dna.species.name
else if(isbrain(M))
var/mob/living/carbon/brain/B = M
var/mob/living/brain/B = M
. = B.get_race()
else if(issilicon(M))
. = "Artificial Life"
Expand Down
2 changes: 1 addition & 1 deletion code/game/gamemodes/cult/runes.dm
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ structure_check() searches for nearby cultist structures required for the invoca

// Offering a head/brain
for(var/obj/item/organ/O in T)
var/mob/living/carbon/brain/b_mob
var/mob/living/brain/b_mob
if(istype(O, /obj/item/organ/external/head)) // Offering a head
var/obj/item/organ/external/head/H = O
for(var/obj/item/organ/internal/brain/brain in H.contents)
Expand Down
2 changes: 1 addition & 1 deletion code/game/gamemodes/wizard/raginmages.dm
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@
L.ghostize()
if(isbrain(L))
// diediedie
var/mob/living/carbon/brain/B = L
var/mob/living/brain/B = L
if(isitem(B.loc))
qdel(B.loc)
if(B && B.container)
Expand Down
8 changes: 4 additions & 4 deletions code/game/mecha/mecha.dm
Original file line number Diff line number Diff line change
Expand Up @@ -1206,7 +1206,7 @@
if(!user.unEquip(mmi_as_oc))
to_chat(user, "<span class='notice'>\the [mmi_as_oc] is stuck to your hand, you cannot put it in \the [src]</span>")
return FALSE
var/mob/living/carbon/brain/brainmob = mmi_as_oc.brainmob
var/mob/living/brain/brainmob = mmi_as_oc.brainmob
brainmob.reset_perspective(src)
occupant = brainmob
brainmob.forceMove(src) //should allow relaymove
Expand All @@ -1231,13 +1231,13 @@
/obj/mecha/proc/pilot_is_mmi()
var/atom/movable/mob_container
if(isbrain(occupant))
var/mob/living/carbon/brain/brain = occupant
var/mob/living/brain/brain = occupant
mob_container = brain.container
if(istype(mob_container, /obj/item/mmi))
return 1
return 0

/obj/mecha/proc/pilot_mmi_hud(mob/living/carbon/brain/pilot)
/obj/mecha/proc/pilot_mmi_hud(mob/living/brain/pilot)
return

/obj/mecha/Exited(atom/movable/M, atom/newloc)
Expand All @@ -1258,7 +1258,7 @@
mob_container = occupant
RemoveActions(occupant, human_occupant = 1)
else if(isbrain(occupant))
var/mob/living/carbon/brain/brain = occupant
var/mob/living/brain/brain = occupant
RemoveActions(brain)
mob_container = brain.container
else if(isAI(occupant))
Expand Down
2 changes: 1 addition & 1 deletion code/game/mecha/medical/odysseus.dm
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
A.remove_hud_from(H)
builtin_hud_user = 0
else if((isbrain(occupant) || pilot_is_mmi()) && builtin_hud_user)
var/mob/living/carbon/brain/H = occupant
var/mob/living/brain/H = occupant
var/datum/atom_hud/A = GLOB.huds[DATA_HUD_MEDICAL_ADVANCED]
A.remove_hud_from(H)
builtin_hud_user = 0
Expand Down
4 changes: 2 additions & 2 deletions code/modules/admin/admin_verbs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -814,7 +814,7 @@ GLOBAL_LIST_INIT(view_runtimes_verbs, list(

if(!istype(H))
if(isbrain(H))
var/mob/living/carbon/brain/B = H
var/mob/living/brain/B = H
if(istype(B.container, /obj/item/mmi/robotic_brain/positronic))
var/obj/item/mmi/robotic_brain/positronic/C = B.container
var/obj/item/organ/internal/brain/mmi_holder/posibrain/P = C.loc
Expand All @@ -840,7 +840,7 @@ GLOBAL_LIST_INIT(view_runtimes_verbs, list(

if(!istype(H))
if(isbrain(H))
var/mob/living/carbon/brain/B = H
var/mob/living/brain/B = H
if(istype(B.container, /obj/item/mmi/robotic_brain/positronic))
var/obj/item/mmi/robotic_brain/positronic/C = B.container
var/obj/item/organ/internal/brain/mmi_holder/posibrain/P = C.loc
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
var/alien = 0
var/syndiemmi = FALSE //Whether or not this is a Syndicate MMI
var/mmi_item_name = "Man-Machine Interface" //Used to name the item when installing a brain
var/mob/living/carbon/brain/brainmob = null//The current occupant.
var/mob/living/brain/brainmob = null//The current occupant.
var/obj/item/organ/internal/brain/held_brain = null // This is so MMI's aren't brainscrubber 9000's
var/mob/living/silicon/robot/robot = null//Appears unused.
var/obj/mecha/mecha = null//This does not appear to be used outside of reference in mecha.dm.
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/mob/living/carbon/brain/death(gibbed)
/mob/living/brain/death(gibbed)
// Only execute the below if we successfully died
. = ..()
if(!.)
Expand All @@ -8,7 +8,7 @@
visible_message("<span class='danger'>[src]'s MMI flatlines!</span>", "<span class='warning'>You hear something flatline.</span>")
mmi.icon_state = mmi.dead_icon

/mob/living/carbon/brain/gib()
/mob/living/brain/gib()
// can we muster a parent call here?
if(!death(TRUE) && stat != DEAD)
return FALSE
Expand Down
Original file line number Diff line number Diff line change
@@ -1,66 +1,66 @@
/**
* Emotes usable by brains, but only while they're in MMIs.
*/
/datum/emote/living/carbon/brain
mob_type_allowed_typecache = list(/mob/living/carbon/brain)
/datum/emote/living/brain
mob_type_allowed_typecache = list(/mob/living/brain)
mob_type_blacklist_typecache = null
/// The message that will be displayed to themselves, since brains can't really see their own emotes
var/self_message

/datum/emote/living/carbon/brain/run_emote(mob/user, params, type_override, intentional)
/datum/emote/living/brain/run_emote(mob/user, params, type_override, intentional)
. = ..()
if(!.)
return FALSE

if(self_message)
to_chat(user, self_message)

/datum/emote/living/carbon/brain/can_run_emote(mob/user, status_check, intentional)
/datum/emote/living/brain/can_run_emote(mob/user, status_check, intentional)
. = ..()
if(!.)
return FALSE

var/mob/living/carbon/brain/B = user
var/mob/living/brain/B = user

if(!(B.container && istype(B.container, /obj/item/mmi))) // No MMI, no emotes
return FALSE

// So, brains can't really see their own emotes so we'll probably just want to send an extra message

/datum/emote/living/carbon/brain/alarm
/datum/emote/living/brain/alarm
key = "alarm"
key_third_person = "alarms"
message = "sounds an alarm."
self_message = "You sound an alarm."

/datum/emote/living/carbon/brain/alert
/datum/emote/living/brain/alert
key = "alert"
key_third_person = "alerts"
message = "lets out a distressed noise."
self_message = "You let out a distressed noise."

/datum/emote/living/carbon/brain/notice
/datum/emote/living/brain/notice
key = "notice"
message = "plays a loud tone."
self_message = "You play a loud tone."

/datum/emote/living/carbon/brain/flash
/datum/emote/living/brain/flash
key = "flash"
message = "starts flashing its lights quickly!"

/datum/emote/living/carbon/brain/whistle
/datum/emote/living/brain/whistle
key = "whistle"
key_third_person = "whistles"
message = "whistles."
self_message = "You whistle."

/datum/emote/living/carbon/brain/beep
/datum/emote/living/brain/beep
key = "beep"
key_third_person = "beeps"
message = "beeps."
self_message = "You beep."

/datum/emote/living/carbon/brain/boop
/datum/emote/living/brain/boop
key = "boop"
key_third_person = "boops"
message = "boops."
Expand Down
5 changes: 5 additions & 0 deletions code/modules/mob/living/brain/brain_life.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
/mob/living/brain/Life()
. = ..()
if(.)
if(!container && (world.time - timeofhostdeath) > GLOB.configuration.general.revival_brain_life)
death()
3 changes: 3 additions & 0 deletions code/modules/mob/living/brain/brain_login.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
/mob/living/brain/Login()
..()
SetSleeping(0)
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//TODO: Convert this over for languages.
/mob/living/carbon/brain/say(message, datum/language/speaking = null)
/mob/living/brain/say(message, datum/language/speaking = null)
if(stat == DEAD)
return ..()
if(!can_speak(warning = TRUE))
Expand All @@ -13,13 +13,13 @@

..(message)

/mob/living/carbon/brain/whisper(message as text)
/mob/living/brain/whisper(message as text)
if(!can_speak(warning = TRUE))
return

..()

/mob/living/carbon/brain/can_speak(warning = FALSE)
/mob/living/brain/can_speak(warning = FALSE)
. = ..()

if(!istype(container, /obj/item/mmi))
Expand All @@ -31,7 +31,7 @@
to_chat(usr, "<span class='warning'>You cannot speak, as your internal speaker is turned off.</span>")
. = FALSE

/mob/living/carbon/brain/handle_message_mode(message_mode, list/message_pieces, verb, used_radios)
/mob/living/brain/handle_message_mode(message_mode, list/message_pieces, verb, used_radios)
switch(message_mode)
if("headset")
var/radio_worked = 0 // If any of the radios our brainmob could use functioned, this is set true so that we don't use any others
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/mob/living/carbon/brain/update_stat(reason = "none given")
/mob/living/brain/update_stat(reason = "none given")
if(status_flags & GODMODE)
return
// if(health <= min_health)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
/mob/living/carbon/brain
/mob/living/brain
var/obj/item/container = null
var/timeofhostdeath = 0
var/emp_damage = 0//Handles a type of MMI damage
use_me = FALSE //Can't use the me verb, it's a freaking immobile brain
icon = 'icons/obj/surgery.dmi'
icon_state = "brain1"

/mob/living/carbon/brain/New()
/mob/living/brain/New()
..()
add_language("Galactic Common")

/mob/living/carbon/brain/Destroy()
/mob/living/brain/Destroy()
if(key) //If there is a mob connected to this thing. Have to check key twice to avoid false death reporting.
if(stat!=DEAD) //If not dead.
death(1) //Brains can die again. AND THEY SHOULD AHA HA HA HA HA HA
ghostize() //Ghostize checks for key so nothing else is necessary.
return ..()

/mob/living/carbon/brain/say_understands(other)//Goddamn is this hackish, but this say code is so odd
/mob/living/brain/say_understands(other)//Goddamn is this hackish, but this say code is so odd
if(isAI(other))
if(!(container && istype(container, /obj/item/mmi)))
return 0
Expand All @@ -44,16 +44,16 @@
return 1
return ..()

/mob/living/carbon/brain/ex_act() //you cant blow up brainmobs because it makes transfer_to() freak out when borgs blow up.
/mob/living/brain/ex_act() //you cant blow up brainmobs because it makes transfer_to() freak out when borgs blow up.
return

/mob/living/carbon/brain/blob_act(obj/structure/blob/B)
/mob/living/brain/blob_act(obj/structure/blob/B)
return

/mob/living/carbon/brain/incapacitated(ignore_restraints = FALSE, ignore_grab = FALSE)
/mob/living/brain/incapacitated(ignore_restraints = FALSE, ignore_grab = FALSE)
return FALSE

/mob/living/carbon/brain/on_forcemove(atom/newloc)
/mob/living/brain/on_forcemove(atom/newloc)
if(container)
container.forceMove(newloc)
else //something went very wrong.
Expand All @@ -65,10 +65,10 @@ This will return true if the brain has a container that leaves it less helpless
I'm using this for Stat to give it a more nifty interface to work with
*/
/mob/living/carbon/brain/proc/has_synthetic_assistance()
/mob/living/brain/proc/has_synthetic_assistance()
return (container && istype(container, /obj/item/mmi)) || in_contents_of(/obj/mecha)

/mob/living/carbon/brain/proc/get_race()
/mob/living/brain/proc/get_race()
if(container)
var/obj/item/mmi/M = container
if(istype(M) && M.held_brain)
Expand All @@ -79,7 +79,7 @@ I'm using this for Stat to give it a more nifty interface to work with
var/obj/item/organ/internal/brain/B = loc
return B.dna.species.name

/mob/living/carbon/brain/Stat()
/mob/living/brain/Stat()
..()
if(has_synthetic_assistance() && statpanel("Status"))
show_stat_emergency_shuttle_eta()
Expand All @@ -88,13 +88,13 @@ I'm using this for Stat to give it a more nifty interface to work with
stat("Exosuit Charge:", "[istype(M.cell) ? "[M.cell.charge] / [M.cell.maxcharge]" : "No cell detected"]")
stat("Exosuit Integrity", "[!M.obj_integrity ? "0" : "[(M.obj_integrity / M.max_integrity) * 100]"]%")

/mob/living/carbon/brain/can_safely_leave_loc()
/mob/living/brain/can_safely_leave_loc()
return 0 //You're not supposed to be ethereal jaunting, brains

/mob/living/carbon/brain/can_hear()
/mob/living/brain/can_hear()
. = TRUE

/mob/living/carbon/brain/update_runechat_msg_location()
/mob/living/brain/update_runechat_msg_location()
if(ismecha(loc))
runechat_msg_location = loc.UID()
else if(container)
Expand Down
Loading

0 comments on commit 5d5f83d

Please sign in to comment.