mirror of
https://github.com/PolarisSS13/Polaris.git
synced 2025-12-25 17:42:26 +00:00
@@ -44,8 +44,7 @@
|
||||
var/list/D = list()
|
||||
D["Cancel"] = "Cancel"
|
||||
for(var/obj/machinery/camera/C in L)
|
||||
var/list/tempnetwork = C.network&network
|
||||
if(tempnetwork.len)
|
||||
if(can_access_camera(C))
|
||||
D[text("[][]", C.c_tag, (C.status ? null : " (Deactivated)"))] = C
|
||||
|
||||
var/t = input(user, "Which camera should you change to?") as null|anything in D
|
||||
@@ -60,23 +59,32 @@
|
||||
return 0
|
||||
|
||||
if(C)
|
||||
if ((get_dist(user, src) > 1 || user.machine != src || user.blinded || !( user.canmove ) || !( C.can_use() )) && (!istype(user, /mob/living/silicon/ai)))
|
||||
if(!C.can_use() && !isAI(user))
|
||||
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
|
||||
src.current = C
|
||||
use_power(50)
|
||||
|
||||
spawn(5)
|
||||
attack_hand(user)
|
||||
switch_to_camera(user, C)
|
||||
spawn(5)
|
||||
attack_hand(user)
|
||||
return
|
||||
|
||||
proc/can_access_camera(var/obj/machinery/camera/C)
|
||||
var/list/shared_networks = src.network & C.network
|
||||
if(shared_networks.len)
|
||||
return 1
|
||||
return 0
|
||||
|
||||
proc/switch_to_camera(var/mob/user, var/obj/machinery/camera/C)
|
||||
if ((get_dist(user, src) > 1 || user.machine != src || user.blinded || !( user.canmove ) || !( C.can_use() )) && (!istype(user, /mob/living/silicon/ai)))
|
||||
if(!C.can_use() && !isAI(user))
|
||||
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
|
||||
src.current = C
|
||||
use_power(50)
|
||||
return 1
|
||||
|
||||
attackby(I as obj, user as mob)
|
||||
if(istype(I, /obj/item/weapon/screwdriver))
|
||||
playsound(loc, 'sound/items/Screwdriver.ogg', 50, 1)
|
||||
@@ -110,6 +118,52 @@
|
||||
attack_hand(user)
|
||||
return
|
||||
|
||||
//Camera control: moving.
|
||||
proc/jump_on_click(var/mob/user,var/A)
|
||||
if(user.machine != src)
|
||||
return
|
||||
var/obj/machinery/camera/jump_to
|
||||
if(istype(A,/obj/machinery/camera))
|
||||
jump_to = A
|
||||
else if(ismob(A))
|
||||
if(ishuman(A))
|
||||
jump_to = locate() in A:head
|
||||
else if(isrobot(A))
|
||||
jump_to = A:camera
|
||||
else if(isobj(A))
|
||||
jump_to = locate() in A
|
||||
else if(isturf(A))
|
||||
var/best_dist = INFINITY
|
||||
for(var/obj/machinery/camera/camera in get_area(A))
|
||||
if(!camera.can_use())
|
||||
continue
|
||||
if(!can_access_camera(camera))
|
||||
continue
|
||||
var/dist = get_dist(camera,A)
|
||||
if(dist < best_dist)
|
||||
best_dist = dist
|
||||
jump_to = camera
|
||||
if(isnull(jump_to))
|
||||
return
|
||||
if(can_access_camera(jump_to))
|
||||
switch_to_camera(user,jump_to)
|
||||
//Camera control: mouse.
|
||||
/atom/DblClick()
|
||||
..()
|
||||
if(istype(usr.machine,/obj/machinery/computer/security))
|
||||
var/obj/machinery/computer/security/console = usr.machine
|
||||
console.jump_on_click(usr,src)
|
||||
//Camera control: arrow keys.
|
||||
/mob/Move(n,direct)
|
||||
if(istype(machine,/obj/machinery/computer/security))
|
||||
var/obj/machinery/computer/security/console = machine
|
||||
var/turf/T = get_turf(console.current)
|
||||
for(var/i;i<10;i++)
|
||||
T = get_step(T,direct)
|
||||
console.jump_on_click(src,T)
|
||||
return
|
||||
..(n,direct)
|
||||
|
||||
/obj/machinery/computer/security/telescreen
|
||||
name = "Telescreen"
|
||||
desc = "Used for watching an empty arena."
|
||||
|
||||
Reference in New Issue
Block a user