From f46cb302a489d1e6102d4ea3925a2e35c2b3f83c Mon Sep 17 00:00:00 2001 From: ikarrus Date: Wed, 2 Apr 2014 22:12:36 -0600 Subject: [PATCH] Updated to work with newer cyborg code. --- code/__HELPERS/unsorted.dm | 2 +- code/datums/wires/robot.dm | 2 +- code/game/machinery/transformer.dm | 1 + code/game/objects/items/robot/robot_parts.dm | 1 + code/game/objects/items/robot/robot_upgrades.dm | 7 ++++--- code/modules/mob/living/silicon/robot/robot.dm | 14 ++++++++++++-- code/modules/mob/transform_procs.dm | 1 + code/modules/projectiles/projectile/magic.dm | 1 + 8 files changed, 22 insertions(+), 7 deletions(-) diff --git a/code/__HELPERS/unsorted.dm b/code/__HELPERS/unsorted.dm index b1d1bac4a89..bbfb029354e 100644 --- a/code/__HELPERS/unsorted.dm +++ b/code/__HELPERS/unsorted.dm @@ -252,7 +252,7 @@ Turf and target are seperate in case you want to teleport some distance from a t if(isrobot(src)) var/mob/living/silicon/robot/R = src if(oldname != real_name) - R.connected_ai << "

NOTICE - Cyborg reclassification detected: [oldname] is now designated as [real_name].
" + R.notify_ai(3, oldname, newname) if(R.camera) R.camera.c_tag = real_name diff --git a/code/datums/wires/robot.dm b/code/datums/wires/robot.dm index 58f5d0647bb..3f0695d07ae 100644 --- a/code/datums/wires/robot.dm +++ b/code/datums/wires/robot.dm @@ -58,7 +58,7 @@ var/const/BORG_WIRE_CAMERA = 16 var/new_ai = select_active_ai(R) if(new_ai && (new_ai != R.connected_ai)) R.connected_ai = new_ai - R.connected_ai << "

NOTICE - New cyborg connection detected: [R.name]
" + 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 be8104de98b..295097b2464 100644 --- a/code/game/objects/items/robot/robot_upgrades.dm +++ b/code/game/objects/items/robot/robot_upgrades.dm @@ -35,7 +35,8 @@ R.modtype = "robot" R.updatename("Default") R.status_flags |= CANPUSH - R.connected_ai << "

NOTICE - Cyborg module change detected: [R.name] has been reset.
" + R.designation = "Default" + R.notify_ai(2) R.updateicon() return 1 @@ -52,7 +53,7 @@ /obj/item/borg/upgrade/rename/action(var/mob/living/silicon/robot/R) if(..()) return 0 - R.connected_ai << "

NOTICE - Cyborg reclassification detected: [R.name] is now designated as [heldname].
" + R.notify_ai(3, R.name, heldname) R.name = heldname R.real_name = heldname R.camera.c_tag = heldname @@ -78,7 +79,7 @@ R.key = ghost.key R.stat = CONSCIOUS - R.connected_ai << "

NOTICE - New cyborg connection detected: [R.name].
" + 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 bc80920dd1d..092907557fa 100644 --- a/code/modules/mob/living/silicon/robot/robot.dm +++ b/code/modules/mob/living/silicon/robot/robot.dm @@ -87,7 +87,6 @@ connected_ai.connected_robots += src lawsync() lawupdate = 1 - connected_ai << "

NOTICE - New cyborg connection detected: [name]
" else lawupdate = 0 @@ -211,7 +210,7 @@ overlays -= "eyes" //Takes off the eyes that it started with transform_animation(animation_length) - connected_ai << "

NOTICE - Cyborg module change detected: [name] has loaded the [mod] module.
" + notify_ai(2) updateicon() /mob/living/silicon/robot/proc/transform_animation(animation_length) @@ -1093,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