diff --git a/code/ATMOSPHERICS/components/binary_devices/dp_vent_pump.dm b/code/ATMOSPHERICS/components/binary_devices/dp_vent_pump.dm
index 86a87223eb..0561eda532 100644
--- a/code/ATMOSPHERICS/components/binary_devices/dp_vent_pump.dm
+++ b/code/ATMOSPHERICS/components/binary_devices/dp_vent_pump.dm
@@ -36,6 +36,10 @@
var/frequency = 0
var/id = null
var/datum/radio_frequency/radio_connection
+//YW EDIT: aac start
+ var/advcontrol = 0//does this device listen to the AAC
+ settagwhitelist = list("id")
+//YW EDIT: aac end
var/pressure_checks = PRESSURE_CHECK_EXTERNAL
//1: Do not pass external_pressure_bound
@@ -264,6 +268,24 @@
broadcast_status()
update_icon()
+//YW EDIT: aac start
+/obj/machinery/atmospherics/binary/dp_vent_pump/multitool_menu(var/mob/user,var/obj/item/device/multitool/P)
+ return {"
+
+ "}
+/obj/machinery/atmospherics/binary/dp_vent_pump/multitool_topic(var/mob/user, var/list/href_list, var/obj/O)
+ . = ..()
+ if(.)
+ return .
+ if("toggleadvcontrol" in href_list)
+ advcontrol = !advcontrol
+ return TRUE
+//YW EDIT: aac end
+
#undef DEFAULT_PRESSURE_DELTA
#undef EXTERNAL_PRESSURE_BOUND
diff --git a/code/ATMOSPHERICS/components/unary/outlet_injector.dm b/code/ATMOSPHERICS/components/unary/outlet_injector.dm
index 5eeab2c8e4..dba3135f3e 100644
--- a/code/ATMOSPHERICS/components/unary/outlet_injector.dm
+++ b/code/ATMOSPHERICS/components/unary/outlet_injector.dm
@@ -164,6 +164,9 @@
update_icon()
/obj/machinery/atmospherics/unary/outlet_injector/attackby(var/obj/item/weapon/W as obj, var/mob/user as mob)
+ if(istype(W, /obj/item/device/multitool)) //YW EDIT: aac
+ update_multitool_menu(user)
+ return 1
if (!W.is_wrench())
return ..()
@@ -175,3 +178,12 @@
"You have unfastened \the [src].", \
"You hear a ratchet.")
deconstruct()
+//YW EDIT: aac start
+/obj/machinery/atmospherics/unary/outlet_injector/multitool_menu(var/mob/user,var/obj/item/multitool/P)
+ return {"
+
+"}
+//YW EDIT: aac end
\ No newline at end of file
diff --git a/code/ATMOSPHERICS/components/unary/vent_pump.dm b/code/ATMOSPHERICS/components/unary/vent_pump.dm
index 792d53d65d..efae3349f9 100644
--- a/code/ATMOSPHERICS/components/unary/vent_pump.dm
+++ b/code/ATMOSPHERICS/components/unary/vent_pump.dm
@@ -24,6 +24,11 @@
level = 1
var/area_uid
var/id_tag = null
+//YW EDIT: aac start
+ var/advcontrol = 0
+ Mtoollink = 1
+ settagwhitelist = list("id_tag")
+//YW EDIT: aac end
var/hibernate = 0 //Do we even process?
var/pump_direction = 1 //0 = siphoning, 1 = releasing
@@ -416,6 +421,9 @@
else
to_chat(user, "You need more welding fuel to complete this task.")
return 1
+ if(istype(W, /obj/item/device/multitool)) //YW EDIT: aac
+ update_multitool_menu(user)
+ return 1
else
..()
@@ -457,6 +465,37 @@
"You hear a ratchet.")
deconstruct()
+//YW EDIT: aac start
+/obj/machinery/atmospherics/unary/vent_pump/multitool_menu(var/mob/user,var/obj/item/device/multitool/P)
+ return {"
+
+ "}
+
+/obj/machinery/atmospherics/unary/vent_pump/multitool_topic(var/mob/user, var/list/href_list, var/obj/O)
+ if("toggleadvcontrol" in href_list)
+ advcontrol = !advcontrol
+ return TRUE
+
+ if("set_id" in href_list)
+ var/newid = copytext(reject_bad_text(input(usr, "Specify the new ID tag for this machine", src, src.id_tag) as null|text), 1, MAX_MESSAGE_LEN)
+ if(!newid)
+ return
+ if(frequency == 1439)
+ initial_loc.air_vent_info -= id_tag
+ initial_loc.air_vent_names -= id_tag
+
+ id_tag = newid
+ broadcast_status()
+
+ return TRUE
+
+ return ..()
+//YW EDIT: aac end
+
#undef DEFAULT_PRESSURE_DELTA
#undef EXTERNAL_PRESSURE_BOUND
diff --git a/code/ATMOSPHERICS/components/unary/vent_scrubber.dm b/code/ATMOSPHERICS/components/unary/vent_scrubber.dm
index 1443b296d0..d9b93a5009 100644
--- a/code/ATMOSPHERICS/components/unary/vent_scrubber.dm
+++ b/code/ATMOSPHERICS/components/unary/vent_scrubber.dm
@@ -17,6 +17,7 @@
var/id_tag = null
var/frequency = 1439
var/datum/radio_frequency/radio_connection
+ var/advcontrol = 0 //YW EDIT: aac
var/hibernate = 0 //Do we even process?
var/scrubbing = 1 //0 = siphoning, 1 = scrubbing
@@ -264,6 +265,9 @@
update_icon()
/obj/machinery/atmospherics/unary/vent_scrubber/attackby(var/obj/item/weapon/W as obj, var/mob/user as mob)
+ if(istype(W, /obj/item/device/multitool)) //YW EDIT: aac
+ update_multitool_menu(user)
+ return 1
if (!W.is_wrench())
return ..()
if (!(stat & NOPOWER) && use_power)
@@ -292,3 +296,14 @@
. += "A small gauge in the corner reads [round(last_flow_rate, 0.1)] L/s; [round(last_power_draw)] W"
else
. += "You are too far away to read the gauge."
+
+//YW EDIT: aac start
+/obj/machinery/atmospherics/unary/vent_scrubber/multitool_menu(var/mob/user,var/obj/item/multitool/P)
+ return {"
+
+ "}
+//YW EDIT: aac end
\ No newline at end of file
diff --git a/code/ATMOSPHERICS/components/valve.dm b/code/ATMOSPHERICS/components/valve.dm
index 3ded7b7388..0ff9f105a2 100644
--- a/code/ATMOSPHERICS/components/valve.dm
+++ b/code/ATMOSPHERICS/components/valve.dm
@@ -226,6 +226,7 @@
var/frequency = 0
var/id = null
var/datum/radio_frequency/radio_connection
+ settagwhitelist = list("id") //YW EDIT: aac
/obj/machinery/atmospherics/valve/digital/Destroy()
unregister_radio(src, frequency)
@@ -288,6 +289,9 @@
open()
/obj/machinery/atmospherics/valve/attackby(var/obj/item/weapon/W as obj, var/mob/user as mob)
+ if(istype(W, /obj/item/device/multitool)) //YW EDIT: aac
+ update_multitool_menu(user)
+ return 1
if (!W.is_wrench())
return ..()
if (istype(src, /obj/machinery/atmospherics/valve/digital) && !src.allowed(user))
@@ -309,3 +313,13 @@
/obj/machinery/atmospherics/valve/examine(mob/user)
. = ..()
. += "It is [open ? "open" : "closed"]."
+
+//YW EDIT: aac start
+/obj/machinery/atmospherics/valve/digital/multitool_menu(var/mob/user,var/obj/item/multitool/P)
+ return {"
+
+ "}
+//YW EDIT: aac end
\ No newline at end of file
diff --git a/code/game/machinery/atmo_control.dm b/code/game/machinery/atmo_control.dm
index 2d87fcd45a..ee75570c39 100644
--- a/code/game/machinery/atmo_control.dm
+++ b/code/game/machinery/atmo_control.dm
@@ -3,6 +3,7 @@
icon_state = "gsensor1"
name = "Gas Sensor"
desc = "Senses atmospheric conditions."
+ settagwhitelist = list("id_tag") //YW EDIT: aac
anchored = 1
var/state = 0
@@ -11,6 +12,7 @@
var/frequency = 1439
var/on = 1
+ var/bolts = 1 //YW EDIT: aac
var/output = 3
//Flags:
// 1 for pressure
@@ -59,6 +61,63 @@
signal.data["sigtype"]="status"
radio_connection.post_signal(src, signal, radio_filter = RADIO_ATMOSIA)
+//YW EDIT: aac start
+/obj/machinery/air_sensor/multitool_menu(var/mob/user, var/obj/item/multitool/P)
+ return {"
+ Main
+ "}
+
+/obj/machinery/air_sensor/multitool_topic(var/mob/user, var/list/href_list, var/obj/O)
+ . = ..()
+ if(.)
+ return .
+
+ if("toggle_out_flag" in href_list)
+ var/bitflag_value = text2num(href_list["toggle_out_flag"])//this is a string normally
+ if(!(bitflag_value in list(1, 2, 4, 8, 16, 32))) //Here to prevent breaking the sensors with HREF exploits
+ return 0
+ if(output&bitflag_value)//the bitflag is on ATM
+ output &= ~bitflag_value
+ else//can't not be off
+ output |= bitflag_value
+ return TRUE
+ if("toggle_bolts" in href_list)
+ bolts = !bolts
+ if(bolts)
+ visible_message("You hear a quite click as the [src] bolts to the floor", "You hear a quite click")
+ else
+ visible_message("You hear a quite click as the [src]'s floor bolts raise", "You hear a quite click")
+ return TRUE
+
+/obj/machinery/air_sensor/attackby(var/obj/item/W as obj, var/mob/user as mob)
+ if(istype(W, /obj/item/device/multitool))
+ update_multitool_menu(user)
+ return 1
+ if(istype(W, /obj/item/weapon/tool/wrench))
+ if(bolts)
+ to_chat(usr, "The [src] is bolted to the floor! You can't detach it like this.")
+ return 1
+ playsound(loc, W.usesound, 50, 1)
+ to_chat(user, "You begin to unfasten \the [src]...")
+ if(do_after(user, 40 * W.toolspeed, target = src))
+ user.visible_message("[user] unfastens \the [src].", "You have unfastened \the [src].", "You hear ratchet.")
+ new /obj/item/pipe_gsensor(src.loc)
+ qdel(src)
+ return 1
+ return
+ return ..()
+//YW EDIT: aac end
+
/obj/machinery/air_sensor/proc/set_frequency(new_frequency)
radio_controller.remove_object(src, frequency)
frequency = new_frequency
@@ -90,6 +149,14 @@ obj/machinery/computer/general_air_control/Destroy()
radio_controller.remove_object(src, frequency)
..()
+//YW EDIT: aac start
+/obj/machinery/computer/general_air_control/attackby(I as obj, user as mob, params)
+ if(istype(I, /obj/item/device/multitool))
+ update_multitool_menu(user)
+ return 1
+ return ..()
+//YW EDIT: aac end
+
/obj/machinery/computer/general_air_control/attack_hand(mob/user)
if(..(user))
return
@@ -135,13 +202,110 @@ obj/machinery/computer/general_air_control/Destroy()
if(frequency)
set_frequency(frequency)
+//YW EDIT: aac start
+/obj/machinery/computer/general_air_control/multitool_menu(mob/user, obj/item/multitool/P)
+ var/dat= {"
+ Main
+
+ Sensors:
+ "}
+ return dat
+
+/obj/machinery/computer/general_air_control/multitool_topic(mob/user,list/href_list,obj/O)
+ . = ..()
+ if(.) return .
+ if("add_sensor" in href_list)
+
+ // Make a list of all available sensors on the same frequency
+ var/list/sensor_list = list()
+ for(var/obj/machinery/air_sensor/G)
+ if(!isnull(G.id_tag) && G.frequency == frequency)
+ sensor_list|=G.id_tag
+ if(!sensor_list.len)
+ to_chat(user, "No sensors on this frequency.")
+ return FALSE
+
+ // Have the user pick one of them and name its label
+ var/sensor = input(user, "Select a sensor:", "Sensor Data") as null|anything in sensor_list
+ if(!sensor)
+ return FALSE
+ var/label = sanitize(input(user, "Choose a sensor label:", "Sensor Label") as text|null)
+ if(!label)
+ return FALSE
+
+ // Add the sensor's information to general_air_controler
+ sensors[sensor] = label
+ return TRUE
+
+ if("edit_sensor" in href_list)
+ var/list/sensor_list = list()
+ for(var/obj/machinery/air_sensor/G)
+ if(!isnull(G.id_tag) && G.frequency == frequency)
+ sensor_list|=G.id_tag
+ if(!sensor_list.len)
+ to_chat(user, "No sensors on this frequency.")
+ return FALSE
+ var/label = sensors[href_list["edit_sensor"]]
+ var/sensor = input(user, "Select a sensor:", "Sensor Data", href_list["edit_sensor"]) as null|anything in sensor_list
+ if(!sensor)
+ return FALSE
+ sensors.Remove(href_list["edit_sensor"])
+ sensors[sensor] = label
+ return TRUE
+
+/obj/machinery/computer/general_air_control/unlinkFrom(mob/user, obj/O)
+ ..()
+ if("id_tag" in O.vars && (istype(O,/obj/machinery/air_sensor) || istype(O, /obj/machinery/meter)))
+ sensors.Remove(O:id_tag)
+ return 1
+ return 0
+
+/obj/machinery/computer/general_air_control/linkMenu(obj/O)
+ if(isLinkedWith(O))
+ return
+
+ var/dat=""
+
+ if(istype(O,/obj/machinery/air_sensor) || istype(O, /obj/machinery/meter))
+ dat += " \[New Sensor\] "
+ return dat
+
+/obj/machinery/computer/general_air_control/canLink(obj/O, list/context)
+ if(istype(O,/obj/machinery/air_sensor) || istype(O, /obj/machinery/meter))
+ return O:id_tag
+
+/obj/machinery/computer/general_air_control/isLinkedWith(obj/O)
+ if(istype(O,/obj/machinery/air_sensor) || istype(O, /obj/machinery/meter))
+ return O:id_tag in sensors
+
+/obj/machinery/computer/general_air_control/linkWith(mob/user, obj/O, link/context)
+ sensors[O:id_tag] = sanitize(input(user, "Choose a sensor label:", "Sensor Label") as text|null)
+ return 1
+//YW EDIT: aac end
+
/obj/machinery/computer/general_air_control/large_tank_control
icon = 'icons/obj/computer.dmi'
frequency = 1441
+ settagwhitelist = list("input_tag", "output_tag") //YW EDIT: aac
var/input_tag
var/output_tag
var/list/input_info
var/list/output_info
+//YW EDIT: aac start
+ var/list/input_linkable=list(
+ /obj/machinery/atmospherics/unary/outlet_injector,
+ /obj/machinery/atmospherics/unary/vent_pump
+ )
+
+ var/list/output_linkable=list(
+ /obj/machinery/atmospherics/unary/vent_pump
+ )
+//YW EDIT: aac end
var/input_flow_setting = 200
var/pressure_setting = ONE_ATMOSPHERE * 45
circuit = /obj/item/weapon/circuitboard/air_management/tank_control
@@ -234,6 +398,78 @@ obj/machinery/computer/general_air_control/Destroy()
signal.data["sigtype"]="command"
radio_connection.post_signal(src, signal, radio_filter = RADIO_ATMOSIA)
+//YW EDIT: aac start
+/obj/machinery/computer/general_air_control/large_tank_control/attackby(I as obj, user as mob)
+ if(istype(I, /obj/item/device/multitool))
+ update_multitool_menu(user)
+ return 1
+ return ..()
+
+/obj/machinery/computer/general_air_control/large_tank_control/multitool_menu(mob/user, obj/item/multitool/P)
+ var/dat= {"
+
+ Sensors:
+ "}
+ return dat
+
+
+/*/obj/machinery/computer/general_air_control/large_tank_control/linkWith(mob/user, obj/O, list/context)
+ if(context["slot"]=="input" && is_type_in_list(O,input_linkable))
+ input_info = null
+ if(istype(O,/obj/machinery/atmospherics/unary/vent_pump))
+ send_signal(list("tag"=input_tag,
+ "direction"=1, // Release
+ "checks" =0 // No pressure checks.
+ ))
+ return 1
+ if(context["slot"]=="output" && is_type_in_list(O,output_linkable))
+ output_tag = O:id_tag
+ output_info = null
+ if(istype(O,/obj/machinery/atmospherics/unary/vent_pump))
+ send_signal(list("tag"=output_tag,
+ "direction"=0, // Siphon
+ "checks" =2 // Internal pressure checks.
+ ))
+ return 1*/
+
+/obj/machinery/computer/general_air_control/large_tank_control/unlinkFrom(mob/user, obj/O)
+ if("id_tag" in O.vars)
+ if(O:id_tag == input_tag)
+ input_tag=null
+ input_info=null
+ return 1
+ if(O:id_tag == output_tag)
+ output_tag=null
+ output_info=null
+ return 1
+ return 0
+
+/obj/machinery/computer/general_air_control/large_tank_control/linkMenu(obj/O)
+ var/dat=""
+ if(canLink(O,list("slot"="input")))
+ dat += " \[Link @ Input\] "
+ if(canLink(O,list("slot"="output")))
+ dat += " \[Link @ Output\] "
+ return dat
+
+/obj/machinery/computer/general_air_control/large_tank_control/canLink(obj/O, list/context)
+ return (context["slot"]=="input" && is_type_in_list(O,input_linkable)) || (context["slot"]=="output" && is_type_in_list(O,output_linkable))
+
+/obj/machinery/computer/general_air_control/large_tank_control/isLinkedWith(obj/O)
+ if(O:id_tag == input_tag)
+ return 1
+ if(O:id_tag == output_tag)
+ return 1
+ return 0
+//YW EDIT: aac end
+
/obj/machinery/computer/general_air_control/supermatter_core
icon = 'icons/obj/computer.dmi'
frequency = 1438
diff --git a/code/game/machinery/machinery.dm b/code/game/machinery/machinery.dm
index e410914bee..036332dbc0 100644
--- a/code/game/machinery/machinery.dm
+++ b/code/game/machinery/machinery.dm
@@ -111,6 +111,7 @@ Class Procs:
var/clickvol = 40 // volume
var/interact_offline = 0 // Can the machine be interacted with while de-powered.
var/obj/item/weapon/circuitboard/circuit = null
+ var/list/settagwhitelist = list()//WHITELIST OF VARIABLES THAT THE set_tag HREF CAN MODIFY, DON'T PUT SHIT YOU DON'T NEED ON HERE, AND IF YOU'RE GONNA USE set_tag (format_tag() proc), ADD TO THIS LIST.
var/speed_process = FALSE //If false, SSmachines. If true, SSfastprocess.
@@ -480,3 +481,118 @@ Class Procs:
/datum/proc/remove_visual(mob/M)
return
+
+//YW EDIT: aac start
+/obj/machinery/Topic(href, href_list)
+ if(!interact_offline && (stat & (NOPOWER | BROKEN)))
+ return STATUS_CLOSE
+
+ handle_multitool_topic(href,href_list,usr)
+ add_fingerprint(usr)
+ return 0
+
+/obj/machinery/proc/handle_multitool_topic(var/href, var/list/href_list, var/mob/user)
+ if(!allowed(user))//no, not even HREF exploits
+ return FALSE
+ var/obj/item/device/multitool/P = get_multitool(user)
+ to_chat(world, "[P]")
+ if(P && istype(P,/obj/item/device/multitool))
+ to_chat(world, "LABAXURIAS LABALĂ")
+ var/update_mt_menu = FALSE
+ if(href_list["set_tag"])
+ if(!(href_list["set_tag"] in settagwhitelist))//I see you're trying Href exploits, I see you're failing, I SEE ADMIN WARNING. (seriously though, this is a powerfull HREF, I originally found this loophole, I'm not leaving it in on my PR)
+ message_admins("set_tag HREF (var attempted to edit: [href_list["set_tag"]]) exploit attempted by [key_name_admin(user)] on [src] (JMP)")
+ return FALSE
+ if(!(href_list["set_tag"] in vars))
+ to_chat(usr, "Something went wrong: Unable to find [href_list["set_tag"]] in vars!")
+ return FALSE
+ var/current_tag = vars[href_list["set_tag"]]
+ var/newid = copytext(reject_bad_text(input(usr, "Specify the new value", src, current_tag) as null|text),1,MAX_MESSAGE_LEN)
+ if(newid)
+ vars[href_list["set_tag"]] = newid
+ update_mt_menu = TRUE
+
+ if(href_list["unlink"])
+ var/idx = text2num(href_list["unlink"])
+ if(!idx)
+ return FALSE
+
+ var/obj/O = getLink(idx)
+ if(!O)
+ return FALSE
+ if(!canLink(O))
+ to_chat(usr, "You can't link with that device.")
+ return FALSE
+
+ if(unlinkFrom(usr, O))
+ to_chat(usr, "A green light flashes on \the [P], confirming the link was removed.")
+ else
+ to_chat(usr, "A red light flashes on \the [P]. It appears something went wrong when unlinking the two devices.")
+ update_mt_menu = TRUE
+
+ if(href_list["link"])
+ var/obj/O = P.buffer
+ if(!O)
+ return FALSE
+ if(!canLink(O,href_list))
+ to_chat(usr, "You can't link with that device.")
+ return FALSE
+ if(isLinkedWith(O))
+ to_chat(usr, "A red light flashes on \the [P]. The two devices are already linked.")
+ return FALSE
+
+ if(linkWith(usr, O, href_list))
+ to_chat(usr, "A green light flashes on \the [P], confirming the link was added.")
+ else
+ to_chat(usr, "A red light flashes on \the [P]. It appears something went wrong when linking the two devices.")
+ update_mt_menu = TRUE
+
+ if(href_list["buffer"])
+ P.buffer = src
+ to_chat(usr, "A green light flashes, and the device appears in the multitool buffer.")
+ update_mt_menu = TRUE
+
+ if(href_list["flush"])
+ to_chat(usr, "A green light flashes, and the device disappears from the multitool buffer.")
+ P.buffer = null
+ update_mt_menu = TRUE
+
+ var/ret = multitool_topic(usr,href_list,P.buffer)
+ if(ret)
+ update_mt_menu = TRUE
+
+ if(update_mt_menu)
+ update_multitool_menu(usr)
+ return TRUE
+
+/obj/machinery/proc/multitool_topic(var/mob/user,var/list/href_list,var/obj/O)
+ if(href_list["set_id"])
+ if(!("id_tag" in vars) && !("id" in vars))
+ warning("set_id: [type] has no id_tag or id var.")
+ var/newid
+ if("id_tag" in vars)
+ newid = copytext(reject_bad_text(input(usr, "Specify the new ID tag for this machine", src, src:id_tag) as null|text),1,MAX_MESSAGE_LEN)
+ if(newid)
+ src:id_tag = newid
+ return TRUE
+ else if("id" in vars)
+ newid = copytext(reject_bad_text(input(usr, "Specify the new ID tag for this machine", src, src:id) as null|text),1,MAX_MESSAGE_LEN)
+ if(newid)
+ src:id = newid
+ return TRUE
+ if(href_list["set_freq"])
+ if(!("frequency" in vars))
+ warning("set_freq: [type] has no frequency var.")
+ return FALSE
+ var/newfreq=src:frequency
+ if(href_list["set_freq"]!="-1")
+ newfreq=text2num(href_list["set_freq"])
+ else
+ newfreq = input(usr, "Specify a new frequency (GHz). Decimals assigned automatically.", src, src:frequency) as null|num
+ if(newfreq)
+ if(findtext(num2text(newfreq), "."))
+ newfreq *= 10 // shift the decimal one place
+ src:frequency = sanitize_frequency(newfreq, RADIO_LOW_FREQ, RADIO_HIGH_FREQ)
+ return TRUE
+ return FALSE
+//YW EDIT: aac end
\ No newline at end of file
diff --git a/code/game/machinery/pipe/construction.dm b/code/game/machinery/pipe/construction.dm
index f5f2532080..14347e5a98 100644
--- a/code/game/machinery/pipe/construction.dm
+++ b/code/game/machinery/pipe/construction.dm
@@ -280,3 +280,27 @@ Buildable meters
/obj/item/pipe_meter/proc/setAttachLayer(new_layer = PIPING_LAYER_DEFAULT)
piping_layer = new_layer
+
+//YW EDIT: aac start
+/obj/item/pipe_gsensor
+ name = "gas sensor"
+ desc = "A sensor that can be hooked to a computer"
+ icon = 'icons/obj/pipe-item.dmi'
+ icon_state = "gsensor"
+ item_state = "buildpipe"
+ w_class = ITEMSIZE_LARGE
+
+/obj/item/pipe_gsensor/attackby(var/obj/item/weapon/W as obj, var/mob/user as mob)
+ if(W.is_wrench())
+ return wrench_act(user, W)
+ return ..()
+
+/obj/item/pipe_gsensor/proc/wrench_act(var/mob/living/user, var/obj/item/weapon/tool/wrench/W)
+ //if(!(/turf in loc))
+ //to_chat(user, "You need to fasten it to a floor.")
+ //return TRUE
+ new /obj/machinery/air_sensor(loc)
+ playsound(src, W.usesound, 50, 1)
+ to_chat(user, "You have fastened the gas sensor.")
+ qdel(src)
+//YW EDIT: aac end
\ No newline at end of file
diff --git a/code/game/machinery/pipe/pipe_dispenser.dm b/code/game/machinery/pipe/pipe_dispenser.dm
index 0d5e42f771..b600dbfc18 100644
--- a/code/game/machinery/pipe/pipe_dispenser.dm
+++ b/code/game/machinery/pipe/pipe_dispenser.dm
@@ -99,6 +99,8 @@
created_object = C
else if(istype(recipe, /datum/pipe_recipe/meter))
created_object = new recipe.pipe_type(loc)
+ else if(istype(recipe, /datum/pipe_recipe/air_sensor)) //YW EDIT: aac
+ created_object = new recipe.pipe_type(loc)
else
log_runtime(EXCEPTION("Warning: [usr] attempted to spawn pipe recipe type by params [json_encode(params)] ([recipe] [recipe?.type]), but it was not allowed by this machine ([src] [type])"))
return
diff --git a/code/game/machinery/pipe/pipe_recipes.dm b/code/game/machinery/pipe/pipe_recipes.dm
index 4175efc3ff..588efc6309 100644
--- a/code/game/machinery/pipe/pipe_recipes.dm
+++ b/code/game/machinery/pipe/pipe_recipes.dm
@@ -35,6 +35,7 @@ GLOBAL_LIST_INIT(atmos_pipe_recipes, list(
new /datum/pipe_recipe/pipe("Gas Mixer 'T'", /obj/machinery/atmospherics/trinary/mixer/t_mixer),
new /datum/pipe_recipe/pipe("Omni Gas Mixer", /obj/machinery/atmospherics/omni/mixer),
new /datum/pipe_recipe/pipe("Omni Gas Filter", /obj/machinery/atmospherics/omni/atmos_filter),
+ new /datum/pipe_recipe/air_sensor("Gas Sensor", /obj/item/pipe_gsensor), //YW EDIT: aac
),
"Heat Exchange" = list(
new /datum/pipe_recipe/pipe("Pipe", /obj/machinery/atmospherics/pipe/simple/heat_exchanging),
@@ -138,6 +139,19 @@ GLOBAL_LIST_INIT(disposal_pipe_recipes, list(
// YW Edit: Add HE pipes to non-paintable objects list.
paintable = ispath(path, /obj/machinery/atmospherics/pipe) && !(ispath(path, /obj/machinery/atmospherics/pipe/vent)) && !(ispath(path, /obj/machinery/atmospherics/pipe/simple/heat_exchanging)) // VOREStation Add
+//YW EDIT: aac start
+/datum/pipe_recipe/air_sensor
+ dirtype = PIPE_ONEDIR
+ icon_state = "gsensor"
+ pipe_type = /obj/item/pipe_gsensor
+
+/datum/pipe_recipe/air_sensor/New(label)
+ name = label
+/*
+/datum/pipe_recipe/air_sensor/Params()
+ return "makesensor=1"
+*/
+//YW EDIT: aac stop
//
// Subtype for meters
diff --git a/code/game/machinery/telecomms/machine_interactions.dm b/code/game/machinery/telecomms/machine_interactions.dm
index b4edf1d470..68625ace7d 100644
--- a/code/game/machinery/telecomms/machine_interactions.dm
+++ b/code/game/machinery/telecomms/machine_interactions.dm
@@ -46,6 +46,7 @@
data["on"] = on
data["id"] = null
+ data["tag"] = null //YW EDIT: aac
data["network"] = null
data["autolinkers"] = FALSE
data["shadowlink"] = FALSE
@@ -57,6 +58,7 @@
if(on || interact_offline)
data["id"] = id
+ data["tag"] = tag //YW EDIT: aac
data["network"] = network
data["autolinkers"] = !!LAZYLEN(autolinkers)
data["shadowlink"] = !!hide
@@ -68,7 +70,7 @@
data["multitool_buffer"] = null
if(P && P.buffer)
P.update_icon()
- data["multitool_buffer"] = list("name" = "[P.buffer]", "id" = "[P.buffer.id]")
+ data["multitool_buffer"] = list("name" = "[P.buffer]", "id" = "[P.buffer.id]", "tag" = "[P.buffer.id_tag]") //YW EDIT: aac
var/i = 0
data["linked"] = list()
@@ -341,11 +343,11 @@
if("link")
if(P)
if(P.buffer && P.buffer != src)
- if(!(src in P.buffer.links))
+ /*if(!(src in P.buffer.links)) //YW EDIT: aac
P.buffer.links.Add(src)
if(!(P.buffer in src.links))
- src.links.Add(P.buffer)
+ src.links.Add(P.buffer)*/
set_temp("-% Successfully linked with \ref[P.buffer] [P.buffer.name] %-", "average")
diff --git a/code/game/machinery/telecomms/telecomunications.dm b/code/game/machinery/telecomms/telecomunications.dm
index 6f2e626a00..42e9fe53af 100644
--- a/code/game/machinery/telecomms/telecomunications.dm
+++ b/code/game/machinery/telecomms/telecomunications.dm
@@ -22,6 +22,7 @@ var/global/list/obj/machinery/telecomms/telecomms_list = list()
var/netspeed = 5 // how much traffic to lose per tick (50 gigabytes/second * netspeed)
var/list/autolinkers = list() // list of text/number values to link with
var/id = "NULL" // identification string
+ var/id_tag = "NULL" //YW EDIT: aacs
var/network = "NULL" // the network of the machinery
var/list/freq_listening = list() // list of frequencies to tune into: if none, will listen to all
diff --git a/code/game/objects/items/weapons/RPD_vr.dm b/code/game/objects/items/weapons/RPD_vr.dm
index d15236e7e7..31074461ac 100644
--- a/code/game/objects/items/weapons/RPD_vr.dm
+++ b/code/game/objects/items/weapons/RPD_vr.dm
@@ -216,6 +216,13 @@
PM.setAttachLayer(queued_piping_layer)
if(mode & WRENCH_MODE)
do_wrench(PM, user)
+ else if(istype(recipe, /datum/pipe_recipe/air_sensor)) //YW EDIT: aac
+ to_chat(user, "You start building a sensor...")
+ if(do_after(user, 2, target = A))
+ activate()
+ var/obj/item/pipe_gsensor/PM = new /obj/item/pipe_gsensor(get_turf(A))
+ if(WRENCH_MODE)
+ do_wrench(PM, user)
else if(istype(recipe, /datum/pipe_recipe/pipe))
var/datum/pipe_recipe/pipe/R = recipe
to_chat(user, "You start building a pipe...")
diff --git a/code/game/objects/objs.dm b/code/game/objects/objs.dm
index 046958a915..1d04b50771 100644
--- a/code/game/objects/objs.dm
+++ b/code/game/objects/objs.dm
@@ -18,6 +18,7 @@
var/preserve_item = 0 //whether this object is preserved when its owner goes into cryo-storage, gateway, etc
var/can_speak = 0 //For MMIs and admin trickery. If an object has a brainmob in its contents, set this to 1 to allow it to speak.
+ var/Mtoollink = 0 //YW EDIT: aac
var/show_examine = TRUE // Does this pop up on a mob when the mob is examined?
/obj/Destroy()
@@ -193,3 +194,86 @@
if(src)
step(src, pick(NORTH,SOUTH,EAST,WEST))
sleep(rand(2,4))
+
+//YW EDIT: aac start
+/obj/machinery/proc/multitool_menu(var/mob/user,var/obj/item/multitool/P)
+ return "NO MULTITOOL_MENU!"
+
+/obj/machinery/proc/linkWith(var/mob/user, var/obj/buffer, var/link/context)
+ return 0
+
+/obj/machinery/proc/unlinkFrom(var/mob/user, var/obj/buffer)
+ return 0
+
+/obj/machinery/proc/canLink(var/obj/O, var/link/context)
+ return 0
+
+/obj/machinery/proc/isLinkedWith(var/obj/O)
+ return 0
+
+/obj/machinery/proc/getLink(var/idx)
+ return null
+
+/obj/machinery/proc/linkMenu(var/obj/O)
+ var/dat=""
+ if(canLink(O, list()))
+ dat += " \[Link\] "
+ return dat
+
+/obj/machinery/proc/format_tag(var/label,var/varname, var/act="set_tag")
+ var/value = vars[varname]
+ if(!value || value=="")
+ value="-----"
+ return "[label]: [value]"
+
+
+/obj/machinery/proc/update_multitool_menu(mob/user as mob)
+ var/obj/item/device/multitool/P = get_multitool(user)
+
+ if(!istype(P))
+ return 0
+ var/dat = {"
+
+ [name] Configuration
+
+
+
+ [name]
+"}
+ if(allowed(user))//no, assistants, you're not ruining all vents on the station with just a multitool
+ dat += multitool_menu(user,P)
+ if(Mtoollink)
+ if(P)
+ if(P.buffer)
+ var/id = null
+ if("id_tag" in P.buffer.vars)
+ id = P.buffer:id_tag
+ else if("id" in P.buffer.vars)
+ id = P.buffer:id
+ dat += "MULTITOOL BUFFER: [P.buffer] [id ? "([id])" : ""]"
+
+ dat += linkMenu(P.buffer)
+
+ if(P.buffer)
+ dat += "\[Flush\]"
+ dat += "
"
+ else
+ dat += "MULTITOOL BUFFER: \[Add Machine\]
"
+ else
+ dat += "ACCESS DENIED"
+ dat += ""
+ user << browse(dat, "window=mtcomputer")
+ user.set_machine(src)
+ onclose(user, "mtcomputer")
+//YW EDIT: aac end
\ No newline at end of file
diff --git a/code/modules/power/singularity/emitter.dm b/code/modules/power/singularity/emitter.dm
index ea8b5cd230..0164ecde65 100644
--- a/code/modules/power/singularity/emitter.dm
+++ b/code/modules/power/singularity/emitter.dm
@@ -146,7 +146,11 @@
A.fire(dir2angle(dir))
/obj/machinery/power/emitter/attackby(obj/item/W, mob/user)
-
+//YW EDIT: aac start
+ if(istype(W, /obj/item/device/multitool))
+ update_multitool_menu(user)
+ return 1
+//YW EDIT: aac end
if(W.is_wrench())
if(active)
to_chat(user, "Turn off [src] first.")
@@ -288,4 +292,12 @@
return burst_delay
/obj/machinery/power/emitter/proc/get_emitter_beam()
- return new /obj/item/projectile/beam/emitter(get_turf(src))
\ No newline at end of file
+ return new /obj/item/projectile/beam/emitter(get_turf(src))
+//YW EDIT: aac start
+/obj/machinery/power/emitter/multitool_menu(var/mob/user,var/obj/item/multitool/P)
+ return {"
+
+ - [format_tag("ID Tag","id","set_id")]
+
+ "}
+//YW EDIT: aac end
\ No newline at end of file
diff --git a/icons/obj/pipe-item.dmi b/icons/obj/pipe-item.dmi
index 66ab7e2646..6cca0bebce 100644
Binary files a/icons/obj/pipe-item.dmi and b/icons/obj/pipe-item.dmi differ