Atmos construction rework again
This commit is contained in:
committed by
CitadelStationBot
parent
3243eaa6b8
commit
ed12370a73
@@ -4,12 +4,6 @@
|
||||
CONTAINS:
|
||||
RPD
|
||||
*/
|
||||
#define PIPE_BINARY 0
|
||||
#define PIPE_BENDABLE 1
|
||||
#define PIPE_TRINARY 2
|
||||
#define PIPE_TRIN_M 3
|
||||
#define PIPE_UNARY 4
|
||||
#define PIPE_QUAD 5
|
||||
|
||||
#define PAINT_MODE -2
|
||||
#define EATING_MODE -1
|
||||
@@ -22,23 +16,29 @@ RPD
|
||||
|
||||
/datum/pipe_info
|
||||
var/id=-1
|
||||
var/categoryId = CATEGORY_ATMOS
|
||||
var/categoryId
|
||||
var/dir=SOUTH
|
||||
var/dirtype = PIPE_BENDABLE
|
||||
var/icon = 'icons/obj/atmospherics/pipes/pipe_item.dmi'
|
||||
var/icon_state=""
|
||||
var/icon
|
||||
var/icon_state
|
||||
var/selected=0
|
||||
|
||||
/datum/pipe_info/New(pid,direction,dt)
|
||||
id=pid
|
||||
icon_state=GLOB.pipeID2State["[pid]"]
|
||||
dir = direction
|
||||
dirtype=dt
|
||||
/datum/pipe_info/pipe
|
||||
categoryId = CATEGORY_ATMOS
|
||||
icon = 'icons/obj/atmospherics/pipes/pipe_item.dmi'
|
||||
|
||||
/datum/pipe_info/pipe/New(obj/machinery/atmospherics/path)
|
||||
id = path
|
||||
icon_state = initial(path.pipe_state)
|
||||
dirtype = initial(path.construction_type)
|
||||
|
||||
/datum/pipe_info/proc/Render(dispenser,label)
|
||||
|
||||
/datum/pipe_info/pipe/Render(dispenser,label,dir=NORTH)
|
||||
return "<li><a href='?src=\ref[dispenser];makepipe=[id];dir=[dir];type=[dirtype]'>[label]</a></li>"
|
||||
|
||||
/datum/pipe_info/meter
|
||||
categoryId = CATEGORY_ATMOS
|
||||
icon = 'icons/obj/atmospherics/pipes/simple.dmi'
|
||||
icon_state = "meterX"
|
||||
|
||||
@@ -64,7 +64,6 @@ GLOBAL_LIST_INIT(disposalpipeID2State, list(
|
||||
/datum/pipe_info/disposal
|
||||
categoryId = CATEGORY_DISPOSALS
|
||||
icon = 'icons/obj/atmospherics/pipes/disposal.dmi'
|
||||
icon_state = "meterX"
|
||||
|
||||
/datum/pipe_info/disposal/New(var/pid,var/dt)
|
||||
id=pid
|
||||
@@ -80,33 +79,31 @@ GLOBAL_LIST_INIT(disposalpipeID2State, list(
|
||||
//find these defines in code\game\machinery\pipe\consruction.dm
|
||||
GLOBAL_LIST_INIT(RPD_recipes, list(
|
||||
"Pipes" = list(
|
||||
"Pipe" = new /datum/pipe_info(PIPE_SIMPLE, 1, PIPE_BENDABLE),
|
||||
//"Bent Pipe" = new /datum/pipe_info(PIPE_SIMPLE, 5, PIPE_BENT),
|
||||
"Manifold" = new /datum/pipe_info(PIPE_MANIFOLD, 1, PIPE_TRINARY),
|
||||
"Manual Valve" = new /datum/pipe_info(PIPE_MVALVE, 1, PIPE_BINARY),
|
||||
"Digital Valve" = new /datum/pipe_info(PIPE_DVALVE, 1, PIPE_BINARY),
|
||||
"4-Way Manifold" = new /datum/pipe_info(PIPE_4WAYMANIFOLD, 1, PIPE_QUAD),
|
||||
"Layer Manifold" = new /datum/pipe_info(PIPE_LAYER_MANIFOLD, 1, PIPE_BINARY),
|
||||
"Pipe" = new /datum/pipe_info/pipe(/obj/machinery/atmospherics/pipe/simple),
|
||||
"Manifold" = new /datum/pipe_info/pipe(/obj/machinery/atmospherics/pipe/manifold),
|
||||
"Manual Valve" = new /datum/pipe_info/pipe(/obj/machinery/atmospherics/components/binary/valve),
|
||||
"Digital Valve" = new /datum/pipe_info/pipe(/obj/machinery/atmospherics/components/binary/valve/digital),
|
||||
"4-Way Manifold" = new /datum/pipe_info/pipe(/obj/machinery/atmospherics/pipe/manifold4w),
|
||||
"Layer Manifold" = new /datum/pipe_info/pipe(/obj/machinery/atmospherics/pipe/layer_manifold),
|
||||
),
|
||||
"Devices"=list(
|
||||
"Connector" = new /datum/pipe_info(PIPE_CONNECTOR, 1, PIPE_UNARY),
|
||||
"Unary Vent" = new /datum/pipe_info(PIPE_UVENT, 1, PIPE_UNARY),
|
||||
"Gas Pump" = new /datum/pipe_info(PIPE_PUMP, 1, PIPE_UNARY),
|
||||
"Passive Gate" = new /datum/pipe_info(PIPE_PASSIVE_GATE, 1, PIPE_UNARY),
|
||||
"Volume Pump" = new /datum/pipe_info(PIPE_VOLUME_PUMP, 1, PIPE_UNARY),
|
||||
"Scrubber" = new /datum/pipe_info(PIPE_SCRUBBER, 1, PIPE_UNARY),
|
||||
"Injector" = new /datum/pipe_info(PIPE_INJECTOR, 1, PIPE_UNARY),
|
||||
"Devices" = list(
|
||||
"Connector" = new /datum/pipe_info/pipe(/obj/machinery/atmospherics/components/unary/portables_connector),
|
||||
"Unary Vent" = new /datum/pipe_info/pipe(/obj/machinery/atmospherics/components/unary/vent_pump),
|
||||
"Gas Pump" = new /datum/pipe_info/pipe(/obj/machinery/atmospherics/components/binary/pump),
|
||||
"Passive Gate" = new /datum/pipe_info/pipe(/obj/machinery/atmospherics/components/binary/passive_gate),
|
||||
"Volume Pump" = new /datum/pipe_info/pipe(/obj/machinery/atmospherics/components/binary/volume_pump),
|
||||
"Scrubber" = new /datum/pipe_info/pipe(/obj/machinery/atmospherics/components/unary/vent_scrubber),
|
||||
"Injector" = new /datum/pipe_info/pipe(/obj/machinery/atmospherics/components/unary/outlet_injector),
|
||||
"Meter" = new /datum/pipe_info/meter(),
|
||||
"Gas Filter" = new /datum/pipe_info(PIPE_GAS_FILTER, 1, PIPE_TRIN_M),
|
||||
"Gas Mixer" = new /datum/pipe_info(PIPE_GAS_MIXER, 1, PIPE_TRIN_M),
|
||||
"Gas Filter" = new /datum/pipe_info/pipe(/obj/machinery/atmospherics/components/trinary/filter),
|
||||
"Gas Mixer" = new /datum/pipe_info/pipe(/obj/machinery/atmospherics/components/trinary/mixer),
|
||||
),
|
||||
"Heat Exchange" = list(
|
||||
"Pipe" = new /datum/pipe_info(PIPE_HE, 1, PIPE_BENDABLE),
|
||||
//"Bent Pipe" = new /datum/pipe_info(PIPE_HE, 5, PIPE_BENT),
|
||||
"Manifold" = new /datum/pipe_info(PIPE_HE_MANIFOLD, 1, PIPE_TRINARY),
|
||||
"4-Way Manifold" = new /datum/pipe_info(PIPE_HE_4WAYMANIFOLD, 1, PIPE_QUAD),
|
||||
"Junction" = new /datum/pipe_info(PIPE_JUNCTION, 1, PIPE_UNARY),
|
||||
"Heat Exchanger" = new /datum/pipe_info(PIPE_HEAT_EXCHANGE, 1, PIPE_UNARY),
|
||||
"Pipe" = new /datum/pipe_info/pipe(/obj/machinery/atmospherics/pipe/heat_exchanging/simple),
|
||||
"Manifold" = new /datum/pipe_info/pipe(/obj/machinery/atmospherics/pipe/heat_exchanging/manifold),
|
||||
"4-Way Manifold" = new /datum/pipe_info/pipe(/obj/machinery/atmospherics/pipe/heat_exchanging/manifold4w),
|
||||
"Junction" = new /datum/pipe_info/pipe(/obj/machinery/atmospherics/pipe/heat_exchanging/junction),
|
||||
"Heat Exchanger" = new /datum/pipe_info/pipe(/obj/machinery/atmospherics/components/unary/heat_exchanger),
|
||||
),
|
||||
"Disposal Pipes" = list(
|
||||
"Pipe" = new /datum/pipe_info/disposal(DISP_PIPE_STRAIGHT, PIPE_BINARY),
|
||||
@@ -120,6 +117,7 @@ GLOBAL_LIST_INIT(RPD_recipes, list(
|
||||
"Sort Junction" = new /datum/pipe_info/disposal(DISP_SORTJUNCTION, PIPE_TRINARY),
|
||||
)
|
||||
))
|
||||
|
||||
/obj/item/pipe_dispenser
|
||||
name = "Rapid Piping Device (RPD)"
|
||||
desc = "A device used to rapidly pipe things."
|
||||
@@ -137,7 +135,7 @@ GLOBAL_LIST_INIT(RPD_recipes, list(
|
||||
resistance_flags = FIRE_PROOF
|
||||
var/datum/effect_system/spark_spread/spark_system
|
||||
var/working = 0
|
||||
var/p_type = PIPE_SIMPLE
|
||||
var/p_type = /obj/machinery/atmospherics/pipe/simple
|
||||
var/p_conntype = PIPE_BENDABLE
|
||||
var/p_dir = 1
|
||||
var/p_flipped = 0
|
||||
@@ -201,7 +199,7 @@ GLOBAL_LIST_INIT(RPD_recipes, list(
|
||||
if(screen == CATEGORY_ATMOS)
|
||||
dat += "<span class='linkOn'>Atmospherics</span> <A href='?src=\ref[src];screen=[CATEGORY_DISPOSALS];dmake=0;type=0'>Disposals</A><BR>"
|
||||
else if(screen == CATEGORY_DISPOSALS)
|
||||
dat += "<A href='?src=\ref[src];screen=[CATEGORY_ATMOS];makepipe=0;dir=1;type=0'>Atmospherics</A> <span class='linkOn'>Disposals</span><BR>"
|
||||
dat += "<A href='?src=\ref[src];screen=[CATEGORY_ATMOS];makepipe=[/obj/machinery/atmospherics/pipe/simple];dir=1;type=0'>Atmospherics</A> <span class='linkOn'>Disposals</span><BR>"
|
||||
var/generated_layer_list = ""
|
||||
var/layers_total = PIPING_LAYER_MAX - PIPING_LAYER_MIN + 1
|
||||
for(var/iter = PIPING_LAYER_MIN, iter <= layers_total, iter++)
|
||||
@@ -220,9 +218,9 @@ GLOBAL_LIST_INIT(RPD_recipes, list(
|
||||
var/datum/pipe_info/I = cat[label]
|
||||
var/found=0
|
||||
if(I.id == p_type)
|
||||
if((p_class == ATMOS_MODE || p_class == METER_MODE) && (I.type == /datum/pipe_info || I.type == /datum/pipe_info/meter))
|
||||
if((p_class == ATMOS_MODE || p_class == METER_MODE) && (istype(I, /datum/pipe_info/pipe) || istype(I, /datum/pipe_info/meter)))
|
||||
found=1
|
||||
else if(p_class == DISPOSALS_MODE && I.type==/datum/pipe_info/disposal)
|
||||
else if(p_class == DISPOSALS_MODE && istype(I, /datum/pipe_info/disposal))
|
||||
found=1
|
||||
if(found)
|
||||
preview=new /icon(I.icon,I.icon_state)
|
||||
@@ -510,7 +508,8 @@ GLOBAL_LIST_INIT(RPD_recipes, list(
|
||||
if(href_list["makepipe"])
|
||||
p_type = text2path(href_list["makepipe"])
|
||||
p_dir = text2num(href_list["dir"])
|
||||
p_conntype = text2num(href_list["type"])
|
||||
var/obj/item/pipe/path = text2path(href_list["type"])
|
||||
p_conntype = initial(path.RPD_type)
|
||||
p_class = ATMOS_MODE
|
||||
spark_system.start()
|
||||
playsound(get_turf(src), 'sound/effects/pop.ogg', 50, 0)
|
||||
@@ -581,7 +580,9 @@ GLOBAL_LIST_INIT(RPD_recipes, list(
|
||||
if(do_after(user, 2, target = A))
|
||||
activate()
|
||||
var/obj/item/pipe/P = new(A, queued_p_type, queued_p_dir)
|
||||
P.flipped = queued_p_flipped
|
||||
if(queued_p_flipped)
|
||||
var/obj/item/pipe/trinary/flippable/F = P
|
||||
F.flipped = queued_p_flipped
|
||||
P.update()
|
||||
P.add_fingerprint(usr)
|
||||
if(!isnull(temp_piping_layer))
|
||||
@@ -627,12 +628,6 @@ GLOBAL_LIST_INIT(RPD_recipes, list(
|
||||
/obj/item/pipe_dispenser/proc/activate()
|
||||
playsound(get_turf(src), 'sound/items/deconstruct.ogg', 50, 1)
|
||||
|
||||
#undef PIPE_BINARY
|
||||
#undef PIPE_BENT
|
||||
#undef PIPE_TRINARY
|
||||
#undef PIPE_TRIN_M
|
||||
#undef PIPE_UNARY
|
||||
#undef PIPE_QUAD
|
||||
#undef PAINT_MODE
|
||||
#undef EATING_MODE
|
||||
#undef ATMOS_MODE
|
||||
|
||||
Reference in New Issue
Block a user