/obj/machinery/camera name = "security camera" desc = "It's used to monitor rooms." icon = 'icons/obj/monitors.dmi' icon_state = "camera" use_power = 2 idle_power_usage = 5 active_power_usage = 10 layer = 5 var/datum/wires/camera/wires = null // Wires datum var/list/network = list("SS13") var/c_tag = null var/c_tag_order = 999 var/status = 1.0 anchored = 1.0 var/start_active = 0 //If it ignores the random chance to start broken on round start var/invuln = null var/obj/item/device/camera_bug/bug = null var/obj/item/weapon/camera_assembly/assembly = null //OTHER var/view_range = 7 var/short_range = 2 var/light_disabled = 0 var/alarm_on = 0 var/busy = 0 var/emped = 0 //Number of consecutive EMP's on this camera /obj/machinery/camera/New() wires = new(src) assembly = new(src) assembly.state = 4 assembly.anchored = 1 assembly.update_icon() /* // Use this to look for cameras that have the same c_tag. for(var/obj/machinery/camera/C in cameranet.cameras) var/list/tempnetwork = C.network&src.network if(C != src && C.c_tag == src.c_tag && tempnetwork.len) world.log << "[src.c_tag] [src.x] [src.y] [src.z] conflicts with [C.c_tag] [C.x] [C.y] [C.z]" */ ..() /obj/machinery/camera/initialize() if(z == ZLEVEL_STATION && prob(3) && !start_active) deactivate() /obj/machinery/camera/Destroy() deactivate(null, 0) //kick anyone viewing out if(assembly) qdel(assembly) assembly = null if(istype(bug)) bug.bugged_cameras -= src.c_tag if(bug.current == src) bug.current = null bug = null qdel(wires) cameranet.removeCamera(src) //Will handle removal from the camera network and the chunks, so we don't need to worry about that return ..() /obj/machinery/camera/emp_act(severity) if(!isEmpProof()) if(prob(100/severity)) icon_state = "[initial(icon_state)]emp" var/list/previous_network = network network = list() cameranet.removeCamera(src) stat |= EMPED set_light(0) triggerCameraAlarm() emped = emped+1 //Increase the number of consecutive EMP's var/thisemp = emped //Take note of which EMP this proc is for spawn(900) if(loc) //qdel limbo if(emped == thisemp) //Only fix it if the camera hasn't been EMP'd again network = previous_network icon_state = initial(icon_state) stat &= ~EMPED cancelCameraAlarm() if(can_use()) cameranet.addCamera(src) emped = 0 //Resets the consecutive EMP count for(var/mob/O in mob_list) if (O.client && O.client.eye == src) O.unset_machine() O.reset_view(null) O << "The screen bursts into static." ..() /obj/machinery/camera/ex_act(severity, target) if(src.invuln) return else ..() return /obj/machinery/camera/blob_act() qdel(src) return /obj/machinery/camera/proc/setViewRange(var/num = 7) src.view_range = num cameranet.updateVisibility(src, 0) /obj/machinery/camera/proc/shock(var/mob/living/user) if(!istype(user)) return user.electrocute_act(10, src) /obj/machinery/camera/attackby(W as obj, mob/living/user as mob, params) var/msg = "You attach [W] into the assembly inner circuits." var/msg2 = "The camera already has that upgrade!" // DECONSTRUCTION if(istype(W, /obj/item/weapon/screwdriver)) //user << "You start to [panel_open ? "close" : "open"] the camera's panel." //if(toggle_panel(user)) // No delay because no one likes screwdrivers trying to be hip and have a duration cooldown panel_open = !panel_open user.visible_message("[user] screws the camera's panel [panel_open ? "open" : "closed"]!", "You screw the camera's panel [panel_open ? "open" : "closed"].") playsound(src.loc, 'sound/items/Screwdriver.ogg', 50, 1) else if((istype(W, /obj/item/weapon/wirecutters) || istype(W, /obj/item/device/multitool)) && panel_open) wires.Interact(user) else if(istype(W, /obj/item/weapon/weldingtool) && wires.CanDeconstruct()) if(weld(W, user)) user << "You unweld the camera leaving it as just a frame screwed to the wall." if(!assembly) assembly = new() assembly.loc = src.loc assembly.state = 1 assembly.dir = src.dir assembly.update_icon() assembly = null qdel(src) return else if(istype(W, /obj/item/device/analyzer) && panel_open) //XRay if(!isXRay()) upgradeXRay() qdel(W) user << "[msg]" else user << "[msg2]" else if(istype(W, /obj/item/stack/sheet/mineral/plasma) && panel_open) if(!isEmpProof()) upgradeEmpProof() user << "[msg]" qdel(W) else user << "[msg2]" else if(istype(W, /obj/item/device/assembly/prox_sensor) && panel_open) if(!isMotion()) upgradeMotion() user << "[msg]" qdel(W) else user << "[msg2]" // OTHER else if ((istype(W, /obj/item/weapon/paper) || istype(W, /obj/item/device/pda)) && isliving(user)) var/mob/living/U = user var/obj/item/weapon/paper/X = null var/obj/item/device/pda/P = null var/itemname = "" var/info = "" if(istype(W, /obj/item/weapon/paper)) X = W itemname = X.name info = X.info else P = W itemname = P.name info = P.notehtml U << "You hold \the [itemname] up to the camera ..." U.changeNext_move(CLICK_CD_MELEE) for(var/mob/O in player_list) if(istype(O, /mob/living/silicon/ai)) var/mob/living/silicon/ai/AI = O if(U.name == "Unknown") AI << "[U] holds \a [itemname] up to one of your cameras ..." else AI << "[U] holds \a [itemname] up to one of your cameras ..." AI.last_paper_seen = "