diff --git a/code/__DEFINES/flags.dm b/code/__DEFINES/flags.dm index 0ec1567f86d..cd6688d095f 100644 --- a/code/__DEFINES/flags.dm +++ b/code/__DEFINES/flags.dm @@ -101,7 +101,6 @@ //turf-only flags #define NOJAUNT 1 -#define RPD_ALLOWED_HERE 2//By default, RPD is disabled on turfs. //ITEM INVENTORY SLOT BITMASKS #define SLOT_OCLOTHING 1 diff --git a/code/__DEFINES/pipes.dm b/code/__DEFINES/pipes.dm new file mode 100644 index 00000000000..c855a5e4260 --- /dev/null +++ b/code/__DEFINES/pipes.dm @@ -0,0 +1,76 @@ +//Atmospherics pipes + +#define PIPE_SIMPLE_STRAIGHT 0 +#define PIPE_SIMPLE_BENT 1 +#define PIPE_HE_STRAIGHT 2 +#define PIPE_HE_BENT 3 +#define PIPE_CONNECTOR 4 +#define PIPE_MANIFOLD 5 +#define PIPE_JUNCTION 6 +#define PIPE_UVENT 7 +#define PIPE_MVALVE 8 +#define PIPE_PUMP 9 +#define PIPE_SCRUBBER 10 +#define PIPE_INSULATED_STRAIGHT 11 +#define PIPE_INSULATED_BENT 12 +#define PIPE_GAS_FILTER 13 +#define PIPE_GAS_MIXER 14 +#define PIPE_PASSIVE_GATE 15 +#define PIPE_VOLUME_PUMP 16 +#define PIPE_HEAT_EXCHANGE 17 +#define PIPE_TVALVE 18 +#define PIPE_MANIFOLD4W 19 +#define PIPE_CAP 20 +#define PIPE_OMNI_MIXER 21 +#define PIPE_OMNI_FILTER 22 +#define PIPE_UNIVERSAL 23 +#define PIPE_SUPPLY_STRAIGHT 24 +#define PIPE_SUPPLY_BENT 25 +#define PIPE_SCRUBBERS_STRAIGHT 26 +#define PIPE_SCRUBBERS_BENT 27 +#define PIPE_SUPPLY_MANIFOLD 28 +#define PIPE_SCRUBBERS_MANIFOLD 29 +#define PIPE_SUPPLY_MANIFOLD4W 30 +#define PIPE_SCRUBBERS_MANIFOLD4W 31 +#define PIPE_SUPPLY_CAP 32 +#define PIPE_SCRUBBERS_CAP 33 +#define PIPE_INJECTOR 34 +#define PIPE_DVALVE 35 +#define PIPE_DP_VENT 36 +#define PIPE_PASV_VENT 37 +#define PIPE_DTVALVE 38 +#define PIPE_CIRCULATOR 39 +#define PIPE_GAS_SENSOR 98 +#define PIPE_METER 99 + +//Disposals pipes + +#define PIPE_DISPOSALS_STRAIGHT 100 +#define PIPE_DISPOSALS_BENT 101 +#define PIPE_DISPOSALS_JUNCTION_RIGHT 102 +#define PIPE_DISPOSALS_JUNCTION_LEFT 103 +#define PIPE_DISPOSALS_Y_JUNCTION 104 +#define PIPE_DISPOSALS_TRUNK 105 +#define PIPE_DISPOSALS_BIN 106 +#define PIPE_DISPOSALS_OUTLET 107 +#define PIPE_DISPOSALS_CHUTE 108 +#define PIPE_DISPOSALS_SORT_RIGHT 109 +#define PIPE_DISPOSALS_SORT_LEFT 110 + + +//RPD stuff + +#define RPD_ATMOS_MODE 1 +#define RPD_DISPOSALS_MODE 2 +#define RPD_ROTATE_MODE 3 +#define RPD_FLIP_MODE 4 +#define RPD_DELETE_MODE 5 + +#define RPD_ATMOS_PIPING 1 +#define RPD_SUPPLY_PIPING 2 +#define RPD_SCRUBBERS_PIPING 3 +#define RPD_DEVICES 4 +#define RPD_HEAT_PIPING 5 + +#define PIPETYPE_ATMOS 1 +#define PIPETYPE_DISPOSAL 2 diff --git a/code/__HELPERS/global_lists.dm b/code/__HELPERS/global_lists.dm index d0e1feb3d62..2a81cca7045 100644 --- a/code/__HELPERS/global_lists.dm +++ b/code/__HELPERS/global_lists.dm @@ -50,6 +50,12 @@ init_subtypes(/datum/crafting_recipe, crafting_recipes) + //Pipe list building + init_subtypes(/datum/pipes, GLOB.construction_pipe_list) + for(var/D in GLOB.construction_pipe_list) + var/datum/pipes/P = D + if(P.rpd_dispensable) + GLOB.rpd_pipe_list += list(list("pipe_name" = P.pipe_name, "pipe_id" = P.pipe_id, "pipe_type" = P.pipe_type, "pipe_category" = P.pipe_category, "orientations" = P.orientations, "pipe_icon" = P.pipe_icon, "bendy" = P.bendy)) return 1 /* // Uncomment to debug chemical reaction list. diff --git a/code/_globalvars/lists/objects.dm b/code/_globalvars/lists/objects.dm index 5a025702877..82d4c113997 100644 --- a/code/_globalvars/lists/objects.dm +++ b/code/_globalvars/lists/objects.dm @@ -43,4 +43,4 @@ var/global/list/meteor_list = list() //list of all meteors var/global/list/poi_list = list() //list of points of interest for observe/follow var/global/list/active_jammers = list() // List of active radio jammers -var/global/list/active_diseases = list() //List of Active disease in all mobs; purely for quick referencing. \ No newline at end of file +var/global/list/active_diseases = list() //List of Active disease in all mobs; purely for quick referencing. diff --git a/code/datums/pipe_datums.dm b/code/datums/pipe_datums.dm new file mode 100644 index 00000000000..007f08c6673 --- /dev/null +++ b/code/datums/pipe_datums.dm @@ -0,0 +1,389 @@ +GLOBAL_LIST_EMPTY(construction_pipe_list) //List of all pipe datums +GLOBAL_LIST_EMPTY(rpd_pipe_list) //Some pipes we don't want to be dispensable by the RPD, so we have a separate thing + +/datum/pipes + var/pipe_name //What the pipe is called in the interface + var/pipe_id //Use the pipe define for this + var/pipe_type //Atmos, disposals etc. + var/pipe_category //What category of pipe + var/bendy = FALSE //Is this pipe bendy? + var/orientations //Number of orientations (for interface purposes) + var/pipe_icon //icon_state of the dispensed pipe (for interface purposes) + var/rpd_dispensable = FALSE + +/datum/pipes/atmospheric + pipe_type = PIPETYPE_ATMOS + pipe_category = PIPETYPE_ATMOS + +/datum/pipes/disposal + pipe_type = PIPETYPE_DISPOSAL + +//Normal pipes + +/datum/pipes/atmospheric/simple + pipe_name = "straight pipe" + pipe_id = PIPE_SIMPLE_STRAIGHT + orientations = 2 + pipe_icon = "simple" + rpd_dispensable = TRUE + +/datum/pipes/atmospheric/bent //Why is this not atmospheric/simple/bent you ask? Because otherwise the ordering of the pipes in the UI menu gets weird + pipe_name = "bent pipe" + pipe_id = PIPE_SIMPLE_BENT + orientations = 4 + bendy = TRUE + pipe_icon = "simple" + rpd_dispensable = TRUE + +/datum/pipes/atmospheric/manifold + pipe_name = "t-manifold" + pipe_id = PIPE_MANIFOLD + orientations = 4 + pipe_icon = "manifold" + rpd_dispensable = TRUE + +/datum/pipes/atmospheric/manifold4w + pipe_name = "4-way manifold" + pipe_id = PIPE_MANIFOLD4W + orientations = 1 + pipe_icon = "manifold4w" + rpd_dispensable = TRUE + +/datum/pipes/atmospheric/cap + pipe_name = "pipe cap" + pipe_id = PIPE_CAP + orientations = 4 + pipe_icon = "cap" + rpd_dispensable = TRUE + +/datum/pipes/atmospheric/valve + pipe_name = "manual valve" + pipe_id = PIPE_MVALVE + orientations = 2 + pipe_icon = "mvalve" + rpd_dispensable = TRUE + +/datum/pipes/atmospheric/valve/digital + pipe_name = "digital valve" + pipe_id = PIPE_DVALVE + pipe_icon = "dvalve" + +/datum/pipes/atmospheric/tvalve + pipe_name = "manual t-valve" + pipe_id = PIPE_TVALVE + orientations = 4 + pipe_icon = "tvalve" + rpd_dispensable = TRUE + +/datum/pipes/atmospheric/tvalve/digital + pipe_name = "digital t-valve" + pipe_id = PIPE_DTVALVE + pipe_icon = "dtvalve" + +//Supply pipes + +/datum/pipes/atmospheric/simple/supply + pipe_name = "straight supply pipe" + pipe_id = PIPE_SUPPLY_STRAIGHT + pipe_category = RPD_SUPPLY_PIPING + +/datum/pipes/atmospheric/bent/supply + pipe_name = "bent supply pipe" + pipe_id = PIPE_SUPPLY_BENT + pipe_category = RPD_SUPPLY_PIPING + +/datum/pipes/atmospheric/manifold/supply + pipe_name = "supply T-manifold" + pipe_id = PIPE_SUPPLY_MANIFOLD + pipe_category = RPD_SUPPLY_PIPING + +/datum/pipes/atmospheric/manifold4w/supply + pipe_name = "4-way supply manifold" + pipe_id = PIPE_SUPPLY_MANIFOLD4W + pipe_category = RPD_SUPPLY_PIPING + +/datum/pipes/atmospheric/cap/supply + pipe_name = "supply pipe cap" + pipe_id = PIPE_SUPPLY_CAP + pipe_category = RPD_SUPPLY_PIPING + +//Scrubbers pipes + +/datum/pipes/atmospheric/simple/scrubbers + pipe_name = "straight scrubbers pipe" + pipe_id = PIPE_SCRUBBERS_STRAIGHT + pipe_category = RPD_SCRUBBERS_PIPING + +/datum/pipes/atmospheric/bent/scrubbers + pipe_name = "bent scrubbers pipe" + pipe_id = PIPE_SCRUBBERS_BENT + pipe_category = RPD_SCRUBBERS_PIPING + +/datum/pipes/atmospheric/manifold/scrubbers + pipe_name = "scrubbers t-manifold" + pipe_id = PIPE_SCRUBBERS_MANIFOLD + pipe_category = RPD_SCRUBBERS_PIPING + +/datum/pipes/atmospheric/manifold4w/scrubbers + pipe_name = "4-way scrubbers manifold" + pipe_id = PIPE_SCRUBBERS_MANIFOLD4W + pipe_category = RPD_SCRUBBERS_PIPING + +/datum/pipes/atmospheric/cap/scrubbers + pipe_name = "scrubbers pipe cap" + pipe_id = PIPE_SCRUBBERS_CAP + pipe_category = RPD_SCRUBBERS_PIPING + +//Devices + +/datum/pipes/atmospheric/upa + pipe_name = "universal pipe adapter" + pipe_id = PIPE_UNIVERSAL + orientations = 2 + pipe_icon = "universal" + pipe_category = RPD_DEVICES + rpd_dispensable = TRUE + +/datum/pipes/atmospheric/connector + pipe_name = "connector" + pipe_id = PIPE_CONNECTOR + orientations = 4 + pipe_icon = "connector" + pipe_category = RPD_DEVICES + rpd_dispensable = TRUE + +/datum/pipes/atmospheric/unaryvent + pipe_name = "unary vent" + pipe_id = PIPE_UVENT + orientations = 4 + pipe_icon = "uvent" + pipe_category = RPD_DEVICES + rpd_dispensable = TRUE + +/datum/pipes/atmospheric/scrubber + pipe_name = "scrubber" + pipe_id = PIPE_SCRUBBER + orientations = 4 + pipe_icon = "scrubber" + pipe_category = RPD_DEVICES + rpd_dispensable = TRUE + +/datum/pipes/atmospheric/pump + pipe_name = "pump" + pipe_id = PIPE_PUMP + orientations = 4 + pipe_icon = "pump" + pipe_category = RPD_DEVICES + rpd_dispensable = TRUE + +/datum/pipes/atmospheric/volume_pump + pipe_name = "volume pump" + pipe_id = PIPE_VOLUME_PUMP + orientations = 4 + pipe_icon = "volumepump" + pipe_category = RPD_DEVICES + +/datum/pipes/atmospheric/gate + pipe_name = "passive gate" + pipe_id = PIPE_PASSIVE_GATE + orientations = 4 + pipe_icon = "passivegate" + pipe_category = RPD_DEVICES + rpd_dispensable = TRUE + +/datum/pipes/atmospheric/filter + pipe_name = "gas filter" + pipe_id = PIPE_GAS_FILTER + orientations = 4 + pipe_icon = "filter" + pipe_category = RPD_DEVICES + rpd_dispensable = TRUE + +/datum/pipes/atmospheric/mixer + pipe_name = "gas mixer" + pipe_id = PIPE_GAS_MIXER + orientations = 4 + pipe_icon = "mixer" + pipe_category = RPD_DEVICES + rpd_dispensable = TRUE + +/datum/pipes/atmospheric/sensor + pipe_name = "gas sensor" + pipe_id = PIPE_GAS_SENSOR + orientations = 1 + pipe_icon = "sensor" + pipe_category = RPD_DEVICES + rpd_dispensable = TRUE + +/datum/pipes/atmospheric/meter + pipe_name = "meter" + pipe_id = PIPE_METER + orientations = 1 + pipe_icon = "meter" + pipe_category = RPD_DEVICES + rpd_dispensable = TRUE + +/datum/pipes/atmospheric/passive_vent + pipe_name = "passive vent" + pipe_id = PIPE_PASV_VENT + orientations = 4 + pipe_icon = "passive vent" + pipe_category = RPD_DEVICES + rpd_dispensable = TRUE + +/datum/pipes/atmospheric/dual_vent_pump + pipe_name = "dual-port vent pump" + pipe_id = PIPE_DP_VENT + orientations = 2 + pipe_icon = "dual-port vent" + pipe_category = RPD_DEVICES + rpd_dispensable = TRUE + +/datum/pipes/atmospheric/injector + pipe_name = "air injector" + pipe_id = PIPE_INJECTOR + orientations = 4 + pipe_icon = "injector" + pipe_category = RPD_DEVICES + rpd_dispensable = TRUE + +//Heat exchange pipes + +/datum/pipes/atmospheric/simple/he + pipe_name = "straight h/e pipe" + pipe_id = PIPE_HE_STRAIGHT + pipe_icon = "he" + pipe_category = RPD_HEAT_PIPING + +/datum/pipes/atmospheric/bent/he + pipe_name = "bent h/e pipe" + pipe_id = PIPE_HE_BENT + pipe_icon = "he" + bendy = TRUE + pipe_category = RPD_HEAT_PIPING + +/datum/pipes/atmospheric/he_junction + pipe_name = "junction" + pipe_id = PIPE_JUNCTION + orientations = 4 + pipe_icon = "junction" + pipe_category = RPD_HEAT_PIPING + rpd_dispensable = TRUE + +/datum/pipes/atmospheric/heat_exchanger + pipe_name = "heat exchanger" + pipe_id = PIPE_HEAT_EXCHANGE + orientations = 4 + pipe_icon = "heunary" + pipe_category = RPD_HEAT_PIPING + rpd_dispensable = TRUE + +//DISPOSALS PIPES + +/datum/pipes/disposal/straight + pipe_name = "straight disposals pipe" + pipe_id = PIPE_DISPOSALS_STRAIGHT + orientations = 2 + pipe_icon = "pipe-s" + rpd_dispensable = TRUE + +/datum/pipes/disposal/bent + pipe_name = "bent disposals pipe" + pipe_id = PIPE_DISPOSALS_BENT + orientations = 4 + pipe_icon = "pipe-c" + rpd_dispensable = TRUE + +/datum/pipes/disposal/junction + pipe_name = "disposals junction" + pipe_id = PIPE_DISPOSALS_JUNCTION_RIGHT + orientations = 4 + pipe_icon = "pipe-j1" + rpd_dispensable = TRUE + +/datum/pipes/disposal/y_junction + pipe_name = "disposals y-junction" + pipe_id = PIPE_DISPOSALS_Y_JUNCTION + orientations = 4 + pipe_icon = "pipe-y" + rpd_dispensable = TRUE + +/datum/pipes/disposal/trunk + pipe_name = "disposals trunk" + pipe_id = PIPE_DISPOSALS_TRUNK + orientations = 4 + pipe_icon = "pipe-t" + rpd_dispensable = TRUE + +/datum/pipes/disposal/bin + pipe_name = "disposals pipe bin" + pipe_id = PIPE_DISPOSALS_BIN + orientations = 1 + pipe_icon = "disposal" + rpd_dispensable = TRUE + +/datum/pipes/disposal/outlet + pipe_name = "disposals outlet" + pipe_id = PIPE_DISPOSALS_OUTLET + orientations = 4 + pipe_icon = "outlet" + rpd_dispensable = TRUE + +/datum/pipes/disposal/chute + pipe_name = "disposals chute" + pipe_id = PIPE_DISPOSALS_CHUTE + orientations = 4 + pipe_icon = "intake" + rpd_dispensable = TRUE + +//Pipes the RPD can't dispense. Since these don't use an interface, we don't need to bother with setting an icon. We do, however, want to name these for other purposes + +/datum/pipes/atmospheric/circulator + pipe_name = "circulator / heat exchanger" + pipe_id = PIPE_CIRCULATOR + pipe_icon = "circ" + +/datum/pipes/atmospheric/omni_filter + pipe_name = "omni filter" + pipe_id = PIPE_OMNI_FILTER + pipe_icon = "omni_filter" + +/datum/pipes/atmospheric/omni_mixer + pipe_name = "omni mixer" + pipe_id = PIPE_OMNI_MIXER + pipe_icon = "omni_mixer" + +/datum/pipes/atmospheric/insulated + pipe_name = "insulated pipe" + pipe_id = PIPE_INSULATED_STRAIGHT + pipe_icon = "insulated" + +/datum/pipes/atmospheric/insulated/bent + pipe_name = "bent insulated pipe" + pipe_id = PIPE_INSULATED_BENT + +/datum/pipes/disposal/sortjunction + pipe_name = "disposals sort junction" + pipe_id = PIPE_DISPOSALS_SORT_RIGHT + pipe_icon = "pipe-j1s" + +/datum/pipes/disposal/sortjunction/left + pipe_id = PIPE_DISPOSALS_SORT_LEFT + pipe_icon = "pipe-j2s" + +/datum/pipes/disposal/left_junction + pipe_name = "disposals junction" + pipe_id = PIPE_DISPOSALS_JUNCTION_LEFT + pipe_icon = "pipe-j2" + +/proc/get_pipe_name(var/pipe_id, var/pipe_type) + for(var/datum/pipes/P in GLOB.construction_pipe_list) + if(P.pipe_id == pipe_id && P.pipe_type == pipe_type) + return P.pipe_name + return "unknown pipe" + +/proc/get_pipe_icon(var/pipe_id) + for(var/datum/pipes/P in GLOB.construction_pipe_list) + if(P.pipe_id == pipe_id) + return P.pipe_icon + return "unknown icon" diff --git a/code/game/atoms.dm b/code/game/atoms.dm index 136c8950028..ea3b9df4f54 100644 --- a/code/game/atoms.dm +++ b/code/game/atoms.dm @@ -302,6 +302,9 @@ /atom/proc/emag_act() return +/atom/proc/rpd_act() + return + /atom/proc/hitby(atom/movable/AM, skipcatch, hitpush, blocked) if(density && !has_gravity(AM)) //thrown stuff bounces off dense stuff in no grav, unless the thrown stuff ends up inside what it hit(embedding, bola, etc...). addtimer(CALLBACK(src, .proc/hitby_react, AM), 2) diff --git a/code/game/machinery/pipe/construction.dm b/code/game/machinery/pipe/construction.dm index 2d5a885aba1..270b2a99411 100644 --- a/code/game/machinery/pipe/construction.dm +++ b/code/game/machinery/pipe/construction.dm @@ -1,44 +1,3 @@ -#define PIPE_SIMPLE_STRAIGHT 0 -#define PIPE_SIMPLE_BENT 1 -#define PIPE_HE_STRAIGHT 2 -#define PIPE_HE_BENT 3 -#define PIPE_CONNECTOR 4 -#define PIPE_MANIFOLD 5 -#define PIPE_JUNCTION 6 -#define PIPE_UVENT 7 -#define PIPE_MVALVE 8 -#define PIPE_PUMP 9 -#define PIPE_SCRUBBER 10 -#define PIPE_INSULATED_STRAIGHT 11 -#define PIPE_INSULATED_BENT 12 -#define PIPE_GAS_FILTER 13 -#define PIPE_GAS_MIXER 14 -#define PIPE_PASSIVE_GATE 15 -#define PIPE_VOLUME_PUMP 16 -#define PIPE_HEAT_EXCHANGE 17 -#define PIPE_TVALVE 18 -#define PIPE_MANIFOLD4W 19 -#define PIPE_CAP 20 -#define PIPE_OMNI_MIXER 21 -#define PIPE_OMNI_FILTER 22 -#define PIPE_UNIVERSAL 23 -#define PIPE_SUPPLY_STRAIGHT 24 -#define PIPE_SUPPLY_BENT 25 -#define PIPE_SCRUBBERS_STRAIGHT 26 -#define PIPE_SCRUBBERS_BENT 27 -#define PIPE_SUPPLY_MANIFOLD 28 -#define PIPE_SCRUBBERS_MANIFOLD 29 -#define PIPE_SUPPLY_MANIFOLD4W 30 -#define PIPE_SCRUBBERS_MANIFOLD4W 31 -#define PIPE_SUPPLY_CAP 32 -#define PIPE_SCRUBBERS_CAP 33 -#define PIPE_INJECTOR 34 -#define PIPE_DVALVE 35 -#define PIPE_DP_VENT 36 -#define PIPE_PASV_VENT 37 -#define PIPE_DTVALVE 38 -#define PIPE_CIRCULATOR 39 - /obj/item/pipe name = "pipe" desc = "A pipe" @@ -180,93 +139,19 @@ //update the name and icon of the pipe item depending on the type +/obj/item/pipe/rpd_act(mob/user, obj/item/rpd/our_rpd) + if(our_rpd.mode == RPD_ROTATE_MODE) + rotate() + else if(our_rpd.mode == RPD_FLIP_MODE) + flip() + else if(our_rpd.mode == RPD_DELETE_MODE) + our_rpd.delete_single_pipe(user, src) + else + ..() + /obj/item/pipe/proc/update(var/obj/machinery/atmospherics/make_from) - var/list/nlist = list( \ - "pipe", \ - "bent pipe", \ - "h/e pipe", \ - "bent h/e pipe", \ - "connector", \ - "manifold", \ - "junction", \ - "uvent", \ - "mvalve", \ - "pump", \ - "scrubber", \ - "insulated pipe", \ - "bent insulated pipe", \ - "gas filter", \ - "gas mixer", \ - "passive gate", \ - "volume pump", \ - "heat exchanger", \ - "t-valve", \ - "4-way manifold", \ - "pipe cap", \ - "omni mixer", \ - "omni filter", \ - "universal pipe adapter", \ - "supply pipe", \ - "bent supply pipe", \ - "scrubbers pipe", \ - "bent scrubbers pipe", \ - "supply manifold", \ - "scrubbers manifold", \ - "supply 4-way manifold", \ - "scrubbers 4-way manifold", \ - "supply pipe cap", \ - "scrubbers pipe cap", \ - "air injector", \ - "digital valve", \ - "dual-port vent", \ - "passive vent", \ - "digital t-valve", \ - "circulator/heat exchanger", \ - ) - name = nlist[pipe_type+1] + " fitting" - var/list/islist = list( \ - "simple", \ - "simple", \ - "he", \ - "he", \ - "connector", \ - "manifold", \ - "junction", \ - "uvent", \ - "mvalve", \ - "pump", \ - "scrubber", \ - "insulated", \ - "insulated", \ - "filter", \ - "mixer", \ - "passivegate", \ - "volumepump", \ - "heunary", \ - "tvalve", \ - "manifold4w", \ - "cap", \ - "omni_mixer", \ - "omni_filter", \ - "universal", \ - "simple", \ - "simple", \ - "simple", \ - "simple", \ - "manifold", \ - "manifold", \ - "manifold4w", \ - "manifold4w", \ - "cap", \ - "cap", \ - "injector", \ - "dvalve", \ - "dual-port vent", \ - "passive vent", \ - "dtvalve", \ - "circ", \ - ) - icon_state = islist[pipe_type + 1] + name = "[get_pipe_name(pipe_type, PIPETYPE_ATMOS)] fitting" + icon_state = get_pipe_icon(pipe_type) var/obj/machinery/atmospherics/trinary/triP = make_from if(istype(triP) && triP.flipped) icon_state = "m_[icon_state]" @@ -650,6 +535,12 @@ to_chat(user, "You have fastened the meter to the pipe.") qdel(src) +/obj/item/pipe_meter/rpd_act(mob/user, obj/item/rpd/our_rpd) + if(our_rpd.mode == RPD_DELETE_MODE) + our_rpd.delete_single_pipe(user, src) + else + ..() + /obj/item/pipe_gsensor name = "gas sensor" desc = "A sensor that can be hooked to a computer" @@ -667,43 +558,8 @@ to_chat(user, "You have fastened the gas sensor.") qdel(src) -#undef PIPE_SIMPLE_STRAIGHT -#undef PIPE_SIMPLE_BENT -#undef PIPE_HE_STRAIGHT -#undef PIPE_HE_BENT -#undef PIPE_CONNECTOR -#undef PIPE_MANIFOLD -#undef PIPE_JUNCTION -#undef PIPE_UVENT -#undef PIPE_MVALVE -#undef PIPE_PUMP -#undef PIPE_SCRUBBER -#undef PIPE_INSULATED_STRAIGHT -#undef PIPE_INSULATED_BENT -#undef PIPE_GAS_FILTER -#undef PIPE_GAS_MIXER -#undef PIPE_PASSIVE_GATE -#undef PIPE_VOLUME_PUMP -#undef PIPE_HEAT_EXCHANGE -#undef PIPE_TVALVE -#undef PIPE_MANIFOLD4W -#undef PIPE_CAP -#undef PIPE_OMNI_MIXER -#undef PIPE_OMNI_FILTER -#undef PIPE_UNIVERSAL -#undef PIPE_SUPPLY_STRAIGHT -#undef PIPE_SUPPLY_BENT -#undef PIPE_SCRUBBERS_STRAIGHT -#undef PIPE_SCRUBBERS_BENT -#undef PIPE_SUPPLY_MANIFOLD -#undef PIPE_SCRUBBERS_MANIFOLD -#undef PIPE_SUPPLY_MANIFOLD4W -#undef PIPE_SCRUBBERS_MANIFOLD4W -#undef PIPE_SUPPLY_CAP -#undef PIPE_SCRUBBERS_CAP -#undef PIPE_INJECTOR -#undef PIPE_DVALVE -#undef PIPE_DP_VENT -#undef PIPE_PASV_VENT -#undef PIPE_DTVALVE -#undef PIPE_CIRCULATOR +/obj/item/pipe_gsensor/rpd_act(mob/user, obj/item/rpd/our_rpd) + if(our_rpd.mode == RPD_DELETE_MODE) + our_rpd.delete_single_pipe(user, src) + else + ..() diff --git a/code/game/machinery/pipe/pipe_dispenser.dm b/code/game/machinery/pipe/pipe_dispenser.dm index cb2892722aa..43613ef4990 100644 --- a/code/game/machinery/pipe/pipe_dispenser.dm +++ b/code/game/machinery/pipe/pipe_dispenser.dm @@ -10,12 +10,12 @@ /obj/machinery/pipedispenser/attack_hand(mob/user) if(..()) return 1 - + interact(user) - + /obj/machinery/pipedispenser/attack_ghost(mob/user) interact(user) - + /obj/machinery/pipedispenser/interact(mob/user) var/dat = {" Regular pipes:
@@ -163,22 +163,22 @@ /obj/machinery/pipedispenser/disposal/attack_hand(mob/user) if(..()) return - + interact(user) - + /obj/machinery/pipedispenser/disposal/attack_ghost(mob/user) interact(user) - + /obj/machinery/pipedispenser/disposal/interact(mob/user) var/dat = {"Disposal Pipes

-Pipe
-Bent Pipe
-Junction
-Y-Junction
-Trunk
-Bin
-Outlet
-Chute
+Pipe
+Bent Pipe
+Junction
+Y-Junction
+Trunk
+Bin
+Outlet
+Chute
"} var/datum/browser/popup = new(user, "pipedispenser", name, 400, 400) @@ -194,29 +194,10 @@ if(!wait) var/p_type = text2num(href_list["dmake"]) - var/obj/structure/disposalconstruct/C = new (loc) - switch(p_type) - if(0) - C.ptype = 0 - if(1) - C.ptype = 1 - if(2) - C.ptype = 2 - if(3) - C.ptype = 4 - if(4) - C.ptype = 5 - if(5) - C.ptype = 6 - C.density = 1 - if(6) - C.ptype = 7 - C.density = 1 - if(7) - C.ptype = 8 - C.density = 1 + var/obj/structure/disposalconstruct/C = new(loc, p_type) + if(p_type in list(PIPE_DISPOSALS_BIN, PIPE_DISPOSALS_OUTLET, PIPE_DISPOSALS_CHUTE)) + C.density = TRUE C.add_fingerprint(usr) - C.update() wait = 1 spawn(15) - wait = 0 \ No newline at end of file + wait = 0 diff --git a/code/game/objects/items/weapons/rpd.dm b/code/game/objects/items/weapons/rpd.dm index aaaf034b933..e130c3ed606 100644 --- a/code/game/objects/items/weapons/rpd.dm +++ b/code/game/objects/items/weapons/rpd.dm @@ -2,28 +2,8 @@ Rapid Pipe Dispenser */ -#define SIMPLE_CAP 20 -#define SUPPLY_CAP 32 -#define SCRUBBERS_CAP 33 -#define HE_EXCHANGER 17 -#define CONNECTOR 4 -#define UNARY_VENT 7 -#define PASSIVE_VENT 37 -#define GAS_SCRUBBER 10 -#define INJECTOR 34 -#define GAS_SENSOR 98 -#define METER 99 -#define DISPOSALS_JUNCTION 2 -#define ATMOS_MODE 1 -#define DISPOSALS_MODE 2 -#define ROTATION_MODE 3 -#define FLIP_MODE 4 -#define DELETE_MODE 5 -#define ATMOS_PIPING 1 -#define SUPPLY_PIPING 2 -#define SCRUBBERS_PIPING 3 -#define DEVICES 4 -#define HEAT_PIPING 5 +#define RPD_COOLDOWN_TIME 4 //How long should we have to wait between dispensing pipes? +#define RPD_WALLBUILD_TIME 40 //How long should drilling into a wall take? /obj/item/rpd name = "rapid pipe dispenser" @@ -43,13 +23,13 @@ origin_tech = "engineering=4;materials=2" var/datum/effect_system/spark_spread/spark_system var/lastused - var/iconrotation = 0 //used to orient icons and pipes - var/mode = 1 //Disposals, atmospherics, etc. - var/pipetype = 1//For nanoUI menus - var/whatpipe = 0 //What kind of pipe is it? See code/game/machinery/pipe/construction.dm for a list of defines - var/whatdpipe = 0 //What kind of disposals pipe is it? See code/game/machinery/pipe/dispenser.dm for a list of defines - var/spawndelay = 4 //How long should we have to wait between dispensing pipes? - var/walldelay = 40 //How long should drilling into a wall take? + var/iconrotation = 0 //Used to orient icons and pipes + var/mode = RPD_ATMOS_MODE //Disposals, atmospherics, etc. + var/pipe_category = RPD_ATMOS_PIPING//For nanoUI menus, this is a subtype of pipes e.g. scrubbers pipes, devices + var/whatpipe = PIPE_SIMPLE_STRAIGHT //What kind of atmos pipe is it? + var/whatdpipe = PIPE_DISPOSALS_STRAIGHT //What kind of disposals pipe is it? + var/spawndelay = RPD_COOLDOWN_TIME + var/walldelay = RPD_WALLBUILD_TIME /obj/item/rpd/New() ..() @@ -57,82 +37,112 @@ spark_system.set_up(1, 0, src) spark_system.attach(src) +/obj/item/rpd/Destroy() + QDEL_NULL(spark_system) + return ..() + //Procs -/obj/item/rpd/proc/Activaterpd(delay) +/obj/item/rpd/proc/activate_rpd(delay) //Maybe makes sparks and activates cooldown if there is a delay playsound(loc, "sound/machines/click.ogg", 50, 1) if(prob(15)) spark_system.start() if(delay) lastused = world.time -/obj/item/rpd/proc/Manipulatepipes(subject, atmosverb, disposalsverb) - if(istype(subject, /obj/item/pipe)) - call(subject, atmosverb)() - else if(istype(subject, /obj/structure/disposalconstruct/)) - call(subject, disposalsverb)() +/obj/item/rpd/proc/can_dispense_pipe(var/pipe_id, var/pipe_type) //Returns TRUE if this is a legit pipe we can dispense, otherwise returns FALSE + for(var/list/L in GLOB.rpd_pipe_list) + if(pipe_type != L["pipe_type"]) //Sometimes pipes in different categories have the same pipe_id, so we need to skip anything not in the category we want + continue + if(pipe_id == L["pipe_id"]) //Found the pipe, we can dispense it + return TRUE + +/obj/item/rpd/proc/create_atmos_pipe(mob/user, turf/T) //Make an atmos pipe, meter, or gas sensor + if(!can_dispense_pipe(whatpipe, RPD_ATMOS_MODE)) + log_runtime(EXCEPTION("Failed to spawn [get_pipe_name(whatpipe, PIPETYPE_ATMOS)] - possible tampering detected")) //Damn dirty apes -- I mean hackers + return + var/obj/item/pipe/P + if(whatpipe == PIPE_GAS_SENSOR) + P = new /obj/item/pipe_gsensor(T) + else if(whatpipe == PIPE_METER) + P = new /obj/item/pipe_meter(T) + else + P = new(T, whatpipe, iconrotation) //Make the pipe, BUT WAIT! There's more! + if(!iconrotation && P.is_bent_pipe()) //Automatically rotates dispensed pipes if the user selected auto-rotation + P.dir = turn(user.dir, 135) + else if(!iconrotation && P.pipe_type in list(PIPE_CONNECTOR, PIPE_UVENT, PIPE_SCRUBBER, PIPE_HEAT_EXCHANGE, PIPE_CAP, PIPE_SUPPLY_CAP, PIPE_SCRUBBERS_CAP, PIPE_INJECTOR, PIPE_PASV_VENT)) //Some pipes dispense oppositely to what you'd expect, but we don't want to do anything if they selected a direction + P.flip() + else if(iconrotation && P.is_bent_pipe()) //If user selected a rotation and the pipe is bent + P.dir = turn(iconrotation, -45) + else if(!iconrotation) //If user selected a rotation + P.dir = user.dir + to_chat(user, "[src] rapidly dispenses [P]!") + activate_rpd(TRUE) + +/obj/item/rpd/proc/create_disposals_pipe(mob/user, turf/T) //Make a disposals pipe / construct + if(!can_dispense_pipe(whatdpipe, RPD_DISPOSALS_MODE)) + log_runtime(EXCEPTION("Failed to spawn [get_pipe_name(whatdpipe, PIPETYPE_DISPOSAL)] - possible tampering detected")) + return + var/obj/structure/disposalconstruct/P = new(T, whatdpipe, iconrotation) + if(!iconrotation) //Automatic rotation + P.dir = user.dir + if(!iconrotation && whatdpipe != PIPE_DISPOSALS_JUNCTION_RIGHT) //Disposals pipes are in the opposite direction to atmos pipes, so we need to flip them. Junctions don't have this quirk though + P.flip() + to_chat(user, "[src] rapidly dispenses [P]!") + activate_rpd(TRUE) + +/obj/item/rpd/proc/rotate_all_pipes(mob/user, turf/T) //Rotate all pipes on a turf + for(var/obj/item/pipe/P in T) + P.rotate() + for(var/obj/structure/disposalconstruct/D in T) + D.rotate() + +/obj/item/rpd/proc/flip_all_pipes(mob/user, turf/T) //Flip all pipes on a turf + for(var/obj/item/pipe/P in T) + P.flip() + for(var/obj/structure/disposalconstruct/D in T) + D.flip() + +/obj/item/rpd/proc/delete_all_pipes(mob/user, turf/T) //Delete all pipes on a turf + var/eaten + for(var/obj/item/pipe/P in T) + QDEL_NULL(P) + eaten = TRUE + for(var/obj/item/pipe_gsensor/G in T) + QDEL_NULL(G) + eaten = TRUE + for(var/obj/item/pipe_meter/M in T) + QDEL_NULL(M) + eaten = TRUE + for(var/obj/structure/disposalconstruct/D in T) + if(!D.anchored) + QDEL_NULL(D) + eaten = TRUE + if(eaten) + to_chat(user, "[src] sucks up the loose pipes on [T].") + activate_rpd() + else + to_chat(user, "There were no loose pipes on [T].") + +/obj/item/rpd/proc/delete_single_pipe(mob/user, obj/P) //Delete a single pipe + to_chat(user, "[src] sucks up [P].") + QDEL_NULL(P) + activate_rpd() //Lists of things -var/list/pipelist = list( //id refers to the pipe_type found in construction.dm, icon refers to the name of the icon state in icons/obj/pipe-item.dmi. Icons are made with the asset-cache - list("pipename" = "Straight pipe", "id" = 0, "category" = ATMOS_PIPING, "orientations" = 2, "icon" = "simple"), - list("pipename" = "Bent pipe", "id" = 1, "category" = ATMOS_PIPING, "orientations" = 4, "icon" = "simple", "bendy" = 1), - list("pipename" = "T-manifold", "id" = 5, "category" = ATMOS_PIPING, "orientations" = 4, "icon" = "manifold"), - list("pipename" = "4-way manifold", "id" = 19, "category" = ATMOS_PIPING, "orientations" = 1, "icon" = "manifold4w"), - list("pipename" = "Pipe cap", "id" = 20, "category" = ATMOS_PIPING, "orientations" = 4, "icon" = "cap"), - list("pipename" = "Manual valve", "id" = 8, "category" = ATMOS_PIPING, "orientations" = 2, "icon" = "mvalve"), - list("pipename" = "Digital valve", "id" = 35, "category" = ATMOS_PIPING, "orientations" = 2, "icon" = "dvalve"), - list("pipename" = "Manual T-valve", "id" = 18, "category" = ATMOS_PIPING, "orientations" = 4, "icon" = "tvalve"), - list("pipename" = "Digital T-valve", "id" = 38, "category" = ATMOS_PIPING, "orientations" = 4, "icon" = "dtvalve"), - list("pipename" = "Straight supply pipe", "id" = 24, "category" = SUPPLY_PIPING, "orientations" = 2, "icon" = "simple"), - list("pipename" = "Bent supply pipe", "id" = 25, "category" = SUPPLY_PIPING, "orientations" = 4, "icon" = "simple", "bendy" = 1), - list("pipename" = "Supply T-manifold", "id" = 28, "category" = SUPPLY_PIPING, "orientations" = 4, "icon" = "manifold"), - list("pipename" = "4-way supply manifold", "id" = 30, "category" = SUPPLY_PIPING, "orientations" = 1, "icon" = "manifold4w"), - list("pipename" = "Supply pipe cap", "id" = 32, "category" = SUPPLY_PIPING, "orientations" = 4, "icon" = "cap"), - list("pipename" = "Straight scrubbers pipe", "id" = 26, "category" = SCRUBBERS_PIPING, "orientations" = 2, "icon" = "simple"), - list("pipename" = "Bent scrubbers pipe", "id" = 27, "category" = SCRUBBERS_PIPING, "orientations" = 4, "icon" = "simple", "bendy" = 1), - list("pipename" = "Scrubbers T-manifold", "id" = 29, "category" = SCRUBBERS_PIPING, "orientations" = 4, "icon" = "manifold"), - list("pipename" = "4-way scrubbers manifold", "id" = 31, "category" = SCRUBBERS_PIPING, "orientations" = 1, "icon" = "manifold4w"), - list("pipename" = "Scrubbers pipe cap", "id" = 33, "category" = SCRUBBERS_PIPING, "orientations" = 4, "icon" = "cap"), - list("pipename" = "Universal pipe adapter", "id" = 23, "category" = DEVICES, "orientations" = 2, "icon" = "universal"), - list("pipename" = "Connector", "id" = 4, "category" = DEVICES, "orientations" = 4, "icon" = "connector"), - list("pipename" = "Unary vent", "id" = 7, "category" = DEVICES, "orientations" = 4, "icon" = "uvent"), - list("pipename" = "Scrubber", "id" = 10, "category" = DEVICES, "orientations" = 4, "icon" = "scrubber"), - list("pipename" = "Gas pump", "id" = 9, "category" = DEVICES, "orientations" = 4, "icon" = "pump"), - list("pipename" = "Volume pump", "id" = 16, "category" = DEVICES, "orientations" = 4, "icon" = "volumepump"), - list("pipename" = "Passive gate", "id" = 15, "category" = DEVICES, "orientations" = 4, "icon" = "passivegate"), - list("pipename" = "Gas filter", "id" = 13, "category" = DEVICES, "orientations" = 4, "icon" = "filter"), - list("pipename" = "Gas mixer", "id" = 14, "category" = DEVICES, "orientations" = 4, "icon" = "mixer"), - list("pipename" = "Gas sensor", "id" = 98, "category" = DEVICES, "orientations" = 1, "icon" = "sensor"), - list("pipename" = "Meter", "id" = 99, "category" = DEVICES, "orientations" = 1, "icon" = "meter"), - list("pipename" = "Passive vent", "id" = 37, "category" = DEVICES, "orientations" = 4, "icon" = "passive vent"), - list("pipename" = "Dual-port vent pump", "id" = 36, "category" = DEVICES, "orientations" = 2, "icon" = "dual-port vent"), - list("pipename" = "Air injector", "id" = 34, "category" = DEVICES, "orientations" = 4, "icon" = "injector"), - list("pipename" = "Straight HE pipe", "id" = 2, "category" = HEAT_PIPING, "orientations" = 2, "icon" = "he"), - list("pipename" = "Bent HE pipe", "id" = 3, "category" = HEAT_PIPING, "orientations" = 4, "icon" = "he", "bendy" = 1), - list("pipename" = "Junction", "id" = 6, "category" = HEAT_PIPING, "orientations" = 4, "icon" = "junction"), - list("pipename" = "Heat exchanger", "id" = 17, "category" = HEAT_PIPING, "orientations" = 4, "icon" = "heunary")) -var/list/dpipelist = list( - list("pipename" = "Straight pipe", "id" = 0, "orientations" = 2, "icon" = "conpipe-s"), - list("pipename" = "Bent pipe", "id" = 1, "orientations" = 4, "icon" = "conpipe-c"), - list("pipename" = "Junction", "id" = 2, "orientations" = 4, "icon" = "conpipe-j1"), - list("pipename" = "Y-junction", "id" = 4, "orientations" = 4, "icon" = "conpipe-y"), - list("pipename" = "Trunk", "id" = 5, "orientations" = 4, "icon" = "conpipe-t"), - list("pipename" = "Bin", "id" = 6, "orientations" = 1, "icon" = "condisposal"), - list("pipename" = "Outlet", "id" = 7, "orientations" = 4, "icon" = "outlet"), - list("pipename" = "Chute", "id" = 8, "orientations" = 4, "icon" = "intake")) var/list/mainmenu = list( - list("category" = "Atmospherics", "mode" = 1, "icon" = "wrench"), - list("category" = "Disposals", "mode" = 2, "icon" = "recycle"), - list("category" = "Rotate", "mode" = 3, "icon" = "rotate-right"), - list("category" = "Flip", "mode" = 4, "icon" = "exchange"), - list("category" = "Recycle", "mode" = 5, "icon" = "trash")) + list("category" = "Atmospherics", "mode" = RPD_ATMOS_MODE, "icon" = "wrench"), + list("category" = "Disposals", "mode" = RPD_DISPOSALS_MODE, "icon" = "recycle"), + list("category" = "Rotate", "mode" = RPD_ROTATE_MODE, "icon" = "rotate-right"), + list("category" = "Flip", "mode" = RPD_FLIP_MODE, "icon" = "exchange"), + list("category" = "Recycle", "mode" = RPD_DELETE_MODE, "icon" = "trash")) var/list/pipemenu = list( - list("pipecategory" = "Normal", "pipemode" = 1), - list("pipecategory" = "Supply", "pipemode" = 2), - list("pipecategory" = "Scrubber", "pipemode" = 3), - list("pipecategory" = "Devices", "pipemode" = 4), - list("pipecategory" = "Heat exchange", "pipemode" = 5)) + list("category" = "Normal", "pipemode" = RPD_ATMOS_PIPING), + list("category" = "Supply", "pipemode" = RPD_SUPPLY_PIPING), + list("category" = "Scrubber", "pipemode" = RPD_SCRUBBERS_PIPING), + list("category" = "Devices", "pipemode" = RPD_DEVICES), + list("category" = "Heat exchange", "pipemode" = RPD_HEAT_PIPING)) //NanoUI stuff @@ -148,13 +158,12 @@ var/list/pipemenu = list( /obj/item/rpd/ui_data(mob/user, ui_key = "main", datum/topic_state/state = inventory_state) var/data[0] - data["dpipelist"] = dpipelist data["iconrotation"] = iconrotation data["mainmenu"] = mainmenu data["mode"] = mode - data["pipelist"] = pipelist + data["pipelist"] = GLOB.rpd_pipe_list data["pipemenu"] = pipemenu - data["pipetype"] = pipetype + data["pipe_category"] = pipe_category data["whatdpipe"] = whatdpipe data["whatpipe"] = whatpipe return data @@ -167,99 +176,23 @@ var/list/pipemenu = list( whatpipe = text2num(sanitize(href_list["whatpipe"])) else if(href_list["whatdpipe"]) whatdpipe = text2num(sanitize(href_list["whatdpipe"])) - else if(href_list["pipetype"]) - pipetype = text2num(sanitize(href_list["pipetype"])) + else if(href_list["pipe_category"]) + pipe_category = text2num(sanitize(href_list["pipe_category"])) else if(href_list["mode"]) mode = text2num(sanitize(href_list["mode"])) else return SSnanoui.update_uis(src) -//What the RPD actually does - /obj/item/rpd/afterattack(atom/target, mob/user, proximity) ..() - var/turf/T = get_turf(target) - if(loc != user || ismob(target) || istype(target, /obj/structure/window) || !proximity || world.time < lastused + spawndelay) + if(loc != user) return - if(!(T.flags & RPD_ALLOWED_HERE)) - to_chat(user, "[src] beeps, \"Unable to interface with [T]. Please try again later.\"") + if(!proximity) return - if(mode == ATMOS_MODE) - if(istype(T, /turf/simulated/wall)) //Drilling into walls takes time - playsound(loc, "sound/weapons/circsawhit.ogg", 50, 1) - user.visible_message("[user] starts drilling a hole in [T]...", "You start drilling a hole in [T]...", "You hear a drill.") - if(!do_after(user, walldelay, target = T)) - return - user.visible_message("[user] finishes drilling a hole in [T]!", "You finish drilling a hole in [T]!", "You hear clanking.") - var/obj/item/pipe/P - if(whatpipe == GAS_SENSOR) - P = new /obj/item/pipe_gsensor(T) - else if(whatpipe == METER) - P = new /obj/item/pipe_meter(T) - else - P = new(T, pipe_type = whatpipe, dir = user.dir) - if(iconrotation == 0 && P.is_bent_pipe()) //Automatic rotation of dispensed pipes - P.dir = turn(user.dir, 135) - else if(iconrotation == 0 && P.pipe_type in list(CONNECTOR, UNARY_VENT, GAS_SCRUBBER, HE_EXCHANGER, SIMPLE_CAP, SUPPLY_CAP, SCRUBBERS_CAP, INJECTOR, PASSIVE_VENT)) //Some pipes dispense oppositely to what you'd expect, but we don't want to do anything if they selected a direction - P.flip() - else if(iconrotation != 0 && P.is_bent_pipe()) //If they selected a rotation and the pipe is bent - P.dir = turn(iconrotation, -45) - else if(iconrotation != 0) - P.dir = iconrotation - to_chat(user, "[src] rapidly dispenses [P]!") - Activaterpd(1) - else if(mode == DISPOSALS_MODE && !istype(T, /turf/simulated/shuttle)) - if(istype(T, /turf/simulated/wall)) //No disposals pipes on walls - to_chat(user, "That type of pipe won't fit on [T]!") - return - var/obj/structure/disposalconstruct/P = new(T) //Now we make the pipe - P.dir = iconrotation - P.ptype = whatdpipe - if(iconrotation == 0) //Automatic rotation - P.dir = user.dir - if(iconrotation == 0 && whatdpipe != DISPOSALS_JUNCTION) //Disposals pipes are in the opposite direction to atmos pipes, so we need to flip them. Junctions don't have this quirk though - P.flip() - P.update() - to_chat(user, "[src] rapidly dispenses [P]!") - Activaterpd(1) - else if(mode == ROTATION_MODE) - for(var/obj/W in T) - Manipulatepipes(W, /obj/item/pipe/verb/rotate, /obj/structure/disposalconstruct/verb/rotate) - else if(mode == FLIP_MODE) - for(var/obj/W in T) - Manipulatepipes(W, /obj/item/pipe/verb/flip, /obj/structure/disposalconstruct/verb/flip) - else if(mode == DELETE_MODE) - var/eaten - for(var/obj/W in T) - if(istype(W, /obj/item/pipe) || istype(W, /obj/item/pipe_meter) || istype(W, /obj/item/pipe_gsensor) || istype(W, /obj/structure/disposalconstruct) && !W.anchored) - QDEL_NULL(W) - eaten = TRUE - if(eaten) - to_chat(user, "[src] sucks up the loose pipes on [T].") - Activaterpd() - else - to_chat(user, "There were no loose pipes on [T].") + if(world.time < lastused + spawndelay) + return + target.rpd_act(user, src) //Handle RPD effects in separate procs -#undef SIMPLE_CAP -#undef SUPPLY_CAP -#undef SCRUBBERS_CAP -#undef HE_EXCHANGER -#undef CONNECTOR -#undef UNARY_VENT -#undef PASSIVE_VENT -#undef GAS_SCRUBBER -#undef INJECTOR -#undef GAS_SENSOR -#undef METER -#undef DISPOSALS_JUNCTION -#undef ATMOS_MODE -#undef DISPOSALS_MODE -#undef ROTATION_MODE -#undef FLIP_MODE -#undef DELETE_MODE -#undef ATMOS_PIPING -#undef SUPPLY_PIPING -#undef SCRUBBERS_PIPING -#undef DEVICES -#undef HEAT_PIPING +#undef RPD_COOLDOWN_TIME +#undef RPD_WALLBUILD_TIME diff --git a/code/game/objects/objs.dm b/code/game/objects/objs.dm index dc642dcbde5..426da47d5ea 100644 --- a/code/game/objects/objs.dm +++ b/code/game/objects/objs.dm @@ -69,6 +69,10 @@ SSnanoui.close_uis(src) return ..() +/obj/rpd_act(mob/user, obj/item/rpd/our_rpd) + var/turf/T = get_turf(src) //This preserves RPD behaviour on specific turfs + T.rpd_act(user, our_rpd) + /obj/proc/process() set waitfor = 0 processing_objects.Remove(src) diff --git a/code/game/objects/structures/window.dm b/code/game/objects/structures/window.dm index 8a30f18f7bd..25c78f6e972 100644 --- a/code/game/objects/structures/window.dm +++ b/code/game/objects/structures/window.dm @@ -123,6 +123,9 @@ var/global/wcCommon = pick(list("#379963", "#0d8395", "#58b5c3", "#49e46e", "#8f new/obj/structure/window/reinforced/clockwork/fulltile(get_turf(src)) qdel(src) +/obj/structure/window/rpd_act() + return + /obj/structure/window/singularity_pull(S, current_size) if(current_size >= STAGE_FIVE) deconstruct(FALSE) diff --git a/code/game/turfs/simulated.dm b/code/game/turfs/simulated.dm index 89c40be8641..61f622c071f 100644 --- a/code/game/turfs/simulated.dm +++ b/code/game/turfs/simulated.dm @@ -4,7 +4,6 @@ var/image/wet_overlay = null var/thermite = 0 - flags = RPD_ALLOWED_HERE oxygen = MOLES_O2STANDARD nitrogen = MOLES_N2STANDARD var/to_be_destroyed = 0 //Used for fire, if a melting temperature was reached, it will be destroyed diff --git a/code/game/turfs/simulated/shuttle.dm b/code/game/turfs/simulated/shuttle.dm index 0c5e6c08f6b..7a781679173 100644 --- a/code/game/turfs/simulated/shuttle.dm +++ b/code/game/turfs/simulated/shuttle.dm @@ -1,7 +1,6 @@ /turf/simulated/shuttle name = "shuttle" icon = 'icons/turf/shuttle.dmi' - flags = null thermal_conductivity = 0.05 heat_capacity = 0 layer = 2 @@ -13,6 +12,9 @@ density = 1 blocks_air = 1 +/turf/simulated/shuttle/rpd_act(mob/user, obj/item/rpd/our_rpd) + if(our_rpd.mode == RPD_DELETE_MODE)//No pipes on shuttles + our_rpd.delete_all_pipes(user, src) /turf/simulated/shuttle/narsie_act() if(prob(20)) diff --git a/code/game/turfs/simulated/walls.dm b/code/game/turfs/simulated/walls.dm index db85329f8c1..a24e6f2953f 100644 --- a/code/game/turfs/simulated/walls.dm +++ b/code/game/turfs/simulated/walls.dm @@ -168,6 +168,18 @@ if(prob(50)) dismantle_wall() +/turf/simulated/wall/rpd_act(mob/user, obj/item/rpd/our_rpd) + if(our_rpd.mode == RPD_ATMOS_MODE) + playsound(src, "sound/weapons/circsawhit.ogg", 50, 1) + user.visible_message("[user] starts drilling a hole in [src]...", "You start drilling a hole in [src]...", "You hear drilling.") + if(!do_after(user, our_rpd.walldelay, target = src)) //Drilling into walls takes time + return + our_rpd.create_atmos_pipe(user, src) + else if(our_rpd.mode == RPD_DISPOSALS_MODE) + return + else + ..() + /turf/simulated/wall/mech_melee_attack(obj/mecha/M) if(M.damtype == "brute") playsound(src, 'sound/weapons/punch4.ogg', 50, 1) diff --git a/code/game/turfs/space/space.dm b/code/game/turfs/space/space.dm index 60c63d0f221..58911d952b4 100644 --- a/code/game/turfs/space/space.dm +++ b/code/game/turfs/space/space.dm @@ -3,7 +3,6 @@ name = "\proper space" icon_state = "0" dynamic_lighting = 0 - flags = RPD_ALLOWED_HERE luminosity = 1 temperature = TCMB diff --git a/code/game/turfs/space/transit.dm b/code/game/turfs/space/transit.dm index 2831894e3ea..c08189e4d93 100644 --- a/code/game/turfs/space/transit.dm +++ b/code/game/turfs/space/transit.dm @@ -1,5 +1,4 @@ /turf/space/transit - flags = null var/pushdirection // push things that get caught in the transit tile this direction //Overwrite because we dont want people building rods in space. @@ -118,7 +117,8 @@ AM.newtonian_move(dir) - +/turf/space/transit/rpd_act() + return //Overwrite because we dont want people building rods in space. /turf/space/transit/attackby() diff --git a/code/game/turfs/turf.dm b/code/game/turfs/turf.dm index f70aee9740f..337233b5bf4 100644 --- a/code/game/turfs/turf.dm +++ b/code/game/turfs/turf.dm @@ -71,6 +71,21 @@ /turf/ex_act(severity) return 0 +/turf/rpd_act(mob/user, obj/item/rpd/our_rpd) //This is the default turf behaviour for the RPD; override it as required + if(our_rpd.mode == RPD_ATMOS_MODE) + our_rpd.create_atmos_pipe(user, src) + else if(our_rpd.mode == RPD_DISPOSALS_MODE) + for(var/obj/machinery/door/airlock/A in src) + if(A.density) + to_chat(user, "That type of pipe won't fit under [A]!") + return + our_rpd.create_disposals_pipe(user, src) + else if(our_rpd.mode == RPD_ROTATE_MODE) + our_rpd.rotate_all_pipes(user, src) + else if(our_rpd.mode == RPD_FLIP_MODE) + our_rpd.flip_all_pipes(user, src) + else if(our_rpd.mode == RPD_DELETE_MODE) + our_rpd.delete_all_pipes(user, src) /turf/bullet_act(var/obj/item/projectile/Proj) if(istype(Proj ,/obj/item/projectile/beam/pulse)) diff --git a/code/game/turfs/unsimulated.dm b/code/game/turfs/unsimulated.dm index 5c9509a3d68..35b6c2056e3 100644 --- a/code/game/turfs/unsimulated.dm +++ b/code/game/turfs/unsimulated.dm @@ -7,6 +7,9 @@ /turf/unsimulated/can_lay_cable() return 0 +/turf/unsimulated/rpd_act() + return + /turf/unsimulated/floor/plating/vox icon_state = "plating" name = "plating" diff --git a/code/modules/client/asset_cache.dm b/code/modules/client/asset_cache.dm index 471c1334bf8..c7f8504f13e 100644 --- a/code/modules/client/asset_cache.dm +++ b/code/modules/client/asset_cache.dm @@ -324,7 +324,7 @@ proc/getFilesSlow(var/client/client, var/list/files, var/register_asset = TRUE) for(var/D in cardinal) assets["[state]-[dir2text(D)].png"] = icon('icons/obj/pipe-item.dmi', state, D) for(var/state in icon_states('icons/obj/pipes/disposal.dmi')) - if(!(state in list("conpipe-c", "conpipe-j1", "conpipe-s", "conpipe-t", "conpipe-y", "intake", "outlet"))) //Pipes we want sprites for + if(!(state in list("pipe-c", "pipe-j1", "pipe-s", "pipe-t", "pipe-y", "intake", "outlet"))) //Pipes we want sprites for continue for(var/D in cardinal) assets["[state]-[dir2text(D)].png"] = icon('icons/obj/pipes/disposal.dmi', state, D) diff --git a/code/modules/recycling/disposal-construction.dm b/code/modules/recycling/disposal-construction.dm index 3658846a696..c7e276cae17 100644 --- a/code/modules/recycling/disposal-construction.dm +++ b/code/modules/recycling/disposal-construction.dm @@ -11,66 +11,57 @@ density = 0 pressure_resistance = 5*ONE_ATMOSPHERE level = 2 - var/ptype = 0 - // 0=straight, 1=bent, 2=junction-j1, 3=junction-j2, 4=junction-y, 5=trunk, 6=disposal bin, 7=outlet, 8=inlet - + var/ptype = PIPE_DISPOSALS_STRAIGHT //Use the defines + var/base_state var/dpdir = 0 // directions as disposalpipe - var/base_state = "pipe-s" + +/obj/structure/disposalconstruct/New(loc, pipe_type, direction) + ..() + if(pipe_type) + ptype = pipe_type + if(dir) + dir = direction + update() // update iconstate and dpdir due to dir and type /obj/structure/disposalconstruct/proc/update() + base_state = get_pipe_icon(ptype) + icon_state = "con[base_state]" var/flip = turn(dir, 180) var/left = turn(dir, 90) var/right = turn(dir, -90) - + name = get_pipe_name(ptype, PIPETYPE_DISPOSAL) switch(ptype) - if(0) - base_state = "pipe-s" + if(PIPE_DISPOSALS_STRAIGHT) dpdir = dir | flip - if(1) - base_state = "pipe-c" + if(PIPE_DISPOSALS_BENT) dpdir = dir | right - if(2) - base_state = "pipe-j1" + if(PIPE_DISPOSALS_JUNCTION_RIGHT) dpdir = dir | right | flip - if(3) - base_state = "pipe-j2" + if(PIPE_DISPOSALS_JUNCTION_LEFT) dpdir = dir | left | flip - if(4) - base_state = "pipe-y" + if(PIPE_DISPOSALS_Y_JUNCTION) dpdir = dir | left | right - if(5) - base_state = "pipe-t" + if(PIPE_DISPOSALS_TRUNK) dpdir = dir - // disposal bin has only one dir, thus we don't need to care about setting it - if(6) - if(anchored) - base_state = "disposal" - else - base_state = "condisposal" - - if(7) - base_state = "outlet" - dpdir = dir - - if(8) - base_state = "intake" - dpdir = dir - - if(9) - base_state = "pipe-j1s" + if(PIPE_DISPOSALS_SORT_RIGHT) dpdir = dir | right | flip - - if(10) - base_state = "pipe-j2s" + if(PIPE_DISPOSALS_SORT_LEFT) dpdir = dir | left | flip - - - if(ptype<6 || ptype>8) + // disposal bin has only one dir, thus we don't need to care about setting it + if(PIPE_DISPOSALS_BIN) + if(!anchored) + icon_state = "[base_state]-unanchored" + else + icon_state = base_state + if(PIPE_DISPOSALS_OUTLET) + dpdir = dir + icon_state = base_state + if(PIPE_DISPOSALS_CHUTE) + dpdir = dir + icon_state = base_state + if(!(ptype in list(PIPE_DISPOSALS_BIN, PIPE_DISPOSALS_OUTLET, PIPE_DISPOSALS_CHUTE))) icon_state = "con[base_state]" - else - icon_state = base_state - if(invisibility) // if invisible, fade icon icon -= rgb(0,0,0,128) @@ -116,33 +107,33 @@ dir = turn(dir, 180) switch(ptype) - if(2) - ptype = 3 - if(3) - ptype = 2 - if(9) - ptype = 10 - if(10) - ptype = 9 + if(PIPE_DISPOSALS_JUNCTION_RIGHT) + ptype = PIPE_DISPOSALS_JUNCTION_LEFT + if(PIPE_DISPOSALS_JUNCTION_LEFT) + ptype = PIPE_DISPOSALS_JUNCTION_RIGHT + if(PIPE_DISPOSALS_SORT_RIGHT) + ptype = PIPE_DISPOSALS_SORT_LEFT + if(PIPE_DISPOSALS_SORT_LEFT) + ptype = PIPE_DISPOSALS_SORT_RIGHT update() // returns the type path of disposalpipe corresponding to this item dtype /obj/structure/disposalconstruct/proc/dpipetype() switch(ptype) - if(0,1) + if(PIPE_DISPOSALS_STRAIGHT, PIPE_DISPOSALS_BENT) return /obj/structure/disposalpipe/segment - if(2,3,4) + if(PIPE_DISPOSALS_JUNCTION_RIGHT, PIPE_DISPOSALS_JUNCTION_LEFT, PIPE_DISPOSALS_Y_JUNCTION) return /obj/structure/disposalpipe/junction - if(5) + if(PIPE_DISPOSALS_TRUNK) return /obj/structure/disposalpipe/trunk - if(6) + if(PIPE_DISPOSALS_BIN) return /obj/machinery/disposal - if(7) + if(PIPE_DISPOSALS_OUTLET) return /obj/structure/disposaloutlet - if(8) + if(PIPE_DISPOSALS_CHUTE) return /obj/machinery/disposal/deliveryChute - if(9,10) + if(PIPE_DISPOSALS_SORT_RIGHT, PIPE_DISPOSALS_SORT_LEFT) return /obj/structure/disposalpipe/sortjunction return @@ -157,13 +148,13 @@ var/ispipe = 0 // Indicates if we should change the level of this pipe src.add_fingerprint(user) switch(ptype) - if(6) + if(PIPE_DISPOSALS_BIN) nicetype = "disposal bin" - if(7) + if(PIPE_DISPOSALS_OUTLET) nicetype = "disposal outlet" - if(8) + if(PIPE_DISPOSALS_CHUTE) nicetype = "delivery chute" - if(9, 10) + if(PIPE_DISPOSALS_SORT_RIGHT, PIPE_DISPOSALS_SORT_LEFT) nicetype = "sorting pipe" ispipe = 1 else @@ -197,7 +188,7 @@ return var/obj/structure/disposalpipe/CP = locate() in T - if(ptype>=6 && ptype <= 8) // Disposal or outlet + if(ptype in list(PIPE_DISPOSALS_BIN, PIPE_DISPOSALS_OUTLET, PIPE_DISPOSALS_CHUTE)) // Disposal or outlet if(CP) // There's something there if(!istype(CP,/obj/structure/disposalpipe/trunk)) to_chat(user, "The [nicetype] requires a trunk underneath it in order to work.") @@ -236,22 +227,22 @@ P.update_icon() //Needs some special treatment ;) - if(ptype==9 || ptype==10) + if(ptype == PIPE_DISPOSALS_SORT_RIGHT || ptype == PIPE_DISPOSALS_SORT_LEFT) var/obj/structure/disposalpipe/sortjunction/SortP = P SortP.updatedir() - else if(ptype==6) // Disposal bin + else if(ptype == PIPE_DISPOSALS_BIN) // Disposal bin var/obj/machinery/disposal/P = new /obj/machinery/disposal(src.loc) src.transfer_fingerprints_to(P) P.mode = 0 // start with pump off - else if(ptype==7) // Disposal outlet + else if(ptype == PIPE_DISPOSALS_OUTLET) // Disposal outlet var/obj/structure/disposaloutlet/P = new /obj/structure/disposaloutlet(src.loc) src.transfer_fingerprints_to(P) P.dir = dir - else if(ptype==8) // Disposal outlet + else if(ptype==PIPE_DISPOSALS_CHUTE) // Disposal outlet var/obj/machinery/disposal/deliveryChute/P = new /obj/machinery/disposal/deliveryChute(src.loc) src.transfer_fingerprints_to(P) @@ -265,3 +256,13 @@ else to_chat(user, "You need to attach it to the plating first!") return + +/obj/structure/disposalconstruct/rpd_act(mob/user, obj/item/rpd/our_rpd) + if(our_rpd.mode == RPD_ROTATE_MODE) + rotate() + else if(our_rpd.mode == RPD_FLIP_MODE) + flip() + else if(our_rpd.mode == RPD_DELETE_MODE) + our_rpd.delete_single_pipe(user, src) + else + ..() diff --git a/code/modules/recycling/disposal.dm b/code/modules/recycling/disposal.dm index 00b3b06a3a5..476028b4532 100644 --- a/code/modules/recycling/disposal.dm +++ b/code/modules/recycling/disposal.dm @@ -97,7 +97,7 @@ to_chat(user, "You sliced the floorweld off the disposal unit.") var/obj/structure/disposalconstruct/C = new (src.loc) src.transfer_fingerprints_to(C) - C.ptype = 6 // 6 = disposal unit + C.ptype = PIPE_DISPOSALS_BIN C.anchored = 1 C.density = 1 C.update() @@ -889,21 +889,21 @@ var/obj/structure/disposalconstruct/C = new (src.loc) switch(base_icon_state) if("pipe-s") - C.ptype = 0 + C.ptype = PIPE_DISPOSALS_STRAIGHT if("pipe-c") - C.ptype = 1 + C.ptype = PIPE_DISPOSALS_BENT if("pipe-j1") - C.ptype = 2 + C.ptype = PIPE_DISPOSALS_JUNCTION_RIGHT if("pipe-j2") - C.ptype = 3 + C.ptype = PIPE_DISPOSALS_JUNCTION_LEFT if("pipe-y") - C.ptype = 4 + C.ptype = PIPE_DISPOSALS_Y_JUNCTION if("pipe-t") - C.ptype = 5 + C.ptype = PIPE_DISPOSALS_TRUNK if("pipe-j1s") - C.ptype = 9 + C.ptype = PIPE_DISPOSALS_SORT_RIGHT if("pipe-j2s") - C.ptype = 10 + C.ptype = PIPE_DISPOSALS_SORT_LEFT src.transfer_fingerprints_to(C) C.dir = dir C.density = 0 @@ -1339,7 +1339,7 @@ to_chat(user, "You sliced the floorweld off the disposal outlet.") var/obj/structure/disposalconstruct/C = new (src.loc) src.transfer_fingerprints_to(C) - C.ptype = 7 // 7 = outlet + C.ptype = PIPE_DISPOSALS_OUTLET C.update() C.anchored = 1 C.density = 1 diff --git a/code/modules/recycling/sortingmachinery.dm b/code/modules/recycling/sortingmachinery.dm index c40ed9fe73b..8b2f7c4197f 100755 --- a/code/modules/recycling/sortingmachinery.dm +++ b/code/modules/recycling/sortingmachinery.dm @@ -349,7 +349,7 @@ if(!src || !W.isOn()) return to_chat(user, "You sliced the floorweld off the delivery chute.") var/obj/structure/disposalconstruct/C = new (src.loc) - C.ptype = 8 // 8 = Delivery chute + C.ptype = PIPE_DISPOSALS_CHUTE C.update() C.anchored = 1 C.density = 1 diff --git a/icons/obj/pipes/disposal.dmi b/icons/obj/pipes/disposal.dmi index 707a064dd94..83440fc1b52 100644 Binary files a/icons/obj/pipes/disposal.dmi and b/icons/obj/pipes/disposal.dmi differ diff --git a/nano/templates/rpd.tmpl b/nano/templates/rpd.tmpl index bd92b91c979..6a9c2ccb517 100644 --- a/nano/templates/rpd.tmpl +++ b/nano/templates/rpd.tmpl @@ -4,101 +4,104 @@ Used In File(s): /code/game/objects/items/weapons/rpd.dm

Mode:

{{for data.mainmenu}} - {{:helper.link(String(value.category), String(value.icon), {"mode": Number(value.mode)}, data.mode == Number(value.mode) ? "linkOn" : null)}} + {{:helper.link(value.category, value.icon, {mode: value.mode}, data.mode == value.mode ? "linkOn" : null)}} {{/for}}
{{if data.mode == 1}}

Pipe type:

{{for data.pipemenu}} - {{:helper.link(String(value.pipecategory), null, {"pipetype": Number(value.pipemode)}, data.pipetype == Number(value.pipemode) ? "linkOn" : null)}} + {{:helper.link(value.category, null, {pipe_category: value.pipemode}, data.pipe_category == value.pipemode ? "linkOn" : null)}} {{/for}}

Available pipes:

{{for data.pipelist}} - {{if value.category == data.pipetype}} -
{{:helper.link(String(value.pipename), "arrow-right", {"whatpipe": Number(value.id)}, data.whatpipe == Number(value.id) ? "linkOn" : null)}}
+ {{if value.pipe_type == 1 && value.pipe_category == data.pipe_category}} +
{{:helper.link(value.pipe_name, "arrow-right", {whatpipe: value.pipe_id}, data.whatpipe == value.pipe_id ? "linkOn" : null)}}
{{/if}} {{/for}}
{{for data.pipelist}} + {{if value.pipe_type != 1 || value.pipe_id != data.whatpipe || value.orientations == 1}} + {{continue;}} + {{/if}}
- {{if value.id == data.whatpipe && value.orientations != 1}} -
- {{:helper.link("Orient automatically", null, {"iconrotation": 0}, data.iconrotation == 0 ? "linkOn" : null)}} -
- {{/if}} - {{if value.id == data.whatpipe && value.orientations != 1 && value.bendy != 1}} +
+ {{:helper.link("Orient automatically", null, {iconrotation: 0}, data.iconrotation == 0 ? "linkOn" : null)}} +
+ {{if value.bendy}}
- {{:helper.link("", "arrow-right", {"iconrotation": 1}, data.iconrotation == 1 ? "linkOn" : null)}} - + {{:helper.link("", "arrow-right", {iconrotation: 1}, data.iconrotation == 1 ? "linkOn" : null)}} +
- {{:helper.link("", "arrow-right", {"iconrotation": 4}, data.iconrotation == 4 ? "linkOn" : null)}} - -
- {{/if}} - {{if value.id == data.whatpipe && value.orientations == 4 && value.bendy != 1}} -
- {{:helper.link("", "arrow-right", {"iconrotation": 2}, data.iconrotation == 2 ? "linkOn" : null)}} - + {{:helper.link("", "arrow-right", {iconrotation: 4}, data.iconrotation == 4 ? "linkOn" : null)}} +
- {{:helper.link("", "arrow-right", {"iconrotation": 8}, data.iconrotation == 8 ? "linkOn" : null)}} - -
- {{/if}} - {{if value.id == data.whatpipe && value.bendy == 1}} -
- {{:helper.link("", "arrow-right", {"iconrotation": 1}, data.iconrotation == 1 ? "linkOn" : null)}} - + {{:helper.link("", "arrow-right", {iconrotation: 2}, data.iconrotation == 2 ? "linkOn" : null)}} +
- {{:helper.link("", "arrow-right", {"iconrotation": 4}, data.iconrotation == 4 ? "linkOn" : null)}} - + {{:helper.link("", "arrow-right", {iconrotation: 8}, data.iconrotation == 8 ? "linkOn" : null)}} + +
+ {{else}} +
+ {{:helper.link("", "arrow-right", {iconrotation: 1}, data.iconrotation == 1 ? "linkOn" : null)}} +
- {{:helper.link("", "arrow-right", {"iconrotation": 2}, data.iconrotation == 2 ? "linkOn" : null)}} - -
-
- {{:helper.link("", "arrow-right", {"iconrotation": 8}, data.iconrotation == 8 ? "linkOn" : null)}} - + {{:helper.link("", "arrow-right", {iconrotation: 4}, data.iconrotation == 4 ? "linkOn" : null)}} +
+ {{if value.orientations == 4}} +
+ {{:helper.link("", "arrow-right", {iconrotation: 2}, data.iconrotation == 2 ? "linkOn" : null)}} + +
+
+ {{:helper.link("", "arrow-right", {iconrotation: 8}, data.iconrotation == 8 ? "linkOn" : null)}} + +
+ {{/if}} {{/if}}
{{/for}} {{else data.mode == 2}}

Available pipes:

- {{for data.dpipelist}} -
{{:helper.link(String(value.pipename), "arrow-right", {"whatdpipe": Number(value.id)}, data.whatdpipe == Number(value.id) ? "linkOn" : null)}}
+ {{for data.pipelist}} + {{if value.pipe_type == 2}} +
{{:helper.link(value.pipe_name, "arrow-right", {whatdpipe: value.pipe_id}, data.whatdpipe == value.pipe_id ? "linkOn" : null)}}
+ {{/if}} {{/for}}
- {{for data.dpipelist}} + {{for data.pipelist}} + {{if value.pipe_type != 2 || value.pipe_id != data.whatdpipe || value.orientations == 1}} + {{continue;}} + {{/if}}
- {{if value.id == data.whatdpipe && value.orientations != 1}} -
- {{:helper.link("Orient automatically", null, {"iconrotation": 0}, data.iconrotation == 0 ? "linkOn" : null)}} +
+ {{:helper.link("Orient automatically", null, {iconrotation: 0}, data.iconrotation == 0 ? "linkOn" : null)}} +
+
+ {{:helper.link("", "arrow-right", {iconrotation: 1}, data.iconrotation == 1 ? "linkOn" : null)}} + +
+
+ {{:helper.link("", "arrow-right", {iconrotation: 4}, data.iconrotation == 4 ? "linkOn" : null)}} + +
+ {{if value.orientations == 4}} +
+ {{:helper.link("", "arrow-right", {iconrotation: 2}, data.iconrotation == 2 ? "linkOn" : null)}} +
- {{:helper.link("", "arrow-right", {"iconrotation": 1}, data.iconrotation == 1 ? "linkOn" : null)}} - -
-
- {{:helper.link("", "arrow-right", {"iconrotation": 4}, data.iconrotation == 4 ? "linkOn" : null)}} - -
- {{/if}} - {{if value.id == data.whatdpipe && value.orientations == 4}} -
- {{:helper.link("", "arrow-right", {"iconrotation": 2}, data.iconrotation == 2 ? "linkOn" : null)}} - -
-
- {{:helper.link("", "arrow-right", {"iconrotation": 8}, data.iconrotation == 8 ? "linkOn" : null)}} - + {{:helper.link("", "arrow-right", {iconrotation: 8}, data.iconrotation == 8 ? "linkOn" : null)}} +
{{/if}}
@@ -109,4 +112,4 @@ Used In File(s): /code/game/objects/items/weapons/rpd.dm

Device ready to flip loose pipes...

{{else data.mode == 5}}

Device ready to eat loose pipes...

-{{/if}} +{{/if}} \ No newline at end of file diff --git a/paradise.dme b/paradise.dme index 402b6bd167f..daa3e1c9b65 100644 --- a/paradise.dme +++ b/paradise.dme @@ -45,6 +45,7 @@ #include "code\__DEFINES\misc.dm" #include "code\__DEFINES\mobs.dm" #include "code\__DEFINES\pda.dm" +#include "code\__DEFINES\pipes.dm" #include "code\__DEFINES\preferences.dm" #include "code\__DEFINES\process_scheduler.dm" #include "code\__DEFINES\qdel.dm" @@ -231,6 +232,7 @@ #include "code\datums\mixed.dm" #include "code\datums\mutable_appearance.dm" #include "code\datums\periodic_news.dm" +#include "code\datums\pipe_datums.dm" #include "code\datums\progressbar.dm" #include "code\datums\recipe.dm" #include "code\datums\ruins.dm"