diff --git a/code/__HELPERS/unsorted.dm b/code/__HELPERS/unsorted.dm index 65565da4d7e..bbfb029354e 100644 --- a/code/__HELPERS/unsorted.dm +++ b/code/__HELPERS/unsorted.dm @@ -249,6 +249,13 @@ Turf and target are seperate in case you want to teleport some distance from a t if(C.dna) C.dna.real_name = real_name + if(isrobot(src)) + var/mob/living/silicon/robot/R = src + if(oldname != real_name) + R.notify_ai(3, oldname, newname) + if(R.camera) + R.camera.c_tag = real_name + if(oldname) //update the datacore records! This is goig to be a bit costly. for(var/list/L in list(data_core.general,data_core.medical,data_core.security,data_core.locked)) diff --git a/code/datums/wires/robot.dm b/code/datums/wires/robot.dm index 9675b3757ed..3f0695d07ae 100644 --- a/code/datums/wires/robot.dm +++ b/code/datums/wires/robot.dm @@ -55,7 +55,10 @@ var/const/BORG_WIRE_CAMERA = 16 switch(index) if (BORG_WIRE_AI_CONTROL) //pulse the AI wire to make the borg reselect an AI if(!R.emagged) - R.connected_ai = select_active_ai(R) + var/new_ai = select_active_ai(R) + if(new_ai && (new_ai != R.connected_ai)) + R.connected_ai = new_ai + R.notify_ai(1) if (BORG_WIRE_CAMERA) if(!isnull(R.camera) && R.camera.can_use() && !R.scrambledcodes) diff --git a/code/game/machinery/transformer.dm b/code/game/machinery/transformer.dm index 03660e68caa..5f00666e819 100644 --- a/code/game/machinery/transformer.dm +++ b/code/game/machinery/transformer.dm @@ -87,6 +87,7 @@ sleep(30) if(R) R.SetLockdown(0) + R.notify_ai(1) /obj/machinery/transformer/conveyor/New() ..() diff --git a/code/game/objects/items/robot/robot_parts.dm b/code/game/objects/items/robot/robot_parts.dm index 3d411567b35..9d94318d2c4 100644 --- a/code/game/objects/items/robot/robot_parts.dm +++ b/code/game/objects/items/robot/robot_parts.dm @@ -213,6 +213,7 @@ if(!aisync) lawsync = 0 O.connected_ai = null + O.notify_ai(1) else if(forced_ai) O.connected_ai = forced_ai if(!lawsync) diff --git a/code/game/objects/items/robot/robot_upgrades.dm b/code/game/objects/items/robot/robot_upgrades.dm index 2a759774675..295097b2464 100644 --- a/code/game/objects/items/robot/robot_upgrades.dm +++ b/code/game/objects/items/robot/robot_upgrades.dm @@ -35,6 +35,8 @@ R.modtype = "robot" R.updatename("Default") R.status_flags |= CANPUSH + R.designation = "Default" + R.notify_ai(2) R.updateicon() return 1 @@ -51,8 +53,10 @@ /obj/item/borg/upgrade/rename/action(var/mob/living/silicon/robot/R) if(..()) return 0 + R.notify_ai(3, R.name, heldname) R.name = heldname R.real_name = heldname + R.camera.c_tag = heldname R.custom_name = heldname //Required or else if the cyborg's module changes, their name is lost. return 1 @@ -75,6 +79,8 @@ R.key = ghost.key R.stat = CONSCIOUS + R.notify_ai(1) + return 1 diff --git a/code/modules/mob/living/silicon/robot/robot.dm b/code/modules/mob/living/silicon/robot/robot.dm index cb3b02bbe25..092907557fa 100644 --- a/code/modules/mob/living/silicon/robot/robot.dm +++ b/code/modules/mob/living/silicon/robot/robot.dm @@ -210,6 +210,7 @@ overlays -= "eyes" //Takes off the eyes that it started with transform_animation(animation_length) + notify_ai(2) updateicon() /mob/living/silicon/robot/proc/transform_animation(animation_length) @@ -1091,3 +1092,14 @@ radio = new /obj/item/device/radio/borg/syndicate(src) module = new /obj/item/weapon/robot_module/syndicate(src) laws = new /datum/ai_laws/syndicate_override() + +/mob/living/silicon/robot/proc/notify_ai(var/notifytype, var/oldname, var/newname) + if(!connected_ai) + return + switch(notifytype) + if(1) //New Cyborg + connected_ai << "

NOTICE - New cyborg connection detected: [name]
" + if(2) //New Module + connected_ai << "

NOTICE - Cyborg module change detected: [name] has loaded the [designation] module.
" + if(3) //New Name + connected_ai << "

NOTICE - Cyborg reclassification detected: [oldname] is now designated as [newname].
" \ No newline at end of file diff --git a/code/modules/mob/transform_procs.dm b/code/modules/mob/transform_procs.dm index bceb9ce2152..03fb40fb3a9 100644 --- a/code/modules/mob/transform_procs.dm +++ b/code/modules/mob/transform_procs.dm @@ -304,6 +304,7 @@ O.loc = loc O.job = "Cyborg" + O.notify_ai(1) O.mmi = new /obj/item/device/mmi(O) O.mmi.transfer_identity(src)//Does not transfer key/client. diff --git a/code/modules/projectiles/projectile/magic.dm b/code/modules/projectiles/projectile/magic.dm index f5accf497e1..e65431d7ad7 100644 --- a/code/modules/projectiles/projectile/magic.dm +++ b/code/modules/projectiles/projectile/magic.dm @@ -117,6 +117,7 @@ proc/wabbajack(mob/living/M) if(istype(M, /mob/living/silicon/robot)) var/mob/living/silicon/robot/Robot = M if(Robot.mmi) qdel(Robot.mmi) + Robot.notify_ai(1) else for(var/obj/item/W in M) if(istype(W, /obj/item/weapon/implant)) //TODO: Carn. give implants a dropped() or something diff --git a/config/game_options.txt b/config/game_options.txt index 0c059ce64d0..e4560c5601f 100644 --- a/config/game_options.txt +++ b/config/game_options.txt @@ -20,7 +20,7 @@ REVIVAL_BRAIN_LIFE -1 ### RENAMING ### -# Whether cyborgs can rename themselves at roundstart or when built. Has no effect on roboticists renaming cyborgs the normal way. Set to 0 to disable self-renaming. +#Uncomment to allow cyborgs to rename themselves at roundstart. Has no effect on roboticists renaming cyborgs the normal way. #RENAME_CYBORG ### MOB MOVEMENT ###