mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-07-12 08:36:00 +01:00
Merge pull request #8841 from GunHog/Bot_Radio_And_Newscasters
Bot fixes and PDA upgrades!
This commit is contained in:
@@ -173,12 +173,7 @@ var/const/RADIO_CHAT = "3" //deprecated
|
||||
var/const/RADIO_ATMOSIA = "4"
|
||||
var/const/RADIO_NAVBEACONS = "5"
|
||||
var/const/RADIO_AIRLOCK = "6"
|
||||
var/const/RADIO_SECBOT = "7"
|
||||
var/const/RADIO_MULEBOT = "8"
|
||||
var/const/RADIO_MAGNETS = "9"
|
||||
var/const/RADIO_CLEANBOT = "10"
|
||||
var/const/RADIO_FLOORBOT = "11"
|
||||
var/const/RADIO_MEDBOT = "12"
|
||||
|
||||
/datum/radio_frequency
|
||||
|
||||
|
||||
@@ -48,8 +48,6 @@
|
||||
var/beacon_freq = 1445 // navigation beacon frequency
|
||||
var/control_freq = 1447 // bot control frequency
|
||||
|
||||
var/bot_filter // The radio filter the bot uses to identify itself on the network.
|
||||
|
||||
var/bot_type = 0 //The type of bot it is, for radio control.
|
||||
#define SEC_BOT 1 // Secutritrons (Beepsky) and ED-209s
|
||||
#define MULE_BOT 2 // MULEbots
|
||||
@@ -69,7 +67,7 @@
|
||||
#define BOT_SUMMON 6 // summoned by PDA
|
||||
#define BOT_CLEANING 7 // cleaning (cleanbots)
|
||||
#define BOT_REPAIRING 8 // repairing hull breaches (floorbots)
|
||||
#define BOT_MOVING 9 // for clean/floor bots, when moving.
|
||||
#define BOT_MOVING 9 // for clean/floor/med bots, when moving.
|
||||
#define BOT_HEALING 10 // healing people (medbots)
|
||||
#define BOT_RESPONDING 11 // responding to a call from the AI
|
||||
#define BOT_LOADING 12 // loading/unloading
|
||||
@@ -103,19 +101,19 @@
|
||||
set_custom_texts()
|
||||
Radio = new /obj/item/device/radio(src)
|
||||
Radio.listening = 0 //Makes bot radios transmit only so no one hears things while adjacent to one.
|
||||
spawn(5)
|
||||
add_to_beacons()
|
||||
|
||||
/obj/machinery/bot/Destroy()
|
||||
if(radio_controller)
|
||||
radio_controller.remove_object(src,beacon_freq)
|
||||
if(bot_filter)
|
||||
radio_controller.remove_object(src,control_freq)
|
||||
radio_controller.remove_object(src,control_freq)
|
||||
..()
|
||||
|
||||
/obj/machinery/bot/proc/add_to_beacons(bot_filter) //Master filter control for bots. Must be placed in the bot's local New() to support map spawned bots.
|
||||
/obj/machinery/bot/proc/add_to_beacons() //Master radio control for bots. Must be placed in the bot's local New() to support map spawned bots.
|
||||
if(radio_controller)
|
||||
radio_controller.add_object(src, beacon_freq, filter = RADIO_NAVBEACONS)
|
||||
if(bot_filter)
|
||||
radio_controller.add_object(src, control_freq, filter = bot_filter)
|
||||
radio_controller.add_object(src, control_freq)
|
||||
|
||||
|
||||
/obj/machinery/bot/proc/explode()
|
||||
@@ -376,12 +374,13 @@ obj/machinery/bot/proc/scan(var/scan_type, var/old_target, var/scan_range = DEFA
|
||||
for (var/scan in view (scan_range, src) ) //Search for something in range!
|
||||
if(!istype(scan, scan_type)) //Check that the thing we found is the type we want!
|
||||
continue //If not, keep searching!
|
||||
if( !(scan in ignore_list) && (scan != old_target) ) //Filter for blacklisted elements, usually unreachable or previously processed oness
|
||||
var/scan_result = process_scan(scan) //Some bots may require additional processing when a result is selected.
|
||||
if( scan_result )
|
||||
final_result = scan_result
|
||||
else
|
||||
continue //The current element failed assessment, move on to the next.
|
||||
if( (scan in ignore_list) || (scan == old_target) ) //Filter for blacklisted elements, usually unreachable or previously processed oness
|
||||
continue
|
||||
var/scan_result = process_scan(scan) //Some bots may require additional processing when a result is selected.
|
||||
if( scan_result )
|
||||
final_result = scan_result
|
||||
else
|
||||
continue //The current element failed assessment, move on to the next.
|
||||
return final_result
|
||||
|
||||
//When the scan finds a target, run bot specific processing to select it for the next step. Empty by default.
|
||||
@@ -405,8 +404,13 @@ obj/machinery/bot/proc/bot_move(var/dest, var/move_speed)
|
||||
if(!dest || !path || path.len == 0) //A-star failed or a path/destination was not set.
|
||||
path = list()
|
||||
return 0
|
||||
if(get_turf(src) == get_turf(dest)) //We have arrived, no need to move again.
|
||||
dest = get_turf(dest) //We must always compare turfs, so get the turf of the dest var if dest was originally something else.
|
||||
var/turf/last_node = get_turf(path[path.len]) //This is the turf at the end of the path, it should be equal to dest.
|
||||
if(get_turf(src) == dest) //We have arrived, no need to move again.
|
||||
return 1
|
||||
else if (dest != last_node) //The path should lead us to our given destination. If this is not true, we must stop.
|
||||
path = list()
|
||||
return 0
|
||||
var/success
|
||||
var/step_count = move_speed ? move_speed : speed //If a value is passed into move_speed, use that instead of the default speed var.
|
||||
if(step_count >= 1 && tries < 4)
|
||||
@@ -703,8 +707,6 @@ obj/machinery/bot/proc/start_patrol()
|
||||
|
||||
// send a radio signal with multiple data key/values
|
||||
/obj/machinery/bot/proc/post_signal_multiple(var/freq, var/list/keyval)
|
||||
if(!z || z != 1) //Bot control will only work on station.
|
||||
return
|
||||
var/datum/radio_frequency/frequency = radio_controller.return_frequency(freq)
|
||||
|
||||
if(!frequency) return
|
||||
@@ -718,8 +720,6 @@ obj/machinery/bot/proc/start_patrol()
|
||||
// world << "sent [key],[keyval[key]] on [freq]"
|
||||
if(signal.data["findbeacon"])
|
||||
frequency.post_signal(src, signal, filter = RADIO_NAVBEACONS)
|
||||
else if(signal.data["type"] == bot_type)
|
||||
frequency.post_signal(src, signal, filter = bot_filter)
|
||||
else
|
||||
frequency.post_signal(src, signal)
|
||||
|
||||
@@ -731,7 +731,8 @@ obj/machinery/bot/proc/start_patrol()
|
||||
"type" = bot_type,
|
||||
"name" = name,
|
||||
"loca" = get_area(src), // area
|
||||
"mode" = mode
|
||||
"mode" = mode,
|
||||
"sect" = z // z-level, or "sector"
|
||||
)
|
||||
post_signal_multiple(control_freq, kv)
|
||||
|
||||
|
||||
@@ -27,7 +27,6 @@
|
||||
var/blood = 1
|
||||
var/list/target_types = list()
|
||||
var/obj/effect/decal/cleanable/target
|
||||
var/obj/effect/decal/cleanable/oldtarget
|
||||
var/max_targets = 50 //Maximum number of targets a cleanbot can ignore.
|
||||
var/oldloc = null
|
||||
req_one_access = list(access_janitor, access_robotics)
|
||||
@@ -40,7 +39,6 @@
|
||||
var/next_dest_loc
|
||||
radio_frequency = SERV_FREQ //Service
|
||||
bot_type = CLEAN_BOT
|
||||
bot_filter = RADIO_CLEANBOT
|
||||
|
||||
/obj/machinery/bot/cleanbot/New()
|
||||
..()
|
||||
@@ -51,9 +49,6 @@
|
||||
botcard.access = J.get_access()
|
||||
prev_access = botcard.access
|
||||
|
||||
spawn(5)
|
||||
add_to_beacons(bot_filter)
|
||||
|
||||
/obj/machinery/bot/cleanbot/turn_on()
|
||||
..()
|
||||
icon_state = "cleanbot[on]"
|
||||
@@ -68,7 +63,6 @@
|
||||
..()
|
||||
ignore_list = list() //Allows the bot to clean targets it previously ignored due to being unreachable.
|
||||
target = null
|
||||
oldtarget = null
|
||||
oldloc = null
|
||||
|
||||
/obj/machinery/bot/cleanbot/set_custom_texts()
|
||||
@@ -163,21 +157,14 @@ text("<A href='?src=\ref[src];power=1'>[on ? "On" : "Off"]</A>"))
|
||||
visible_message("[src] makes an excited beeping booping sound!")
|
||||
|
||||
if(!target) //Search for cleanables it can see.
|
||||
target = scan(/obj/effect/decal/cleanable/, oldtarget)
|
||||
oldtarget = target
|
||||
target = scan(/obj/effect/decal/cleanable/)
|
||||
|
||||
if(!target)
|
||||
if(loc != oldloc)
|
||||
oldtarget = null
|
||||
if(!target && auto_patrol) //Search for cleanables it can see.
|
||||
if(mode == BOT_IDLE || mode == BOT_START_PATROL)
|
||||
start_patrol()
|
||||
|
||||
if(auto_patrol)
|
||||
if(mode == BOT_IDLE || mode == BOT_START_PATROL)
|
||||
start_patrol()
|
||||
|
||||
if(mode == BOT_PATROL)
|
||||
bot_patrol()
|
||||
|
||||
return
|
||||
if(mode == BOT_PATROL)
|
||||
bot_patrol()
|
||||
|
||||
if(target)
|
||||
if(!path || path.len == 0) //No path, need a new one
|
||||
|
||||
@@ -35,7 +35,6 @@
|
||||
var/shoot_sound = 'sound/weapons/Taser.ogg'
|
||||
radio_frequency = SEC_FREQ
|
||||
bot_type = SEC_BOT
|
||||
bot_filter = RADIO_SECBOT
|
||||
|
||||
|
||||
/obj/item/weapon/ed209_assembly
|
||||
@@ -62,8 +61,6 @@
|
||||
botcard.access = J.get_access()
|
||||
prev_access = botcard.access
|
||||
|
||||
|
||||
add_to_beacons(bot_filter)
|
||||
if(lasercolor)
|
||||
shot_delay = 6//Longer shot delay because JESUS CHRIST
|
||||
check_records = 0//Don't actively target people set to arrest
|
||||
|
||||
@@ -45,13 +45,11 @@
|
||||
var/nagged = 0 //Prevents the Floorbot nagging more than once per refill.
|
||||
var/max_targets = 50
|
||||
var/turf/target
|
||||
var/turf/oldtarget
|
||||
var/oldloc = null
|
||||
req_one_access = list(access_construction, access_robotics)
|
||||
var/targetdirection
|
||||
radio_frequency = ENG_FREQ //Engineering channel
|
||||
bot_type = FLOOR_BOT
|
||||
bot_filter = RADIO_FLOORBOT
|
||||
var/process_type //Determines what to do when process_scan() recieves a target. See process_scan() for details.
|
||||
#define HULL_BREACH 1
|
||||
#define BRIDGE_MODE 2
|
||||
@@ -67,9 +65,6 @@
|
||||
botcard.access = J.get_access()
|
||||
prev_access = botcard.access
|
||||
|
||||
spawn(5)
|
||||
add_to_beacons(bot_filter)
|
||||
|
||||
/obj/machinery/bot/floorbot/turn_on()
|
||||
. = ..()
|
||||
updateicon()
|
||||
@@ -83,7 +78,6 @@
|
||||
/obj/machinery/bot/floorbot/bot_reset()
|
||||
..()
|
||||
target = null
|
||||
oldtarget = null
|
||||
oldloc = null
|
||||
ignore_list = list()
|
||||
nagged = 0
|
||||
@@ -209,11 +203,11 @@
|
||||
|
||||
if(amount <= 0 && !target) //Out of tiles! We must refill!
|
||||
if(eattiles) //Configured to find and consume floortiles!
|
||||
target = scan(/obj/item/stack/tile/plasteel, oldtarget)
|
||||
target = scan(/obj/item/stack/tile/plasteel)
|
||||
process_type = null
|
||||
|
||||
if(!target && maketiles) //We did not manage to find any floor tiles! Scan for metal stacks and make our own!
|
||||
target = scan(/obj/item/stack/sheet/metal, oldtarget)
|
||||
target = scan(/obj/item/stack/sheet/metal)
|
||||
process_type = null
|
||||
return
|
||||
else
|
||||
@@ -232,24 +226,24 @@
|
||||
target = T
|
||||
|
||||
else //Find a space tile farther way!
|
||||
target = scan(/turf/space, oldtarget)
|
||||
target = scan(/turf/space)
|
||||
process_type = BRIDGE_MODE
|
||||
|
||||
if(!target)
|
||||
process_type = HULL_BREACH //Ensures the floorbot does not try to "fix" space areas or shuttle docking zones.
|
||||
target = scan(/turf/space, oldtarget)
|
||||
target = scan(/turf/space)
|
||||
|
||||
if(!target && replacetiles) //Finds a floor without a tile and gives it one.
|
||||
process_type = REPLACE_TILE //The target must be the floor and not a tile. The floor must not already have a floortile.
|
||||
target = scan(/turf/simulated/floor, oldtarget)
|
||||
target = scan(/turf/simulated/floor)
|
||||
|
||||
if(!target && fixfloors) //Repairs damaged floors and tiles.
|
||||
process_type = FIX_TILE
|
||||
target = scan(/turf/simulated/floor, oldtarget)
|
||||
target = scan(/turf/simulated/floor)
|
||||
|
||||
if(!target && emagged == 2) //We are emagged! Time to rip up the floors!
|
||||
process_type = TILE_EMAG
|
||||
target = scan(/turf/simulated/floor, oldtarget)
|
||||
target = scan(/turf/simulated/floor)
|
||||
|
||||
|
||||
if(!target)
|
||||
@@ -261,11 +255,6 @@
|
||||
if(mode == BOT_PATROL)
|
||||
bot_patrol()
|
||||
|
||||
if(!target)
|
||||
if(loc != oldloc)
|
||||
oldtarget = null
|
||||
return
|
||||
|
||||
if(target)
|
||||
if(path.len == 0)
|
||||
if(!istype(target, /turf/))
|
||||
@@ -276,12 +265,10 @@
|
||||
|
||||
if(!bot_move(target))
|
||||
add_to_ignore(target)
|
||||
oldtarget = target
|
||||
target = null
|
||||
mode = BOT_IDLE
|
||||
return
|
||||
else if( !bot_move(target) )
|
||||
oldtarget = target
|
||||
target = null
|
||||
mode = BOT_IDLE
|
||||
return
|
||||
|
||||
@@ -40,7 +40,6 @@
|
||||
var/treat_virus = 1 //If on, the bot will attempt to treat viral infections, curing them if possible.
|
||||
var/shut_up = 0 //self explanatory :)
|
||||
bot_type = MED_BOT
|
||||
bot_filter = RADIO_MEDBOT
|
||||
|
||||
/obj/machinery/bot/medbot/mysterious
|
||||
name = "\improper Mysterious Medibot"
|
||||
@@ -104,7 +103,6 @@
|
||||
else
|
||||
botcard.access = botcard_access
|
||||
prev_access = botcard.access
|
||||
add_to_beacons(bot_filter)
|
||||
|
||||
/obj/machinery/bot/medbot/turn_on()
|
||||
. = ..()
|
||||
@@ -124,6 +122,12 @@
|
||||
last_found = world.time
|
||||
declare_cooldown = 0
|
||||
|
||||
/obj/machinery/bot/medbot/proc/soft_reset() //Allows the medibot to still actively perform its medical duties without being completely halted as a hard reset does.
|
||||
path = list()
|
||||
patient = null
|
||||
mode = BOT_IDLE
|
||||
last_found = world.time
|
||||
|
||||
/obj/machinery/bot/medbot/set_custom_texts()
|
||||
|
||||
text_hack = "You corrupt [name]'s reagent processor circuits."
|
||||
@@ -271,7 +275,7 @@
|
||||
if (H.stat == 2)
|
||||
return
|
||||
|
||||
if ((H == oldpatient) && (world.time < last_found + 100))
|
||||
if ((H == oldpatient) && (world.time < last_found + 200))
|
||||
return
|
||||
|
||||
if(assess_patient(H))
|
||||
@@ -306,10 +310,7 @@
|
||||
|
||||
if(frustration > 8)
|
||||
oldpatient = patient
|
||||
patient = null
|
||||
mode = BOT_IDLE
|
||||
last_found = world.time
|
||||
path = list()
|
||||
soft_reset()
|
||||
|
||||
if(!patient)
|
||||
if(!shut_up && prob(1))
|
||||
@@ -334,21 +335,19 @@
|
||||
last_found = world.time
|
||||
|
||||
else if(stationary_mode && patient) //Since we cannot move in this mode, ignore the patient and wait for another.
|
||||
patient = null
|
||||
mode = BOT_IDLE
|
||||
last_found = world.time
|
||||
soft_reset()
|
||||
return
|
||||
|
||||
if(patient && path.len == 0 && (get_dist(src,patient) > 1))
|
||||
spawn(0)
|
||||
path = get_path_to(loc, get_turf(patient), /turf/proc/CardinalTurfsWithAccess, /turf/proc/Distance_cardinal, 0, 30,id=botcard)
|
||||
path = get_path_to(loc, get_turf(patient), /turf/proc/CardinalTurfsWithAccess, /turf/proc/Distance_cardinal, 0, 30,id=botcard)
|
||||
mode = BOT_MOVING
|
||||
if(!path.len) //Do not chase a patient we cannot reach.
|
||||
soft_reset()
|
||||
|
||||
if(path.len > 0 && patient)
|
||||
if(!bot_move(patient))
|
||||
oldpatient = patient
|
||||
patient = null
|
||||
mode = BOT_IDLE
|
||||
last_found = world.time
|
||||
soft_reset()
|
||||
return
|
||||
|
||||
if(path.len > 8 && patient)
|
||||
|
||||
@@ -23,7 +23,6 @@ var/global/mulebot_count = 0
|
||||
beacon_freq = 1400
|
||||
control_freq = 1447
|
||||
bot_type = MULE_BOT
|
||||
bot_filter = RADIO_MULEBOT
|
||||
blood_DNA = list()
|
||||
|
||||
suffix = ""
|
||||
@@ -71,8 +70,6 @@ var/global/mulebot_count = 0
|
||||
cell.maxcharge = 2000
|
||||
|
||||
spawn(5) // must wait for map loading to finish
|
||||
add_to_beacons(bot_filter)
|
||||
|
||||
mulebot_count += 1
|
||||
if(!suffix)
|
||||
suffix = "#[mulebot_count]"
|
||||
@@ -883,8 +880,6 @@ obj/machinery/bot/mulebot/bot_reset()
|
||||
//world << "sent [key],[keyval[key]] on [freq]"
|
||||
if (signal.data["findbeacon"])
|
||||
frequency.post_signal(src, signal, filter = RADIO_NAVBEACONS)
|
||||
else if (signal.data["type"] == MULE_BOT)
|
||||
frequency.post_signal(src, signal, filter = RADIO_MULEBOT)
|
||||
else
|
||||
frequency.post_signal(src, signal)
|
||||
|
||||
|
||||
@@ -25,7 +25,6 @@
|
||||
var/arrest_type = 0 //If true, don't handcuff
|
||||
radio_frequency = SEC_FREQ //Security channel
|
||||
bot_type = SEC_BOT
|
||||
bot_filter = RADIO_SECBOT
|
||||
|
||||
/obj/machinery/bot/secbot/beepsky
|
||||
name = "Officer Beep O'sky"
|
||||
@@ -58,7 +57,6 @@
|
||||
var/datum/job/detective/J = new/datum/job/detective
|
||||
botcard.access = J.get_access()
|
||||
prev_access = botcard.access
|
||||
add_to_beacons(bot_filter)
|
||||
|
||||
|
||||
/obj/machinery/bot/secbot/turn_on()
|
||||
|
||||
@@ -318,7 +318,7 @@ var/global/list/obj/item/device/pda/PDAs = list()
|
||||
dat += "<h4>Engineering Functions</h4>"
|
||||
dat += "<ul>"
|
||||
dat += "<li><a href='byond://?src=\ref[src];choice=43'><img src=pda_power.png> Power Monitor</a></li>"
|
||||
if(istype(cartridge.radio, /obj/item/radio/integrated/floorbot))
|
||||
if(cartridge.access_floorbots)
|
||||
dat += "<li><a href='byond://?src=\ref[src];choice=51'><img src=pda_floorbot.png> Floorbot Access</a></li>"
|
||||
dat += "</ul>"
|
||||
if (cartridge.access_medical)
|
||||
@@ -326,7 +326,7 @@ var/global/list/obj/item/device/pda/PDAs = list()
|
||||
dat += "<ul>"
|
||||
dat += "<li><a href='byond://?src=\ref[src];choice=44'><img src=pda_medical.png> Medical Records</a></li>"
|
||||
dat += "<li><a href='byond://?src=\ref[src];choice=Medical Scan'><img src=pda_scanner.png> [scanmode == 1 ? "Disable" : "Enable"] Medical Scanner</a></li>"
|
||||
if(istype(cartridge.radio, /obj/item/radio/integrated/medbot))
|
||||
if(cartridge.access_medbots)
|
||||
dat += "<li><a href='byond://?src=\ref[src];choice=52'><img src=pda_medbot.png> Medibot Access</a></li>"
|
||||
dat += "</ul>"
|
||||
else
|
||||
@@ -335,7 +335,7 @@ var/global/list/obj/item/device/pda/PDAs = list()
|
||||
dat += "<h4>Security Functions</h4>"
|
||||
dat += "<ul>"
|
||||
dat += "<li><a href='byond://?src=\ref[src];choice=45'><img src=pda_cuffs.png> Security Records</A></li>"
|
||||
if(istype(cartridge.radio, /obj/item/radio/integrated/beepsky))
|
||||
if(cartridge.access_secbots)
|
||||
dat += "<li><a href='byond://?src=\ref[src];choice=46'><img src=pda_cuffs.png> Security Bot Access</a></li>"
|
||||
dat += "</ul>"
|
||||
else dat += "</ul>"
|
||||
@@ -350,10 +350,12 @@ var/global/list/obj/item/device/pda/PDAs = list()
|
||||
dat += "<h4>Utilities</h4>"
|
||||
dat += "<ul>"
|
||||
if (cartridge)
|
||||
if(cartridge.access_multibots)
|
||||
dat += "<li><a href='byond://?src=\ref[src];choice=54'><img src=pda_medbot.png> Bots Access</a></li>"
|
||||
if (cartridge.access_janitor)
|
||||
dat += "<li><a href='byond://?src=\ref[src];choice=49'><img src=pda_bucket.png> Custodial Locator</a></li>"
|
||||
if(istype(cartridge.radio, /obj/item/radio/integrated/cleanbot))
|
||||
dat += "<li><a href='byond://?src=\ref[src];choice=50'><img src=pda_cleanbot.png> Cleanbot Access</a></li>"
|
||||
if(cartridge.access_cleanbots)
|
||||
dat += "<li><a href='byond://?src=\ref[src];choice=50'><img src=pda_cleanbot.png> Cleanbot Access</a></li>"
|
||||
if (istype(cartridge.radio, /obj/item/radio/integrated/signal))
|
||||
dat += "<li><a href='byond://?src=\ref[src];choice=40'><img src=pda_signaler.png> Signaler System</a></li>"
|
||||
if (cartridge.access_newscaster)
|
||||
|
||||
@@ -23,6 +23,11 @@
|
||||
var/access_status_display = 0
|
||||
var/access_quartermaster = 0
|
||||
var/access_hydroponics = 0
|
||||
var/access_secbots = 0
|
||||
var/access_medbots = 0
|
||||
var/access_floorbots = 0
|
||||
var/access_cleanbots = 0
|
||||
var/access_multibots = 0
|
||||
var/mode = null
|
||||
var/menu
|
||||
var/datum/data/record/active1 = null //General
|
||||
@@ -39,6 +44,7 @@
|
||||
name = "\improper Power-ON cartridge"
|
||||
icon_state = "cart-e"
|
||||
access_engine = 1
|
||||
access_floorbots = 1
|
||||
|
||||
/obj/item/weapon/cartridge/engineering/New()
|
||||
..()
|
||||
@@ -48,6 +54,7 @@
|
||||
name = "\improper BreatheDeep cartridge"
|
||||
icon_state = "cart-a"
|
||||
access_atmos = 1
|
||||
access_floorbots = 1
|
||||
|
||||
/obj/item/weapon/cartridge/atmos/New()
|
||||
..()
|
||||
@@ -57,6 +64,7 @@
|
||||
name = "\improper Med-U cartridge"
|
||||
icon_state = "cart-m"
|
||||
access_medical = 1
|
||||
access_medbots = 1
|
||||
|
||||
/obj/item/weapon/cartridge/medical/New()
|
||||
..()
|
||||
@@ -66,6 +74,7 @@
|
||||
name = "\improper ChemWhiz cartridge"
|
||||
icon_state = "cart-chem"
|
||||
access_reagent_scanner = 1
|
||||
access_medbots = 1
|
||||
|
||||
/obj/item/weapon/cartridge/chemistry/New()
|
||||
..()
|
||||
@@ -75,6 +84,7 @@
|
||||
name = "\improper R.O.B.U.S.T. cartridge"
|
||||
icon_state = "cart-s"
|
||||
access_security = 1
|
||||
access_secbots = 1
|
||||
|
||||
/obj/item/weapon/cartridge/security/New()
|
||||
..()
|
||||
@@ -86,6 +96,7 @@
|
||||
access_security = 1
|
||||
access_medical = 1
|
||||
access_manifest = 1
|
||||
access_secbots = 1
|
||||
|
||||
/obj/item/weapon/cartridge/detective/New()
|
||||
..()
|
||||
@@ -96,6 +107,7 @@
|
||||
desc = "The ultimate in clean-room design."
|
||||
icon_state = "cart-j"
|
||||
access_janitor = 1
|
||||
access_cleanbots = 1
|
||||
|
||||
/obj/item/weapon/cartridge/janitor/New()
|
||||
..()
|
||||
@@ -171,6 +183,7 @@
|
||||
access_quartermaster = 1
|
||||
access_janitor = 1
|
||||
access_security = 1
|
||||
access_newscaster = 1
|
||||
|
||||
/obj/item/weapon/cartridge/hop/New()
|
||||
..()
|
||||
@@ -182,6 +195,7 @@
|
||||
access_manifest = 1
|
||||
access_status_display = 1
|
||||
access_security = 1
|
||||
access_medbots = 1
|
||||
|
||||
/obj/item/weapon/cartridge/hos/New()
|
||||
..()
|
||||
@@ -194,6 +208,7 @@
|
||||
access_status_display = 1
|
||||
access_engine = 1
|
||||
access_atmos = 1
|
||||
access_floorbots = 1
|
||||
|
||||
/obj/item/weapon/cartridge/ce/New()
|
||||
..()
|
||||
@@ -206,6 +221,7 @@
|
||||
access_status_display = 1
|
||||
access_reagent_scanner = 1
|
||||
access_medical = 1
|
||||
access_medbots = 1
|
||||
|
||||
/obj/item/weapon/cartridge/cmo/New()
|
||||
..()
|
||||
@@ -225,7 +241,7 @@
|
||||
|
||||
/obj/item/weapon/cartridge/captain
|
||||
name = "\improper Value-PAK cartridge"
|
||||
desc = "Now with 200% more value!"
|
||||
desc = "Now with 250% more value!"
|
||||
icon_state = "cart-c"
|
||||
access_manifest = 1
|
||||
access_engine = 1
|
||||
@@ -234,10 +250,12 @@
|
||||
access_reagent_scanner = 1
|
||||
access_status_display = 1
|
||||
access_atmos = 1
|
||||
access_newscaster = 1
|
||||
access_multibots = 1
|
||||
|
||||
/obj/item/weapon/cartridge/captain/New()
|
||||
..()
|
||||
radio = new /obj/item/radio/integrated/beepsky(src)
|
||||
radio = new /obj/item/radio/integrated/multi(src)
|
||||
|
||||
/obj/item/weapon/cartridge/syndicate
|
||||
name = "\improper Detomatix cartridge"
|
||||
@@ -346,7 +364,7 @@
|
||||
return menu
|
||||
|
||||
|
||||
/obj/item/weapon/cartridge/proc/generate_menu()
|
||||
/obj/item/weapon/cartridge/proc/generate_menu(mob/user)
|
||||
switch(mode)
|
||||
if(40) //signaller
|
||||
menu = "<h4><img src=pda_signaler.png> Remote Signaling System</h4>"
|
||||
@@ -689,7 +707,7 @@ Code:
|
||||
menu += "<h4>Located Cleanbots:</h4>"
|
||||
|
||||
ldat = null
|
||||
for (var/obj/machinery/bot/cleanbot/B in world)
|
||||
for (var/obj/machinery/bot/cleanbot/B in SSbot.processing)
|
||||
var/turf/bl = get_turf(B)
|
||||
|
||||
if(bl)
|
||||
@@ -732,10 +750,23 @@ Code:
|
||||
if(!current)
|
||||
menu += "<h5> ERROR : NO CHANNEL FOUND </h5>"
|
||||
return
|
||||
var/i = 1
|
||||
for(var/datum/feed_message/msg in current.messages)
|
||||
menu +="-[msg.body] <BR><FONT SIZE=1>\[Story by <FONT COLOR='maroon'>[msg.author]</FONT>\]</FONT><BR>"
|
||||
menu +="<b><font size=1>[msg.comments.len] comment[msg.comments.len > 1 ? "s" : ""]</font></b><br>"
|
||||
if(msg.img)
|
||||
user << browse_rsc(msg.img, "tmp_photo[i].png")
|
||||
menu +="<img src='tmp_photo[i].png' width = '180'><BR>"
|
||||
i++
|
||||
for(var/datum/feed_comment/comment in msg.comments)
|
||||
menu +="<font size=1><small>[comment.body]</font><br><font size=1><small><small><small>[comment.author] [comment.time_stamp]</small></small></small></small></font><br>"
|
||||
menu += "<br> <A href='byond://?src=\ref[src];choice=Newscaster Message'>Post Message</a>"
|
||||
|
||||
if (54) // Beepsky, Medibot, Floorbot, and Cleanbot access
|
||||
menu = "<h4><img src=pda_medbot.png> Multi-Bot Interlink</h4>"
|
||||
var/obj/item/radio/integrated/multi/SC = radio
|
||||
bot_control(SC)
|
||||
|
||||
/obj/item/weapon/cartridge/Topic(href, href_list)
|
||||
..()
|
||||
|
||||
@@ -825,5 +856,5 @@ Code:
|
||||
|
||||
|
||||
|
||||
generate_menu()
|
||||
generate_menu(usr)
|
||||
print_to_host(menu)
|
||||
|
||||
@@ -8,7 +8,6 @@
|
||||
var/obj/machinery/bot/active // the active bot; if null, show bot list
|
||||
var/list/botstatus // the status signal sent by the bot
|
||||
var/bot_type //The type of bot it is.
|
||||
var/bot_filter //Determines which radio filter to use.
|
||||
|
||||
var/control_freq = 1447
|
||||
|
||||
@@ -19,9 +18,8 @@
|
||||
..()
|
||||
if (istype(loc.loc, /obj/item/device/pda))
|
||||
hostpda = loc.loc
|
||||
if (bot_filter)
|
||||
spawn(5)
|
||||
add_to_radio(bot_filter)
|
||||
spawn(5)
|
||||
add_to_radio()
|
||||
|
||||
/obj/item/radio/integrated/Destroy()
|
||||
if(radio_controller)
|
||||
@@ -30,7 +28,6 @@
|
||||
|
||||
/obj/item/radio/integrated/proc/post_signal(var/freq, var/key, var/value, var/key2, var/value2, var/key3, var/value3,var/key4, var/value4, s_filter)
|
||||
|
||||
//world << "Post: [freq]: [key]=[value], [key2]=[value2]"
|
||||
var/datum/radio_frequency/frequency = radio_controller.return_frequency(freq)
|
||||
|
||||
if(!frequency)
|
||||
@@ -63,13 +60,14 @@
|
||||
/obj/item/radio/integrated/receive_signal(datum/signal/signal)
|
||||
/*var/obj/item/device/pda/P = src.loc
|
||||
|
||||
|
||||
world << "recvd:[P] : [signal.source]"
|
||||
for(var/d in signal.data)
|
||||
world << "- [d] = [signal.data[d]]"
|
||||
*/
|
||||
if(signal.data["sect"] != ZLEVEL_STATION) //Only detect bots on the station! (Getting the current Z-level is too costly)
|
||||
return
|
||||
|
||||
if (signal.data["type"] == bot_type)
|
||||
if (signal.data["type"] & bot_type)
|
||||
if(!botlist)
|
||||
botlist = new()
|
||||
|
||||
@@ -88,44 +86,43 @@
|
||||
|
||||
if("control")
|
||||
active = locate(href_list["bot"])
|
||||
post_signal(control_freq, "command", "bot_status", "active", active, s_filter = bot_filter)
|
||||
post_signal(control_freq, "command", "bot_status", "active", active)
|
||||
|
||||
if("scanbots") // find all bots
|
||||
botlist = null
|
||||
post_signal(control_freq, "command", "bot_status", s_filter = bot_filter)
|
||||
post_signal(control_freq, "command", "bot_status")
|
||||
|
||||
if("botlist")
|
||||
active = null
|
||||
|
||||
if("stop", "go")
|
||||
post_signal(control_freq, "command", href_list["op"], "active", active, s_filter = bot_filter)
|
||||
post_signal(control_freq, "command", "bot_status", "active", active, s_filter = bot_filter)
|
||||
post_signal(control_freq, "command", href_list["op"], "active", active)
|
||||
post_signal(control_freq, "command", "bot_status", "active", active)
|
||||
|
||||
if("summon")
|
||||
post_signal(control_freq, "command", "summon", "active", active, "target", get_turf(PDA) , "useraccess", PDA.GetAccess(), s_filter = bot_filter)
|
||||
post_signal(control_freq, "command", "bot_status", "active", active, s_filter = bot_filter)
|
||||
post_signal(control_freq, "command", "summon", "active", active, "target", get_turf(PDA) , "useraccess", PDA.GetAccess())
|
||||
post_signal(control_freq, "command", "bot_status", "active", active)
|
||||
PDA.cartridge.unlock()
|
||||
|
||||
/obj/item/radio/integrated/proc/add_to_radio(bot_filter) //Master filter control for bots. Must be placed in the bot's local New() to support map spawned bots.
|
||||
/obj/item/radio/integrated/proc/add_to_radio()
|
||||
if(radio_controller)
|
||||
radio_controller.add_object(src, control_freq, filter = bot_filter)
|
||||
radio_controller.add_object(src, control_freq)
|
||||
|
||||
|
||||
/obj/item/radio/integrated/beepsky
|
||||
bot_filter = RADIO_SECBOT
|
||||
bot_type = SEC_BOT
|
||||
|
||||
/obj/item/radio/integrated/medbot
|
||||
bot_filter = RADIO_MEDBOT
|
||||
bot_type = MED_BOT
|
||||
|
||||
/obj/item/radio/integrated/floorbot
|
||||
bot_filter = RADIO_FLOORBOT
|
||||
bot_type = FLOOR_BOT
|
||||
|
||||
/obj/item/radio/integrated/cleanbot
|
||||
bot_filter = RADIO_CLEANBOT
|
||||
bot_type = CLEAN_BOT
|
||||
/obj/item/radio/integrated/multi
|
||||
bot_type = SEC_BOT|CLEAN_BOT|MED_BOT|FLOOR_BOT
|
||||
|
||||
|
||||
/obj/item/radio/integrated/mule
|
||||
//var/list/botlist = null // list of bots
|
||||
@@ -141,7 +138,7 @@
|
||||
..()
|
||||
spawn(5)
|
||||
if(radio_controller)
|
||||
radio_controller.add_object(src, control_freq, filter = RADIO_MULEBOT)
|
||||
radio_controller.add_object(src, control_freq)
|
||||
radio_controller.add_object(src, beacon_freq, filter = RADIO_NAVBEACONS)
|
||||
spawn(10)
|
||||
post_signal(beacon_freq, "findbeacon", "delivery", s_filter = RADIO_NAVBEACONS)
|
||||
@@ -203,28 +200,28 @@
|
||||
active = null
|
||||
|
||||
if("unload")
|
||||
post_signal(control_freq, cmd, "unload", s_filter = RADIO_MULEBOT)
|
||||
post_signal(control_freq, cmd, "unload")
|
||||
if("setdest")
|
||||
if(beacons)
|
||||
var/dest = input("Select Bot Destination", "Mulebot [active.suffix] Interlink", active.destination) as null|anything in beacons
|
||||
if(dest)
|
||||
post_signal(control_freq, cmd, "target", "destination", dest, s_filter = RADIO_MULEBOT)
|
||||
post_signal(control_freq, cmd, "target", "destination", dest)
|
||||
|
||||
if("retoff")
|
||||
post_signal(control_freq, cmd, "autoret", "value", 0, s_filter = RADIO_MULEBOT)
|
||||
post_signal(control_freq, cmd, "autoret", "value", 0)
|
||||
if("reton")
|
||||
post_signal(control_freq, cmd, "autoret", "value", 1, s_filter = RADIO_MULEBOT)
|
||||
post_signal(control_freq, cmd, "autoret", "value", 1)
|
||||
|
||||
if("pickoff")
|
||||
post_signal(control_freq, cmd, "autopick", "value", 0, s_filter = RADIO_MULEBOT)
|
||||
post_signal(control_freq, cmd, "autopick", "value", 0)
|
||||
|
||||
if("pickon")
|
||||
post_signal(control_freq, cmd, "autopick", "value", 1, s_filter = RADIO_MULEBOT)
|
||||
post_signal(control_freq, cmd, "autopick", "value", 1)
|
||||
|
||||
if("stop", "go", "home")
|
||||
post_signal(control_freq, cmd, href_list["op"], s_filter = RADIO_MULEBOT)
|
||||
post_signal(control_freq, cmd, href_list["op"])
|
||||
|
||||
post_signal(control_freq, cmd, "bot_status", s_filter = RADIO_MULEBOT)
|
||||
post_signal(control_freq, cmd, "bot_status")
|
||||
PDA.cartridge.unlock()
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user