//This file was auto-corrected by findeclaration.exe on 25.5.2012 20:42:32 /* All telecommunications interactions: */ /obj/machinery/telecomms var/temp = "" // output message var/construct_op = 0 /obj/machinery/telecomms/attackby(obj/item/P as obj, mob/user as mob, params) // Using a multitool lets you access the receiver's interface if(istype(P, /obj/item/device/multitool)) attack_hand(user) // REPAIRING: Use Nanopaste to repair 10-20 integrity points. if(istype(P, /obj/item/stack/nanopaste)) var/obj/item/stack/nanopaste/T = P if (integrity < 100) //Damaged, let's repair! integrity = between(0, integrity + rand(10,20), 100) T.use(1) usr << "You apply the Nanopaste to [src], repairing some of the damage." else usr << "This machine is already in perfect condition." return switch(construct_op) if(0) if(istype(P, /obj/item/weapon/screwdriver)) user << "You unfasten the bolts." playsound(src.loc, 'sound/items/Screwdriver.ogg', 50, 1) construct_op ++ if(1) if(istype(P, /obj/item/weapon/screwdriver)) user << "You fasten the bolts." playsound(src.loc, 'sound/items/Screwdriver.ogg', 50, 1) construct_op -- if(istype(P, /obj/item/weapon/wrench)) user << "You dislodge the external plating." playsound(src.loc, 'sound/items/Ratchet.ogg', 75, 1) construct_op ++ if(2) if(istype(P, /obj/item/weapon/wrench)) user << "You secure the external plating." playsound(src.loc, 'sound/items/Ratchet.ogg', 75, 1) construct_op -- if(istype(P, /obj/item/weapon/wirecutters)) playsound(src.loc, 'sound/items/Wirecutter.ogg', 50, 1) user << "You remove the cables." construct_op ++ var/obj/item/stack/cable_coil/A = new /obj/item/stack/cable_coil( user.loc ) A.amount = 5 stat |= BROKEN // the machine's been borked! if(3) if(istype(P, /obj/item/stack/cable_coil)) var/obj/item/stack/cable_coil/A = P if(A.amount >= 5) user << "You insert the cables." A.amount -= 5 if(A.amount <= 0) user.drop_item() qdel(A) construct_op -- stat &= ~BROKEN // the machine's not borked anymore! if(istype(P, /obj/item/weapon/crowbar)) user << "You begin prying out the circuit board other components..." playsound(src.loc, 'sound/items/Crowbar.ogg', 50, 1) if(do_after(user,60)) user << "You finish prying out the components." // Drop all the component stuff if(component_parts) for(var/obj/I in component_parts) if(I.reliability != 100 && crit_fail) I.crit_fail = 1 I.loc = src.loc else // If the machine wasn't made during runtime, probably doesn't have components: // manually find the components and drop them! var/newpath = text2path(circuitboard) var/obj/item/weapon/circuitboard/C = new newpath for(var/I in C.req_components) for(var/i = 1, i <= C.req_components[I], i++) newpath = text2path(I) var/obj/item/s = new newpath s.loc = src.loc if(istype(s, /obj/item/stack/cable_coil)) var/obj/item/stack/cable_coil/A = s A.amount = 1 // Drop a circuit board too C.loc = src.loc // Create a machine frame and delete the current machine var/obj/machinery/constructable_frame/machine_frame/F = new F.loc = src.loc qdel(src) /obj/machinery/telecomms/proc/formatInput(var/label,var/varname, var/input) var/value = vars[varname] if(!value || value=="") value="-----" return "[label]: [value]" /obj/machinery/telecomms/attack_ai(var/mob/user as mob) attack_hand(user) /obj/machinery/telecomms/attack_hand(var/mob/user as mob) update_multitool_menu(user) /obj/machinery/telecomms/multitool_menu(var/mob/user,var/obj/item/device/multitool/P) // You need a multitool to use this, or be silicon if(!issilicon(user)) // istype returns false if the value is null if(!istype(user.get_active_hand(), /obj/item/device/multitool)) return if(stat & (BROKEN|NOPOWER)) return var/dat dat = {"

[temp]

Power Status: [src.toggled ? "On" : "Off"]

"} if(on && toggled) dat += {"

[formatInput("Identification String","id","id")]

[formatInput("Network","network","network")]

Prefabrication: [autolinkers.len ? "TRUE" : "FALSE"]

"} if(hide) dat += "

Shadow Link: ACTIVE

" //Show additional options for certain machines. dat += Options_Menu() dat += {"

Linked Network Entities:

    "} var/i = 0 for(var/obj/machinery/telecomms/T in links) i++ if(T.hide && !src.hide) continue dat += "
  1. \ref[T] [T.name] ([T.id]) \[X\]
  2. " // AUTOFIXED BY fix_string_idiocy.py // C:\Users\Rob\Documents\Projects\vgstation13\code\game\machinery\telecomms\machine_interactions.dm:140: dat += "
" dat += {"

Filtering Frequencies:

"} // END AUTOFIX i = 0 if(length(freq_listening)) dat += "" else dat += "
  • NONE
  • " // AUTOFIXED BY fix_string_idiocy.py // C:\Users\Rob\Documents\Projects\vgstation13\code\game\machinery\telecomms\machine_interactions.dm:155: dat += "
    \[Add Filter\]" dat += {"

    \[Add Filter\]


    "} // END AUTOFIX return dat /obj/machinery/telecomms/canLink(var/obj/O) return istype(O,/obj/machinery/telecomms) /obj/machinery/telecomms/isLinkedWith(var/obj/O) return O != null && O in links /obj/machinery/telecomms/getLink(var/idx) return (idx >= 1 && idx <= links.len) ? links[idx] : null // Off-Site Relays // // You are able to send/receive signals from the station's z level (changeable in the STATION_Z #define) if // the relay is on the telecomm satellite (changable in the TELECOMM_Z #define) /obj/machinery/telecomms/relay/proc/toggle_level() var/turf/position = get_turf(src) // Toggle on/off getting signals from the station or the current Z level if(src.listening_level == ZLEVEL_STATION) // equals the station src.listening_level = position.z return 1 else if(position.z == ZLEVEL_TELECOMMS) src.listening_level = ZLEVEL_STATION return 1 return 0 // Returns a multitool from a user depending on their mobtype. /obj/machinery/telecomms/proc/get_multitool(mob/user as mob) var/obj/item/device/multitool/P = null // Let's double check if(!issilicon(user) && istype(user.get_active_hand(), /obj/item/device/multitool)) P = user.get_active_hand() else if(isAI(user)) var/mob/living/silicon/ai/U = user P = U.aiMulti else if(isrobot(user) && in_range(user, src)) if(istype(user.get_active_hand(), /obj/item/device/multitool)) P = user.get_active_hand() return P // Additional Options for certain machines. Use this when you want to add an option to a specific machine. // Example of how to use below. /obj/machinery/telecomms/proc/Options_Menu() return "" /* // Add an option to the processor to switch processing mode. (COMPRESS -> UNCOMPRESS or UNCOMPRESS -> COMPRESS) /obj/machinery/telecomms/processor/Options_Menu() var/dat = "
    Processing Mode: [process_mode ? "UNCOMPRESS" : "COMPRESS"]" return dat */ // The topic for Additional Options. Use this for checking href links for your specific option. // Example of how to use below. /obj/machinery/telecomms/proc/Options_Topic(href, href_list) return /* /obj/machinery/telecomms/processor/Options_Topic(href, href_list) if(href_list["process"]) temp = "-% Processing mode changed. %-" src.process_mode = !src.process_mode */ // RELAY /obj/machinery/telecomms/relay/Options_Menu() var/dat = "" if(src.z == ZLEVEL_TELECOMMS) dat += "
    Signal Locked to Station: [listening_level == ZLEVEL_STATION ? "TRUE" : "FALSE"]" dat += "
    Broadcasting: [broadcasting ? "YES" : "NO"]" dat += "
    Receiving: [receiving ? "YES" : "NO"]" return dat /obj/machinery/telecomms/relay/Options_Topic(href, href_list) if(href_list["receive"]) receiving = !receiving temp = "-% Receiving mode changed. %-" if(href_list["broadcast"]) broadcasting = !broadcasting temp = "-% Broadcasting mode changed. %-" if(href_list["change_listening"]) //Lock to the station OR lock to the current position! //You need at least two receivers and two broadcasters for this to work, this includes the machine. var/result = toggle_level() if(result) temp = "-% [src]'s signal has been successfully changed." else temp = "-% [src] could not lock it's signal onto the station. Two broadcasters or receivers required." // BUS /obj/machinery/telecomms/bus/Options_Menu() var/dat = "
    Change Signal Frequency: [change_frequency ? "YES ([change_frequency])" : "NO"]" return dat /obj/machinery/telecomms/bus/Options_Topic(href, href_list) if(href_list["change_freq"]) var/newfreq = input(usr, "Specify a new frequency for new signals to change to. Enter null to turn off frequency changing. Decimals assigned automatically.", src, network) as null|num if(canAccess(usr)) if(newfreq) if(findtext(num2text(newfreq), ".")) newfreq *= 10 // shift the decimal one place if(newfreq < 10000) change_frequency = newfreq temp = "-% New frequency to change to assigned: \"[newfreq] GHz\" %-" else change_frequency = 0 temp = "-% Frequency changing deactivated %-" /obj/machinery/telecomms/Topic(href, href_list) if(!issilicon(usr)) if(!istype(usr.get_active_hand(), /obj/item/device/multitool)) return if(stat & (BROKEN|NOPOWER)) return var/obj/item/device/multitool/P = get_multitool(usr) if(href_list["input"]) switch(href_list["input"]) if("toggle") src.toggled = !src.toggled temp = "-% [src] has been [src.toggled ? "activated" : "deactivated"]." update_power() /* if("hide") src.hide = !hide temp = "-% Shadow Link has been [src.hide ? "activated" : "deactivated"]." */ if("id") var/newid = copytext(reject_bad_text(input(usr, "Specify the new ID for this machine", src, id) as null|text),1,MAX_MESSAGE_LEN) if(newid && canAccess(usr)) id = newid temp = "-% New ID assigned: \"[id]\" %-" if("network") var/newnet = input(usr, "Specify the new network for this machine. This will break all current links.", src, network) as null|text if(newnet && canAccess(usr)) if(length(newnet) > 15) temp = "-% Too many characters in new network tag %-" else for(var/obj/machinery/telecomms/T in links) T.links.Remove(src) network = newnet links = list() temp = "-% New network tag assigned: \"[network]\" %-" if("freq") var/newfreq = input(usr, "Specify a new frequency to filter (GHz). Decimals assigned automatically.", src, network) as null|num if(newfreq && canAccess(usr)) if(findtext(num2text(newfreq), ".")) newfreq *= 10 // shift the decimal one place if(!(newfreq in freq_listening) && newfreq < 10000) freq_listening.Add(newfreq) temp = "-% New frequency filter assigned: \"[newfreq] GHz\" %-" if(href_list["delete"]) // changed the layout about to workaround a pesky runtime -- Doohl var/x = text2num(href_list["delete"]) temp = "-% Removed frequency filter [x] %-" freq_listening.Remove(x) if(href_list["unlink"]) if(text2num(href_list["unlink"]) <= length(links)) var/obj/machinery/telecomms/T = links[text2num(href_list["unlink"])] temp = "-% Removed \ref[T] [T.name] from linked entities. %-" // Remove link entries from both T and src. if(src in T.links) T.links.Remove(src) links.Remove(T) if(href_list["link"]) if(P) if(P.buffer && P.buffer != src) if(!(src in P.buffer:links)) P.buffer:links.Add(src) if(!(P.buffer in src.links)) src.links.Add(P.buffer) temp = "-% Successfully linked with \ref[P.buffer] [P.buffer.name] %-" else temp = "-% Unable to acquire buffer %-" if(href_list["buffer"]) P.buffer = src temp = "-% Successfully stored \ref[P.buffer] [P.buffer.name] in buffer %-" if(href_list["flush"]) temp = "-% Buffer successfully flushed. %-" P.buffer = null src.Options_Topic(href, href_list) usr.set_machine(src) src.add_fingerprint(usr) updateUsrDialog() /obj/machinery/telecomms/proc/canAccess(var/mob/user) if(issilicon(user) || in_range(user, src)) return 1 return 0