Skip to content

Commit 78f5595

Browse files
committed
Move brain-machine interfaces into a modpack
1 parent 99be0ea commit 78f5595

File tree

32 files changed

+179
-111
lines changed

32 files changed

+179
-111
lines changed

code/controllers/subsystems/initialization/robots.dm

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,22 +10,19 @@ SUBSYSTEM_DEF(robots)
1010
var/list/robot_alt_titles = list()
1111

1212
var/list/mob_types_by_title = list(
13-
"cyborg, flying" = /mob/living/silicon/robot/flying,
1413
"robot, flying" = /mob/living/silicon/robot/flying
1514
)
1615

17-
var/list/mmi_types_by_title = list(
18-
"cyborg" = /obj/item/organ/internal/brain_interface,
16+
var/list/processor_types_by_title = list(
1917
"robot" = /obj/item/organ/internal/brain/robotic,
20-
"cyborg, flying" = /obj/item/organ/internal/brain_interface,
2118
"robot, flying" = /obj/item/organ/internal/brain/robotic
2219
)
2320

2421
/datum/controller/subsystem/robots/Initialize()
2522
. = ..()
2623

2724
// This is done via loop instead of just assignment in order to trim associations.
28-
for(var/title in (mob_types_by_title|mmi_types_by_title))
25+
for(var/title in (mob_types_by_title|processor_types_by_title))
2926
robot_alt_titles |= capitalize(title)
3027
sortTim(robot_alt_titles, /proc/cmp_text_asc)
3128

@@ -58,7 +55,7 @@ SUBSYSTEM_DEF(robots)
5855
.[include_override] = modules[include_override]
5956

6057
/datum/controller/subsystem/robots/proc/get_brain_type_by_title(var/check_title)
61-
. = mmi_types_by_title[lowertext(trim(check_title))] || /obj/item/organ/internal/brain/robotic
58+
. = processor_types_by_title[lowertext(trim(check_title))] || /obj/item/organ/internal/brain/robotic
6259

6360
/datum/controller/subsystem/robots/proc/get_mob_type_by_title(var/check_title)
6461
. = mob_types_by_title[lowertext(trim(check_title))] || /mob/living/silicon/robot

code/datums/trading/traders/goods.dm

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,6 @@ Sells devices, odds and ends, and medical stuff
247247
/obj/item/synthesized_instrument/violin = TRADER_THIS_TYPE,
248248
/obj/item/hailer = TRADER_THIS_TYPE,
249249
/obj/item/uv_light = TRADER_THIS_TYPE,
250-
/obj/item/organ/internal/brain_interface = TRADER_SUBTYPES_ONLY,
251250
/obj/item/robotanalyzer = TRADER_THIS_TYPE,
252251
/obj/item/chems/toner_cartridge = TRADER_THIS_TYPE,
253252
/obj/item/camera_film = TRADER_THIS_TYPE,

code/game/machinery/computer/ai_core.dm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ var/global/list/empty_playable_ai_cores = list()
5151
if(open_for_latejoin)
5252
empty_playable_ai_cores += D
5353
else
54-
var/mob/living/silicon/ai/A = new /mob/living/silicon/ai ( loc, laws, brain )
54+
var/mob/living/silicon/ai/A = new /mob/living/silicon/ai ( loc, laws, brain.get_brainmob() )
5555
if(A) //if there's no brain, the mob is deleted and a structure/AIcore is created
5656
A.on_mob_init()
5757
A.rename_self("ai", 1)

code/game/objects/items/robot/robot_frame.dm

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@
3232
SSstatistics.add_field("cyborg_frames_built",1)
3333
return TRUE
3434

35+
/obj/item/robot_parts/robot_suit/proc/is_valid_processor(obj/item/used_item)
36+
return istype(used_item, /obj/item/organ/internal/brain/robotic)
37+
3538
/obj/item/robot_parts/robot_suit/attackby(obj/item/used_item, mob/user)
3639

3740
// Uninstall a robotic part.
@@ -61,28 +64,28 @@
6164
return TRUE
6265

6366
// Install a brain.
64-
else if(istype(used_item, /obj/item/organ/internal/brain_interface))
67+
else if(istype(used_item, /obj/item/organ/internal) && is_valid_processor(used_item))
68+
var/obj/item/organ/internal/processor = used_item
6569

6670
if(!isturf(loc))
67-
to_chat(user, SPAN_WARNING("You can't put \the [used_item] in without the frame being on the ground."))
71+
to_chat(user, SPAN_WARNING("You can't put \the [processor] in without the frame being on the ground."))
6872
return TRUE
6973

7074
if(!check_completion())
7175
to_chat(user, SPAN_WARNING("The frame is not ready for the central processor to be installed."))
7276
return TRUE
7377

74-
var/obj/item/organ/internal/brain_interface/M = used_item
75-
var/mob/living/brainmob = M?.get_brainmob()
78+
var/mob/living/brainmob = processor.get_brainmob()
7679
if(!brainmob)
77-
to_chat(user, SPAN_WARNING("Sticking an empty [used_item.name] into the frame would sort of defeat the purpose."))
80+
to_chat(user, SPAN_WARNING("Sticking an empty [processor.name] into the frame would sort of defeat the purpose."))
7881
return TRUE
7982

8083
if(jobban_isbanned(brainmob, ASSIGNMENT_ROBOT))
81-
to_chat(user, SPAN_WARNING("\The [used_item] does not seem to fit."))
84+
to_chat(user, SPAN_WARNING("\The [processor] does not seem to fit."))
8285
return TRUE
8386

8487
if(brainmob.stat == DEAD)
85-
to_chat(user, SPAN_WARNING("Sticking a dead [used_item.name] into the frame would sort of defeat the purpose."))
88+
to_chat(user, SPAN_WARNING("Sticking a dead [processor.name] into the frame would sort of defeat the purpose."))
8689
return TRUE
8790

8891
var/ghost_can_reenter = 0
@@ -95,18 +98,18 @@
9598
else
9699
ghost_can_reenter = 1
97100
if(!ghost_can_reenter)
98-
to_chat(user, SPAN_WARNING("\The [used_item] is completely unresponsive; there's no point."))
101+
to_chat(user, SPAN_WARNING("\The [processor] is completely unresponsive; there's no point."))
99102
return TRUE
100103

101-
if(!user.try_unequip(used_item))
104+
if(!user.try_unequip(processor))
102105
return TRUE
103106

104107
SSstatistics.add_field("cyborg_frames_built",1)
105108
var/mob/living/silicon/robot/O = new product(get_turf(loc))
106109
if(!O)
107110
return TRUE
108111

109-
O.central_processor = used_item
112+
O.central_processor = processor
110113
O.set_invisibility(INVISIBILITY_NONE)
111114
O.custom_name = created_name
112115
O.updatename("Default")
@@ -120,7 +123,7 @@
120123

121124
var/obj/item/robot_parts/chest/chest = parts[BP_CHEST]
122125
chest.cell.forceMove(O)
123-
used_item.forceMove(O) //Should fix cybros run time erroring when blown up. It got deleted before, along with the frame.
126+
processor.forceMove(O) //Should fix cybros run time erroring when blown up. It got deleted before, along with the frame.
124127

125128
// Since we "magically" installed a cell, we also have to update the correct component.
126129
if(O.cell)

code/modules/bodytype/bodytype_prosthetic.dm

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@
3535
'sound/foley/metal1.ogg'
3636
)
3737
has_organ = list(
38-
BP_BRAIN = /obj/item/organ/internal/brain_interface,
3938
BP_EYES = /obj/item/organ/internal/eyes,
4039
BP_CELL = /obj/item/organ/internal/cell
4140
)

code/modules/clothing/spacesuits/rig/modules/computer.dm

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@
5959
var/mob/living/integrated_ai // Direct reference to the actual mob held in the suit.
6060
var/obj/item/ai_card // Reference to the object previously holding the AI.
6161
var/obj/item/ai_verbs/verb_holder
62+
var/list/simple_insert_types = list(/obj/item/paicard)
6263

6364
/mob/living
6465
var/get_rig_stats = 0
@@ -136,7 +137,7 @@
136137
return 1
137138

138139
// Okay, it wasn't a terminal being touched, check for all the simple insertions.
139-
if(input_device.type in list(/obj/item/paicard, /obj/item/organ/internal/brain_interface))
140+
if(is_type_in_list(input_device, simple_insert_types))
140141
if(integrated_ai)
141142
integrated_ai.attackby(input_device,user)
142143
// If the transfer was successful, we can clear out our vars.

code/modules/emotes/emote_mob.dm

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@
1515
/mob/living/check_mob_can_emote(var/emote_type)
1616
return ..() && !(HAS_STATUS(src, STAT_SILENCE) && emote_type == AUDIBLE_MESSAGE)
1717

18-
/mob/living/brain/check_mob_can_emote(var/emote_type)
19-
return ..() && istype(get_container(), /obj/item/organ/internal/brain_interface)
18+
/mob/living/brain/check_mob_can_emote(var/emote_type, allow_brain_emote = FALSE)
19+
return ..() && allow_brain_emote
2020

2121
#define EMOTE_REFRESH_SPAM_COOLDOWN (5 SECONDS)
2222
/mob/proc/emote(var/act, var/m_type, var/message)

code/modules/fabrication/designs/protolathe/designs_machine_intelligence.dm

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,10 @@
11
/datum/fabricator_recipe/protolathe/brains
22
category = "Machine Intelligence"
3-
path = /obj/item/organ/internal/brain_interface/empty
3+
path = /obj/item/organ/internal/brain/robotic
44

55
/datum/fabricator_recipe/protolathe/brains/get_product_name()
66
. = "intelligence storage ([..()])"
77

8-
/datum/fabricator_recipe/protolathe/brains/robotic
9-
path = /obj/item/organ/internal/brain/robotic
10-
11-
/datum/fabricator_recipe/protolathe/brains/mmi_radio
12-
path = /obj/item/organ/internal/brain_interface/radio_enabled/empty
13-
148
/datum/fabricator_recipe/protolathe/brains/paicard
159
path = /obj/item/paicard
1610

code/modules/mob/inventory.dm

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -375,6 +375,11 @@
375375
for(var/thing in get_held_items())
376376
try_unequip(thing, drop_loc)
377377

378+
/mob/proc/drop_equipped_items(drop_loc = loc, include_carried = FALSE)
379+
SHOULD_CALL_PARENT(TRUE)
380+
for(var/thing in get_equipped_items(include_carried))
381+
try_unequip(thing, drop_loc)
382+
378383
//Returns the item equipped to the specified slot, if any.
379384
/mob/proc/get_equipped_item(var/slot)
380385
SHOULD_CALL_PARENT(TRUE)

code/modules/mob/living/brain/brain.dm

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,18 +41,18 @@
4141
/mob/living/brain/proc/get_container()
4242
return get_recursive_loc_of_type(/obj/item/organ/internal)
4343

44+
/mob/living/brain/proc/on_container_login(obj/item/organ/internal/container)
45+
container.update_icon()
46+
4447
/mob/living/brain/Login()
4548
. = ..()
4649
var/obj/item/organ/internal/container = get_container()
4750
if(istype(container))
48-
var/obj/item/organ/internal/brain_interface/interface = container
49-
if(istype(interface))
50-
interface.locked = TRUE
51-
container.update_icon()
51+
on_container_login(container)
5252

5353
/mob/living/brain/proc/is_in_interface()
5454
var/container = get_container()
55-
return istype(container, /obj/item/organ/internal/brain_interface) || istype(container, /obj/item/organ/internal/brain/robotic)
55+
return istype(container, /obj/item/organ/internal/brain/robotic)
5656

5757
/mob/living/brain/can_emote(emote_type, show_message)
5858
return is_in_interface() && ..()

0 commit comments

Comments
 (0)