// Navigation beacon for AI robots // Functions as a transponder: looks for incoming signal matching GLOBAL_LIST_EMPTY(navbeacons) // no I don't like putting this in, but it will do for now /obj/machinery/navbeacon icon = 'icons/obj/objects.dmi' icon_state = "navbeacon0-f" name = "navigation beacon" desc = "A beacon used for bot navigation." plane = PLATING_PLANE anchored = TRUE var/open = 0 // true if cover is open var/locked = 1 // true if controls are locked var/freq = null // DEPRECATED we don't use radios anymore! var/location = "" // location response text var/codes_txt // DEPRECATED codes as set on map: "tag1;tag2" or "tag1=value;tag2=value" var/list/codes = list() // assoc. list of transponder codes req_access = list(ACCESS_ENGINE) /obj/machinery/navbeacon/Initialize(mapload) . = ..() set_codes_from_txt(codes_txt) if(freq) WARNING("[src] at [x],[y],[z] has deprecated var freq=[freq]. Replace it with proper type.") var/turf/T = loc hide(!T.is_plating()) GLOB.navbeacons += src // set the transponder codes assoc list from codes_txt // DEPRECATED - This is kept only for compatibilty with old map files! Do not use this! // Instead, you should replace the map instance with one of the appropriate navbeacon subtypes. // See the bottom of this file for a list of subtypes, make your own examples if your map needs more /obj/machinery/navbeacon/proc/set_codes_from_txt() if(!codes_txt) return WARNING("[src] at [x],[y],[z] in [get_area(src)] is using the deprecated 'codes_txt' mapping method. Replace it with proper type.") codes = list() var/list/entries = splittext(codes_txt, ";") // entries are separated by semicolons for(var/e in entries) var/index = findtext(e, "=") // format is "key=value" if(index) var/key = copytext(e, 1, index) var/val = copytext(e, index+1) codes[key] = val else codes[e] = "1" /obj/machinery/navbeacon/hides_under_flooring() return 1 // called when turf state changes // hide the object if turf is intact /obj/machinery/navbeacon/hide(var/intact) invisibility = intact ? INVISIBILITY_ABSTRACT : INVISIBILITY_NONE update_icon() // update the icon_state /obj/machinery/navbeacon/update_icon() var/state="navbeacon[open]" if(invisibility) icon_state = "[state]-f" // if invisible, set icon to faded version // in case revealed by T-scanner else icon_state = "[state]" /obj/machinery/navbeacon/attackby(var/obj/item/I, var/mob/user) var/turf/T = loc if(!T.is_plating()) return // prevent intraction when T-scanner revealed if(I.has_tool_quality(TOOL_SCREWDRIVER)) open = !open playsound(src, I.usesound, 50, 1) user.visible_message("[user] [open ? "opens" : "closes"] the beacon's cover.", "You [open ? "open" : "close"] the beacon's cover.") update_icon() else if(I.GetID()) if(open) if(allowed(user)) locked = !locked to_chat(user, "Controls are now [locked ? "locked." : "unlocked."]") else to_chat(user, span_warning("Access denied.")) updateDialog() else to_chat(user, "You must open the cover first!") return /obj/machinery/navbeacon/attack_ai(var/mob/user) interact(user, 1) /obj/machinery/navbeacon/attack_hand(var/mob/user) if(!user.IsAdvancedToolUser()) return 0 interact(user, 0) /obj/machinery/navbeacon/interact(var/mob/user, var/ai = 0) var/turf/T = loc if(!T.is_plating()) return // prevent intraction when T-scanner revealed if(!open && !ai) // can't alter controls if not open, unless you're an AI to_chat(user, "The beacon's control cover is closed.") return var/t if(locked && !ai) t = {"Navigation Beacon

(swipe card to unlock controls)

Location: [location ? location : "(none)"]
Transponder Codes: