Merge pull request #7617 from fira/obscomps

Observers Improvements: Ghosts are able to spy on computers, SMES and APCs, with NanoUI and OldUI support
This commit is contained in:
Chinsky
2015-02-03 18:12:16 +03:00
6 changed files with 40 additions and 5 deletions

View File

@@ -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)

View File

@@ -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

View File

@@ -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/teleporter/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()

View File

@@ -140,7 +140,10 @@ nanoui is used to open and update nano browser uis
* @return nothing
*/
/datum/nanoui/proc/update_status(var/push_update = 0)
if (istype(user, /mob/living/silicon/ai) || (get_dist(get_turf(user),get_turf(src_object)) <= 1))
if (istype(user, /mob/dead/observer))
/* Ghosts see updates but can't interact */
set_status(STATUS_UPDATE, push_update)
else if (istype(user, /mob/living/silicon/ai) || (get_dist(get_turf(user),get_turf(src_object)) <= 1))
set_status(STATUS_INTERACTIVE, push_update) // interactive (green visibility)
else if (istype(user, /mob/living/silicon/robot))
if (src_object in view(7, user)) // robots can see and interact with things they can see within 7 tiles

View File

@@ -724,6 +724,11 @@
// do APC interaction
src.interact(user)
/obj/machinery/power/apc/attack_ghost(user as mob)
if(stat & (BROKEN|MAINT))
return
return ui_interact(user)
/obj/machinery/power/apc/interact(mob/user)
if(!user)
return

View File

@@ -218,6 +218,8 @@
add_fingerprint(user)
ui_interact(user)
/obj/machinery/power/smes/attack_ghost(mob/user)
ui_interact(user)
/obj/machinery/power/smes/attack_hand(mob/user)
add_fingerprint(user)