Merge pull request #3115 from Ikarrus/borgnotice

AIs are notified when a cyborg is slaved to it
This commit is contained in:
Razharas
2014-04-03 04:14:31 -07:00
9 changed files with 34 additions and 2 deletions
+7
View File
@@ -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))
+4 -1
View File
@@ -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)
+1
View File
@@ -87,6 +87,7 @@
sleep(30)
if(R)
R.SetLockdown(0)
R.notify_ai(1)
/obj/machinery/transformer/conveyor/New()
..()
@@ -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)
@@ -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
@@ -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 << "<br><br><span class='notice'>NOTICE - New cyborg connection detected: <a href='byond://?src=\ref[connected_ai];track2=\ref[connected_ai];track=\ref[src]'>[name]</a></span><br>"
if(2) //New Module
connected_ai << "<br><br><span class='notice'>NOTICE - Cyborg module change detected: [name] has loaded the [designation] module.</span><br>"
if(3) //New Name
connected_ai << "<br><br><span class='notice'>NOTICE - Cyborg reclassification detected: [oldname] is now designated as [newname].</span><br>"
+1
View File
@@ -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.
@@ -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
+1 -1
View File
@@ -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 ###