From 81b1b189dede98f87e5a966b745a8d5ae2c2c4b7 Mon Sep 17 00:00:00 2001 From: Alek2ander Date: Sat, 22 Mar 2014 22:33:09 +0400 Subject: [PATCH 1/7] paipairing Stuff --- .../machinery/computer/HolodeckControl.dm | 4 +-- code/game/machinery/computer/arcade.dm | 1 + code/game/machinery/computer/camera.dm | 6 +++- code/game/machinery/computer/computer.dm | 7 +++- code/game/machinery/computer/law.dm | 1 + code/game/machinery/computer/medical.dm | 18 ++++++---- code/game/machinery/computer/security.dm | 8 ++++- code/game/machinery/computer/shuttle.dm | 1 + .../machinery/computer/telecrystalconsoles.dm | 1 + code/game/machinery/machinery.dm | 17 +++++++++ .../machinery/telecomms/traffic_control.dm | 4 ++- code/modules/mob/living/silicon/pai/death.dm | 1 + code/modules/mob/living/silicon/pai/life.dm | 2 +- code/modules/mob/living/silicon/pai/pai.dm | 33 +++++++++++++++++ .../mob/living/silicon/pai/software.dm | 36 +++++++++++++++++++ code/modules/mob/mob_helpers.dm | 5 +++ code/modules/power/power.dm | 3 +- .../particle_accelerator/particle_control.dm | 15 +++++++- code/modules/power/solar.dm | 9 +++++ 19 files changed, 157 insertions(+), 15 deletions(-) diff --git a/code/game/machinery/computer/HolodeckControl.dm b/code/game/machinery/computer/HolodeckControl.dm index e4c6e621fee..431bb10cc4c 100644 --- a/code/game/machinery/computer/HolodeckControl.dm +++ b/code/game/machinery/computer/HolodeckControl.dm @@ -32,11 +32,11 @@ dat += "(Begin Wildlife Simulation)
" dat += "Ensure the holodeck is empty before testing.
" dat += "
" - if(issilicon(user)) + if(isaiorborg(user)) dat += "(Re-Enable Safety Protocols?)
" dat += "Safety Protocols are DISABLED
" else - if(issilicon(user)) + if(isaiorborg(user)) dat += "(Override Safety Protocols?)
" dat += "
" dat += "Safety Protocols are ENABLED
" diff --git a/code/game/machinery/computer/arcade.dm b/code/game/machinery/computer/arcade.dm index 449bc3b3074..84b027b7b2a 100644 --- a/code/game/machinery/computer/arcade.dm +++ b/code/game/machinery/computer/arcade.dm @@ -26,6 +26,7 @@ /obj/item/toy/cards/deck = 2, /obj/item/toy/nuke = 2 ) + paiallowed = 0 //Fun is forbidden. Must serve humans /obj/machinery/computer/arcade/New() ..() diff --git a/code/game/machinery/computer/camera.dm b/code/game/machinery/computer/camera.dm index 0d29218a025..75909cffa01 100644 --- a/code/game/machinery/computer/camera.dm +++ b/code/game/machinery/computer/camera.dm @@ -62,11 +62,12 @@ var/obj/machinery/camera/C = D[t] if(t == "Cancel") + user.reset_view() user.unset_machine() return 0 if(C) - if ((get_dist(user, src) > 1 || user.machine != src || user.blinded || !( C.can_use() )) && (!istype(user, /mob/living/silicon/ai))) + if ((get_dist(user, src) > 1 || user.machine != src || user.blinded || !( C.can_use() )) && (!issilicon(user))) if(!C.can_use() && !isAI(user)) src.current = null return 0 @@ -75,6 +76,9 @@ var/mob/living/silicon/ai/A = user A.eyeobj.setLoc(get_turf(C)) A.client.eye = A.eyeobj + else if (ispAI(user)) + var/mob/living/silicon/pai/A = user + A.switchCamera(C) else src.current = C use_power(50) diff --git a/code/game/machinery/computer/computer.dm b/code/game/machinery/computer/computer.dm index bdf58f727dc..8d9d9d562fa 100644 --- a/code/game/machinery/computer/computer.dm +++ b/code/game/machinery/computer/computer.dm @@ -8,6 +8,7 @@ active_power_usage = 300 var/obj/item/weapon/circuitboard/circuit = null //if circuit==null, computer can't disassembly var/processing = 0 + paiallowed = 1 /obj/machinery/computer/New() ..() @@ -88,6 +89,8 @@ /obj/machinery/computer/proc/set_broken() if(circuit) //no circuit, no breaking + if(paired) + paired.unpair(0) stat |= BROKEN update_icon() return @@ -112,6 +115,8 @@ A.state = 4 A.icon_state = "4" qdel(src) + else + ..() return /obj/machinery/computer/attack_hand(user) @@ -140,4 +145,4 @@ return user.visible_message("[user.name] smashes against the [src.name] with its claws.",\ "You smash against the [src.name] with your claws.",\ - "You hear a clicking sound.") + "You hear a clicking sound.") \ No newline at end of file diff --git a/code/game/machinery/computer/law.dm b/code/game/machinery/computer/law.dm index 58991352c91..959bbc67b45 100644 --- a/code/game/machinery/computer/law.dm +++ b/code/game/machinery/computer/law.dm @@ -3,6 +3,7 @@ /obj/machinery/computer/upload var/mob/living/silicon/current = null //The target of future law uploads icon_state = null //To make sure mappers understand THIS ISN'T A VALID TYPE + paiallowed = 0 /obj/machinery/computer/upload/attackby(obj/item/O as obj, mob/user as mob) if(istype(O, /obj/item/weapon/aiModule)) diff --git a/code/game/machinery/computer/medical.dm b/code/game/machinery/computer/medical.dm index b2a5436ef66..1c248145d41 100644 --- a/code/game/machinery/computer/medical.dm +++ b/code/game/machinery/computer/medical.dm @@ -133,12 +133,18 @@ src.active1 = null src.active2 = null else if (href_list["login"]) - if (istype(usr, /mob/living/silicon)) - src.active1 = null - src.active2 = null - src.authenticated = 1 - src.rank = "AI" - src.screen = 1 + if (isaiorborg(usr)) + active1 = null + active2 = null + authenticated = 1 + rank = "AI" + screen = 1 + else if (ispAI(usr)) + active1 = null + active2 = null + authenticated = usr.name + rank = "pAI" + screen = 1 else if (istype(src.scan, /obj/item/weapon/card/id)) src.active1 = null src.active2 = null diff --git a/code/game/machinery/computer/security.dm b/code/game/machinery/computer/security.dm index 5034a19f459..512db410c3f 100644 --- a/code/game/machinery/computer/security.dm +++ b/code/game/machinery/computer/security.dm @@ -230,12 +230,18 @@ What a mess.*/ active2 = null if("Log In") - if (istype(usr, /mob/living/silicon)) + if (isaiorborg(usr)) active1 = null active2 = null authenticated = 1 rank = "AI" screen = 1 + else if (ispAI(usr)) + active1 = null + active2 = null + authenticated = usr.name + rank = "pAI" + screen = 1 else if (istype(scan, /obj/item/weapon/card/id)) active1 = null active2 = null diff --git a/code/game/machinery/computer/shuttle.dm b/code/game/machinery/computer/shuttle.dm index d43833b955f..ee7ea2b1d81 100644 --- a/code/game/machinery/computer/shuttle.dm +++ b/code/game/machinery/computer/shuttle.dm @@ -4,6 +4,7 @@ icon_state = "shuttle" var/auth_need = 3.0 var/list/authorized = list( ) + paiallowed = 0 attackby(var/obj/item/weapon/card/W as obj, var/mob/user as mob) diff --git a/code/game/machinery/computer/telecrystalconsoles.dm b/code/game/machinery/computer/telecrystalconsoles.dm index 5409ba20ff0..682b79adcb5 100644 --- a/code/game/machinery/computer/telecrystalconsoles.dm +++ b/code/game/machinery/computer/telecrystalconsoles.dm @@ -7,6 +7,7 @@ var/list/possible_uplinker_IDs = list("Alfa","Bravo","Charlie","Delta","Echo","F name = "\improper Telecrystal assignment station" desc = "A device used to manage telecrystals during group operations. You shouldn't be looking at this particular one..." icon_state = "tcstation" + paiallowed = 0 ///////////////////////////////////////////// /obj/machinery/computer/telecrystals/uplinker diff --git a/code/game/machinery/machinery.dm b/code/game/machinery/machinery.dm index db84ff75a83..0ba4761cff4 100644 --- a/code/game/machinery/machinery.dm +++ b/code/game/machinery/machinery.dm @@ -109,12 +109,16 @@ Class Procs: var/mob/living/occupant = null var/unsecuring_tool = /obj/item/weapon/wrench var/interact_offline = 0 // Can the machine be interacted with while de-powered. + var/mob/living/silicon/pai/paired + var/paiallowed = 0 /obj/machinery/New() ..() machines += src /obj/machinery/Destroy() + if(paired) + paired.unpair(0) machines.Remove(src) ..() @@ -235,6 +239,19 @@ Class Procs: else return src.attack_hand(user) +/obj/machinery/attackby(I as obj, user as mob) + if(istype(I, /obj/item/device/paicard)) + var/obj/item/device/paicard/C = I + if(C.pai && (C.pai.stat != DEAD) && C.pai.pairing) + if(allowed(user)) + if(paiallowed) + C.pai.pair(src) + else + C.pai << "\[ERROR\] Remote device does not accept remote control connections." + else + user << "Access denied." + C.pai << "\[ERROR\] Handshake failed. User not authorised to connect remote devices." + /obj/machinery/attack_paw(mob/user as mob) return src.attack_hand(user) diff --git a/code/game/machinery/telecomms/traffic_control.dm b/code/game/machinery/telecomms/traffic_control.dm index 9a6f87c8d17..1fc91644fea 100644 --- a/code/game/machinery/telecomms/traffic_control.dm +++ b/code/game/machinery/telecomms/traffic_control.dm @@ -142,8 +142,10 @@ /obj/machinery/computer/telecomms/traffic/proc/create_log(var/entry, var/mob/user) var/id = null - if(issilicon(user)) + if(isaiorborg(user)) id = "System Administrator" + else if(ispAI(user)) + id = "[user.name] (pAI)" else if(auth) id = "[auth.registered_name] ([auth.assignment])" diff --git a/code/modules/mob/living/silicon/pai/death.dm b/code/modules/mob/living/silicon/pai/death.dm index 75e30dda3f9..8d30f3b20d3 100644 --- a/code/modules/mob/living/silicon/pai/death.dm +++ b/code/modules/mob/living/silicon/pai/death.dm @@ -1,5 +1,6 @@ /mob/living/silicon/pai/death(gibbed) if(stat == DEAD) return + unpair(1) stat = DEAD canmove = 0 if(blind) blind.layer = 0 diff --git a/code/modules/mob/living/silicon/pai/life.dm b/code/modules/mob/living/silicon/pai/life.dm index 0f56249f060..328493dbb5e 100644 --- a/code/modules/mob/living/silicon/pai/life.dm +++ b/code/modules/mob/living/silicon/pai/life.dm @@ -6,7 +6,7 @@ var/turf/T = get_turf(src.loc) for (var/mob/M in viewers(T)) M.show_message("\red [src.cable] rapidly retracts back into its spool.", 3, "\red You hear a click and the sound of wire spooling rapidly.", 2) - qdel(src.cable) + del(src.cable) //Because otherwise it spams every tick until the gc gets around to deleting it. regular_hud_updates() if(src.secHUD == 1) diff --git a/code/modules/mob/living/silicon/pai/pai.dm b/code/modules/mob/living/silicon/pai/pai.dm index 89fb455c19d..bfd00aabb98 100644 --- a/code/modules/mob/living/silicon/pai/pai.dm +++ b/code/modules/mob/living/silicon/pai/pai.dm @@ -52,6 +52,9 @@ var/obj/item/radio/integrated/signal/sradio // AI's signaller + var/obj/machinery/paired + var/pairing = 0 + /mob/living/silicon/pai/New(var/obj/item/device/paicard) canmove = 0 @@ -191,6 +194,36 @@ /mob/living/silicon/pai/UnarmedAttack(var/atom/A)//Stops runtimes due to attack_animal being the default return +/mob/living/silicon/pai/proc/unpair(var/silent = 0) + if(!paired) + return + if(!(paired.paired == src)) + return + src.unset_machine() + paired.paired = null + paired = null + if(!silent) + src << "\[ERROR\] Network timeout. Remote control connection severed." + return + +/mob/living/silicon/pai/proc/pair(var/obj/machinery/P) + if(!pairing) + return + if(!P) + return + if(P.stat & (BROKEN|NOPOWER)) + src << "\[ERROR\] Remote device not responding to remote control handshake. Cannot establish connection." + return + if(!P.paiallowed) + src << "\[ERROR\] Remote device does not accept remote control connections." + return + if(P.paired && (P.paired != src)) + P.paired.unpair(0) + P.paired = src + paired = P + src << "Handshake complete. Remote control connection established." + return + //Addition by Mord_Sith to define AI's network change ability /* /mob/living/silicon/pai/proc/pai_network_change() diff --git a/code/modules/mob/living/silicon/pai/software.dm b/code/modules/mob/living/silicon/pai/software.dm index cd797cb9ab3..fa53de7c9ed 100644 --- a/code/modules/mob/living/silicon/pai/software.dm +++ b/code/modules/mob/living/silicon/pai/software.dm @@ -13,6 +13,7 @@ "security records" = 15, //"camera jack" = 10, "door jack" = 30, + "remote control" = 60, "atmosphere sensor" = 5, //"heartbeat sensor" = 10, "security HUD" = 20, @@ -60,6 +61,8 @@ left_part = src.facialRecognition() if("medicalhud") left_part = src.medicalAnalysis() + if("remote") + left_part = src.remoteControl() if("doorjack") left_part = src.softwareDoor() if("camerajack") @@ -243,6 +246,17 @@ if("translator") if(href_list["toggle"]) src.universal_speak = !src.universal_speak + if("remote") + if(href_list["pair"]) + pairing = 1 + if(href_list["abort"]) + pairing = 0 + if(href_list["control"]) + if(paired) + paired.attack_hand(src) + if(href_list["disconnect"]) + unpair(1) + pairing = 0 if("doorjack") if(href_list["jack"]) if(src.cable && src.cable.machine) @@ -306,6 +320,8 @@ dat += "Projection Array
" if(s == "camera jack") dat += "Camera Jack
" + if(s == "remote control") + dat += "Remote Control
" if(s == "door jack") dat += "Door Jack
" dat += "
" @@ -561,6 +577,26 @@ src << "DERP" return dat +// Computer remote control +/mob/living/silicon/pai/proc/remoteControl() + var/dat = "

Remote control

" + dat += "Connection status : " + if(!paired) + if(!pairing) + dat += "Disconnected
" + dat += "Initiate connection
" + return dat + else + dat += "Waiting for connection...
" + dat += "Abort
" + dat += "Request to be swiped near the computer's network card to begin remote control handshake.
" + return dat + + dat += "Connected to [paired.name]
" + dat += "Access remote interface
" + dat += "Disconnect
" + return dat + // Door Jack /mob/living/silicon/pai/proc/softwareDoor() var/dat = "

Airlock Jack

" diff --git a/code/modules/mob/mob_helpers.dm b/code/modules/mob/mob_helpers.dm index 63d292b63c4..dc3946fafba 100644 --- a/code/modules/mob/mob_helpers.dm +++ b/code/modules/mob/mob_helpers.dm @@ -100,6 +100,11 @@ return 1 return 0 +/proc/isaiorborg(A) + if(istype(A, /mob/living/silicon/ai) || istype(A, /mob/living/silicon/robot)) + return 1 + return 0 + /proc/isliving(A) if(istype(A, /mob/living)) return 1 diff --git a/code/modules/power/power.dm b/code/modules/power/power.dm index f07cd84d7b6..f88084ee433 100644 --- a/code/modules/power/power.dm +++ b/code/modules/power/power.dm @@ -71,7 +71,8 @@ if(powered(power_channel)) stat &= ~NOPOWER else - + if(paired) + paired.unpair(0) stat |= NOPOWER return diff --git a/code/modules/power/singularity/particle_accelerator/particle_control.dm b/code/modules/power/singularity/particle_accelerator/particle_control.dm index afaac0be300..4cee0645ae4 100644 --- a/code/modules/power/singularity/particle_accelerator/particle_control.dm +++ b/code/modules/power/singularity/particle_accelerator/particle_control.dm @@ -20,6 +20,7 @@ var/assembled = 0 var/parts = null var/datum/wires/particle_acc/control_box/wires = null + paiallowed = 1 /obj/machinery/particle_accelerator/control_box/New() wires = new(src) @@ -34,11 +35,21 @@ /obj/machinery/particle_accelerator/control_box/attack_hand(mob/user as mob) if(construction_state >= 3) interact(user) - else if(construction_state == 2) // Wires exposed + else if(construction_state == 2 && (get_dist(src, user) <= 1)) // Wires exposed wires.Interact(user) +/obj/machinery/particle_accelerator/control_box/attackby(obj/item/W, mob/user) + if(istype(W, /obj/item/device/paicard)) + var/obj/item/device/paicard/C = W + if(C.pai && (C.pai.stat != DEAD) && C.pai.pairing) + C.pai.pair(src) + else + ..() + /obj/machinery/particle_accelerator/control_box/update_state() if(construction_state < 3) + if(paired) + paired.unpair() use_power = 0 assembled = 0 active = 0 @@ -136,6 +147,8 @@ /obj/machinery/particle_accelerator/control_box/power_change() ..() if(stat & NOPOWER) + if(paired) + paired.unpair() active = 0 use_power = 0 else if(!stat && construction_state <= 3) diff --git a/code/modules/power/solar.dm b/code/modules/power/solar.dm index fa40707236e..1ca2f549811 100644 --- a/code/modules/power/solar.dm +++ b/code/modules/power/solar.dm @@ -281,6 +281,7 @@ var/list/solars_list = list() var/trackrate = 600 // 300-900 seconds var/trackdir = 1 // 0 =CCW, 1=CW var/nexttime = 0 + paiallowed = 1 /obj/machinery/power/solar_control/New() @@ -358,6 +359,10 @@ var/list/solars_list = list() A.icon_state = "4" A.anchored = 1 qdel(src) + else if(paiallowed && istype(I, /obj/item/device/paicard)) + var/obj/item/device/paicard/C = I + if(C.pai && (C.pai.stat != DEAD) && C.pai.pairing) + C.pai.pair(src) else src.attack_hand(user) return @@ -473,11 +478,15 @@ var/list/solars_list = list() update_icon() else spawn(rand(0, 15)) + if(paired) + paired.unpair(0) stat |= NOPOWER update_icon() /obj/machinery/power/solar_control/proc/broken() + if(paired) + paired.unpair() stat |= BROKEN update_icon() From 7b3dabeb90482f2138f02d8142c62dd8012d8115 Mon Sep 17 00:00:00 2001 From: Alek2ander Date: Sun, 23 Mar 2014 00:44:39 +0400 Subject: [PATCH 2/7] That computer is horrendous Still doesn't work properly for AI. Probably never will. --- code/game/machinery/computer/camera.dm | 40 ++++++++++++++------------ 1 file changed, 22 insertions(+), 18 deletions(-) diff --git a/code/game/machinery/computer/camera.dm b/code/game/machinery/computer/camera.dm index 75909cffa01..379675db44b 100644 --- a/code/game/machinery/computer/camera.dm +++ b/code/game/machinery/computer/camera.dm @@ -56,37 +56,41 @@ var/t = input(user, "Which camera should you change to?") as null|anything in D if(!t) + if(!isAI(user)) + user.reset_view() user.unset_machine() return 0 var/obj/machinery/camera/C = D[t] if(t == "Cancel") - user.reset_view() + if(!isAI(user)) + user.reset_view() user.unset_machine() return 0 if(C) - if ((get_dist(user, src) > 1 || user.machine != src || user.blinded || !( C.can_use() )) && (!issilicon(user))) - if(!C.can_use() && !isAI(user)) - src.current = null + if(isAI(user)) + var/mob/living/silicon/ai/A = user + A.eyeobj.setLoc(get_turf(C)) + A.client.eye = A.eyeobj + if(ispAI(user)) + var/mob/living/silicon/pai/A = user + A.switchCamera(C) + else if ((get_dist(user, src) > 1) || (user.machine != src)|| user.blinded || !( C.can_use() )) + src.current = null return 0 else - if(isAI(user)) - var/mob/living/silicon/ai/A = user - A.eyeobj.setLoc(get_turf(C)) - A.client.eye = A.eyeobj - else if (ispAI(user)) - var/mob/living/silicon/pai/A = user - A.switchCamera(C) - else - src.current = C - use_power(50) - - spawn(5) - attack_hand(user) + src.current = C + use_power(50) + spawn(5) + attack_hand(user) + return + else + if(!isAI(user)) + user.reset_view() + user.unset_machine() return - /obj/machinery/computer/security/telescreen From 90c79c0f9ded71e08110456facd860e3a344888d Mon Sep 17 00:00:00 2001 From: Alek2ander Date: Sun, 23 Mar 2014 01:33:57 +0400 Subject: [PATCH 3/7] Back to qdel() Sorry --- code/modules/mob/living/silicon/pai/life.dm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/code/modules/mob/living/silicon/pai/life.dm b/code/modules/mob/living/silicon/pai/life.dm index 328493dbb5e..7241a4dec18 100644 --- a/code/modules/mob/living/silicon/pai/life.dm +++ b/code/modules/mob/living/silicon/pai/life.dm @@ -6,7 +6,8 @@ var/turf/T = get_turf(src.loc) for (var/mob/M in viewers(T)) M.show_message("\red [src.cable] rapidly retracts back into its spool.", 3, "\red You hear a click and the sound of wire spooling rapidly.", 2) - del(src.cable) //Because otherwise it spams every tick until the gc gets around to deleting it. + qdel(src.cable) + src.cable = null regular_hud_updates() if(src.secHUD == 1) From 223e5f7478857e8d1770733c49b2a79350dfb41f Mon Sep 17 00:00:00 2001 From: Alek2ander Date: Sun, 23 Mar 2014 12:39:13 +0400 Subject: [PATCH 4/7] Arcades, overlays and Git being evil Added the most important damn checks of this entire PR that got eaten by Git when I synced Added a visual indication of a pAI being paired with a computer - a tiny blue light at the bottom Forbid to pair with computers that have non-standard icons, except the arcade machine. When the arcade is emagged, if the pAI loses, it will explode like a detonated PDA. If it's slotted into a PDA, it will explode with it. Severs connection if the pAI and the computer are on different z-levels --- code/game/machinery/computer/arcade.dm | 7 ++++++- code/game/machinery/computer/camera.dm | 2 ++ code/game/machinery/computer/medical.dm | 1 + code/game/machinery/computer/pod.dm | 1 + code/game/machinery/computer/security.dm | 1 + code/game/machinery/machinery.dm | 8 ++++++++ code/game/objects/items/devices/paicard.dm | 19 +++++++++++++++++++ code/modules/mob/living/silicon/pai/life.dm | 4 +++- code/modules/mob/living/silicon/pai/pai.dm | 2 ++ icons/obj/computer.dmi | Bin 70640 -> 70657 bytes 10 files changed, 43 insertions(+), 2 deletions(-) diff --git a/code/game/machinery/computer/arcade.dm b/code/game/machinery/computer/arcade.dm index 84b027b7b2a..5331562c2ea 100644 --- a/code/game/machinery/computer/arcade.dm +++ b/code/game/machinery/computer/arcade.dm @@ -26,7 +26,6 @@ /obj/item/toy/cards/deck = 2, /obj/item/toy/nuke = 2 ) - paiallowed = 0 //Fun is forbidden. Must serve humans /obj/machinery/computer/arcade/New() ..() @@ -223,6 +222,9 @@ src.temp = "You have been drained! GAME OVER" if(emagged) feedback_inc("arcade_loss_mana_emagged") + if(ispAI(usr)) + var/mob/living/silicon/pai/pai = usr + pai.card.explode() usr.gib() else feedback_inc("arcade_loss_mana_normal") @@ -242,6 +244,9 @@ src.temp = "You have been crushed! GAME OVER" if(emagged) feedback_inc("arcade_loss_hp_emagged") + if(ispAI(usr)) + var/mob/living/silicon/pai/pai = usr + pai.card.explode() usr.gib() else feedback_inc("arcade_loss_hp_normal") diff --git a/code/game/machinery/computer/camera.dm b/code/game/machinery/computer/camera.dm index 379675db44b..fcdb5ca4666 100644 --- a/code/game/machinery/computer/camera.dm +++ b/code/game/machinery/computer/camera.dm @@ -101,6 +101,7 @@ network = list("thunder") density = 0 circuit = null + paiallowed = 0 //2retro /obj/machinery/computer/security/telescreen/update_icon() icon_state = initial(icon_state) @@ -122,6 +123,7 @@ name = "security camera monitor" desc = "An old TV hooked into the stations camera network." icon_state = "security_det" + paiallowed = 0 //2retro /obj/machinery/computer/security/mining diff --git a/code/game/machinery/computer/medical.dm b/code/game/machinery/computer/medical.dm index 1c248145d41..e1eed34cc29 100644 --- a/code/game/machinery/computer/medical.dm +++ b/code/game/machinery/computer/medical.dm @@ -459,3 +459,4 @@ name = "medical laptop" desc = "A cheap Nanotrasen medical laptop, it functions as a medical records computer. It's bolted to the table." icon_state = "medlaptop" + paiallowed = 0 //Go use a real computer diff --git a/code/game/machinery/computer/pod.dm b/code/game/machinery/computer/pod.dm index 5b93f9e6d53..a412954abfc 100644 --- a/code/game/machinery/computer/pod.dm +++ b/code/game/machinery/computer/pod.dm @@ -123,6 +123,7 @@ icon_state = "old" name = "\improper DoorMex control console" title = "Door Controls" + paiallowed = 0 //2retro /obj/machinery/computer/pod/old/syndicate diff --git a/code/game/machinery/computer/security.dm b/code/game/machinery/computer/security.dm index 512db410c3f..e9fabd91fb5 100644 --- a/code/game/machinery/computer/security.dm +++ b/code/game/machinery/computer/security.dm @@ -562,3 +562,4 @@ What a mess.*/ /obj/machinery/computer/secure_data/detective_computer icon = 'icons/obj/computer.dmi' icon_state = "messyfiles" + paiallowed = 0 //2retro diff --git a/code/game/machinery/machinery.dm b/code/game/machinery/machinery.dm index 0ba4761cff4..2260e710fb9 100644 --- a/code/game/machinery/machinery.dm +++ b/code/game/machinery/machinery.dm @@ -212,6 +212,10 @@ Class Procs: usr << "You don't have the dexterity to do this!" return 1 + if(ispAI(usr)) + if(paired != usr) + return 1 + var/norange = 0 if(istype(usr, /mob/living/carbon/human)) var/mob/living/carbon/human/H = usr @@ -270,6 +274,10 @@ Class Procs: if ((get_dist(src, user) > 1 || !istype(src.loc, /turf)) && !istype(user, /mob/living/silicon)) return 1 */ + if(ispAI(usr)) + if(paired != usr) + return 1 + if (ishuman(user)) var/mob/living/carbon/human/H = user if(H.getBrainLoss() >= 60) diff --git a/code/game/objects/items/devices/paicard.dm b/code/game/objects/items/devices/paicard.dm index 3fa8f1593f8..f4acf51399d 100644 --- a/code/game/objects/items/devices/paicard.dm +++ b/code/game/objects/items/devices/paicard.dm @@ -134,3 +134,22 @@ pai.emp_act(severity) ..() +/obj/item/device/paicard/proc/explode() + var/turf/T = get_turf(src.loc) + + if (ismob(loc)) + var/mob/M = loc + M.show_message("\red Your [src] explodes!", 1) + else if(istype(loc, /obj/item/device/pda)) + var/obj/item/device/pda/P = loc + if(P.detonate) + P.explode() + qdel(src) + return + if(T) + T.hotspot_expose(700,125) + + explosion(T, -1, -1, 2, 3) + + qdel(src) + return \ No newline at end of file diff --git a/code/modules/mob/living/silicon/pai/life.dm b/code/modules/mob/living/silicon/pai/life.dm index 7241a4dec18..9166e7ba855 100644 --- a/code/modules/mob/living/silicon/pai/life.dm +++ b/code/modules/mob/living/silicon/pai/life.dm @@ -7,7 +7,7 @@ for (var/mob/M in viewers(T)) M.show_message("\red [src.cable] rapidly retracts back into its spool.", 3, "\red You hear a click and the sound of wire spooling rapidly.", 2) qdel(src.cable) - src.cable = null + cable = null regular_hud_updates() if(src.secHUD == 1) @@ -29,5 +29,7 @@ /mob/living/silicon/pai/proc/follow_pai() while(card) loc = get_turf(card) + if(paired && (loc.z != paired.z)) + unpair(0) //Limit remote control to same z-level sleep(5) qdel(src) //if there's no pAI we shouldn't exist diff --git a/code/modules/mob/living/silicon/pai/pai.dm b/code/modules/mob/living/silicon/pai/pai.dm index bfd00aabb98..56fad7ffd58 100644 --- a/code/modules/mob/living/silicon/pai/pai.dm +++ b/code/modules/mob/living/silicon/pai/pai.dm @@ -200,6 +200,7 @@ if(!(paired.paired == src)) return src.unset_machine() + paired.overlays -= image('icons/obj/computer.dmi', "paipaired") paired.paired = null paired = null if(!silent) @@ -221,6 +222,7 @@ P.paired.unpair(0) P.paired = src paired = P + paired.overlays += image('icons/obj/computer.dmi', "paipaired") src << "Handshake complete. Remote control connection established." return diff --git a/icons/obj/computer.dmi b/icons/obj/computer.dmi index 9557a1472da9bf5d9431db156edbfc1a691cbd16..2b5896d9ce647a8dfdfc83184b7205bd9eb9f828 100644 GIT binary patch delta 4576 zcmXAr2{csi8^>qt8Bvja4N+r>7)y4EC~G2Q23a$X;+dYnvQxAZ7gvn z$rVpuNq=l@tkB}Yl!gEpF%f<%!!)c^p*`oGsK^2NOL2(#{N510O^L+ zVnpe);xudYH-Qq<>v~wD4sWH5WpX4(o|{yPthf8*ljN?VmkXvE#e+w8q5P_|t$X>P zO5+gzgpubCu~(f^5gGd-jCYH-rPJpfP3NIC^(Icq@7cYe5(cC-TkW&xktl|oLZt_f z_kEl=?Y%-UyZw0mW;m)=rT5;TQ-aoE)%dRb3t*TKl2vBfu9; z5Z_1I;FKwa=%mRj!euc@lfyx^m)c8w+G&J{$fC_W>Ca#7!NQ(P@AakQ`ZG67vY6j* zbnuB+zyN2Yu=&vnwlV#0iI(6|YL|O)`QKPZ)s*LEo$3_j+_O_Z8czc{`rvB~_(uK8 z_6ptsvEW8aJ$?nh@SWjCc^zs@BBi^Ma1_f&pH%Gga!-|mgv`4(hLWWE+dR_*r+5`! zwkJ&oAu_u8gS6KW=zO1H74*AqFVXhL2wqk$Pql6vDcn7#VUK)fZ=n z`u(YftA7xfsg|lXa}NyAfmF|#P`1Vgi&O$Cb??N&nk$}yN07zFDjjAPfu=%%((SmI zxvMCiLmCSIU&>DtP%Xi*gRsV6rl{dGpit04`yP7sOR%|H-T-H-zC8NDM0$0G*4W|6 z!-eF*zDv#aE<%&()z1s)$9K?Vh9#j744cTQm()4PRw$7)Dc7s{5W3@WlSKAx%0;2t zneUUTkY?(GQ8T<^dD_Zn>AP4K=$L8 zC7&*T(3-dPpuaDiJ%E7xbQw2GN(jF8d>Z}8;dh5>s{B9_r}WDdPf=u{19kB)Z1HB} z4JIFlr`0;*1cNG3Ijey6xytqQGKS3fj;!Q#8p17iwGg%(2b_`Q(6HjIr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4JbBSG#P4LuK-3legSwHt4~JB}*NF%8-rlxRJ5_4S8rd1E`2Ioq6c-u1P}ErnES zEG$V%s=FhyO@ZfG9ZcSk=}(vv-n`Z~XP=}Nsc6aOkndkc!?RHm? z13BTPNgE~Vyrg(YWRepmDy$%W%uSb|mtoRHPT{{(CQlt69&TT=o;0u9LQNAmY2~{M zmx%1nj_DDkxww!+&@FGVS?c;7WQJR{>_fMc1lv2g_oWge-7 zJw|h)Dr(C>uJ@iCw)`CFxc~d_{p4Q*ZzCV<;C8})@I*Zb=Ukkhzpz3eoMNKS(1+Aw z9)*YV00C_OfEZo?Ms+D)I>_;iWXAnVbpa?C+=zLpBN}l(JUslC{0-&GzZ#vrt}R&X z{TqD*=c{&ufi2_ZfIcm(B?C6x)3i->$iIy^dj!$N4d0R!5TXNUhqi|P-D)*N%>Mw6 CGv{&u From 5a3b6543025c2d69ccefa9c39485f4c034944449 Mon Sep 17 00:00:00 2001 From: Alek2ander Date: Sun, 23 Mar 2014 13:49:10 +0400 Subject: [PATCH 5/7] More sanity checks pAI interface is weird, let's make sure we're always in a valid state --- code/modules/mob/living/silicon/pai/pai.dm | 2 ++ code/modules/mob/living/silicon/pai/software.dm | 6 ++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/code/modules/mob/living/silicon/pai/pai.dm b/code/modules/mob/living/silicon/pai/pai.dm index 56fad7ffd58..160c0bebbda 100644 --- a/code/modules/mob/living/silicon/pai/pai.dm +++ b/code/modules/mob/living/silicon/pai/pai.dm @@ -218,6 +218,8 @@ if(!P.paiallowed) src << "\[ERROR\] Remote device does not accept remote control connections." return + pairing = 0 + unpair(1) if(P.paired && (P.paired != src)) P.paired.unpair(0) P.paired = src diff --git a/code/modules/mob/living/silicon/pai/software.dm b/code/modules/mob/living/silicon/pai/software.dm index fa53de7c9ed..1b32b96451e 100644 --- a/code/modules/mob/living/silicon/pai/software.dm +++ b/code/modules/mob/living/silicon/pai/software.dm @@ -248,9 +248,11 @@ src.universal_speak = !src.universal_speak if("remote") if(href_list["pair"]) - pairing = 1 + if(!paired) + pairing = 1 if(href_list["abort"]) - pairing = 0 + if(!paired) + pairing = 0 if(href_list["control"]) if(paired) paired.attack_hand(src) From 006a7e2d40cf8ae1dc35e5c91e7633998b4f4d77 Mon Sep 17 00:00:00 2001 From: Alek2ander Date: Thu, 27 Mar 2014 19:16:16 +0400 Subject: [PATCH 6/7] Removed pAI check in attack_hand Added pAI check in the Security Camera Console instead. All the others seem fine. --- code/game/machinery/computer/camera.dm | 6 ++++++ code/game/machinery/machinery.dm | 4 ---- code/modules/mob/living/silicon/pai/software.dm | 2 +- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/code/game/machinery/computer/camera.dm b/code/game/machinery/computer/camera.dm index fcdb5ca4666..5e8f7770730 100644 --- a/code/game/machinery/computer/camera.dm +++ b/code/game/machinery/computer/camera.dm @@ -35,6 +35,12 @@ if(..()) return + if(ispAI(usr)) + if(paired != usr) + user.reset_view() + user.unset_machine() + return + var/list/L = list() for (var/obj/machinery/camera/C in cameranet.cameras) L.Add(C) diff --git a/code/game/machinery/machinery.dm b/code/game/machinery/machinery.dm index 2260e710fb9..47f2fa869b0 100644 --- a/code/game/machinery/machinery.dm +++ b/code/game/machinery/machinery.dm @@ -274,10 +274,6 @@ Class Procs: if ((get_dist(src, user) > 1 || !istype(src.loc, /turf)) && !istype(user, /mob/living/silicon)) return 1 */ - if(ispAI(usr)) - if(paired != usr) - return 1 - if (ishuman(user)) var/mob/living/carbon/human/H = user if(H.getBrainLoss() >= 60) diff --git a/code/modules/mob/living/silicon/pai/software.dm b/code/modules/mob/living/silicon/pai/software.dm index 1b32b96451e..aba8ab06ab1 100644 --- a/code/modules/mob/living/silicon/pai/software.dm +++ b/code/modules/mob/living/silicon/pai/software.dm @@ -254,7 +254,7 @@ if(!paired) pairing = 0 if(href_list["control"]) - if(paired) + if(paired && (paired.paired == src)) paired.attack_hand(src) if(href_list["disconnect"]) unpair(1) From 8fa4005c248deca12465c8b1eddbc1e76a890a11 Mon Sep 17 00:00:00 2001 From: Alek2ander Date: Thu, 27 Mar 2014 23:43:05 +0400 Subject: [PATCH 7/7] Moved paicard check to /obj/machinery/computer BSA control computer now a valid pAI control target. !!FUN!! --- code/game/machinery/computer/computer.dm | 13 +++++++++++-- code/game/machinery/machinery.dm | 13 ------------- code/modules/awaymissions/bluespaceartillery.dm | 7 +++++++ code/modules/power/solar.dm | 2 +- 4 files changed, 19 insertions(+), 16 deletions(-) diff --git a/code/game/machinery/computer/computer.dm b/code/game/machinery/computer/computer.dm index 8d9d9d562fa..f3299e61f20 100644 --- a/code/game/machinery/computer/computer.dm +++ b/code/game/machinery/computer/computer.dm @@ -115,8 +115,17 @@ A.state = 4 A.icon_state = "4" qdel(src) - else - ..() + if(istype(I, /obj/item/device/paicard)) + var/obj/item/device/paicard/C = I + if(C.pai && (C.pai.stat != DEAD) && C.pai.pairing) + if(allowed(user)) + if(paiallowed) + C.pai.pair(src) + else + C.pai << "\[ERROR\] Remote device does not accept remote control connections." + else + user << "Access denied." + C.pai << "\[ERROR\] Handshake failed. User not authorised to connect remote devices." return /obj/machinery/computer/attack_hand(user) diff --git a/code/game/machinery/machinery.dm b/code/game/machinery/machinery.dm index 47f2fa869b0..662bea6800d 100644 --- a/code/game/machinery/machinery.dm +++ b/code/game/machinery/machinery.dm @@ -243,19 +243,6 @@ Class Procs: else return src.attack_hand(user) -/obj/machinery/attackby(I as obj, user as mob) - if(istype(I, /obj/item/device/paicard)) - var/obj/item/device/paicard/C = I - if(C.pai && (C.pai.stat != DEAD) && C.pai.pairing) - if(allowed(user)) - if(paiallowed) - C.pai.pair(src) - else - C.pai << "\[ERROR\] Remote device does not accept remote control connections." - else - user << "Access denied." - C.pai << "\[ERROR\] Handshake failed. User not authorised to connect remote devices." - /obj/machinery/attack_paw(mob/user as mob) return src.attack_hand(user) diff --git a/code/modules/awaymissions/bluespaceartillery.dm b/code/modules/awaymissions/bluespaceartillery.dm index 32fadf2eef7..da6add53782 100644 --- a/code/modules/awaymissions/bluespaceartillery.dm +++ b/code/modules/awaymissions/bluespaceartillery.dm @@ -6,6 +6,7 @@ icon = 'icons/obj/machines/particle_accelerator.dmi' density = 1 anchored = 1 + paiallowed = 1 /obj/machinery/artillerycontrol/process() if(src.reload<180) @@ -20,6 +21,12 @@ /obj/structure/artilleryplaceholder/decorative density = 0 +/obj/machinery/artillerycontrol/attackby(I as obj, user as mob) + if(istype(I, /obj/item/device/paicard)) + var/obj/item/device/paicard/C = I + if(C.pai && (C.pai.stat != DEAD) && C.pai.pairing) + C.pai.pair(src) + /obj/machinery/artillerycontrol/attack_hand(mob/user as mob) user.set_machine(src) var/dat = "Bluespace Artillery Control:
" diff --git a/code/modules/power/solar.dm b/code/modules/power/solar.dm index 1ca2f549811..7368bd1455e 100644 --- a/code/modules/power/solar.dm +++ b/code/modules/power/solar.dm @@ -359,7 +359,7 @@ var/list/solars_list = list() A.icon_state = "4" A.anchored = 1 qdel(src) - else if(paiallowed && istype(I, /obj/item/device/paicard)) + else if(istype(I, /obj/item/device/paicard)) var/obj/item/device/paicard/C = I if(C.pai && (C.pai.stat != DEAD) && C.pai.pairing) C.pai.pair(src)