Rapid Piping Fabrication Device (#8435)

Implements a Piping Rapid Fabrication Device, otherwise known as the RFD-P.

They get added to atmos tech lockers. Can't really think of a better place to slap it in. Doesn't come with extra ammo.
This commit is contained in:
Geeves
2020-03-26 22:48:13 +02:00
committed by GitHub
parent 2404a4ea96
commit c422449d5f
3 changed files with 145 additions and 0 deletions
+136
View File
@@ -413,3 +413,139 @@ RFD Mining-Class
var/mob/living/silicon/robot/R = user
if(R.cell)
R.cell.use(used_energy)
/*
RFD Piping-Class
*/
#define STANDARD_PIPE "Standard Pipes"
#define SUPPLY_PIPE "Supply Pipes"
#define SCRUBBER_PIPE "Scrubber Pipes"
#define DEVICES "Devices"
/obj/item/rfd/piping
name = "\improper Rapid-Fabrication-Device P-Class"
desc = "A RFD, modified to construct pipes and piping accessories."
modes = list(STANDARD_PIPE, SUPPLY_PIPE, SCRUBBER_PIPE, DEVICES)
var/selected_mode = STANDARD_PIPE
var/pipe_examine = "Pipe" // used in the examine proc to see what you're putting down at a glance
var/selected_pipe = 0 // default is standard pipe, used for the new pipe creation
var/build_cost = 1 // this RFD only uses 1 unit of power per pipe, but can be modified if need be in future
var/build_delay = 10
// The numbers below refer to the numberized designator for each pipe, which is used in obj/item/pipe's new
// Take a look at code\game\machinery\pipe\construction.dm line 69 for more information. - Geeves
var/list/standard_pipes = list("Pipe" = 0,
"Bent Pipe" = 1,
"Manifold" = 5,
"Manual Valve" = 8,
"4-Way Manifold" = 19,
"Manual T-Valve" = 18,
"Upward Pipe" = 21,
"Downward Pipe" = 22)
var/list/supply_pipes = list("Pipe" = 29,
"Bent Pipe" = 30,
"Manifold" = 33,
"4-Way Manifold" = 35,
"Upward Pipe" = 37,
"Downward Pipe" = 39)
var/list/scrubber_pipes = list("Pipe" = 31,
"Bent Pipe" = 32,
"Manifold" = 34,
"4-Way Manifold" = 36,
"Upward Pipe" = 38,
"Downward Pipe" = 40)
var/list/devices = list("Universal Pipe Adapter" = 28,
"Connector" = 4,
"Unary Vent" = 7,
"Scrubber" = 10,
"Gas Pump" = 9,
"Pressure Regulator" = 15,
"High Power Gas Pump" = 16,
"Gas Filter" = 13,
"Omni Gas Filter" = 27)
/obj/item/rfd/piping/examine(mob/user)
. = ..()
to_chat(user, FONT_SMALL(SPAN_NOTICE("Change pipe category by Alt clicking, change pipe selection by using in-hand.")))
to_chat(user, SPAN_NOTICE("Selected pipe category: <b>[selected_mode]</b>"))
to_chat(user, SPAN_NOTICE("Selected pipe: <b>[pipe_examine]</b>"))
/obj/item/rfd/piping/afterattack(atom/A, mob/user, proximity)
if(!proximity)
return
if(istype(get_area(A), /area/shuttle) || istype(get_area(A), /turf/space))
to_chat(user, SPAN_WARNING("You can't lay pipe here!"))
return FALSE
var/turf/T = get_turf(A)
if(isNotStationLevel(T.z))
to_chat(user, SPAN_WARNING("You can't lay your pipe on this level!"))
return FALSE
return do_pipe(T, user)
/obj/item/rfd/piping/proc/do_pipe(var/turf/T, var/mob/user)
if(working)
return FALSE
if(!useResource(build_cost, user))
to_chat(user, SPAN_WARNING("The \'Low Ammo\' light on the device blinks yellow."))
flick("[icon_state]-empty", src)
return FALSE
playsound(get_turf(src), 'sound/machines/click.ogg', 50, TRUE)
working = TRUE
to_chat(user, SPAN_NOTICE("You start laying down your pipe..."))
if(build_delay && !do_after(user, build_delay))
working = FALSE
return FALSE
working = FALSE
if(build_delay && !can_use(user, T))
return FALSE
new /obj/item/pipe(T, selected_pipe, NORTH)
playsound(get_turf(src), 'sound/items/Deconstruct.ogg', 50, TRUE)
return TRUE
/obj/item/rfd/piping/attack_self(mob/user)
playsound(get_turf(src), 'sound/effects/pop.ogg', 50, FALSE)
var/list/pipe_selection = list()
switch(selected_mode)
if(STANDARD_PIPE)
pipe_selection = standard_pipes
if(SUPPLY_PIPE)
pipe_selection = supply_pipes
if(SCRUBBER_PIPE)
pipe_selection = scrubber_pipes
if(DEVICES)
pipe_selection = devices
pipe_examine = input(user, "Choose the pipe you want to deploy.", "Pipe Selection") in pipe_selection
selected_pipe = pipe_selection[pipe_examine]
/obj/item/rfd/piping/AltClick(mob/user)
selected_mode = input(user, "Choose the category you want to change to.", "Pipe Categories") in modes
switch(selected_mode)
if(STANDARD_PIPE)
pipe_examine = "Pipe"
selected_pipe = 0
if(SUPPLY_PIPE)
pipe_examine = "Pipe"
selected_pipe = 29
if(SCRUBBER_PIPE)
pipe_examine = "Pipe"
selected_pipe = 31
if(DEVICES)
pipe_examine = "Universal Pipe Adapter"
selected_pipe = 28
#undef STANDARD_PIPE
#undef SUPPLY_PIPE
#undef SCRUBBER_PIPE
#undef DEVICES
@@ -36,6 +36,7 @@
new /obj/item/device/flash(src)
new /obj/item/taperoll/engineering(src)
new /obj/item/clothing/accessory/storage/overalls/chief(src)
new /obj/item/rfd/piping(src)
/obj/structure/closet/secure_closet/engineering_chief2
name = "chief engineer's attire"
@@ -164,3 +165,4 @@
new /obj/item/cartridge/atmos(src)
new /obj/item/taperoll/engineering(src)
new /obj/item/clothing/accessory/storage/overalls/engineer(src)
new /obj/item/rfd/piping(src)