From cf5dff8a717ef18c81bcf9b87efa98575b48ec67 Mon Sep 17 00:00:00 2001 From: Fira Date: Thu, 1 Jan 2015 18:15:47 +0000 Subject: [PATCH] Updated OldUI for Computers to be usable by ghosts --- code/game/machinery/computer/computer.dm | 14 ++++++++++++++ code/game/machinery/computer/law.dm | 7 ++++++- code/game/machinery/teleporter.dm | 12 +++++++++--- 3 files changed, 29 insertions(+), 4 deletions(-) diff --git a/code/game/machinery/computer/computer.dm b/code/game/machinery/computer/computer.dm index ff88f89c5a..b639334c01 100644 --- a/code/game/machinery/computer/computer.dm +++ b/code/game/machinery/computer/computer.dm @@ -101,6 +101,20 @@ return text +/obj/machinery/computer/attack_ghost(user as mob) + return src.attack_hand(user) + +/obj/machinery/computer/attack_hand(user as mob) + /* Observers can view computers, but not actually use them via Topic*/ + if(istype(user, /mob/dead/observer)) return 0 + return ..() + +/obj/machinery/computer/Topic(href, href_list) + /* Can't use topic as observer by default */ + if(istype(usr, /mob/dead/observer)) return 0 + return ..() + + /obj/machinery/computer/attackby(I as obj, user as mob) if(istype(I, /obj/item/weapon/screwdriver) && circuit) playsound(src.loc, 'sound/items/Screwdriver.ogg', 50, 1) diff --git a/code/game/machinery/computer/law.dm b/code/game/machinery/computer/law.dm index 5c970f9d67..2d73e17da8 100644 --- a/code/game/machinery/computer/law.dm +++ b/code/game/machinery/computer/law.dm @@ -50,7 +50,9 @@ else usr << "[src.current.name] selected for law changes." return - + + attack_ghost(user as mob) + return 1 /obj/machinery/computer/borgupload @@ -83,3 +85,6 @@ else usr << "[src.current.name] selected for law changes." return + + attack_ghost(user as mob) + return 1 diff --git a/code/game/machinery/teleporter.dm b/code/game/machinery/teleporter.dm index 04b8c5644a..2ae7abed3d 100644 --- a/code/game/machinery/teleporter.dm +++ b/code/game/machinery/teleporter.dm @@ -9,6 +9,10 @@ var/one_time_use = 0 //Used for one-time-use teleport cards (such as clown planet coordinates.) //Setting this to 1 will set src.locked to null after a player enters the portal and will not allow hand-teles to open portals to that location. +/* Ghosts can't use this */ +/obj/machinery/computer/attack_ghost(user as mob) + return 1 + /obj/machinery/computer/teleporter/New() src.id = "[rand(1000, 9999)]" ..() @@ -80,9 +84,11 @@ /obj/machinery/teleport/station/attack_ai() src.attack_hand() -/obj/machinery/computer/teleporter/attack_hand() - if(stat & (NOPOWER|BROKEN)) - return +/obj/machinery/computer/teleporter/attack_hand(user as mob) + if(..()) return + + /* Ghosts can't use this one because it's a direct selection */ + if(istype(user, /mob/dead/observer)) return var/list/L = list() var/list/areaindex = list()