Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

/vg/ multitool menu port & more buildable atmos equipment #12

Closed
wants to merge 35 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
68d5c75
VG multitool menu port
PJB3005 Nov 30, 2014
9e7c0af
vents + a code snippet I missed
PJB3005 Nov 30, 2014
0e695a0
scrubbers done
PJB3005 Nov 30, 2014
7fe3cc9
gas sensors
PJB3005 Nov 30, 2014
b461d41
Air injectors
PJB3005 Nov 30, 2014
63de476
Gas sensors & Air Injectors buildable
PJB3005 Nov 30, 2014
2512df8
couple of atmos consoles now have multitool menus
PJB3005 Nov 30, 2014
0820679
I forgot to make air injectors deconstructable
PJB3005 Nov 30, 2014
c2369d8
atmos automations console
PJB3005 Nov 30, 2014
7371352
fixes and old stupid code optimization
PJB3005 Dec 2, 2014
7da4e8e
fixes, AAC JSON exporting + improvements
PJB3005 Dec 10, 2014
27d2322
oops
PJB3005 Dec 10, 2014
906eb44
dp vents buildable + meters multitool menu
PJB3005 Dec 13, 2014
e2c03a5
merge conflict fix I hope
PJB3005 Dec 14, 2014
228db89
more things
PJB3005 Dec 14, 2014
244a8a1
menus require engi/atmos access, circuits buildable
PJB3005 Dec 14, 2014
fde4803
merge conflict fix mk2
PJB3005 Dec 15, 2014
a934d01
Cleanup, bugfixes, linkage menu now works
PJB3005 Dec 18, 2014
fd0e5c9
Revert "Cleanup, bugfixes, linkage menu now works"
PJB3005 Dec 18, 2014
8fc6e93
Revert "Revert "Cleanup, bugfixes, linkage menu now works""
PJB3005 Dec 18, 2014
861aed6
crap, I accidentally A thing, now if only github would be better at t…
PJB3005 Dec 18, 2014
ecd55a2
Merge remote-tracking branch 'upstream/master' into vg-masterrace
PJB3005 Dec 19, 2014
fe23439
merge fix
PJB3005 Dec 28, 2014
9cf5493
MERGE FIX
PJB3005 Jan 28, 2015
ddca11a
GITHUB STOP GLITCHING
PJB3005 Jan 28, 2015
0fb39ad
merge fix
PJB3005 Feb 7, 2015
5655a01
Fox -> fox
PJB3005 Feb 7, 2015
4d9a47d
Merge branch 'master' of https://github.com/PJB3005/Paradise-fork int…
Feb 13, 2015
873bbca
Fixes a SERIOUS loophole (allowed people to var edit with HREF exploi…
Feb 13, 2015
9d07ea4
Fixes Pipe dispenser
Feb 14, 2015
2f39861
Gas sensor improvements + less snowflaking
Feb 14, 2015
78bcadf
AAC balancing, the AAC now has a range of 8 tiles and for it to inter…
Feb 14, 2015
47c0c3b
Merge branch 'master' of https://github.com/ParadiseSS13/Paradise int…
Feb 15, 2015
6d09e36
AAC valve control + emitter message fix
Feb 15, 2015
e7fca77
AAC additions: can now control pressure settings for vents,
Feb 15, 2015
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
104 changes: 94 additions & 10 deletions code/ATMOSPHERICS/components/binary_devices/dp_vent_pump.dm
Original file line number Diff line number Diff line change
Expand Up @@ -5,31 +5,65 @@
//node2 is output port
//node1 is input port

req_one_access_txt = "24;10"

name = "Dual Port Air Vent"
desc = "Has a valve and pump attached to it. There are two ports."

level = 1

connect_types = list(1,2,3) //connects to regular, supply and scrubbers pipes
connect_types = list(1,2,3) //connects to regular, supply and scrubbers pipes

var/on = 0
var/pump_direction = 1 //0 = siphoning, 1 = releasing

var/external_pressure_bound = ONE_ATMOSPHERE
var/input_pressure_min = 0
var/output_pressure_max = 0

var/frequency = 0
var/id = null
var/frequency = 1439
var/id_tag = null
var/datum/radio_frequency/radio_connection
var/advcontrol = 0//does this device listen to the AAC

settagwhitelist = list("id_tag")

var/pressure_checks = 1
//1: Do not pass external_pressure_bound
//2: Do not pass input_pressure_min
//4: Do not pass output_pressure_max

/obj/machinery/atmospherics/binary/volume_pump/update_underlays()
if(..())
underlays.Cut()
var/turf/T = get_turf(src)
if(!istype(T))
return
add_underlay(T, node1, turn(dir, -180))
add_underlay(T, node2, dir)

/obj/machinery/atmospherics/binary/dp_vent_pump/multitool_menu(var/mob/user,var/obj/item/device/multitool/P)
return {"
<ul>
<li><b>Frequency:</b> <a href="?src=\ref[src];set_freq=-1">[format_frequency(frequency)] GHz</a> (<a href="?src=\ref[src];set_freq=[1439]">Reset</a>)</li>
<li><b>ID Tag:</b> <a href="?src=\ref[src];set_id=1">[id_tag]</a></li>
<li><b>AAC Acces:</b> <a href="?src=\ref[src];toggleadvcontrol=1">[advcontrol ? "Allowed" : "Blocked"]</a></li>
</ul>
"}

/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 MT_UPDATE

/obj/machinery/atmospherics/binary/dp_vent_pump/New()
..()
if (!id_tag)
assign_uid()
id_tag = num2text(uid)
icon = null

/obj/machinery/atmospherics/binary/dp_vent_pump/high_volume
Expand All @@ -45,7 +79,7 @@
return

overlays.Cut()

var/vent_icon = "vent"

var/turf/T = get_turf(src)
Expand All @@ -54,7 +88,7 @@

if(T.intact && node1 && node2 && node1.level == 1 && node2.level == 1 && istype(node1, /obj/machinery/atmospherics/pipe) && istype(node2, /obj/machinery/atmospherics/pipe))
vent_icon += "h"

if(!powered())
vent_icon += "off"
else
Expand Down Expand Up @@ -150,7 +184,7 @@
signal.source = src

signal.data = list(
"tag" = id,
"tag" = id_tag,
"device" = "ADVP",
"power" = on,
"direction" = pump_direction?("release"):("siphon"),
Expand All @@ -170,7 +204,7 @@
set_frequency(frequency)

/obj/machinery/atmospherics/binary/dp_vent_pump/receive_signal(datum/signal/signal)
if(!signal.data["tag"] || (signal.data["tag"] != id) || (signal.data["sigtype"]!="command"))
if(!signal.data["tag"] || (signal.data["tag"] != id_tag) || (signal.data["sigtype"]!="command") || (signal.data["advcontrol"] && !advcontrol))
return 0
if(signal.data["power"])
on = text2num(signal.data["power"])
Expand All @@ -188,7 +222,7 @@
pressure_checks &= ~1
pump_direction = 0

if(signal.data["stabalize"])
if(signal.data["stabilize"])//the fact that this was "stabalize" shows how many fucks people give about these wonders, none
pressure_checks |= 1
pump_direction = 1

Expand Down Expand Up @@ -220,4 +254,54 @@

spawn(2)
broadcast_status()
update_icon()
update_icon()

/obj/machinery/atmospherics/binary/dp_vent_pump/attackby(var/obj/item/W as obj, var/mob/user as mob)
/*
if(istype(W, /obj/item/weapon/weldingtool))
var/obj/item/weapon/weldingtool/WT = W
if (WT.remove_fuel(0,user))
user << "\blue Now welding the vent."
if(do_after(user, 20))
if(!src || !WT.isOn()) return
playsound(get_turf(src), 'sound/items/Welder2.ogg', 50, 1)
if(!welded)
user.visible_message("[user] welds the vent shut.", "You weld the vent shut.", "You hear welding.")
welded = 1
update_icon()
else
user.visible_message("[user] unwelds the vent.", "You unweld the vent.", "You hear welding.")
welded = 0
update_icon()
else
user << "\blue The welding tool needs to be on to start this task."
else
user << "\blue You need more welding fuel to complete this task."
return 1*/
if(istype(W, /obj/item/device/multitool))
update_multitool_menu(user)
return 1
if (!istype(W, /obj/item/weapon/wrench))
return ..()
if (!(stat & NOPOWER) && on)
user << "\red You cannot unwrench this [src], turn it off first."
return 1
var/turf/T = src.loc
if (level==1 && isturf(T) && T.intact)
user << "\red You must remove the plating first."
return 1
var/datum/gas_mixture/int_air = return_air()
var/datum/gas_mixture/env_air = loc.return_air()
if ((int_air.return_pressure()-env_air.return_pressure()) > 2*ONE_ATMOSPHERE)
user << "\red You cannot unwrench this [src], it too exerted due to internal pressure."
add_fingerprint(user)
return 1
playsound(get_turf(src), 'sound/items/Ratchet.ogg', 50, 1)
user << "\blue You begin to unfasten \the [src]..."
if (do_after(user, 40))
user.visible_message( \
"[user] unfastens \the [src].", \
"\blue You have unfastened \the [src].", \
"You hear ratchet.")
new /obj/item/pipe(loc, make_from=src)
del(src)
71 changes: 66 additions & 5 deletions code/ATMOSPHERICS/components/unary/outlet_injector.dm
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,27 @@
name = "Air Injector"
desc = "Has a valve and pump attached to it"

req_one_access_txt = "24;10"

var/on = 0
var/injecting = 0

var/volume_rate = 50

var/frequency = 0
var/id = null
var/id
var/id_tag = null
var/datum/radio_frequency/radio_connection
Mtoollink = 1
settagwhitelist = list("id_tag")

level = 1

/obj/machinery/atmospherics/unary/outlet_injector/New()
..()
if(id && !id_tag)//I'm not dealing with any more merge conflicts
id_tag = id

/obj/machinery/atmospherics/unary/outlet_injector/update_icon()
if(!powered())
icon_state = "off"
Expand Down Expand Up @@ -90,7 +100,7 @@
signal.source = src

signal.data = list(
"tag" = id,
"tag" = id_tag,
"device" = "AO",
"power" = on,
"volume_rate" = volume_rate,
Expand All @@ -103,11 +113,10 @@

/obj/machinery/atmospherics/unary/outlet_injector/initialize()
..()

set_frequency(frequency)

/obj/machinery/atmospherics/unary/outlet_injector/receive_signal(datum/signal/signal)
if(!signal.data["tag"] || (signal.data["tag"] != id) || (signal.data["sigtype"]!="command"))
if(!signal.data["tag"] || (signal.data["tag"] != id_tag) || (signal.data["sigtype"]!="command"))
return 0

if(signal.data["power"])
Expand Down Expand Up @@ -135,5 +144,57 @@
broadcast_status()
update_icon()

/*hide(var/i) //to make the little pipe section invisible, the icon changes.
if(node)
if(on)
icon_state = "[i == 1 && istype(loc, /turf/simulated) ? "h" : "" ]on"
else
icon_state = "[i == 1 && istype(loc, /turf/simulated) ? "h" : "" ]off"
else
icon_state = "[i == 1 && istype(loc, /turf/simulated) ? "h" : "" ]exposed"
on = 0
return*/

/obj/machinery/atmospherics/unary/outlet_injector/multitool_menu(var/mob/user,var/obj/item/device/multitool/P)
return {"
<ul>
<li><b>Frequency:</b> <a href="?src=\ref[src];set_freq=-1">[format_frequency(frequency)] GHz</a> (<a href="?src=\ref[src];set_freq=[1439]">Reset</a>)</li>
<li>[format_tag("ID Tag","id_tag","set_id")]</a></li>
</ul>
"}

/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))
interact(user)
return 1
if (!istype(W, /obj/item/weapon/wrench))
return ..()
if (!(stat & NOPOWER) && on)
user << "\red You cannot unwrench this [src], turn it off first."
return 1
var/turf/T = src.loc
if (level==1 && isturf(T) && T.intact)
user << "\red You must remove the plating first."
return 1
var/datum/gas_mixture/int_air = return_air()
var/datum/gas_mixture/env_air = loc.return_air()
if ((int_air.return_pressure()-env_air.return_pressure()) > 2*ONE_ATMOSPHERE)
user << "\red You cannot unwrench this [src], it too exerted due to internal pressure."
add_fingerprint(user)
return 1
playsound(get_turf(src), 'sound/items/Ratchet.ogg', 50, 1)
user << "\blue You begin to unfasten \the [src]..."
if (do_after(user, 40))
user.visible_message( \
"[user] unfastens \the [src].", \
"\blue You have unfastened \the [src].", \
"You hear ratchet.")
new /obj/item/pipe(loc, make_from=src)
del(src)

/obj/machinery/atmospherics/unary/outlet_injector/interact(mob/user as mob)
update_multitool_menu(user)

/obj/machinery/atmospherics/unary/outlet_injector/hide(var/i)
update_underlays()
update_underlays()

51 changes: 44 additions & 7 deletions code/ATMOSPHERICS/components/unary/vent_pump.dm
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
var/area_uid
var/id_tag = null

req_one_access_txt = "24;10"

var/on = 0
var/pump_direction = 1 //0 = siphoning, 1 = releasing

Expand All @@ -36,10 +38,13 @@

var/frequency = 1439
var/datum/radio_frequency/radio_connection
Mtoollink = 1
settagwhitelist = list("id_tag")
var/advcontrol = 0//does this device listen to the AAC

var/radio_filter_out
var/radio_filter_in

connect_types = list(1,2) //connects to regular and supply pipes

/obj/machinery/atmospherics/unary/vent_pump/on
Expand Down Expand Up @@ -80,7 +85,7 @@
return

overlays.Cut()

var/vent_icon = "vent"

var/turf/T = get_turf(src)
Expand All @@ -89,7 +94,7 @@

if(T.intact && node && node.level == 1 && istype(node, /obj/machinery/atmospherics/pipe))
vent_icon += "h"

if(welded)
vent_icon += "weld"
else if(!powered())
Expand Down Expand Up @@ -227,14 +232,14 @@
if(stat & (NOPOWER|BROKEN))
return
//log_admin("DEBUG \[[world.timeofday]\]: /obj/machinery/atmospherics/unary/vent_pump/receive_signal([signal.debug_print()])")
if(!signal.data["tag"] || (signal.data["tag"] != id_tag) || (signal.data["sigtype"]!="command"))
if(!signal.data["tag"] || (signal.data["tag"] != id_tag) || (signal.data["sigtype"]!="command") || (signal.data["advcontrol"] && !advcontrol))
return 0

if(signal.data["purge"] != null)
pressure_checks &= ~1
pump_direction = 0

if(signal.data["stabalize"] != null)
if(signal.data["stabilize"] != null)
pressure_checks |= 1
pump_direction = 1

Expand Down Expand Up @@ -324,12 +329,20 @@
welded = 0
update_icon()
else

user << "\blue The welding tool needs to be on to start this task."
else
user << "\blue You need more welding fuel to complete this task."
return 1
else
..()
else if(istype(W, /obj/item/device/multitool))
update_multitool_menu(user)
return 1

/obj/machinery/atmospherics/unary/vent_pump/examine()
set src in oview(1)
..()
if(welded)
usr << "It seems welded shut."

/obj/machinery/atmospherics/unary/vent_pump/examine()
set src in oview(1)
Expand All @@ -343,7 +356,31 @@
if(old_stat != stat)
update_icon()


/obj/machinery/atmospherics/unary/vent_pump/interact(mob/user as mob)
update_multitool_menu(user)

/obj/machinery/atmospherics/unary/vent_pump/multitool_menu(var/mob/user,var/obj/item/device/multitool/P)
return {"
<ul>
<li><b>Frequency:</b> <a href="?src=\ref[src];set_freq=-1">[format_frequency(frequency)] GHz</a> (<a href="?src=\ref[src];set_freq=[1439]">Reset</a>)</li>
<li>[format_tag("ID Tag","id_tag","set_id")]</li>
<li><b>AAC Acces:</b> <a href="?src=\ref[src];toggleadvcontrol=1">[advcontrol ? "Allowed" : "Blocked"]</a>
</ul>
"}

/obj/machinery/atmospherics/unary/vent_pump/multitool_topic(var/mob/user, var/list/href_list, var/obj/O)
. = ..()
if(.)
return .

if("toggleadvcontrol" in href_list)
advcontrol = !advcontrol
return MT_UPDATE

/obj/machinery/atmospherics/unary/vent_pump/attackby(var/obj/item/weapon/W as obj, var/mob/user as mob)
if (istype(W, /obj/item/device/multitool))
update_multitool_menu(user)
if (!istype(W, /obj/item/weapon/wrench))
return ..()
if (!(stat & NOPOWER) && on)
Expand Down