df902d50fc
- Viciously rips radio code from bots, replacing it with something better and faster! - Bot patrol logic redesigned, much faster. - Gives all bots Robotics access for easy patrol activation. - Bot navigation beacons are no longer radios. Instead, they are maintained in a global list. - Navbeacons can now be accessed by Roboticists, and they use a better UI. - PDA bot code rewritten. They no longer use radio objects at all! - Captain now has all-access! His cartridge now has everything except Mime and Clown functions. - There is now one button across all PDAs for accessing bots. Only bots you have access to control will show on the list. - Buffed the signaler cartridge! It may now be used to signal on all valid frequencies. - The AI's botcall interface now includes the bot's model, so it can always identify the type of bot it is controlling. PDAs have this as well. - Spilled my blood to begin Jordie's dark ritual.
65 lines
1.8 KiB
Plaintext
65 lines
1.8 KiB
Plaintext
/obj/item/radio/integrated
|
|
name = "\improper PDA radio module"
|
|
desc = "An electronic radio system of nanotrasen origin."
|
|
icon = 'icons/obj/module.dmi'
|
|
icon_state = "power_mod"
|
|
var/obj/item/device/pda/hostpda = null
|
|
|
|
var/on = 0 //Are we currently active??
|
|
var/menu_message = ""
|
|
|
|
/obj/item/radio/integrated/New()
|
|
..()
|
|
if (istype(loc.loc, /obj/item/device/pda))
|
|
hostpda = loc.loc
|
|
|
|
/*
|
|
* Radio Cartridge, essentially a signaler.
|
|
*/
|
|
|
|
|
|
/obj/item/radio/integrated/signal
|
|
var/frequency = 1457
|
|
var/code = 30.0
|
|
var/last_transmission
|
|
var/datum/radio_frequency/radio_connection
|
|
|
|
/obj/item/radio/integrated/signal/New()
|
|
..()
|
|
if(radio_controller)
|
|
initialize()
|
|
|
|
/obj/item/radio/integrated/signal/Destroy()
|
|
if(radio_controller)
|
|
radio_controller.remove_object(src, frequency)
|
|
..()
|
|
|
|
/obj/item/radio/integrated/signal/initialize()
|
|
if (src.frequency < 1200 || src.frequency > 1600)
|
|
src.frequency = sanitize_frequency(src.frequency)
|
|
|
|
set_frequency(frequency)
|
|
|
|
/obj/item/radio/integrated/signal/proc/set_frequency(new_frequency)
|
|
radio_controller.remove_object(src, frequency)
|
|
frequency = new_frequency
|
|
radio_connection = radio_controller.add_object(src, frequency)
|
|
|
|
/obj/item/radio/integrated/signal/proc/send_signal(message="ACTIVATE")
|
|
|
|
if(last_transmission && world.time < (last_transmission + 5))
|
|
return
|
|
last_transmission = world.time
|
|
|
|
var/time = time2text(world.realtime,"hh:mm:ss")
|
|
var/turf/T = get_turf(src)
|
|
lastsignalers.Add("[time] <B>:</B> [usr.key] used [src] @ location ([T.x],[T.y],[T.z]) <B>:</B> [format_frequency(frequency)]/[code]")
|
|
|
|
var/datum/signal/signal = new
|
|
signal.source = src
|
|
signal.encryption = code
|
|
signal.data["message"] = message
|
|
|
|
radio_connection.post_signal(src, signal)
|
|
|
|
return |