From 99234185de8dffc0a18bc834640e0010c3b89396 Mon Sep 17 00:00:00 2001 From: duncathan Date: Sun, 16 Aug 2015 23:10:57 -0600 Subject: [PATCH 01/14] first pass of cleanup makes simple pipes more OOP adjusts defines; puts them in __DEFINES/atmospherics.dm adds DEVICE_TYPE_LOOP define, which is used in a bunch of the for loops --- code/ATMOSPHERICS/atmospherics.dm | 28 +++- .../binary_devices/binary_atmos_base.dm | 4 +- .../components/binary_devices/circulator.dm | 4 +- .../components/binary_devices/dp_vent_pump.dm | 12 +- .../components/binary_devices/passive_gate.dm | 4 +- .../components/binary_devices/pump.dm | 4 +- .../components/binary_devices/valve.dm | 2 +- .../components/binary_devices/volume_pump.dm | 6 +- .../components/components_base.dm | 127 ++++++------------ .../components/trinary_devices/filter.dm | 10 +- .../components/trinary_devices/mixer.dm | 20 +-- .../trinary_devices/trinary_base.dm | 4 +- .../components/unary_devices/Freezer.dm | 4 +- .../components/unary_devices/cold_sink.dm | 4 +- .../components/unary_devices/cryo.dm | 14 +- .../unary_devices/generator_input.dm | 4 +- .../unary_devices/heat_exchanger.dm | 8 +- .../components/unary_devices/heat_source.dm | 4 +- .../unary_devices/outlet_injector.dm | 8 +- .../unary_devices/oxygen_generator.dm | 8 +- .../components/unary_devices/tank.dm | 12 +- .../components/unary_devices/unary_base.dm | 9 +- .../components/unary_devices/vent_pump.dm | 8 +- .../components/unary_devices/vent_scrubber.dm | 6 +- code/ATMOSPHERICS/pipes/he_pipes.dm | 28 ++-- code/ATMOSPHERICS/pipes/manifold.dm | 34 +++-- code/ATMOSPHERICS/pipes/manifold4w.dm | 40 ++---- code/ATMOSPHERICS/pipes/pipes.dm | 35 ++++- code/ATMOSPHERICS/pipes/simple.dm | 60 ++++----- code/__DEFINES/atmospherics.dm | 39 +++++- .../atmoalter/portable_atmospherics.dm | 2 +- code/modules/admin/verbs/atmosdebug.dm | 4 +- code/modules/mob/living/ventcrawling.dm | 4 +- 33 files changed, 279 insertions(+), 281 deletions(-) diff --git a/code/ATMOSPHERICS/atmospherics.dm b/code/ATMOSPHERICS/atmospherics.dm index 321e172522d..d7f878e06ca 100644 --- a/code/ATMOSPHERICS/atmospherics.dm +++ b/code/ATMOSPHERICS/atmospherics.dm @@ -9,7 +9,6 @@ Pipes -> Pipelines Pipelines + Other Objects -> Pipe network */ - /obj/machinery/atmospherics anchored = 1 idle_power_usage = 0 @@ -25,6 +24,9 @@ Pipelines + Other Objects -> Pipe network var/image/pipe_vision_img = null + var/device_type = 0 + var/list/obj/machinery/atmospherics/nodes = list() + /obj/machinery/atmospherics/New() ..() SSair.atmos_machinery += src @@ -47,8 +49,19 @@ Pipelines + Other Objects -> Pipe network ..() //this is called just after the air controller sets up turfs -/obj/machinery/atmospherics/proc/atmosinit() - return +/obj/machinery/atmospherics/proc/atmosinit(var/list/node_connects) + for(DEVICE_TYPE_LOOP) + for(var/obj/machinery/atmospherics/target in get_step(src,node_connects[I])) + if(target.initialize_directions & get_dir(target,src)) + NODE_I = target + break + update_icon() + +/obj/machinery/atmospherics/proc/pipeline_expansion() + var/list/return_nodes = list() + for(DEVICE_TYPE_LOOP) + return_nodes |= NODE_I + return return_nodes /obj/machinery/atmospherics/proc/SetInitDirections() return @@ -70,7 +83,14 @@ Pipelines + Other Objects -> Pipe network return /obj/machinery/atmospherics/proc/disconnect(obj/machinery/atmospherics/reference) - return + for(DEVICE_TYPE_LOOP) + if(reference == NODE_I) + if(istype(NODE_I, /obj/machinery/atmospherics/pipe)) + var/obj/machinery/atmospherics/pipe/P = NODE_I + qdel(P.parent) + NODE_I = null + break + update_icon() /obj/machinery/atmospherics/update_icon() return diff --git a/code/ATMOSPHERICS/components/binary_devices/binary_atmos_base.dm b/code/ATMOSPHERICS/components/binary_devices/binary_atmos_base.dm index b78301584cb..df89a24e5ba 100644 --- a/code/ATMOSPHERICS/components/binary_devices/binary_atmos_base.dm +++ b/code/ATMOSPHERICS/components/binary_devices/binary_atmos_base.dm @@ -28,10 +28,8 @@ Housekeeping and pipe network stuff */ /obj/machinery/atmospherics/components/binary/atmosinit() - var/node2_connect = dir var/node1_connect = turn(dir, 180) - var/list/node_connects = new/list() - node_connects.Add(node1_connect, node2_connect) + var/list/node_connects = list(node1_connect, node2_connect) ..(node_connects) \ No newline at end of file diff --git a/code/ATMOSPHERICS/components/binary_devices/circulator.dm b/code/ATMOSPHERICS/components/binary_devices/circulator.dm index f5da3152aae..436725a4baf 100644 --- a/code/ATMOSPHERICS/components/binary_devices/circulator.dm +++ b/code/ATMOSPHERICS/components/binary_devices/circulator.dm @@ -18,8 +18,8 @@ /obj/machinery/atmospherics/components/binary/circulator/proc/return_transfer_air() - var/datum/gas_mixture/air1 = airs[AIR1] - var/datum/gas_mixture/air2 = airs[AIR2] + var/datum/gas_mixture/air1 = AIR1 + var/datum/gas_mixture/air2 = AIR2 var/output_starting_pressure = air1.return_pressure() var/input_starting_pressure = air2.return_pressure() diff --git a/code/ATMOSPHERICS/components/binary_devices/dp_vent_pump.dm b/code/ATMOSPHERICS/components/binary_devices/dp_vent_pump.dm index 9cecf78413f..fb3cbcdf028 100644 --- a/code/ATMOSPHERICS/components/binary_devices/dp_vent_pump.dm +++ b/code/ATMOSPHERICS/components/binary_devices/dp_vent_pump.dm @@ -42,8 +42,8 @@ Acts like a normal vent, but has an input AND output. /obj/machinery/atmospherics/components/binary/dp_vent_pump/high_volume/New() ..() - var/datum/gas_mixture/air1 = airs[AIR1] - var/datum/gas_mixture/air2 = airs[AIR2] + var/datum/gas_mixture/air1 = AIR1 + var/datum/gas_mixture/air2 = AIR2 air1.volume = 1000 air2.volume = 1000 @@ -66,8 +66,8 @@ Acts like a normal vent, but has an input AND output. if(!on) return 0 - var/datum/gas_mixture/air1 = airs[AIR1] - var/datum/gas_mixture/air2 = airs[AIR2] + var/datum/gas_mixture/air1 = AIR1 + var/datum/gas_mixture/air2 = AIR2 var/datum/gas_mixture/environment = loc.return_air() var/environment_pressure = environment.return_pressure() @@ -89,7 +89,7 @@ Acts like a normal vent, but has an input AND output. loc.assume_air(removed) air_update_turf() - var/datum/pipeline/parent1 = parents[PARENT1] + var/datum/pipeline/parent1 = PARENT1 parent1.update = 1 else //external -> output @@ -109,7 +109,7 @@ Acts like a normal vent, but has an input AND output. air2.merge(removed) air_update_turf() - var/datum/pipeline/parent2 = parents[PARENT2] + var/datum/pipeline/parent2 = PARENT2 parent2.update = 1 return 1 diff --git a/code/ATMOSPHERICS/components/binary_devices/passive_gate.dm b/code/ATMOSPHERICS/components/binary_devices/passive_gate.dm index d75d045a636..b522febf58e 100644 --- a/code/ATMOSPHERICS/components/binary_devices/passive_gate.dm +++ b/code/ATMOSPHERICS/components/binary_devices/passive_gate.dm @@ -40,8 +40,8 @@ Passive gate is similar to the regular pump except: if(!on) return 0 - var/datum/gas_mixture/air1 = airs[AIR1] - var/datum/gas_mixture/air2 = airs[AIR2] + var/datum/gas_mixture/air1 = AIR1 + var/datum/gas_mixture/air2 = AIR2 var/output_starting_pressure = air2.return_pressure() var/input_starting_pressure = air1.return_pressure() diff --git a/code/ATMOSPHERICS/components/binary_devices/pump.dm b/code/ATMOSPHERICS/components/binary_devices/pump.dm index 73482b9c864..c4f3073e767 100644 --- a/code/ATMOSPHERICS/components/binary_devices/pump.dm +++ b/code/ATMOSPHERICS/components/binary_devices/pump.dm @@ -48,8 +48,8 @@ Thus, the two variables affect pump operation are set in New(): if(!on) return 0 - var/datum/gas_mixture/air1 = airs[AIR1] - var/datum/gas_mixture/air2 = airs[AIR2] + var/datum/gas_mixture/air1 = AIR1 + var/datum/gas_mixture/air2 = AIR2 var/output_starting_pressure = air2.return_pressure() diff --git a/code/ATMOSPHERICS/components/binary_devices/valve.dm b/code/ATMOSPHERICS/components/binary_devices/valve.dm index 3239d3a6ec4..a99fa0df02b 100644 --- a/code/ATMOSPHERICS/components/binary_devices/valve.dm +++ b/code/ATMOSPHERICS/components/binary_devices/valve.dm @@ -28,7 +28,7 @@ It's like a regular ol' straight pipe, but you can turn it on and off. open = 1 update_icon_nopipes() update_parents() - var/datum/pipeline/parent1 = parents[PARENT1] + var/datum/pipeline/parent1 = PARENT1 parent1.reconcile_air() investigate_log("was opened by [usr ? key_name(usr) : "a remote signal"]", "atmos") diff --git a/code/ATMOSPHERICS/components/binary_devices/volume_pump.dm b/code/ATMOSPHERICS/components/binary_devices/volume_pump.dm index a87f2964480..1d8253997f5 100644 --- a/code/ATMOSPHERICS/components/binary_devices/volume_pump.dm +++ b/code/ATMOSPHERICS/components/binary_devices/volume_pump.dm @@ -48,8 +48,8 @@ Thus, the two variables affect pump operation are set in New(): if(!on) return 0 - var/datum/gas_mixture/air1 = airs[AIR1] - var/datum/gas_mixture/air2 = airs[AIR2] + var/datum/gas_mixture/air1 = AIR1 + var/datum/gas_mixture/air2 = AIR2 // Pump mechanism just won't do anything if the pressure is too high/too low @@ -125,7 +125,7 @@ Thus, the two variables affect pump operation are set in New(): on = !on if("set_transfer_rate" in signal.data) - var/datum/gas_mixture/air1 = airs[AIR1] + var/datum/gas_mixture/air1 = AIR1 transfer_rate = Clamp( text2num(signal.data["set_transfer_rate"]), 0, diff --git a/code/ATMOSPHERICS/components/components_base.dm b/code/ATMOSPHERICS/components/components_base.dm index 78bd351c9f4..45b2b548d29 100644 --- a/code/ATMOSPHERICS/components/components_base.dm +++ b/code/ATMOSPHERICS/components/components_base.dm @@ -3,41 +3,19 @@ So much of atmospherics.dm was used solely by components, so separating this mak On top of that, now people can add component-speciic procs/vars if they want! */ -#define UNARY 1 -#define BINARY 2 -#define TRINARY 3 - -#define AIR1 "a1" -#define AIR2 "a2" -#define AIR3 "a3" - -#define PARENT1 "p1" -#define PARENT2 "p2" -#define PARENT3 "p3" - -#define NODE1 "n1" -#define NODE2 "n2" -#define NODE3 "n3" - /obj/machinery/atmospherics/components/ var/welded //Used on pumps and scrubbers var/showpipe = 0 - var/device_type = 0//used for initialization stuff - //UNARY = 1 - //BINARY = 2 - //TRINARY = 3 - - var/list/obj/machinery/atmospherics/nodes = list() var/list/datum/pipeline/parents = list() var/list/datum/gas_mixture/airs = list() /obj/machinery/atmospherics/components/New() ..() - for(var/I = 1; I <= device_type; I++) + for(DEVICE_TYPE_LOOP) var/datum/gas_mixture/A = new A.volume = 200 - airs["a[I]"] = A + AIR_I = A /* Iconnery */ @@ -57,7 +35,7 @@ Iconnery /obj/machinery/atmospherics/components/proc/update_icon_nopipes() return -/obj/machinery/atmospherics/components/update_icon() //not working +/obj/machinery/atmospherics/components/update_icon() update_icon_nopipes() underlays.Cut() @@ -66,9 +44,9 @@ Iconnery var/connected = 0 - for(var/I = 1; I <= device_type; I++) //adds intact pieces - if(nodes["n[I]"]) - connected = icon_addintact(nodes["n[I]"], connected) + for(DEVICE_TYPE_LOOP) //adds intact pieces + if(NODE_I) + connected = icon_addintact(NODE_I, connected) icon_addbroken(connected) //adds broken pieces @@ -77,83 +55,66 @@ Iconnery Pipenet stuff; housekeeping */ /obj/machinery/atmospherics/components/Destroy() - for(var/I = 1; I <= device_type; I++) - var/obj/machinery/atmospherics/N = nodes["n[I]"] + for(DEVICE_TYPE_LOOP) + var/obj/machinery/atmospherics/N = NODE_I if(N) N.disconnect(src) - nodes["n[I]"] = null - nullifyPipenet(parents["p[I]"]) + NODE_I = null + nullifyPipenet(PARENT_I) ..() -/obj/machinery/atmospherics/components/atmosinit(var/list/node_connects) - for(var/I = 1; I <= device_type; I++) - for(var/obj/machinery/atmospherics/target in get_step(src,node_connects[I])) - if(target.initialize_directions & get_dir(target,src)) - nodes["n[I]"] = target - break +/obj/machinery/atmospherics/components/atmosinit() if(level == 2) showpipe = 1 - update_icon() + ..() /obj/machinery/atmospherics/components/construction() ..() update_parents() /obj/machinery/atmospherics/components/build_network() - for(var/I = 1; I <= device_type; I++) - if(!parents["p[I]"]) - parents["p[I]"] = new /datum/pipeline() - var/datum/pipeline/P = parents["p[I]"] + for(DEVICE_TYPE_LOOP) + if(!PARENT_I) + PARENT_I = new /datum/pipeline() + var/datum/pipeline/P = PARENT_I P.build_pipeline(src) -/obj/machinery/atmospherics/components/disconnect(obj/machinery/atmospherics/reference) - for(var/I = 1; I <= device_type; I++) - if(reference == nodes["n[I]"]) - if(istype(nodes["n[I]"], /obj/machinery/atmospherics/pipe)) - qdel(parents["p[I]"]) - nodes["n[I]"] = null - break - update_icon() - /obj/machinery/atmospherics/components/nullifyPipenet(datum/pipeline/reference) ..() - for(var/I = 1; I <= device_type; I++) - if(reference == parents["p[I]"]) - var/datum/pipeline/P = parents["p[I]"] - P.other_airs -= airs["a[I]"] - parents["p[I]"] = null + for(DEVICE_TYPE_LOOP) + if(reference == PARENT_I) + var/datum/pipeline/P = PARENT_I + P.other_airs -= AIR_I + PARENT_I = null /obj/machinery/atmospherics/components/returnPipenetAir(datum/pipeline/reference) - for(var/I = 1; I <= device_type; I++) - if(reference == parents["p[I]"]) - return airs["a[I]"] + for(DEVICE_TYPE_LOOP) + if(reference == PARENT_I) + return AIR_I /obj/machinery/atmospherics/components/pipeline_expansion(datum/pipeline/reference) if(reference) - for(var/I = 1; I <= device_type; I++) - if(parents["p[I]"] == reference) - return list(nodes["n[I]"]) + for(DEVICE_TYPE_LOOP) + if(PARENT_I == reference) + return list(NODE_I) else - var/list/obj/machinery/atmospherics/return_nodes = list() - for(var/I = 1; I <= device_type; I++) - return_nodes += nodes["n[I]"] - return return_nodes + return ..() /obj/machinery/atmospherics/components/setPipenet(datum/pipeline/reference, obj/machinery/atmospherics/A) - for(var/I = 1; I <= device_type; I++) - if(A == nodes["n[I]"]) - parents["p[I]"] = reference + for(DEVICE_TYPE_LOOP) + if(A == NODE_I) + PARENT_I = reference break -/obj/machinery/atmospherics/components/returnPipenet(obj/machinery/atmospherics/A = nodes[NODE1]) //returns PARENT1 if called without argument - for(var/I = 1; I <= device_type; I++) - if(A == nodes["n[I]"]) - return parents["p[I]"] +/obj/machinery/atmospherics/components/returnPipenet(obj/machinery/atmospherics/A = NODE1) //returns PARENT1 if called without argument + for(DEVICE_TYPE_LOOP) + if(A == NODE_I) + return PARENT_I /obj/machinery/atmospherics/components/replacePipenet(datum/pipeline/Old, datum/pipeline/New) - for(var/I = 1; I <= device_type; I++) - if(parents["p[I]"] == Old) - parents["p[I]"] = New + for(DEVICE_TYPE_LOOP) + if(PARENT_I == Old) + PARENT_I = New /obj/machinery/atmospherics/components/unsafe_pressure_release(var/mob/user, var/pressures) ..() @@ -164,15 +125,15 @@ Pipenet stuff; housekeeping var/datum/gas_mixture/environment = T.return_air() var/lost = null var/times_lost = 0 - for(var/I = 1; I <= device_type; I++) - var/datum/gas_mixture/air = airs["a[I]"] + for(DEVICE_TYPE_LOOP) + var/datum/gas_mixture/air = AIR_I lost += pressures*environment.volume/(air.temperature * R_IDEAL_GAS_EQUATION) times_lost++ var/shared_loss = lost/times_lost var/datum/gas_mixture/to_release - for(var/I = 1; I <= device_type; I++) - var/datum/gas_mixture/air = airs["a[I]"] + for(DEVICE_TYPE_LOOP) + var/datum/gas_mixture/air = AIR_I if(!to_release) to_release = air.remove(shared_loss) continue @@ -195,6 +156,6 @@ Helpers */ /obj/machinery/atmospherics/components/proc/update_parents() - for(var/I = 1; I <= device_type; I++) - var/datum/pipeline/parent = parents["p[I]"] + for(DEVICE_TYPE_LOOP) + var/datum/pipeline/parent = PARENT_I parent.update = 1 \ No newline at end of file diff --git a/code/ATMOSPHERICS/components/trinary_devices/filter.dm b/code/ATMOSPHERICS/components/trinary_devices/filter.dm index a56bdd14c0c..439311ce86e 100644 --- a/code/ATMOSPHERICS/components/trinary_devices/filter.dm +++ b/code/ATMOSPHERICS/components/trinary_devices/filter.dm @@ -62,7 +62,7 @@ Filter types: /obj/machinery/atmospherics/components/trinary/filter/update_icon_nopipes() - if(!(stat & NOPOWER) && on && nodes[NODE1] && nodes[NODE2] && nodes[NODE3]) + if(!(stat & NOPOWER) && on && NODE1 && NODE2 && NODE3) icon_state = "filter_on[flipped?"_f":""]" return @@ -80,12 +80,12 @@ Filter types: ..() if(!on) return 0 - if(!(nodes[NODE1] && nodes[NODE2] && nodes[NODE3])) + if(!(NODE1 && NODE2 && NODE3)) return 0 - var/datum/gas_mixture/air1 = airs[AIR1] - var/datum/gas_mixture/air2 = airs[AIR2] - var/datum/gas_mixture/air3 = airs[AIR3] + var/datum/gas_mixture/air1 = AIR1 + var/datum/gas_mixture/air2 = AIR2 + var/datum/gas_mixture/air3 = AIR3 var/output_starting_pressure = air3.return_pressure() diff --git a/code/ATMOSPHERICS/components/trinary_devices/mixer.dm b/code/ATMOSPHERICS/components/trinary_devices/mixer.dm index 8b8850744ec..818b410626a 100644 --- a/code/ATMOSPHERICS/components/trinary_devices/mixer.dm +++ b/code/ATMOSPHERICS/components/trinary_devices/mixer.dm @@ -32,7 +32,7 @@ ..() /obj/machinery/atmospherics/components/trinary/mixer/update_icon_nopipes() - if(!(stat & NOPOWER) && on && nodes[NODE1] && nodes[NODE2] && nodes[NODE3]) + if(!(stat & NOPOWER) && on && NODE1 && NODE2 && NODE3) icon_state = "mixer_on[flipped?"_f":""]" return @@ -48,20 +48,20 @@ /obj/machinery/atmospherics/components/trinary/mixer/New() ..() - var/datum/gas_mixture/air3 = airs[AIR3] + var/datum/gas_mixture/air3 = AIR3 air3.volume = 300 - airs[AIR3] = air3 + AIR3 = air3 /obj/machinery/atmospherics/components/trinary/mixer/process_atmos() ..() if(!on) return 0 - if(!(nodes[NODE1] && nodes[NODE2] && nodes[NODE3])) + if(!(NODE1 && NODE2 && NODE3)) return 0 - var/datum/gas_mixture/air1 = airs[AIR1] - var/datum/gas_mixture/air2 = airs[AIR2] - var/datum/gas_mixture/air3 = airs[AIR3] + var/datum/gas_mixture/air1 = AIR1 + var/datum/gas_mixture/air2 = AIR2 + var/datum/gas_mixture/air3 = AIR3 var/output_starting_pressure = air3.return_pressure() @@ -107,14 +107,14 @@ air3.merge(removed2) if(transfer_moles1) - var/datum/pipeline/parent1 = parents[PARENT1] + var/datum/pipeline/parent1 = PARENT1 parent1.update = 1 if(transfer_moles2) - var/datum/pipeline/parent2 = parents[PARENT2] + var/datum/pipeline/parent2 = PARENT2 parent2.update = 1 - var/datum/pipeline/parent3 = parents[PARENT3] + var/datum/pipeline/parent3 = PARENT3 parent3.update = 1 return 1 diff --git a/code/ATMOSPHERICS/components/trinary_devices/trinary_base.dm b/code/ATMOSPHERICS/components/trinary_devices/trinary_base.dm index cec9c7ed27b..d2c37ec30e0 100644 --- a/code/ATMOSPHERICS/components/trinary_devices/trinary_base.dm +++ b/code/ATMOSPHERICS/components/trinary_devices/trinary_base.dm @@ -43,7 +43,5 @@ Housekeeping and pipe network stuff node1_connect = turn(node1_connect, 180) node3_connect = turn(node3_connect, 180) - var/list/node_connects = new/list() - - node_connects.Add(node1_connect, node2_connect, node3_connect) + var/list/node_connects = list(node1_connect, node2_connect, node3_connect) ..(node_connects) \ No newline at end of file diff --git a/code/ATMOSPHERICS/components/unary_devices/Freezer.dm b/code/ATMOSPHERICS/components/unary_devices/Freezer.dm index b91d8a74dbb..83739c0e13b 100644 --- a/code/ATMOSPHERICS/components/unary_devices/Freezer.dm +++ b/code/ATMOSPHERICS/components/unary_devices/Freezer.dm @@ -69,7 +69,7 @@ /obj/machinery/atmospherics/components/unary/cold_sink/freezer/interact(mob/user) if(stat & (NOPOWER|BROKEN)) return - var/datum/gas_mixture/air_contents = airs[AIR1] + var/datum/gas_mixture/air_contents = AIR1 user.set_machine(src) var/temp_text = "" if(air_contents.temperature > (T0C - 20)) @@ -194,7 +194,7 @@ return interact(user) /obj/machinery/atmospherics/components/unary/heat_reservoir/heater/interact(mob/user) - var/datum/gas_mixture/air_contents = airs[AIR1] + var/datum/gas_mixture/air_contents = AIR1 if(stat & (NOPOWER|BROKEN)) return diff --git a/code/ATMOSPHERICS/components/unary_devices/cold_sink.dm b/code/ATMOSPHERICS/components/unary_devices/cold_sink.dm index 7750a7c7b14..65419798bfd 100644 --- a/code/ATMOSPHERICS/components/unary_devices/cold_sink.dm +++ b/code/ATMOSPHERICS/components/unary_devices/cold_sink.dm @@ -16,7 +16,7 @@ if(showpipe) overlays += getpipeimage('icons/obj/atmospherics/components/unary_devices.dmi', "scrub_cap", initialize_directions) //scrub_cap works for now - if(!nodes[NODE1] || !on || stat & (NOPOWER|BROKEN)) + if(!NODE1 || !on || stat & (NOPOWER|BROKEN)) icon_state = "cold_off" return @@ -27,7 +27,7 @@ ..() if(!on) return 0 - var/datum/gas_mixture/air_contents = airs[AIR1] + var/datum/gas_mixture/air_contents = AIR1 var/air_heat_capacity = air_contents.heat_capacity() var/combined_heat_capacity = current_heat_capacity + air_heat_capacity diff --git a/code/ATMOSPHERICS/components/unary_devices/cryo.dm b/code/ATMOSPHERICS/components/unary_devices/cryo.dm index 87eb0e606e8..4565fd97ccc 100644 --- a/code/ATMOSPHERICS/components/unary_devices/cryo.dm +++ b/code/ATMOSPHERICS/components/unary_devices/cryo.dm @@ -47,7 +47,7 @@ ..() /obj/machinery/atmospherics/components/unary/cryo_cell/process_atmos() ..() - var/datum/gas_mixture/air_contents = airs[AIR1] + var/datum/gas_mixture/air_contents = AIR1 if(air_contents) temperature_archived = air_contents.temperature @@ -62,14 +62,14 @@ on = 0 open_machine() playsound(src.loc, 'sound/machines/ding.ogg', 50, 1) - if(!nodes[NODE1] || !is_operational()) + if(!NODE1 || !is_operational()) return if(!on) updateDialog() return - if(airs[AIR1]) + if(AIR1) if (occupant) process_occupant() expel_gas() @@ -145,7 +145,7 @@ /obj/machinery/atmospherics/components/unary/cryo_cell/get_ui_data() // this is the data which will be sent to the ui - var/datum/gas_mixture/air_contents = airs[AIR1] + var/datum/gas_mixture/air_contents = AIR1 var/data = list() data["isOperating"] = on @@ -289,7 +289,7 @@ update_icon() /obj/machinery/atmospherics/components/unary/cryo_cell/proc/process_occupant() - var/datum/gas_mixture/air_contents = airs[AIR1] + var/datum/gas_mixture/air_contents = AIR1 if(air_contents.total_moles() < 10) return if(occupant) @@ -321,7 +321,7 @@ /obj/machinery/atmospherics/components/unary/cryo_cell/proc/heat_gas_contents() - var/datum/gas_mixture/air_contents = airs[AIR1] + var/datum/gas_mixture/air_contents = AIR1 if(air_contents.total_moles() < 1) return @@ -332,7 +332,7 @@ air_contents.temperature = combined_energy/combined_heat_capacity /obj/machinery/atmospherics/components/unary/cryo_cell/proc/expel_gas() - var/datum/gas_mixture/air_contents = airs[AIR1] + var/datum/gas_mixture/air_contents = AIR1 if(air_contents.total_moles() < 1) return diff --git a/code/ATMOSPHERICS/components/unary_devices/generator_input.dm b/code/ATMOSPHERICS/components/unary_devices/generator_input.dm index 20d1474ffd3..15ae3eb88f9 100644 --- a/code/ATMOSPHERICS/components/unary_devices/generator_input.dm +++ b/code/ATMOSPHERICS/components/unary_devices/generator_input.dm @@ -9,7 +9,7 @@ var/update_cycle /obj/machinery/atmospherics/components/unary/generator_input/update_icon() - if(nodes[NODE1]) + if(NODE1) icon_state = "intact" else icon_state = "exposed" @@ -17,4 +17,4 @@ return /obj/machinery/atmospherics/components/unary/generator_input/proc/return_exchange_air() - return airs[AIR1] + return AIR1 diff --git a/code/ATMOSPHERICS/components/unary_devices/heat_exchanger.dm b/code/ATMOSPHERICS/components/unary_devices/heat_exchanger.dm index 21746bc4e97..1b400dad2bb 100644 --- a/code/ATMOSPHERICS/components/unary_devices/heat_exchanger.dm +++ b/code/ATMOSPHERICS/components/unary_devices/heat_exchanger.dm @@ -11,9 +11,9 @@ var/update_cycle /obj/machinery/atmospherics/components/unary/heat_exchanger/update_icon() - if(nodes[NODE1]) + if(NODE1) icon_state = "he_intact" - var/obj/machinery/atmospherics/node = nodes[NODE1] + var/obj/machinery/atmospherics/node = NODE1 color = node.color else icon_state = "he_exposed" @@ -43,8 +43,8 @@ update_cycle = SSair.times_fired partner.update_cycle = SSair.times_fired - var/datum/gas_mixture/air_contents = airs[AIR1] - var/datum/gas_mixture/partner_air_contents = partner.airs[AIR1] + var/datum/gas_mixture/air_contents = AIR1 + var/datum/gas_mixture/partner_air_contents = partner.AIR1 var/air_heat_capacity = air_contents.heat_capacity() var/other_air_heat_capacity = partner_air_contents.heat_capacity() diff --git a/code/ATMOSPHERICS/components/unary_devices/heat_source.dm b/code/ATMOSPHERICS/components/unary_devices/heat_source.dm index ceba342a5fa..b08a4a214a7 100644 --- a/code/ATMOSPHERICS/components/unary_devices/heat_source.dm +++ b/code/ATMOSPHERICS/components/unary_devices/heat_source.dm @@ -17,7 +17,7 @@ if(showpipe) overlays += getpipeimage('icons/obj/atmospherics/components/unary_devices.dmi', "scrub_cap", initialize_directions) //scrub_cap works for now - if(!nodes[NODE1] || !on || stat & (NOPOWER|BROKEN)) + if(!NODE1 || !on || stat & (NOPOWER|BROKEN)) icon_state = "cold_off" return @@ -29,7 +29,7 @@ if(!on) return 0 - var/datum/gas_mixture/air_contents = airs[AIR1] + var/datum/gas_mixture/air_contents = AIR1 var/air_heat_capacity = air_contents.heat_capacity() var/combined_heat_capacity = current_heat_capacity + air_heat_capacity diff --git a/code/ATMOSPHERICS/components/unary_devices/outlet_injector.dm b/code/ATMOSPHERICS/components/unary_devices/outlet_injector.dm index 10ecdf726d9..3de7973b1f6 100644 --- a/code/ATMOSPHERICS/components/unary_devices/outlet_injector.dm +++ b/code/ATMOSPHERICS/components/unary_devices/outlet_injector.dm @@ -25,7 +25,7 @@ on = 1 /obj/machinery/atmospherics/components/unary/outlet_injector/update_icon_nopipes() - if(!nodes[NODE1] || !on || stat & (NOPOWER|BROKEN)) + if(!NODE1 || !on || stat & (NOPOWER|BROKEN)) icon_state = "inje_off" return @@ -45,7 +45,7 @@ if(!on || stat & NOPOWER) return 0 - var/datum/gas_mixture/air_contents = airs[AIR1] + var/datum/gas_mixture/air_contents = AIR1 if(air_contents.temperature > 0) var/transfer_moles = (air_contents.return_pressure())*volume_rate/(air_contents.temperature * R_IDEAL_GAS_EQUATION) @@ -63,7 +63,7 @@ if(on || injecting) return 0 - var/datum/gas_mixture/air_contents = airs[AIR1] + var/datum/gas_mixture/air_contents = AIR1 injecting = 1 @@ -126,7 +126,7 @@ if("set_volume_rate" in signal.data) var/number = text2num(signal.data["set_volume_rate"]) - var/datum/gas_mixture/air_contents = airs[AIR1] + var/datum/gas_mixture/air_contents = AIR1 volume_rate = Clamp(number, 0, air_contents.volume) if("status" in signal.data) diff --git a/code/ATMOSPHERICS/components/unary_devices/oxygen_generator.dm b/code/ATMOSPHERICS/components/unary_devices/oxygen_generator.dm index d8c1d69e200..0c0bee0b275 100644 --- a/code/ATMOSPHERICS/components/unary_devices/oxygen_generator.dm +++ b/code/ATMOSPHERICS/components/unary_devices/oxygen_generator.dm @@ -18,7 +18,7 @@ if(showpipe) overlays += getpipeimage('icons/obj/atmospherics/components/unary_devices.dmi', "scrub_cap", initialize_directions) //it works for now - if(!nodes[NODE1] || !on || stat & BROKEN) + if(!NODE1 || !on || stat & BROKEN) icon_state = "o2gen_off" return @@ -27,16 +27,16 @@ /obj/machinery/atmospherics/components/unary/oxygen_generator/New() ..() - var/datum/gas_mixture/air_contents = airs[AIR1] + var/datum/gas_mixture/air_contents = AIR1 air_contents.volume = 50 - airs[AIR1] = air_contents + AIR1 = air_contents /obj/machinery/atmospherics/components/unary/oxygen_generator/process_atmos() ..() if(!on) return 0 - var/datum/gas_mixture/air_contents = airs[AIR1] + var/datum/gas_mixture/air_contents = AIR1 var/total_moles = air_contents.total_moles() diff --git a/code/ATMOSPHERICS/components/unary_devices/tank.dm b/code/ATMOSPHERICS/components/unary_devices/tank.dm index 8f8f6b9e831..f5113d05305 100644 --- a/code/ATMOSPHERICS/components/unary_devices/tank.dm +++ b/code/ATMOSPHERICS/components/unary_devices/tank.dm @@ -11,7 +11,7 @@ /obj/machinery/atmospherics/components/unary/tank/carbon_dioxide/New() ..() - var/datum/gas_mixture/air_contents = airs[AIR1] + var/datum/gas_mixture/air_contents = AIR1 air_contents.volume = volume air_contents.temperature = T20C air_contents.carbon_dioxide = (25*ONE_ATMOSPHERE)*(air_contents.volume)/(R_IDEAL_GAS_EQUATION*air_contents.temperature) @@ -22,7 +22,7 @@ /obj/machinery/atmospherics/components/unary/tank/toxins/New() ..() - var/datum/gas_mixture/air_contents = airs[AIR1] + var/datum/gas_mixture/air_contents = AIR1 air_contents.volume = volume air_contents.temperature = T20C air_contents.toxins = (25*ONE_ATMOSPHERE)*(air_contents.volume)/(R_IDEAL_GAS_EQUATION*air_contents.temperature) @@ -33,7 +33,7 @@ /obj/machinery/atmospherics/components/unary/tank/oxygen_agent_b/New() ..() - var/datum/gas_mixture/air_contents = airs[AIR1] + var/datum/gas_mixture/air_contents = AIR1 air_contents.volume = volume air_contents.temperature = T0C var/datum/gas/oxygen_agent_b/trace_gas = new @@ -46,7 +46,7 @@ /obj/machinery/atmospherics/components/unary/tank/oxygen/New() ..() - var/datum/gas_mixture/air_contents = airs[AIR1] + var/datum/gas_mixture/air_contents = AIR1 air_contents.volume = volume air_contents.temperature = T20C air_contents.oxygen = (25*ONE_ATMOSPHERE)*(air_contents.volume)/(R_IDEAL_GAS_EQUATION*air_contents.temperature) @@ -57,7 +57,7 @@ /obj/machinery/atmospherics/components/unary/tank/nitrogen/New() ..() - var/datum/gas_mixture/air_contents = airs[AIR1] + var/datum/gas_mixture/air_contents = AIR1 air_contents.volume = volume air_contents.temperature = T20C air_contents.nitrogen = (25*ONE_ATMOSPHERE)*(air_contents.volume)/(R_IDEAL_GAS_EQUATION*air_contents.temperature) @@ -68,7 +68,7 @@ /obj/machinery/atmospherics/components/unary/tank/air/New() ..() - var/datum/gas_mixture/air_contents = airs[AIR1] + var/datum/gas_mixture/air_contents = AIR1 air_contents.volume = volume air_contents.temperature = T20C air_contents.oxygen = (25*ONE_ATMOSPHERE*O2STANDARD)*(air_contents.volume)/(R_IDEAL_GAS_EQUATION*air_contents.temperature) diff --git a/code/ATMOSPHERICS/components/unary_devices/unary_base.dm b/code/ATMOSPHERICS/components/unary_devices/unary_base.dm index 96b99f52fd1..1d6a92c7206 100644 --- a/code/ATMOSPHERICS/components/unary_devices/unary_base.dm +++ b/code/ATMOSPHERICS/components/unary_devices/unary_base.dm @@ -23,21 +23,20 @@ Housekeeping and pipe network stuff below */ /obj/machinery/atmospherics/components/unary/atmosinit() - var/list/node_connects = new/list() - node_connects.Add(dir) + var/list/node_connects = list(dir) ..(node_connects) /obj/machinery/atmospherics/components/unary/default_change_direction_wrench(mob/user, obj/item/weapon/wrench/W) if(!..()) return SetInitDirections() - var/obj/machinery/atmospherics/node = nodes[NODE1] + var/obj/machinery/atmospherics/node = NODE1 if(node) node.disconnect(src) node = null - nullifyPipenet(parents[PARENT1]) + nullifyPipenet(PARENT1) atmosinit() - node = nodes[NODE1] + node = NODE1 if(node) node.atmosinit() node.addMember(src) diff --git a/code/ATMOSPHERICS/components/unary_devices/vent_pump.dm b/code/ATMOSPHERICS/components/unary_devices/vent_pump.dm index 7d574f302d6..94d28113548 100644 --- a/code/ATMOSPHERICS/components/unary_devices/vent_pump.dm +++ b/code/ATMOSPHERICS/components/unary_devices/vent_pump.dm @@ -67,7 +67,7 @@ /obj/machinery/atmospherics/components/unary/vent_pump/high_volume/New() ..() - var/datum/gas_mixture/air_contents = airs[AIR1] + var/datum/gas_mixture/air_contents = AIR1 air_contents.volume = 1000 /obj/machinery/atmospherics/components/unary/vent_pump/update_icon_nopipes() @@ -79,7 +79,7 @@ icon_state = "vent_welded" return - if(!nodes[NODE1] || !on || stat & (NOPOWER|BROKEN)) + if(!NODE1 || !on || stat & (NOPOWER|BROKEN)) icon_state = "vent_off" return @@ -92,7 +92,7 @@ ..() if(stat & (NOPOWER|BROKEN)) return - if (!nodes[NODE1]) + if (!NODE1) on = 0 //broadcast_status() // from now air alarm/control computer should request update purposely --rastaf0 if(!on) @@ -101,7 +101,7 @@ if(welded) return 0 - var/datum/gas_mixture/air_contents = airs[AIR1] + var/datum/gas_mixture/air_contents = AIR1 var/datum/gas_mixture/environment = loc.return_air() var/environment_pressure = environment.return_pressure() diff --git a/code/ATMOSPHERICS/components/unary_devices/vent_scrubber.dm b/code/ATMOSPHERICS/components/unary_devices/vent_scrubber.dm index 691835ed4cc..e4f6e606364 100644 --- a/code/ATMOSPHERICS/components/unary_devices/vent_scrubber.dm +++ b/code/ATMOSPHERICS/components/unary_devices/vent_scrubber.dm @@ -86,7 +86,7 @@ icon_state = "scrub_welded" return - if(!nodes[NODE1] || !on || stat & (NOPOWER|BROKEN)) + if(!NODE1 || !on || stat & (NOPOWER|BROKEN)) icon_state = "scrub_off" return @@ -142,7 +142,7 @@ ..() if(stat & (NOPOWER|BROKEN)) return - if (!nodes[NODE1]) + if (!NODE1) on = 0 //broadcast_status() if(!on || welded) @@ -159,7 +159,7 @@ return 0 var/datum/gas_mixture/environment = tile.return_air() - var/datum/gas_mixture/air_contents = airs[AIR1] + var/datum/gas_mixture/air_contents = AIR1 if(scrubbing) if((environment.toxins>0) || (environment.carbon_dioxide>0) || (environment.trace_gases.len>0)) diff --git a/code/ATMOSPHERICS/pipes/he_pipes.dm b/code/ATMOSPHERICS/pipes/he_pipes.dm index 119b371d59b..10f900ab5d3 100644 --- a/code/ATMOSPHERICS/pipes/he_pipes.dm +++ b/code/ATMOSPHERICS/pipes/he_pipes.dm @@ -18,6 +18,8 @@ color = "#404040" /obj/machinery/atmospherics/pipe/simple/heat_exchanging/SetInitDirections() + if(dir in diagonals) + initialize_directions_he = dir switch(dir) if(SOUTH) initialize_directions_he = SOUTH|NORTH @@ -27,14 +29,6 @@ initialize_directions_he = EAST|WEST if(WEST) initialize_directions_he = WEST|EAST - if(NORTHEAST) - initialize_directions_he = NORTH|EAST - if(NORTHWEST) - initialize_directions_he = NORTH|WEST - if(SOUTHEAST) - initialize_directions_he = SOUTH|EAST - if(SOUTHWEST) - initialize_directions_he = SOUTH|WEST /obj/machinery/atmospherics/pipe/simple/heat_exchanging/atmosinit() normalize_dir() @@ -44,11 +38,11 @@ N-- for(var/obj/machinery/atmospherics/pipe/simple/heat_exchanging/target in get_step(src, D)) if(target.initialize_directions_he & get_dir(target,src)) - if(!node1 && N == 1) - node1 = target + if(!NODE1 && N == 1) + NODE1 = target break - if(!node2 && N == 0) - node2 = target + if(!NODE2 && N == 0) + NODE2 = target break update_icon() ..() @@ -131,21 +125,21 @@ initialize_directions_he = WEST /obj/machinery/atmospherics/pipe/simple/heat_exchanging/junction/update_icon() - if(node1&&node2) + if(NODE1&&NODE2) icon_state = "intact" else - var/have_node1 = node1?1:0 - var/have_node2 = node2?1:0 + var/have_node1 = NODE1?1:0 + var/have_node2 = NODE2?1:0 icon_state = "exposed[have_node1][have_node2]" /obj/machinery/atmospherics/pipe/simple/heat_exchanging/junction/atmosinit() for(var/obj/machinery/atmospherics/target in get_step(src,initialize_directions)) if(target.initialize_directions & get_dir(target,src)) - node1 = target + NODE1 = target break for(var/obj/machinery/atmospherics/pipe/simple/heat_exchanging/target in get_step(src,initialize_directions_he)) if(target.initialize_directions_he & get_dir(target,src)) - node2 = target + NODE2 = target break update_icon() ..() \ No newline at end of file diff --git a/code/ATMOSPHERICS/pipes/manifold.dm b/code/ATMOSPHERICS/pipes/manifold.dm index 8f6ac175080..2a56452d46f 100644 --- a/code/ATMOSPHERICS/pipes/manifold.dm +++ b/code/ATMOSPHERICS/pipes/manifold.dm @@ -15,18 +15,13 @@ dir = SOUTH initialize_directions = EAST|NORTH|WEST - var/obj/machinery/atmospherics/node1 - var/obj/machinery/atmospherics/node2 - var/obj/machinery/atmospherics/node3 - - level = 1 - layer = 2.4 //under wires with their 2.44 - + device_type = TRINARY +/* /obj/machinery/atmospherics/pipe/manifold/New() color = pipe_color ..() - +*/ /obj/machinery/atmospherics/pipe/manifold/SetInitDirections() switch(dir) if(NORTH) @@ -39,6 +34,12 @@ initialize_directions = NORTH|EAST|SOUTH /obj/machinery/atmospherics/pipe/manifold/atmosinit() + var/node1_connect = turn(dir, 90) + var/node2_connect = turn(dir, 270) + var/node3_connect = turn(dir, 180) + var/list/node_connects = list(node1_connect, node2_connect, node3_connect) + ..(node_connects) +/* for(var/D in cardinal) if(D == dir) continue @@ -90,7 +91,7 @@ node3 = null update_icon() ..() - +*/ /obj/machinery/atmospherics/pipe/manifold/update_icon() var/invis = invisibility ? "-f" : "" @@ -99,15 +100,10 @@ overlays.Cut() //Add non-broken pieces - if(node1) - overlays += getpipeimage('icons/obj/atmospherics/pipes/manifold.dmi', "manifold_full[invis]", get_dir(src,node1)) - - if(node2) - overlays += getpipeimage('icons/obj/atmospherics/pipes/manifold.dmi', "manifold_full[invis]", get_dir(src,node2)) - - if(node3) - overlays += getpipeimage('icons/obj/atmospherics/pipes/manifold.dmi', "manifold_full[invis]", get_dir(src,node3)) - + for(DEVICE_TYPE_LOOP) + if(NODE_I) + overlays += getpipeimage('icons/obj/atmospherics/pipes/manifold.dmi', "manifold_full[invis]", get_dir(src, NODE_I)) +/* /obj/machinery/atmospherics/pipe/manifold/hide(i) if(level == 1 && istype(loc, /turf/simulated)) invisibility = i ? 101 : 0 @@ -124,7 +120,7 @@ node2.update_icon() if(node3) node3.update_icon() - +*/ //Colored pipes, use these for mapping /obj/machinery/atmospherics/pipe/manifold/general diff --git a/code/ATMOSPHERICS/pipes/manifold4w.dm b/code/ATMOSPHERICS/pipes/manifold4w.dm index 4db873eed76..da510edb363 100644 --- a/code/ATMOSPHERICS/pipes/manifold4w.dm +++ b/code/ATMOSPHERICS/pipes/manifold4w.dm @@ -13,22 +13,18 @@ initialize_directions = NORTH|SOUTH|EAST|WEST - var/obj/machinery/atmospherics/node1 // North - var/obj/machinery/atmospherics/node2 // South - var/obj/machinery/atmospherics/node3 // East - var/obj/machinery/atmospherics/node4 // West - - level = 1 - layer = 2.4 //under wires with their 2.44 - + device_type = QUATERNARY +/* /obj/machinery/atmospherics/pipe/manifold4w/New() color = pipe_color ..() - +*/ /obj/machinery/atmospherics/pipe/manifold4w/SetInitDirections() - return + initialize_directions = initial(initialize_directions) /obj/machinery/atmospherics/pipe/manifold4w/atmosinit() + ..(cardinal) +/* for(var/D in cardinal) for(var/obj/machinery/atmospherics/target in get_step(src, D)) if(target.initialize_directions & get_dir(target,src)) @@ -98,12 +94,8 @@ node4 = null update_icon() ..() - +*/ /obj/machinery/atmospherics/pipe/manifold4w/update_icon() - if(!node1 && !node2 && !node3 && !node4) //Remove us if we ain't connected to anything. - qdel(src) - return - var/invis = invisibility ? "-f" : "" icon_state = "manifold4w_center[invis]" @@ -111,18 +103,10 @@ overlays.Cut() //Add non-broken pieces - if(node1) - overlays += getpipeimage('icons/obj/atmospherics/pipes/manifold.dmi', "manifold_full[invis]", NORTH) - - if(node2) - overlays += getpipeimage('icons/obj/atmospherics/pipes/manifold.dmi', "manifold_full[invis]", SOUTH) - - if(node3) - overlays += getpipeimage('icons/obj/atmospherics/pipes/manifold.dmi', "manifold_full[invis]", EAST) - - if(node4) - overlays += getpipeimage('icons/obj/atmospherics/pipes/manifold.dmi', "manifold_full[invis]", WEST) - + for(DEVICE_TYPE_LOOP) + if(NODE_I) + overlays += getpipeimage('icons/obj/atmospherics/pipes/manifold.dmi', "manifold_full[invis]", get_dir(src, NODE_I)) +/* /obj/machinery/atmospherics/pipe/manifold4w/update_node_icon() ..() if(node1) @@ -133,7 +117,7 @@ node3.update_icon() if(node4) node4.update_icon() - +*/ //Colored pipes, use these for mapping /obj/machinery/atmospherics/pipe/manifold4w/general name="pipe" diff --git a/code/ATMOSPHERICS/pipes/pipes.dm b/code/ATMOSPHERICS/pipes/pipes.dm index f0ca8f8e244..b4b780ae60c 100644 --- a/code/ATMOSPHERICS/pipes/pipes.dm +++ b/code/ATMOSPHERICS/pipes/pipes.dm @@ -1,7 +1,10 @@ /obj/machinery/atmospherics/pipe var/datum/gas_mixture/air_temporary //used when reconstructing a pipeline that broke var/volume = 0 + + level = 1 layer = 2.4 //under wires with their 2.44 + use_power = 0 can_unwrench = 1 var/datum/pipeline/parent = null @@ -11,8 +14,30 @@ buckle_requires_restraints = 1 buckle_lying = -1 -/obj/machinery/atmospherics/proc/pipeline_expansion() - return null +/obj/machinery/atmospherics/pipe/New() + color = pipe_color + ..() + +/obj/machinery/atmospherics/pipe/Destroy() + for(DEVICE_TYPE_LOOP) + var/obj/machinery/atmospherics/N = NODE_I + if(N) + var/obj/machinery/atmospherics/oldN = N + N.disconnect(src) + NODE_I = null + oldN.build_network() + releaseAirToTurf() + ..() + +/obj/machinery/atmospherics/pipe/atmosinit() + var/turf/T = loc // hide if turf is not intact + hide(T.intact) + ..() + +/obj/machinery/atmospherics/pipe/hide(i) + if(level == 1 && istype(loc, /turf/simulated)) + invisibility = i ? 101 : 0 + update_icon() /obj/machinery/atmospherics/pipe/proc/check_pressure(pressure) //Return 1 if parent should continue checking other pipes @@ -59,5 +84,7 @@ ..() /obj/machinery/atmospherics/pipe/proc/update_node_icon() - //Used for pipe painting. Overriden in the children. - return + for(DEVICE_TYPE_LOOP) + if(NODE_I) + var/obj/machinery/atmospherics/N = NODE_I + N.update_icon() diff --git a/code/ATMOSPHERICS/pipes/simple.dm b/code/ATMOSPHERICS/pipes/simple.dm index b4685c44a1d..98b633a10d3 100644 --- a/code/ATMOSPHERICS/pipes/simple.dm +++ b/code/ATMOSPHERICS/pipes/simple.dm @@ -16,18 +16,17 @@ The regular pipe you see everywhere, including bent ones. dir = SOUTH initialize_directions = SOUTH|NORTH - var/obj/machinery/atmospherics/node1 - var/obj/machinery/atmospherics/node2 - - level = 1 - + device_type = BINARY +/* /obj/machinery/atmospherics/pipe/simple/New() color = pipe_color ..() - +*/ /obj/machinery/atmospherics/pipe/simple/SetInitDirections() + if(dir in diagonals) + initialize_directions = dir switch(dir) if(NORTH) initialize_directions = SOUTH|NORTH @@ -37,34 +36,23 @@ The regular pipe you see everywhere, including bent ones. initialize_directions = EAST|WEST if(WEST) initialize_directions = EAST|WEST - if(NORTHEAST) - initialize_directions = NORTH|EAST - if(NORTHWEST) - initialize_directions = NORTH|WEST - if(SOUTHEAST) - initialize_directions = SOUTH|EAST - if(SOUTHWEST) - initialize_directions = SOUTH|WEST /obj/machinery/atmospherics/pipe/simple/atmosinit() normalize_dir() - var/N = 2 - for(var/D in cardinal) - if(D & initialize_directions) - N-- - for(var/obj/machinery/atmospherics/target in get_step(src, D)) - if(target.initialize_directions & get_dir(target,src)) - if(!node1 && N == 1) - node1 = target - break - if(!node2 && N == 0) - node2 = target - break - var/turf/T = loc // hide if turf is not intact - hide(T.intact) - update_icon() - ..() + var/list/node_connects = list() + if(dir in diagonals) //bent pipes + for(var/D in cardinal) + if(D & initialize_directions) + node_connects |= D + else //straight pipes + var/node1_connect = dir + var/node2_connect = turn(dir, 180) + node_connects = list(node1_connect, node2_connect) + + ..(node_connects) + +/* /obj/machinery/atmospherics/pipe/simple/Destroy() if(node1) var/obj/machinery/atmospherics/A = node1 @@ -89,7 +77,7 @@ The regular pipe you see everywhere, including bent ones. qdel(parent) node2 = null update_icon() - +*/ /obj/machinery/atmospherics/pipe/simple/proc/normalize_dir() if(dir==2) dir = 1 @@ -97,13 +85,13 @@ The regular pipe you see everywhere, including bent ones. dir = 4 /obj/machinery/atmospherics/pipe/simple/update_icon() - if(node1&&node2) + if(NODE1&&NODE2) icon_state = "intact[invisibility ? "-f" : "" ]" else - var/have_node1 = node1?1:0 - var/have_node2 = node2?1:0 + var/have_node1 = NODE1?1:0 + var/have_node2 = NODE2?1:0 icon_state = "exposed[have_node1][have_node2][invisibility ? "-f" : "" ]" - +/* /obj/machinery/atmospherics/pipe/simple/hide(i) if(level == 1 && istype(loc, /turf/simulated)) invisibility = i ? 101 : 0 @@ -118,7 +106,7 @@ The regular pipe you see everywhere, including bent ones. node1.update_icon() if(node2) node2.update_icon() - +*/ //Colored pipes, use these for mapping /obj/machinery/atmospherics/pipe/simple/general name="pipe" diff --git a/code/__DEFINES/atmospherics.dm b/code/__DEFINES/atmospherics.dm index 1745c74f2a2..80fd3613796 100644 --- a/code/__DEFINES/atmospherics.dm +++ b/code/__DEFINES/atmospherics.dm @@ -106,9 +106,42 @@ #define PRESSURE_DAMAGE_COEFFICIENT 4 //The amount of pressure damage someone takes is equal to (pressure / HAZARD_HIGH_PRESSURE)*PRESSURE_DAMAGE_COEFFICIENT, with the maximum of MAX_PRESSURE_DAMAGE #define MAX_HIGH_PRESSURE_DAMAGE 4 //This used to be 20... I got this much random rage for some retarded decision by polymorph?! Polymorph now lies in a pool of blood with a katana jammed in his spleen. ~Errorage --PS: The katana did less than 20 damage to him :( #define LOW_PRESSURE_DAMAGE 2 //The amounb of damage someone takes when in a low pressure area (The pressure threshold is so low that it doesn't make sense to do any calculations, so it just applies this flat value). - -#define COLD_SLOWDOWN_FACTOR 20 //Humans are slowed by the difference between bodytemp and BODYTEMP_COLD_DAMAGE_LIMIT divided by this + +#define COLD_SLOWDOWN_FACTOR 20 //Humans are slowed by the difference between bodytemp and BODYTEMP_COLD_DAMAGE_LIMIT divided by this // Atmos pipe limits #define MAX_OUTPUT_PRESSURE 4500 // (kPa) What pressure pumps and powered equipment max out at. -#define MAX_TRANSFER_RATE 200 // (L/s) Maximum speed powered equipment can work at. \ No newline at end of file +#define MAX_TRANSFER_RATE 200 // (L/s) Maximum speed powered equipment can work at. + +//Atmos machinery pipenet stuff + +// used for device_type vars; used by DEVICE_TYPE_LOOP +#define UNARY 1 +#define BINARY 2 +#define TRINARY 3 +#define QUATERNARY 4 + +// this is the standard for loop used by all sorts of atmos machinery procs +#define DEVICE_TYPE_LOOP var/I = 1; I <= device_type; I++ + +// defines for the various machinery lists +// NODE_I, AIR_I, PARENT_I are used within DEVICE_TYPE_LOOP + +// nodes list - all atmos machinery +#define NODE1 nodes["n1"] +#define NODE2 nodes["n2"] +#define NODE3 nodes["n3"] +#define NODE4 nodes["n4"] +#define NODE_I nodes["n[I]"] + +// airs list - components only +#define AIR1 airs["a1"] +#define AIR2 airs["a2"] +#define AIR3 airs["a3"] +#define AIR_I airs["a[I]"] + +// parents list - components only +#define PARENT1 parents["p1"] +#define PARENT2 parents["p2"] +#define PARENT3 parents["p3"] +#define PARENT_I parents["p[I]"] \ No newline at end of file diff --git a/code/game/machinery/atmoalter/portable_atmospherics.dm b/code/game/machinery/atmoalter/portable_atmospherics.dm index e484b42e4c3..b345ea16cd2 100644 --- a/code/game/machinery/atmoalter/portable_atmospherics.dm +++ b/code/game/machinery/atmoalter/portable_atmospherics.dm @@ -47,7 +47,7 @@ //Perform the connection connected_port = new_port connected_port.connected_device = src - var/datum/pipeline/connected_port_parent = connected_port.parents[PARENT1] + var/datum/pipeline/connected_port_parent = connected_port.PARENT1 connected_port_parent.reconcile_air() anchored = 1 //Prevent movement diff --git a/code/modules/admin/verbs/atmosdebug.dm b/code/modules/admin/verbs/atmosdebug.dm index dd5fee98f6c..f6655f193c9 100644 --- a/code/modules/admin/verbs/atmosdebug.dm +++ b/code/modules/admin/verbs/atmosdebug.dm @@ -13,12 +13,12 @@ //Manifolds for (var/obj/machinery/atmospherics/pipe/manifold/pipe in world) - if (!pipe.node1 || !pipe.node2 || !pipe.node3) + if (!pipe.NODE1 || !pipe.NODE2 || !pipe.NODE3) usr << "Unconnected [pipe.name] located at [pipe.x],[pipe.y],[pipe.z] ([get_area(pipe.loc)])" //Pipes for (var/obj/machinery/atmospherics/pipe/simple/pipe in world) - if (!pipe.node1 || !pipe.node2) + if (!pipe.NODE1 || !pipe.NODE2) usr << "Unconnected [pipe.name] located at [pipe.x],[pipe.y],[pipe.z] ([get_area(pipe.loc)])" /client/proc/powerdebug() diff --git a/code/modules/mob/living/ventcrawling.dm b/code/modules/mob/living/ventcrawling.dm index c0531581a36..a44e4865897 100644 --- a/code/modules/mob/living/ventcrawling.dm +++ b/code/modules/mob/living/ventcrawling.dm @@ -37,7 +37,7 @@ var/list/ventcrawl_machinery = list(/obj/machinery/atmospherics/components/unary if(vent_found) - var/datum/pipeline/vent_found_parent = vent_found.parents[PARENT1] + var/datum/pipeline/vent_found_parent = vent_found.PARENT1 if(vent_found_parent && (vent_found_parent.members.len || vent_found_parent.other_atmosmch)) visible_message("[src] begins climbing into the ventilation system..." ,"You begin climbing into the ventilation system...") @@ -70,7 +70,7 @@ var/list/ventcrawl_machinery = list(/obj/machinery/atmospherics/components/unary if(!istype(starting_machine) || !starting_machine.returnPipenet()) return var/list/totalMembers = list() - var/datum/pipeline/starting_machine_parent = starting_machine.parents[PARENT1] + var/datum/pipeline/starting_machine_parent = starting_machine.PARENT1 totalMembers += starting_machine_parent.members totalMembers += starting_machine_parent.other_atmosmch From 3a3ce839f998d23563b0e1592ce0810c49d2a573 Mon Sep 17 00:00:00 2001 From: duncathan Date: Mon, 17 Aug 2015 00:08:46 -0600 Subject: [PATCH 02/14] 2nd pass minor change to atmosinit changes heat exchanging pipes to be a subtype of atmospherics/pipe eventually this will allow us to make h/e manifolds (even 4-way) removes a bunch of comments --- code/ATMOSPHERICS/atmospherics.dm | 5 + .../components/unary_devices/unary_base.dm | 8 - code/ATMOSPHERICS/pipes/he_pipes.dm | 145 ------------------ .../pipes/heat_exchange/he_pipes.dm | 70 +++++++++ .../pipes/heat_exchange/junction.dm | 42 +++++ .../pipes/heat_exchange/simple.dm | 35 +++++ code/ATMOSPHERICS/pipes/manifold.dm | 83 ---------- code/ATMOSPHERICS/pipes/manifold4w.dm | 93 +---------- code/ATMOSPHERICS/pipes/pipes.dm | 8 + code/ATMOSPHERICS/pipes/simple.dm | 68 +------- code/game/machinery/pipe/construction.dm | 8 +- tgstation.dme | 4 +- 12 files changed, 176 insertions(+), 393 deletions(-) delete mode 100644 code/ATMOSPHERICS/pipes/he_pipes.dm create mode 100644 code/ATMOSPHERICS/pipes/heat_exchange/he_pipes.dm create mode 100644 code/ATMOSPHERICS/pipes/heat_exchange/junction.dm create mode 100644 code/ATMOSPHERICS/pipes/heat_exchange/simple.dm diff --git a/code/ATMOSPHERICS/atmospherics.dm b/code/ATMOSPHERICS/atmospherics.dm index d7f878e06ca..30184ff24d2 100644 --- a/code/ATMOSPHERICS/atmospherics.dm +++ b/code/ATMOSPHERICS/atmospherics.dm @@ -50,6 +50,11 @@ Pipelines + Other Objects -> Pipe network //this is called just after the air controller sets up turfs /obj/machinery/atmospherics/proc/atmosinit(var/list/node_connects) + if(!node_connects) //for pipes where order of nodes doesn't matter + node_connects = list() + for(var/D in cardinal) + if(D & GetInitDirections()) + node_connects |= D for(DEVICE_TYPE_LOOP) for(var/obj/machinery/atmospherics/target in get_step(src,node_connects[I])) if(target.initialize_directions & get_dir(target,src)) diff --git a/code/ATMOSPHERICS/components/unary_devices/unary_base.dm b/code/ATMOSPHERICS/components/unary_devices/unary_base.dm index 1d6a92c7206..235c8907982 100644 --- a/code/ATMOSPHERICS/components/unary_devices/unary_base.dm +++ b/code/ATMOSPHERICS/components/unary_devices/unary_base.dm @@ -18,14 +18,6 @@ Iconnery ..(intact) -/* -Housekeeping and pipe network stuff below -*/ - -/obj/machinery/atmospherics/components/unary/atmosinit() - var/list/node_connects = list(dir) - ..(node_connects) - /obj/machinery/atmospherics/components/unary/default_change_direction_wrench(mob/user, obj/item/weapon/wrench/W) if(!..()) return diff --git a/code/ATMOSPHERICS/pipes/he_pipes.dm b/code/ATMOSPHERICS/pipes/he_pipes.dm deleted file mode 100644 index 10f900ab5d3..00000000000 --- a/code/ATMOSPHERICS/pipes/he_pipes.dm +++ /dev/null @@ -1,145 +0,0 @@ -//////////// -//HE Pipes -//////////// - -/obj/machinery/atmospherics/pipe/simple/heat_exchanging - icon = 'icons/obj/atmospherics/pipes/heat.dmi' - icon_state = "intact" - level = 2 - var/initialize_directions_he - var/minimum_temperature_difference = 20 - var/thermal_conductivity = WINDOW_HEAT_TRANSFER_COEFFICIENT - color = "#404040" - buckle_lying = 1 - var/icon_temperature = T20C //stop small changes in temperature causing icon refresh - -/obj/machinery/atmospherics/pipe/simple/heat_exchanging/New() - ..() - color = "#404040" - -/obj/machinery/atmospherics/pipe/simple/heat_exchanging/SetInitDirections() - if(dir in diagonals) - initialize_directions_he = dir - switch(dir) - if(SOUTH) - initialize_directions_he = SOUTH|NORTH - if(NORTH) - initialize_directions_he = SOUTH|NORTH - if(EAST) - initialize_directions_he = EAST|WEST - if(WEST) - initialize_directions_he = WEST|EAST - -/obj/machinery/atmospherics/pipe/simple/heat_exchanging/atmosinit() - normalize_dir() - var/N = 2 - for(var/D in cardinal) - if(D & initialize_directions_he) - N-- - for(var/obj/machinery/atmospherics/pipe/simple/heat_exchanging/target in get_step(src, D)) - if(target.initialize_directions_he & get_dir(target,src)) - if(!NODE1 && N == 1) - NODE1 = target - break - if(!NODE2 && N == 0) - NODE2 = target - break - update_icon() - ..() - -/obj/machinery/atmospherics/pipe/simple/heat_exchanging/process_atmos() - var/environment_temperature = 0 - var/datum/gas_mixture/pipe_air = return_air() - - if(istype(loc, /turf/simulated)) - if(loc:blocks_air) - environment_temperature = loc:temperature - else - var/datum/gas_mixture/environment = loc.return_air() - environment_temperature = environment.temperature - else - environment_temperature = loc:temperature - - if(abs(environment_temperature-pipe_air.temperature) > minimum_temperature_difference) - parent.temperature_interact(loc, volume, thermal_conductivity) - - - //heatup/cooldown any mobs buckled to ourselves based on our temperature - if(buckled_mob) - var/hc = pipe_air.heat_capacity() - var/avg_temp = (pipe_air.temperature * hc + buckled_mob.bodytemperature * 3500) / (hc + 3500) - pipe_air.temperature = avg_temp - buckled_mob.bodytemperature = avg_temp - -/obj/machinery/atmospherics/pipe/simple/heat_exchanging/process() - var/datum/gas_mixture/pipe_air = return_air() - //Burn any mobs buckled to ourselves based on our temperature - if(buckled_mob) - var/heat_limit = 1000 - if(pipe_air.temperature > heat_limit + 1) - buckled_mob.apply_damage(4 * log(pipe_air.temperature - heat_limit), BURN, "chest") - - //Heat causes pipe to glow - if(pipe_air.temperature && (icon_temperature > 500 || pipe_air.temperature > 500)) //glow starts at 500K - if(abs(pipe_air.temperature - icon_temperature) > 10) - icon_temperature = pipe_air.temperature - - var/h_r = heat2colour_r(icon_temperature) - var/h_g = heat2colour_g(icon_temperature) - var/h_b = heat2colour_b(icon_temperature) - - if(icon_temperature < 2000)//scale glow until 2000K - var/scale = (icon_temperature - 500) / 1500 - h_r = 64 + (h_r - 64) * scale - h_g = 64 + (h_g - 64) * scale - h_b = 64 + (h_b - 64) * scale - - animate(src, color = rgb(h_r, h_g, h_b), time = 20, easing = SINE_EASING) - -//////////////// -//HE Junctions -//////////////// -/obj/machinery/atmospherics/pipe/simple/heat_exchanging/junction - icon = 'icons/obj/atmospherics/pipes/junction.dmi' - icon_state = "intact" - level = 2 - minimum_temperature_difference = 300 - thermal_conductivity = WALL_HEAT_TRANSFER_COEFFICIENT - -/obj/machinery/atmospherics/pipe/simple/heat_exchanging/junction/normalize_dir() - return - -/obj/machinery/atmospherics/pipe/simple/heat_exchanging/junction/SetInitDirections() - switch(dir) - if(SOUTH) - initialize_directions = NORTH - initialize_directions_he = SOUTH - if(NORTH) - initialize_directions = SOUTH - initialize_directions_he = NORTH - if(EAST) - initialize_directions = WEST - initialize_directions_he = EAST - if(WEST) - initialize_directions = EAST - initialize_directions_he = WEST - -/obj/machinery/atmospherics/pipe/simple/heat_exchanging/junction/update_icon() - if(NODE1&&NODE2) - icon_state = "intact" - else - var/have_node1 = NODE1?1:0 - var/have_node2 = NODE2?1:0 - icon_state = "exposed[have_node1][have_node2]" - -/obj/machinery/atmospherics/pipe/simple/heat_exchanging/junction/atmosinit() - for(var/obj/machinery/atmospherics/target in get_step(src,initialize_directions)) - if(target.initialize_directions & get_dir(target,src)) - NODE1 = target - break - for(var/obj/machinery/atmospherics/pipe/simple/heat_exchanging/target in get_step(src,initialize_directions_he)) - if(target.initialize_directions_he & get_dir(target,src)) - NODE2 = target - break - update_icon() - ..() \ No newline at end of file diff --git a/code/ATMOSPHERICS/pipes/heat_exchange/he_pipes.dm b/code/ATMOSPHERICS/pipes/heat_exchange/he_pipes.dm new file mode 100644 index 00000000000..3d605767a78 --- /dev/null +++ b/code/ATMOSPHERICS/pipes/heat_exchange/he_pipes.dm @@ -0,0 +1,70 @@ +//////////// +//HE Pipes +//////////// + +/obj/machinery/atmospherics/pipe/heat_exchanging/ + icon = 'icons/obj/atmospherics/pipes/heat.dmi' + level = 2 + var/initialize_directions_he + var/minimum_temperature_difference = 20 + var/thermal_conductivity = WINDOW_HEAT_TRANSFER_COEFFICIENT + color = "#404040" + buckle_lying = 1 + var/icon_temperature = T20C //stop small changes in temperature causing icon refresh + +/obj/machinery/atmospherics/pipe/heat_exchanging/New() + ..() + color = "#404040" + +/obj/machinery/atmospherics/pipe/heat_exchanging/hide() + return + +/obj/machinery/atmospherics/pipe/heat_exchanging/process_atmos() + var/environment_temperature = 0 + var/datum/gas_mixture/pipe_air = return_air() + + var/turf/simulated/T = loc + if(istype(T)) + if(T.blocks_air) + environment_temperature = T.temperature + else + var/datum/gas_mixture/environment = T.return_air() + environment_temperature = environment.temperature + else + environment_temperature = T.temperature + + if(abs(environment_temperature-pipe_air.temperature) > minimum_temperature_difference) + parent.temperature_interact(T, volume, thermal_conductivity) + + + //heatup/cooldown any mobs buckled to ourselves based on our temperature + if(buckled_mob) + var/hc = pipe_air.heat_capacity() + var/avg_temp = (pipe_air.temperature * hc + buckled_mob.bodytemperature * 3500) / (hc + 3500) + pipe_air.temperature = avg_temp + buckled_mob.bodytemperature = avg_temp + +/obj/machinery/atmospherics/pipe/heat_exchanging/process() + var/datum/gas_mixture/pipe_air = return_air() + //Burn any mobs buckled to ourselves based on our temperature + if(buckled_mob) + var/heat_limit = 1000 + if(pipe_air.temperature > heat_limit + 1) + buckled_mob.apply_damage(4 * log(pipe_air.temperature - heat_limit), BURN, "chest") + + //Heat causes pipe to glow + if(pipe_air.temperature && (icon_temperature > 500 || pipe_air.temperature > 500)) //glow starts at 500K + if(abs(pipe_air.temperature - icon_temperature) > 10) + icon_temperature = pipe_air.temperature + + var/h_r = heat2colour_r(icon_temperature) + var/h_g = heat2colour_g(icon_temperature) + var/h_b = heat2colour_b(icon_temperature) + + if(icon_temperature < 2000)//scale glow until 2000K + var/scale = (icon_temperature - 500) / 1500 + h_r = 64 + (h_r - 64) * scale + h_g = 64 + (h_g - 64) * scale + h_b = 64 + (h_b - 64) * scale + + animate(src, color = rgb(h_r, h_g, h_b), time = 20, easing = SINE_EASING) \ No newline at end of file diff --git a/code/ATMOSPHERICS/pipes/heat_exchange/junction.dm b/code/ATMOSPHERICS/pipes/heat_exchange/junction.dm new file mode 100644 index 00000000000..fdc894c6230 --- /dev/null +++ b/code/ATMOSPHERICS/pipes/heat_exchange/junction.dm @@ -0,0 +1,42 @@ +/obj/machinery/atmospherics/pipe/heat_exchanging/junction + icon = 'icons/obj/atmospherics/pipes/junction.dmi' + icon_state = "intact" + + name = "junction" + desc = "A one meter junction that connects regular and heat-exchanging pipe" + + minimum_temperature_difference = 300 + thermal_conductivity = WALL_HEAT_TRANSFER_COEFFICIENT + volume = 70 + + dir = SOUTH + initialize_directions = NORTH + initialize_directions_he = SOUTH + + device_type = BINARY + +/obj/machinery/atmospherics/pipe/heat_exchanging/junction/SetInitDirections() + switch(dir) + if(SOUTH) + initialize_directions = NORTH + initialize_directions_he = SOUTH + if(NORTH) + initialize_directions = SOUTH + initialize_directions_he = NORTH + if(EAST) + initialize_directions = WEST + initialize_directions_he = EAST + if(WEST) + initialize_directions = EAST + initialize_directions_he = WEST + +/obj/machinery/atmospherics/pipe/heat_exchanging/junction/atmosinit() //it pains me that this must be hardcoded, but the alternative is super hacky + for(var/obj/machinery/atmospherics/target in get_step(src,initialize_directions)) + if(target.initialize_directions & get_dir(target,src)) + NODE1 = target + break + for(var/obj/machinery/atmospherics/pipe/heat_exchanging/simple/target in get_step(src,initialize_directions_he)) + if(target.initialize_directions_he & get_dir(target,src)) + NODE2 = target + break + update_icon() \ No newline at end of file diff --git a/code/ATMOSPHERICS/pipes/heat_exchange/simple.dm b/code/ATMOSPHERICS/pipes/heat_exchange/simple.dm new file mode 100644 index 00000000000..0ea6240c437 --- /dev/null +++ b/code/ATMOSPHERICS/pipes/heat_exchange/simple.dm @@ -0,0 +1,35 @@ +/obj/machinery/atmospherics/pipe/heat_exchanging/simple + icon_state = "intact" + + name = "pipe" + desc = "A one meter section of heat-exchanging pipe" + + volume = 70 + + dir = SOUTH + initialize_directions_he = SOUTH|NORTH + + device_type = BINARY + +/obj/machinery/atmospherics/pipe/heat_exchanging/simple/SetInitDirections() + if(dir in diagonals) + initialize_directions_he = dir + switch(dir) + if(SOUTH) + initialize_directions_he = SOUTH|NORTH + if(NORTH) + initialize_directions_he = SOUTH|NORTH + if(EAST) + initialize_directions_he = EAST|WEST + if(WEST) + initialize_directions_he = WEST|EAST + +/obj/machinery/atmospherics/pipe/heat_exchanging/simple/proc/normalize_dir() + if(dir==SOUTH) + dir = NORTH + else if(dir==WEST) + dir = EAST + +/obj/machinery/atmospherics/pipe/heat_exchanging/simple/atmosinit() + normalize_dir() + ..() \ No newline at end of file diff --git a/code/ATMOSPHERICS/pipes/manifold.dm b/code/ATMOSPHERICS/pipes/manifold.dm index 2a56452d46f..997f4fdf8d4 100644 --- a/code/ATMOSPHERICS/pipes/manifold.dm +++ b/code/ATMOSPHERICS/pipes/manifold.dm @@ -1,4 +1,3 @@ - /* 3-Way Manifold */ @@ -16,12 +15,7 @@ initialize_directions = EAST|NORTH|WEST device_type = TRINARY -/* -/obj/machinery/atmospherics/pipe/manifold/New() - color = pipe_color - ..() -*/ /obj/machinery/atmospherics/pipe/manifold/SetInitDirections() switch(dir) if(NORTH) @@ -33,65 +27,6 @@ if(WEST) initialize_directions = NORTH|EAST|SOUTH -/obj/machinery/atmospherics/pipe/manifold/atmosinit() - var/node1_connect = turn(dir, 90) - var/node2_connect = turn(dir, 270) - var/node3_connect = turn(dir, 180) - var/list/node_connects = list(node1_connect, node2_connect, node3_connect) - ..(node_connects) -/* - for(var/D in cardinal) - if(D == dir) - continue - for(var/obj/machinery/atmospherics/target in get_step(src, D)) - if(target.initialize_directions & get_dir(target,src)) - if(turn(dir, 90) == D) - node1 = target - if(turn(dir, 270) == D) - node2 = target - if(turn(dir, 180) == D) - node3 = target - break - var/turf/T = src.loc // hide if turf is not intact - hide(T.intact) - update_icon() - ..() - -/obj/machinery/atmospherics/pipe/manifold/Destroy() - if(node1) - var/obj/machinery/atmospherics/A = node1 - node1.disconnect(src) - node1 = null - A.build_network() - if(node2) - var/obj/machinery/atmospherics/A = node2 - node2.disconnect(src) - node2 = null - A.build_network() - if(node3) - var/obj/machinery/atmospherics/A = node3 - node3.disconnect(src) - node3 = null - A.build_network() - releaseAirToTurf() - ..() - -/obj/machinery/atmospherics/pipe/manifold/disconnect(obj/machinery/atmospherics/reference) - if(reference == node1) - if(istype(node1, /obj/machinery/atmospherics/pipe)) - qdel(parent) - node1 = null - if(reference == node2) - if(istype(node2, /obj/machinery/atmospherics/pipe)) - qdel(parent) - node2 = null - if(reference == node3) - if(istype(node3, /obj/machinery/atmospherics/pipe)) - qdel(parent) - node3 = null - update_icon() - ..() -*/ /obj/machinery/atmospherics/pipe/manifold/update_icon() var/invis = invisibility ? "-f" : "" @@ -103,24 +38,6 @@ for(DEVICE_TYPE_LOOP) if(NODE_I) overlays += getpipeimage('icons/obj/atmospherics/pipes/manifold.dmi', "manifold_full[invis]", get_dir(src, NODE_I)) -/* -/obj/machinery/atmospherics/pipe/manifold/hide(i) - if(level == 1 && istype(loc, /turf/simulated)) - invisibility = i ? 101 : 0 - update_icon() - -/obj/machinery/atmospherics/pipe/manifold/pipeline_expansion() - return list(node1, node2, node3) - -/obj/machinery/atmospherics/pipe/manifold/update_node_icon() - ..() - if(node1) - node1.update_icon() - if(node2) - node2.update_icon() - if(node3) - node3.update_icon() -*/ //Colored pipes, use these for mapping /obj/machinery/atmospherics/pipe/manifold/general diff --git a/code/ATMOSPHERICS/pipes/manifold4w.dm b/code/ATMOSPHERICS/pipes/manifold4w.dm index da510edb363..aeacfcd0b48 100644 --- a/code/ATMOSPHERICS/pipes/manifold4w.dm +++ b/code/ATMOSPHERICS/pipes/manifold4w.dm @@ -1,4 +1,3 @@ - /* 4-way manifold */ @@ -14,87 +13,10 @@ initialize_directions = NORTH|SOUTH|EAST|WEST device_type = QUATERNARY -/* -/obj/machinery/atmospherics/pipe/manifold4w/New() - color = pipe_color - ..() -*/ + /obj/machinery/atmospherics/pipe/manifold4w/SetInitDirections() initialize_directions = initial(initialize_directions) -/obj/machinery/atmospherics/pipe/manifold4w/atmosinit() - ..(cardinal) -/* - for(var/D in cardinal) - for(var/obj/machinery/atmospherics/target in get_step(src, D)) - if(target.initialize_directions & get_dir(target,src)) - if(D == NORTH) - node1 = target - else if(D == SOUTH) - node2 = target - else if(D == EAST) - node3 = target - else if(D == WEST) - node4 = target - break - - var/turf/T = src.loc // hide if turf is not intact - hide(T.intact) - update_icon() - ..() - -/obj/machinery/atmospherics/pipe/manifold4w/hide(i) - if(level == 1 && istype(loc, /turf/simulated)) - invisibility = i ? 101 : 0 - update_icon() - -/obj/machinery/atmospherics/pipe/manifold4w/pipeline_expansion() - return list(node1, node2, node3, node4) - -/obj/machinery/atmospherics/pipe/manifold4w/Destroy() - if(node1) - var/obj/machinery/atmospherics/A = node1 - node1.disconnect(src) - node1 = null - A.build_network() - if(node2) - var/obj/machinery/atmospherics/A = node2 - node2.disconnect(src) - node2 = null - A.build_network() - if(node3) - var/obj/machinery/atmospherics/A = node3 - node3.disconnect(src) - node3 = null - A.build_network() - if(node4) - var/obj/machinery/atmospherics/A = node4 - node4.disconnect(src) - node4 = null - A.build_network() - releaseAirToTurf() - ..() - -/obj/machinery/atmospherics/pipe/manifold4w/disconnect(obj/machinery/atmospherics/reference) - if(reference == node1) - if(istype(node1, /obj/machinery/atmospherics/pipe)) - qdel(parent) - node1 = null - if(reference == node2) - if(istype(node2, /obj/machinery/atmospherics/pipe)) - qdel(parent) - node2 = null - if(reference == node3) - if(istype(node3, /obj/machinery/atmospherics/pipe)) - qdel(parent) - node3 = null - if(reference == node4) - if(istype(node4, /obj/machinery/atmospherics/pipe)) - qdel(parent) - node4 = null - update_icon() - ..() -*/ /obj/machinery/atmospherics/pipe/manifold4w/update_icon() var/invis = invisibility ? "-f" : "" @@ -106,18 +28,7 @@ for(DEVICE_TYPE_LOOP) if(NODE_I) overlays += getpipeimage('icons/obj/atmospherics/pipes/manifold.dmi', "manifold_full[invis]", get_dir(src, NODE_I)) -/* -/obj/machinery/atmospherics/pipe/manifold4w/update_node_icon() - ..() - if(node1) - node1.update_icon() - if(node2) - node2.update_icon() - if(node3) - node3.update_icon() - if(node4) - node4.update_icon() -*/ + //Colored pipes, use these for mapping /obj/machinery/atmospherics/pipe/manifold4w/general name="pipe" diff --git a/code/ATMOSPHERICS/pipes/pipes.dm b/code/ATMOSPHERICS/pipes/pipes.dm index b4b780ae60c..4d902488520 100644 --- a/code/ATMOSPHERICS/pipes/pipes.dm +++ b/code/ATMOSPHERICS/pipes/pipes.dm @@ -29,6 +29,14 @@ releaseAirToTurf() ..() +/obj/machinery/atmospherics/pipe/update_icon() //overridden by manifolds + if(NODE1&&NODE2) + icon_state = "intact[invisibility ? "-f" : "" ]" + else + var/have_node1 = NODE1?1:0 + var/have_node2 = NODE2?1:0 + icon_state = "exposed[have_node1][have_node2][invisibility ? "-f" : "" ]" + /obj/machinery/atmospherics/pipe/atmosinit() var/turf/T = loc // hide if turf is not intact hide(T.intact) diff --git a/code/ATMOSPHERICS/pipes/simple.dm b/code/ATMOSPHERICS/pipes/simple.dm index 98b633a10d3..e1e50f7c752 100644 --- a/code/ATMOSPHERICS/pipes/simple.dm +++ b/code/ATMOSPHERICS/pipes/simple.dm @@ -1,4 +1,3 @@ - /* Simple Pipe The regular pipe you see everywhere, including bent ones. @@ -17,12 +16,6 @@ The regular pipe you see everywhere, including bent ones. initialize_directions = SOUTH|NORTH device_type = BINARY -/* -/obj/machinery/atmospherics/pipe/simple/New() - color = pipe_color - - ..() -*/ /obj/machinery/atmospherics/pipe/simple/SetInitDirections() if(dir in diagonals) @@ -42,9 +35,7 @@ The regular pipe you see everywhere, including bent ones. var/list/node_connects = list() if(dir in diagonals) //bent pipes - for(var/D in cardinal) - if(D & initialize_directions) - node_connects |= D + ..() else //straight pipes var/node1_connect = dir var/node2_connect = turn(dir, 180) @@ -52,61 +43,16 @@ The regular pipe you see everywhere, including bent ones. ..(node_connects) -/* -/obj/machinery/atmospherics/pipe/simple/Destroy() - if(node1) - var/obj/machinery/atmospherics/A = node1 - node1.disconnect(src) - node1 = null - A.build_network() - if(node2) - var/obj/machinery/atmospherics/A = node2 - node2.disconnect(src) - node2 = null - A.build_network() - releaseAirToTurf() - ..() - -/obj/machinery/atmospherics/pipe/simple/disconnect(obj/machinery/atmospherics/reference) - if(reference == node1) - if(istype(node1, /obj/machinery/atmospherics/pipe)) - qdel(parent) - node1 = null - if(reference == node2) - if(istype(node2, /obj/machinery/atmospherics/pipe)) - qdel(parent) - node2 = null - update_icon() -*/ /obj/machinery/atmospherics/pipe/simple/proc/normalize_dir() - if(dir==2) - dir = 1 - else if(dir==8) - dir = 4 + if(dir==SOUTH) + dir = NORTH + else if(dir==WEST) + dir = EAST /obj/machinery/atmospherics/pipe/simple/update_icon() - if(NODE1&&NODE2) - icon_state = "intact[invisibility ? "-f" : "" ]" - else - var/have_node1 = NODE1?1:0 - var/have_node2 = NODE2?1:0 - icon_state = "exposed[have_node1][have_node2][invisibility ? "-f" : "" ]" -/* -/obj/machinery/atmospherics/pipe/simple/hide(i) - if(level == 1 && istype(loc, /turf/simulated)) - invisibility = i ? 101 : 0 - update_icon() - -/obj/machinery/atmospherics/pipe/simple/pipeline_expansion() - return list(node1, node2) - -/obj/machinery/atmospherics/pipe/simple/update_node_icon() + normalize_dir() ..() - if(node1) - node1.update_icon() - if(node2) - node2.update_icon() -*/ + //Colored pipes, use these for mapping /obj/machinery/atmospherics/pipe/simple/general name="pipe" diff --git a/code/game/machinery/pipe/construction.dm b/code/game/machinery/pipe/construction.dm index 2d49668927f..186ec5ce45d 100644 --- a/code/game/machinery/pipe/construction.dm +++ b/code/game/machinery/pipe/construction.dm @@ -57,9 +57,9 @@ Buildable meters is_bent = 0 else is_bent = 1 - if (istype(make_from, /obj/machinery/atmospherics/pipe/simple/heat_exchanging/junction)) + if (istype(make_from, /obj/machinery/atmospherics/pipe/heat_exchanging/junction)) src.pipe_type = PIPE_JUNCTION - else if(istype(make_from, /obj/machinery/atmospherics/pipe/simple/heat_exchanging)) + else if(istype(make_from, /obj/machinery/atmospherics/pipe/heat_exchanging/simple)) src.pipe_type = PIPE_HE_STRAIGHT + is_bent else if(istype(make_from, /obj/machinery/atmospherics/pipe/simple)) src.pipe_type = PIPE_SIMPLE_STRAIGHT + is_bent @@ -311,7 +311,7 @@ var/global/list/pipeID2State = list( P.construction(dir, pipe_dir, pipe_type, color) if(PIPE_HE_STRAIGHT, PIPE_HE_BENT) - var/obj/machinery/atmospherics/pipe/simple/heat_exchanging/P = new ( src.loc ) + var/obj/machinery/atmospherics/pipe/heat_exchanging/simple/P = new ( src.loc ) P.initialize_directions_he = pipe_dir P.construction(dir, pipe_dir, pipe_type, color) @@ -330,7 +330,7 @@ var/global/list/pipeID2State = list( M.construction(dir, pipe_dir, pipe_type, color) if(PIPE_JUNCTION) - var/obj/machinery/atmospherics/pipe/simple/heat_exchanging/junction/P = new ( src.loc ) + var/obj/machinery/atmospherics/pipe/heat_exchanging/junction/P = new ( src.loc ) P.initialize_directions_he = src.get_hdir() P.construction(dir, get_pdir(), pipe_type, color) diff --git a/tgstation.dme b/tgstation.dme index 7677d19fc8f..beaabe5bd84 100644 --- a/tgstation.dme +++ b/tgstation.dme @@ -118,11 +118,13 @@ #include "code\ATMOSPHERICS\components\unary_devices\unary_base.dm" #include "code\ATMOSPHERICS\components\unary_devices\vent_pump.dm" #include "code\ATMOSPHERICS\components\unary_devices\vent_scrubber.dm" -#include "code\ATMOSPHERICS\pipes\he_pipes.dm" #include "code\ATMOSPHERICS\pipes\manifold.dm" #include "code\ATMOSPHERICS\pipes\manifold4w.dm" #include "code\ATMOSPHERICS\pipes\pipes.dm" #include "code\ATMOSPHERICS\pipes\simple.dm" +#include "code\ATMOSPHERICS\pipes\heat_exchange\he_pipes.dm" +#include "code\ATMOSPHERICS\pipes\heat_exchange\junction.dm" +#include "code\ATMOSPHERICS\pipes\heat_exchange\simple.dm" #include "code\controllers\configuration.dm" #include "code\controllers\failsafe.dm" #include "code\controllers\master_controller.dm" From 0d88d0eff66212e0abbdff120cca73a816b559d8 Mon Sep 17 00:00:00 2001 From: duncathan Date: Mon, 17 Aug 2015 16:09:33 -0600 Subject: [PATCH 03/14] 3rd pass adds GetInitDirections() from my other PR redoes atmosinit atmosinit now works if called without an argument (it builds the node_connects list on its own, without care for order) adds can_be_node; this proc is overridden by h/e pipes and junctions --- code/ATMOSPHERICS/atmospherics.dm | 23 ++++++++++++--- .../pipes/heat_exchange/he_pipes.dm | 13 ++++++--- .../pipes/heat_exchange/junction.dm | 29 ++++++++++++------- .../pipes/heat_exchange/simple.dm | 12 ++++---- code/ATMOSPHERICS/pipes/manifold.dm | 1 - code/ATMOSPHERICS/pipes/simple.dm | 19 ++---------- tgstation.dme | 1 - 7 files changed, 56 insertions(+), 42 deletions(-) diff --git a/code/ATMOSPHERICS/atmospherics.dm b/code/ATMOSPHERICS/atmospherics.dm index 30184ff24d2..159023e857f 100644 --- a/code/ATMOSPHERICS/atmospherics.dm +++ b/code/ATMOSPHERICS/atmospherics.dm @@ -52,16 +52,28 @@ Pipelines + Other Objects -> Pipe network /obj/machinery/atmospherics/proc/atmosinit(var/list/node_connects) if(!node_connects) //for pipes where order of nodes doesn't matter node_connects = list() - for(var/D in cardinal) - if(D & GetInitDirections()) - node_connects |= D + node_connects.len = device_type + + for(DEVICE_TYPE_LOOP) + for(var/D in cardinal) + if(D & GetInitDirections()) + if(D in node_connects) + continue + node_connects[I] = D + break + for(DEVICE_TYPE_LOOP) for(var/obj/machinery/atmospherics/target in get_step(src,node_connects[I])) - if(target.initialize_directions & get_dir(target,src)) + if(can_be_node(target, I)) NODE_I = target break + update_icon() +/obj/machinery/atmospherics/proc/can_be_node(obj/machinery/atmospherics/target) + if(target.initialize_directions & get_dir(target,src)) + return 1 + /obj/machinery/atmospherics/proc/pipeline_expansion() var/list/return_nodes = list() for(DEVICE_TYPE_LOOP) @@ -71,6 +83,9 @@ Pipelines + Other Objects -> Pipe network /obj/machinery/atmospherics/proc/SetInitDirections() return +/obj/machinery/atmospherics/proc/GetInitDirections() + return initialize_directions + /obj/machinery/atmospherics/proc/returnPipenet() return diff --git a/code/ATMOSPHERICS/pipes/heat_exchange/he_pipes.dm b/code/ATMOSPHERICS/pipes/heat_exchange/he_pipes.dm index 3d605767a78..30c7bf9e630 100644 --- a/code/ATMOSPHERICS/pipes/heat_exchange/he_pipes.dm +++ b/code/ATMOSPHERICS/pipes/heat_exchange/he_pipes.dm @@ -1,7 +1,3 @@ -//////////// -//HE Pipes -//////////// - /obj/machinery/atmospherics/pipe/heat_exchanging/ icon = 'icons/obj/atmospherics/pipes/heat.dmi' level = 2 @@ -16,9 +12,18 @@ ..() color = "#404040" +/obj/machinery/atmospherics/pipe/heat_exchanging/can_be_node(obj/machinery/atmospherics/pipe/heat_exchanging/target) + if(!istype(target)) + return 0 + if(target.initialize_directions_he & get_dir(target,src)) + return 1 + /obj/machinery/atmospherics/pipe/heat_exchanging/hide() return +/obj/machinery/atmospherics/pipe/heat_exchanging/GetInitDirections() + return ..() | initialize_directions_he + /obj/machinery/atmospherics/pipe/heat_exchanging/process_atmos() var/environment_temperature = 0 var/datum/gas_mixture/pipe_air = return_air() diff --git a/code/ATMOSPHERICS/pipes/heat_exchange/junction.dm b/code/ATMOSPHERICS/pipes/heat_exchange/junction.dm index fdc894c6230..b4424371ac0 100644 --- a/code/ATMOSPHERICS/pipes/heat_exchange/junction.dm +++ b/code/ATMOSPHERICS/pipes/heat_exchange/junction.dm @@ -30,13 +30,22 @@ initialize_directions = EAST initialize_directions_he = WEST -/obj/machinery/atmospherics/pipe/heat_exchanging/junction/atmosinit() //it pains me that this must be hardcoded, but the alternative is super hacky - for(var/obj/machinery/atmospherics/target in get_step(src,initialize_directions)) - if(target.initialize_directions & get_dir(target,src)) - NODE1 = target - break - for(var/obj/machinery/atmospherics/pipe/heat_exchanging/simple/target in get_step(src,initialize_directions_he)) - if(target.initialize_directions_he & get_dir(target,src)) - NODE2 = target - break - update_icon() \ No newline at end of file +/obj/machinery/atmospherics/pipe/heat_exchanging/junction/atmosinit() + var/node2_connect = dir + var/node1_connect = turn(dir, 180) + var/list/node_connects = list(node1_connect, node2_connect) + + ..(node_connects) + +/obj/machinery/atmospherics/pipe/heat_exchanging/junction/can_be_node(obj/machinery/atmospherics/target, iteration) + var/init_dir + switch(iteration) + if(1) + init_dir = target.initialize_directions + if(2) + var/obj/machinery/atmospherics/pipe/heat_exchanging/H = target + if(!istype(H)) + return 0 + init_dir = H.initialize_directions_he + if(init_dir & get_dir(target,src)) + return 1 \ No newline at end of file diff --git a/code/ATMOSPHERICS/pipes/heat_exchange/simple.dm b/code/ATMOSPHERICS/pipes/heat_exchange/simple.dm index 0ea6240c437..71d9b06b647 100644 --- a/code/ATMOSPHERICS/pipes/heat_exchange/simple.dm +++ b/code/ATMOSPHERICS/pipes/heat_exchange/simple.dm @@ -15,13 +15,9 @@ if(dir in diagonals) initialize_directions_he = dir switch(dir) - if(SOUTH) + if(NORTH,SOUTH) initialize_directions_he = SOUTH|NORTH - if(NORTH) - initialize_directions_he = SOUTH|NORTH - if(EAST) - initialize_directions_he = EAST|WEST - if(WEST) + if(EAST,WEST) initialize_directions_he = WEST|EAST /obj/machinery/atmospherics/pipe/heat_exchanging/simple/proc/normalize_dir() @@ -31,5 +27,9 @@ dir = EAST /obj/machinery/atmospherics/pipe/heat_exchanging/simple/atmosinit() + normalize_dir() + ..() + +/obj/machinery/atmospherics/pipe/heat_exchanging/simple/update_icon() normalize_dir() ..() \ No newline at end of file diff --git a/code/ATMOSPHERICS/pipes/manifold.dm b/code/ATMOSPHERICS/pipes/manifold.dm index 997f4fdf8d4..afee736108c 100644 --- a/code/ATMOSPHERICS/pipes/manifold.dm +++ b/code/ATMOSPHERICS/pipes/manifold.dm @@ -1,7 +1,6 @@ /* 3-Way Manifold */ - /obj/machinery/atmospherics/pipe/manifold icon = 'icons/obj/atmospherics/pipes/manifold.dmi' icon_state = "manifold" diff --git a/code/ATMOSPHERICS/pipes/simple.dm b/code/ATMOSPHERICS/pipes/simple.dm index e1e50f7c752..2830f75f804 100644 --- a/code/ATMOSPHERICS/pipes/simple.dm +++ b/code/ATMOSPHERICS/pipes/simple.dm @@ -21,27 +21,14 @@ The regular pipe you see everywhere, including bent ones. if(dir in diagonals) initialize_directions = dir switch(dir) - if(NORTH) + if(NORTH,SOUTH) initialize_directions = SOUTH|NORTH - if(SOUTH) - initialize_directions = SOUTH|NORTH - if(EAST) - initialize_directions = EAST|WEST - if(WEST) + if(EAST,WEST) initialize_directions = EAST|WEST /obj/machinery/atmospherics/pipe/simple/atmosinit() normalize_dir() - var/list/node_connects = list() - - if(dir in diagonals) //bent pipes - ..() - else //straight pipes - var/node1_connect = dir - var/node2_connect = turn(dir, 180) - node_connects = list(node1_connect, node2_connect) - - ..(node_connects) + ..() /obj/machinery/atmospherics/pipe/simple/proc/normalize_dir() if(dir==SOUTH) diff --git a/tgstation.dme b/tgstation.dme index beaabe5bd84..60b36e5e31a 100644 --- a/tgstation.dme +++ b/tgstation.dme @@ -312,7 +312,6 @@ #include "code\game\gamemodes\changeling\powers\absorb.dm" #include "code\game\gamemodes\changeling\powers\adrenaline.dm" #include "code\game\gamemodes\changeling\powers\augmented_eyesight.dm" -#include "code\game\gamemodes\changeling\powers\chameleon_skin.dm" #include "code\game\gamemodes\changeling\powers\digitalcamo.dm" #include "code\game\gamemodes\changeling\powers\fakedeath.dm" #include "code\game\gamemodes\changeling\powers\fleshmend.dm" From e84ca7365a3e58cdddaf81ca37bc62132e159907 Mon Sep 17 00:00:00 2001 From: duncathan Date: Mon, 17 Aug 2015 16:48:34 -0600 Subject: [PATCH 04/14] fixes merge stuff --- code/__DEFINES/pipe_construction.dm | 4 ++-- code/game/machinery/pipe/construction.dm | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/code/__DEFINES/pipe_construction.dm b/code/__DEFINES/pipe_construction.dm index 0fc337db1d2..f04e8a32ee9 100644 --- a/code/__DEFINES/pipe_construction.dm +++ b/code/__DEFINES/pipe_construction.dm @@ -8,8 +8,8 @@ Construction breaks otherwise #define PIPE_SIMPLE /obj/machinery/atmospherics/pipe/simple #define PIPE_MANIFOLD /obj/machinery/atmospherics/pipe/manifold #define PIPE_4WAYMANIFOLD /obj/machinery/atmospherics/pipe/manifold4w -#define PIPE_HE /obj/machinery/atmospherics/pipe/simple/heat_exchanging -#define PIPE_JUNCTION /obj/machinery/atmospherics/pipe/simple/heat_exchanging/junction +#define PIPE_HE /obj/machinery/atmospherics/pipe/heat_exchanging/simple +#define PIPE_JUNCTION /obj/machinery/atmospherics/pipe/heat_exchanging/junction //Unary #define PIPE_CONNECTOR /obj/machinery/atmospherics/components/unary/portables_connector #define PIPE_UVENT /obj/machinery/atmospherics/components/unary/vent_pump diff --git a/code/game/machinery/pipe/construction.dm b/code/game/machinery/pipe/construction.dm index 21674b02d9f..d6d5034dcad 100644 --- a/code/game/machinery/pipe/construction.dm +++ b/code/game/machinery/pipe/construction.dm @@ -49,7 +49,7 @@ Buildable meters src.dir = make_from.dir src.pipename = make_from.name src.color = make_from.color - src.pipe_type = PIPE_4WAYMANIFOLD + if(make_from.type in pipe_types) src.pipe_type = make_from.type else //make pipe_type a value we can work with From cead1653c08a23363e66ea9ed1c66638bd73de94 Mon Sep 17 00:00:00 2001 From: duncathan Date: Mon, 17 Aug 2015 21:46:39 -0600 Subject: [PATCH 05/14] changes associative lists to standard lists; updates MiniStation.dmm --- _maps/map_files/MiniStation/MiniStation.dmm | 36 +++++++++---------- code/ATMOSPHERICS/atmospherics.dm | 1 + .../components/components_base.dm | 3 ++ code/__DEFINES/atmospherics.dm | 26 +++++++------- 4 files changed, 35 insertions(+), 31 deletions(-) diff --git a/_maps/map_files/MiniStation/MiniStation.dmm b/_maps/map_files/MiniStation/MiniStation.dmm index 726e2e7e595..f17efdf2ad7 100644 --- a/_maps/map_files/MiniStation/MiniStation.dmm +++ b/_maps/map_files/MiniStation/MiniStation.dmm @@ -1080,7 +1080,7 @@ "uN" = (/obj/machinery/atmospherics/pipe/simple/cyan/visible{tag = "icon-intact (NORTH)"; icon_state = "intact"; dir = 1},/obj/effect/spawner/structure/window/reinforced,/turf/simulated/floor/plating,/area/engine/engineering) "uO" = (/obj/machinery/door/airlock/external{name = "Arrival Airlock"},/turf/simulated/floor/plating,/area/hallway/secondary/entry) "uP" = (/obj/machinery/atmospherics/pipe/simple/yellow/visible{tag = "icon-intact (NORTH)"; icon_state = "intact"; dir = 1},/obj/effect/spawner/structure/window/reinforced,/turf/simulated/floor/plating,/area/engine/engineering) -"uQ" = (/obj/machinery/atmospherics/pipe/simple/heat_exchanging/junction{dir = 8},/obj/effect/spawner/structure/window/reinforced,/turf/simulated/floor/plating,/area/engine/engineering) +"uQ" = (/obj/machinery/atmospherics/pipe/heat_exchanging/junction{dir = 8},/obj/effect/spawner/structure/window/reinforced,/turf/simulated/floor/plating,/area/engine/engineering) "uR" = (/obj/effect/spawner/structure/window/reinforced,/turf/simulated/floor/plating,/area/tcommsat/computer) "uS" = (/obj/machinery/alarm{dir = 4; icon_state = "alarm0"; pixel_x = -22},/obj/structure/closet/secure_closet/hop,/turf/simulated/floor/plasteel,/area/crew_quarters/heads{name = "\improper Job Assignment"}) "uT" = (/obj/item/device/radio/intercom{broadcasting = 0; freerange = 0; listening = 1; name = "Common Channel"; pixel_y = 25},/obj/structure/closet/radiation,/turf/simulated/floor/plasteel,/area/engine/engineering) @@ -1470,10 +1470,10 @@ "CI" = (/obj/machinery/atmospherics/components/unary/outlet_injector{dir = 8; frequency = 1443; id = "air_in"; on = 1},/turf/simulated/floor/engine/vacuum,/area/engine/engineering) "CJ" = (/obj/structure/sign/fire,/turf/simulated/wall,/area/engine/engineering) "CK" = (/obj/structure/transit_tube{tag = "icon-N-S-Pass"; icon_state = "N-S-Pass"},/turf/space,/area/space) -"CL" = (/obj/machinery/atmospherics/pipe/simple/heat_exchanging{dir = 6},/obj/structure/lattice,/turf/space,/area/engine/engineering) -"CM" = (/obj/machinery/atmospherics/pipe/simple/heat_exchanging{dir = 4},/obj/structure/lattice,/obj/machinery/light/small{dir = 1},/turf/space,/area/engine/engineering) -"CN" = (/obj/machinery/atmospherics/pipe/simple/heat_exchanging{dir = 4},/obj/structure/lattice,/turf/space,/area/engine/engineering) -"CO" = (/obj/machinery/atmospherics/pipe/simple/heat_exchanging{dir = 10},/obj/structure/lattice,/turf/space,/area/engine/engineering) +"CL" = (/obj/machinery/atmospherics/pipe/heat_exchanging/simple{dir = 6},/obj/structure/lattice,/turf/space,/area/engine/engineering) +"CM" = (/obj/machinery/atmospherics/pipe/heat_exchanging/simple{dir = 4},/obj/structure/lattice,/obj/machinery/light/small{dir = 1},/turf/space,/area/engine/engineering) +"CN" = (/obj/machinery/atmospherics/pipe/heat_exchanging/simple{dir = 4},/obj/structure/lattice,/turf/space,/area/engine/engineering) +"CO" = (/obj/machinery/atmospherics/pipe/heat_exchanging/simple{dir = 10},/obj/structure/lattice,/turf/space,/area/engine/engineering) "CP" = (/obj/machinery/atmospherics/components/binary/valve,/turf/simulated/floor/plating{icon_state = "warnplate"; dir = 8},/area/engine/engineering) "CQ" = (/obj/machinery/atmospherics/components/binary/valve,/turf/simulated/floor/plating,/area/engine/engineering) "CR" = (/obj/machinery/atmospherics/components/binary/pump{target_pressure = 1500},/turf/simulated/floor/plating,/area/engine/engineering) @@ -1481,14 +1481,14 @@ "CT" = (/obj/machinery/atmospherics/components/binary/pump{dir = 1; target_pressure = 2000},/turf/simulated/floor/plating{icon_state = "warnplate"; dir = 8},/area/engine/engineering) "CU" = (/obj/machinery/atmospherics/components/binary/valve,/turf/simulated/floor/plating{icon_state = "warnplate"; dir = 4},/area/engine/engineering) "CV" = (/obj/machinery/door_control{id = "burndoor"; name = "Burn Chamber Vent Control"; pixel_x = 25; pixel_y = 5; req_access_txt = "0"},/turf/simulated/floor/plasteel,/area/engine/engineering) -"CW" = (/obj/machinery/atmospherics/pipe/simple/heat_exchanging{dir = 6},/obj/machinery/sparker{id = "burnchamber"; pixel_x = -25},/turf/simulated/floor/engine/vacuum,/area/engine/engineering) -"CX" = (/obj/machinery/atmospherics/pipe/simple/heat_exchanging{dir = 4},/obj/machinery/meter/turf{pixel_y = 24},/obj/machinery/light/small{dir = 1},/turf/simulated/floor/engine/vacuum,/area/engine/engineering) -"CY" = (/obj/machinery/atmospherics/pipe/simple/heat_exchanging{dir = 4},/turf/simulated/floor/engine/vacuum,/area/engine/engineering) -"CZ" = (/obj/machinery/atmospherics/pipe/simple/heat_exchanging{dir = 4},/obj/machinery/camera{c_tag = "Burn Chamber"; network = list("burnchamber")},/turf/simulated/floor/engine/vacuum,/area/engine/engineering) -"Da" = (/obj/machinery/atmospherics/pipe/simple/heat_exchanging{dir = 10},/turf/simulated/floor/engine/vacuum,/area/engine/engineering) +"CW" = (/obj/machinery/atmospherics/pipe/heat_exchanging/simple{dir = 6},/obj/machinery/sparker{id = "burnchamber"; pixel_x = -25},/turf/simulated/floor/engine/vacuum,/area/engine/engineering) +"CX" = (/obj/machinery/atmospherics/pipe/heat_exchanging/simple{dir = 4},/obj/machinery/meter/turf{pixel_y = 24},/obj/machinery/light/small{dir = 1},/turf/simulated/floor/engine/vacuum,/area/engine/engineering) +"CY" = (/obj/machinery/atmospherics/pipe/heat_exchanging/simple{dir = 4},/turf/simulated/floor/engine/vacuum,/area/engine/engineering) +"CZ" = (/obj/machinery/atmospherics/pipe/heat_exchanging/simple{dir = 4},/obj/machinery/camera{c_tag = "Burn Chamber"; network = list("burnchamber")},/turf/simulated/floor/engine/vacuum,/area/engine/engineering) +"Da" = (/obj/machinery/atmospherics/pipe/heat_exchanging/simple{dir = 10},/turf/simulated/floor/engine/vacuum,/area/engine/engineering) "Db" = (/obj/structure/transit_tube{icon_state = "N-S"},/turf/space,/area/space) -"Dc" = (/obj/machinery/atmospherics/pipe/simple/heat_exchanging,/obj/structure/lattice,/turf/space,/area/engine/engineering) -"Dd" = (/obj/machinery/atmospherics/pipe/simple/heat_exchanging{dir = 5},/obj/structure/lattice,/turf/space,/area/engine/engineering) +"Dc" = (/obj/machinery/atmospherics/pipe/heat_exchanging/simple,/obj/structure/lattice,/turf/space,/area/engine/engineering) +"Dd" = (/obj/machinery/atmospherics/pipe/heat_exchanging/simple{dir = 5},/obj/structure/lattice,/turf/space,/area/engine/engineering) "De" = (/obj/machinery/atmospherics/components/unary/portables_connector/visible{dir = 1},/turf/simulated/floor/plating,/area/engine/engineering) "Df" = (/obj/machinery/light,/obj/machinery/atmospherics/components/unary/portables_connector/visible{dir = 1},/turf/simulated/floor/plating,/area/engine/engineering) "Dg" = (/obj/structure/extinguisher_cabinet{pixel_x = 5; pixel_y = -32},/obj/machinery/atmospherics/components/unary/portables_connector/visible{dir = 1},/turf/simulated/floor/plating,/area/engine/engineering) @@ -1498,22 +1498,22 @@ "Dk" = (/obj/structure/stool/bed/chair/office/dark{dir = 8},/obj/machinery/atmospherics/components/unary/vent_scrubber{on = 1},/turf/simulated/floor/plasteel,/area/tcommsat/computer) "Dl" = (/obj/machinery/atmospherics/components/unary/vent_scrubber{dir = 4; on = 1},/turf/simulated/floor/plating,/area/tcommsat/computer) "Dm" = (/obj/machinery/atmospherics/components/unary/vent_scrubber{dir = 1; on = 1},/obj/machinery/camera/autoname{dir = 8},/turf/simulated/floor/plasteel{icon_state = "dark"},/area/engine/gravity_generator) -"Dn" = (/obj/machinery/atmospherics/pipe/simple/heat_exchanging/junction{dir = 4},/turf/simulated/wall,/area/engine/engineering) -"Do" = (/obj/machinery/atmospherics/pipe/simple/heat_exchanging{dir = 9},/turf/simulated/floor/engine/vacuum,/area/engine/engineering) -"Dp" = (/obj/machinery/atmospherics/pipe/simple/heat_exchanging{dir = 6},/turf/simulated/floor/engine/vacuum,/area/engine/engineering) -"Dq" = (/obj/machinery/atmospherics/pipe/simple/heat_exchanging,/turf/simulated/floor/engine/vacuum,/area/engine/engineering) +"Dn" = (/obj/machinery/atmospherics/pipe/heat_exchanging/junction{dir = 4},/turf/simulated/wall,/area/engine/engineering) +"Do" = (/obj/machinery/atmospherics/pipe/heat_exchanging/simple{dir = 9},/turf/simulated/floor/engine/vacuum,/area/engine/engineering) +"Dp" = (/obj/machinery/atmospherics/pipe/heat_exchanging/simple{dir = 6},/turf/simulated/floor/engine/vacuum,/area/engine/engineering) +"Dq" = (/obj/machinery/atmospherics/pipe/heat_exchanging/simple,/turf/simulated/floor/engine/vacuum,/area/engine/engineering) "Dr" = (/obj/machinery/door/poddoor{id = "burndoor"; name = "Mixer Room Vent"},/turf/simulated/floor/plating/airless,/area/engine/engineering) "Dt" = (/obj/structure/stool/bed/chair/office/dark{dir = 8},/obj/machinery/atmospherics/components/unary/vent_scrubber{dir = 1; on = 1},/turf/simulated/floor/plasteel,/area/tcommsat/computer) "Du" = (/obj/machinery/atmospherics/components/unary/vent_pump{dir = 1; on = 1},/turf/simulated/floor/plasteel,/area/tcommsat/computer) "Dv" = (/obj/structure/cable{d1 = 1; d2 = 8; icon_state = "1-8"},/obj/machinery/atmospherics/components/unary/vent_scrubber{dir = 1; on = 1},/turf/simulated/floor/plasteel,/area/engine/gravity_generator) "Dw" = (/obj/item/device/analyzer,/obj/item/weapon/wrench,/turf/simulated/floor/plasteel,/area/engine/engineering) "DG" = (/obj/machinery/atmospherics/components/binary/volume_pump{dir = 4},/turf/simulated/floor/plating,/area/engine/engineering) -"DL" = (/obj/machinery/atmospherics/pipe/simple/heat_exchanging{dir = 9},/obj/structure/lattice,/turf/space,/area/engine/engineering) +"DL" = (/obj/machinery/atmospherics/pipe/heat_exchanging/simple{dir = 9},/obj/structure/lattice,/turf/space,/area/engine/engineering) "DP" = (/obj/machinery/alarm{dir = 1; icon_state = "alarm0"; pixel_y = -22},/obj/machinery/camera/autoname{dir = 1},/obj/item/device/flashlight{pixel_x = 1; pixel_y = 5},/turf/simulated/floor/plating,/area/engine/engineering) "DS" = (/obj/machinery/computer/security/telescreen{desc = "Used for watching the burn chamber."; dir = 8; layer = 4; name = "Burn Chamber Telescreen"; network = list("burnchamber"); pixel_x = 0; pixel_y = -30},/obj/structure/stool,/turf/simulated/floor/plating,/area/engine/engineering) "DT" = (/obj/machinery/light,/turf/simulated/floor/plating,/area/engine/engineering) "DU" = (/obj/machinery/ignition_switch{id = "burnchamber"; pixel_x = 25},/turf/simulated/floor/plating,/area/engine/engineering) -"DW" = (/obj/machinery/atmospherics/pipe/simple/heat_exchanging{dir = 5},/turf/simulated/floor/engine/vacuum,/area/engine/engineering) +"DW" = (/obj/machinery/atmospherics/pipe/heat_exchanging/simple{dir = 5},/turf/simulated/floor/engine/vacuum,/area/engine/engineering) "DX" = (/obj/structure/transit_tube{icon_state = "N-S"},/obj/structure/lattice,/turf/space,/area/space) "DZ" = (/obj/structure/lattice,/obj/structure/transit_tube{tag = "icon-N-S-Pass"; icon_state = "N-S-Pass"},/turf/space,/area/space) "Ea" = (/turf/simulated/wall,/area/tcommsat/computer) diff --git a/code/ATMOSPHERICS/atmospherics.dm b/code/ATMOSPHERICS/atmospherics.dm index aa25c510853..132dc41a595 100644 --- a/code/ATMOSPHERICS/atmospherics.dm +++ b/code/ATMOSPHERICS/atmospherics.dm @@ -29,6 +29,7 @@ Pipelines + Other Objects -> Pipe network /obj/machinery/atmospherics/New() ..() + nodes.len = device_type SSair.atmos_machinery += src SetInitDirections() if(can_unwrench) diff --git a/code/ATMOSPHERICS/components/components_base.dm b/code/ATMOSPHERICS/components/components_base.dm index 555018e9440..1414cd8f742 100644 --- a/code/ATMOSPHERICS/components/components_base.dm +++ b/code/ATMOSPHERICS/components/components_base.dm @@ -12,6 +12,9 @@ On top of that, now people can add component-speciic procs/vars if they want! /obj/machinery/atmospherics/components/New() ..() + parents.len = device_type + airs.len = device_type + for(DEVICE_TYPE_LOOP) var/datum/gas_mixture/A = new A.volume = 200 diff --git a/code/__DEFINES/atmospherics.dm b/code/__DEFINES/atmospherics.dm index 80fd3613796..c09cb0de0f6 100644 --- a/code/__DEFINES/atmospherics.dm +++ b/code/__DEFINES/atmospherics.dm @@ -128,20 +128,20 @@ // NODE_I, AIR_I, PARENT_I are used within DEVICE_TYPE_LOOP // nodes list - all atmos machinery -#define NODE1 nodes["n1"] -#define NODE2 nodes["n2"] -#define NODE3 nodes["n3"] -#define NODE4 nodes["n4"] -#define NODE_I nodes["n[I]"] +#define NODE1 nodes[1] +#define NODE2 nodes[2] +#define NODE3 nodes[3] +#define NODE4 nodes[4] +#define NODE_I nodes[I] // airs list - components only -#define AIR1 airs["a1"] -#define AIR2 airs["a2"] -#define AIR3 airs["a3"] -#define AIR_I airs["a[I]"] +#define AIR1 airs[1] +#define AIR2 airs[2] +#define AIR3 airs[3] +#define AIR_I airs[I] // parents list - components only -#define PARENT1 parents["p1"] -#define PARENT2 parents["p2"] -#define PARENT3 parents["p3"] -#define PARENT_I parents["p[I]"] \ No newline at end of file +#define PARENT1 parents[1] +#define PARENT2 parents[2] +#define PARENT3 parents[3] +#define PARENT_I parents[I] \ No newline at end of file From 393dc4bdd7131a3f27ea9bbe9f02081f3610c1db Mon Sep 17 00:00:00 2001 From: duncathan Date: Wed, 26 Aug 2015 00:34:32 -0600 Subject: [PATCH 06/14] I don't think I wanted to remove this --- tgstation.dme | 1 + 1 file changed, 1 insertion(+) diff --git a/tgstation.dme b/tgstation.dme index 0f73ac1adc9..10a7d74554f 100644 --- a/tgstation.dme +++ b/tgstation.dme @@ -312,6 +312,7 @@ #include "code\game\gamemodes\changeling\powers\absorb.dm" #include "code\game\gamemodes\changeling\powers\adrenaline.dm" #include "code\game\gamemodes\changeling\powers\augmented_eyesight.dm" +#include "code\game\gamemodes\changeling\powers\chameleon_skin.dm" #include "code\game\gamemodes\changeling\powers\digitalcamo.dm" #include "code\game\gamemodes\changeling\powers\fakedeath.dm" #include "code\game\gamemodes\changeling\powers\fleshmend.dm" From 48a06b96ddb598b9e90c14b27ca33fd5e0042c80 Mon Sep 17 00:00:00 2001 From: duncathan Date: Fri, 28 Aug 2015 20:37:44 -0600 Subject: [PATCH 07/14] fixing pipe gc --- code/ATMOSPHERICS/atmospherics.dm | 15 +++++++++++++ .../components/binary_devices/pump.dm | 2 ++ .../components/components_base.dm | 22 ++++++++----------- .../components/unary_devices/vent_pump.dm | 6 +++++ .../components/unary_devices/vent_scrubber.dm | 5 +++++ code/ATMOSPHERICS/pipes/pipes.dm | 16 ++++++-------- tgstation.dme | 1 + 7 files changed, 45 insertions(+), 22 deletions(-) diff --git a/code/ATMOSPHERICS/atmospherics.dm b/code/ATMOSPHERICS/atmospherics.dm index 132dc41a595..8957e46f485 100644 --- a/code/ATMOSPHERICS/atmospherics.dm +++ b/code/ATMOSPHERICS/atmospherics.dm @@ -36,6 +36,10 @@ Pipelines + Other Objects -> Pipe network stored = new(src, make_from=src) /obj/machinery/atmospherics/Destroy() + for(DEVICE_TYPE_LOOP) + if(NODE_I) + nullifyNode(I) + SSair.atmos_machinery -= src if(stored) qdel(stored) @@ -49,6 +53,13 @@ Pipelines + Other Objects -> Pipe network ..() +/obj/machinery/atmospherics/proc/nullifyNode(I) + var/obj/machinery/atmospherics/N = NODE_I + N.disconnect(src) + NODE_I = null + + + //this is called just after the air controller sets up turfs /obj/machinery/atmospherics/proc/atmosinit(var/list/node_connects) if(!node_connects) //for pipes where order of nodes doesn't matter @@ -106,11 +117,15 @@ Pipelines + Other Objects -> Pipe network /obj/machinery/atmospherics/proc/disconnect(obj/machinery/atmospherics/reference) for(DEVICE_TYPE_LOOP) if(reference == NODE_I) + // world << "[reference] found in nodes of [src]" if(istype(NODE_I, /obj/machinery/atmospherics/pipe)) var/obj/machinery/atmospherics/pipe/P = NODE_I qdel(P.parent) + // world << "[reference] has qdel'd its parent" NODE_I = null + // world << "NODE[I]: [NODE_I]" break + //world << "[reference] not yet disconnected from [src]" update_icon() /obj/machinery/atmospherics/update_icon() diff --git a/code/ATMOSPHERICS/components/binary_devices/pump.dm b/code/ATMOSPHERICS/components/binary_devices/pump.dm index c4f3073e767..3218246eb90 100644 --- a/code/ATMOSPHERICS/components/binary_devices/pump.dm +++ b/code/ATMOSPHERICS/components/binary_devices/pump.dm @@ -29,6 +29,8 @@ Thus, the two variables affect pump operation are set in New(): /obj/machinery/atmospherics/components/binary/pump/Destroy() if(radio_controller) radio_controller.remove_object(src,frequency) + if(radio_connection) + radio_connection = null ..() /obj/machinery/atmospherics/components/binary/pump/on diff --git a/code/ATMOSPHERICS/components/components_base.dm b/code/ATMOSPHERICS/components/components_base.dm index 1414cd8f742..f60f3af95d9 100644 --- a/code/ATMOSPHERICS/components/components_base.dm +++ b/code/ATMOSPHERICS/components/components_base.dm @@ -23,11 +23,11 @@ On top of that, now people can add component-speciic procs/vars if they want! Iconnery */ -/obj/machinery/atmospherics/components/proc/icon_addintact(var/obj/machinery/atmospherics/node, var/connected = 0) +/obj/machinery/atmospherics/components/proc/icon_addintact(var/obj/machinery/atmospherics/node) var/image/img = getpipeimage('icons/obj/atmospherics/components/binary_devices.dmi', "pipe_intact", get_dir(src,node), node.pipe_color) underlays += img - return connected | img.dir + return img.dir /obj/machinery/atmospherics/components/proc/icon_addbroken(var/connected = 0) var/unconnected = (~connected) & initialize_directions @@ -56,7 +56,7 @@ Iconnery for(DEVICE_TYPE_LOOP) //adds intact pieces if(NODE_I) - connected = icon_addintact(NODE_I, connected) + connected |= icon_addintact(NODE_I) icon_addbroken(connected) //adds broken pieces @@ -64,17 +64,12 @@ Iconnery /* Pipenet stuff; housekeeping */ -/obj/machinery/atmospherics/components/Destroy() - for(DEVICE_TYPE_LOOP) - var/obj/machinery/atmospherics/N = NODE_I - if(N) - N.disconnect(src) - NODE_I = null - nullifyPipenet(PARENT_I) + +/obj/machinery/atmospherics/components/nullifyNode(I) ..() - - - + nullifyPipenet(PARENT_I) + qdel(AIR_I) + AIR_I = null /obj/machinery/atmospherics/components/construction() ..() @@ -93,6 +88,7 @@ Pipenet stuff; housekeeping if(reference == PARENT_I) var/datum/pipeline/P = PARENT_I P.other_airs -= AIR_I + P.other_atmosmch -= src PARENT_I = null /obj/machinery/atmospherics/components/returnPipenetAir(datum/pipeline/reference) diff --git a/code/ATMOSPHERICS/components/unary_devices/vent_pump.dm b/code/ATMOSPHERICS/components/unary_devices/vent_pump.dm index 94d28113548..af4234cf1da 100644 --- a/code/ATMOSPHERICS/components/unary_devices/vent_pump.dm +++ b/code/ATMOSPHERICS/components/unary_devices/vent_pump.dm @@ -59,6 +59,12 @@ /obj/machinery/atmospherics/components/unary/vent_pump/Destroy() if(radio_controller) radio_controller.remove_object(src,frequency) + if(radio_connection) + radio_connection = null + if(initial_loc) + initial_loc.air_vent_info -= id_tag + initial_loc.air_vent_names -= id_tag + initial_loc = null ..() /obj/machinery/atmospherics/components/unary/vent_pump/high_volume diff --git a/code/ATMOSPHERICS/components/unary_devices/vent_scrubber.dm b/code/ATMOSPHERICS/components/unary_devices/vent_scrubber.dm index e4f6e606364..568286d3230 100644 --- a/code/ATMOSPHERICS/components/unary_devices/vent_scrubber.dm +++ b/code/ATMOSPHERICS/components/unary_devices/vent_scrubber.dm @@ -48,9 +48,14 @@ /obj/machinery/atmospherics/components/unary/vent_scrubber/Destroy() if(radio_controller) radio_controller.remove_object(src,frequency) + if(radio_connection) + radio_connection = null if(initial_loc) initial_loc.air_scrub_info -= id_tag initial_loc.air_scrub_names -= id_tag + initial_loc = null + for(var/I in adjacent_turfs) + I = null ..() /obj/machinery/atmospherics/components/unary/vent_scrubber/auto_use_power() if(!powered(power_channel)) diff --git a/code/ATMOSPHERICS/pipes/pipes.dm b/code/ATMOSPHERICS/pipes/pipes.dm index 4d902488520..1e3c06cf7ad 100644 --- a/code/ATMOSPHERICS/pipes/pipes.dm +++ b/code/ATMOSPHERICS/pipes/pipes.dm @@ -18,16 +18,10 @@ color = pipe_color ..() -/obj/machinery/atmospherics/pipe/Destroy() - for(DEVICE_TYPE_LOOP) - var/obj/machinery/atmospherics/N = NODE_I - if(N) - var/obj/machinery/atmospherics/oldN = N - N.disconnect(src) - NODE_I = null - oldN.build_network() - releaseAirToTurf() +/obj/machinery/atmospherics/pipe/nullifyNode(I) + var/obj/machinery/atmospherics/oldN = NODE_I ..() + oldN.build_network() /obj/machinery/atmospherics/pipe/update_icon() //overridden by manifolds if(NODE1&&NODE2) @@ -83,6 +77,10 @@ parent = P /obj/machinery/atmospherics/pipe/Destroy() + releaseAirToTurf() + qdel(air_temporary) + air_temporary = null + var/turf/T = loc for(var/obj/machinery/meter/meter in T) if(meter.target == src) diff --git a/tgstation.dme b/tgstation.dme index 0f73ac1adc9..10a7d74554f 100644 --- a/tgstation.dme +++ b/tgstation.dme @@ -312,6 +312,7 @@ #include "code\game\gamemodes\changeling\powers\absorb.dm" #include "code\game\gamemodes\changeling\powers\adrenaline.dm" #include "code\game\gamemodes\changeling\powers\augmented_eyesight.dm" +#include "code\game\gamemodes\changeling\powers\chameleon_skin.dm" #include "code\game\gamemodes\changeling\powers\digitalcamo.dm" #include "code\game\gamemodes\changeling\powers\fakedeath.dm" #include "code\game\gamemodes\changeling\powers\fleshmend.dm" From f7363fc7379d5b5006d6e44f17f0ba2679cf62db Mon Sep 17 00:00:00 2001 From: duncathan Date: Sat, 29 Aug 2015 13:19:15 -0600 Subject: [PATCH 08/14] Squashed commit of the following: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit commit 5ab47a85f7d1c7f2b6d2acbd4206b6bd16413534 Author: duncathan Date: Sat Aug 29 03:29:23 2015 -0600 disables TESTING; it should not be enabled by default commit 2cc7226ea89c7d3e3bd182f963169b432c6f5f24 Author: duncathan Date: Sat Aug 29 03:27:55 2015 -0600 adds ways to check references while qdel'ing; removes redundant compile option commit 4409db7f0bea4728848fad21b6e6b46a7b3b1dc4 Author: duncathan Date: Sat Aug 29 00:19:25 2015 -0600 makes the game compile if TESTING is defined in compile options commit e11befbbfaa89678764de35e11d0bb55dcf397e0 Merge: 22ffbca 20ba307 Author: Cheridan Date: Fri Aug 28 07:20:03 2015 -0500 Merge pull request #11356 from Aranclanos/listnull Fixes the brand intelligence event not triggering the uprising under … commit 22ffbca5a297f397ca8f65e57c2ddf97b74a354d Author: sybil-tgstation13 Date: Fri Aug 28 05:43:08 2015 +0000 Automatic changelog compile commit d824f7b35f2afa4159d0fa9d6e066c48707667c7 Merge: 7f0f74f 3737234 Author: Cheridan Date: Fri Aug 28 00:21:23 2015 -0500 Merge pull request #11382 from Ergovisavi/bot_swarm Adds "Swarmers" - Simple mob side antagonist commit 3737234b9c69801cb83ec949805d0451b99d6a9a Merge: 9572bd6 ba1a268 Author: Ergovisavi Date: Tue Aug 25 05:48:37 2015 -0700 -Adds swarmer as a language, makes them only able to speak to each other -Fixes a few structures/machines taking non brute/burn damage from attack_animal -Adjusts girders to be a little less resistant to explosions -Span classes all the swarmer messages, bumps their health up to 40 -Adds ability for swarmers to dismantle machines and disable cameras. Some are obviously protected. commit 7f0f74f100eec35d66102d4da5718d5a96ae4ffa Merge: d8f8f89 6ab2443 Author: Cheridan Date: Thu Aug 27 23:53:58 2015 -0500 Merge pull request #11380 from bgobandit/salicyclicassblastusa Fixes burn kits containing salicyclic acid pills. Adds new burn medication. commit d8f8f89203ffb1aeff37f85b1cdae3f1bfa1c09d Merge: 68002be 460c2c2 Author: Cheridan Date: Thu Aug 27 23:46:57 2015 -0500 Merge pull request #11386 from Aranclanos/rapiddupe Fixes the admin message not appearing under certain conditions when t… commit 68002bed9944e02f8b4e819b221537d61d4161c9 Merge: eebbed3 d27a736 Author: Cheridan Date: Thu Aug 27 16:50:33 2015 -0500 Merge pull request #11315 from CorruptComputer/why Removes dmm2tgm from map merger commit eebbed3a6b0777f5c8341b46c7fbd4156df9ea79 Merge: 1769bc2 3749dca Author: Cheridan Date: Thu Aug 27 12:10:40 2015 -0500 Merge pull request #11405 from Aranclanos/floortilesfirst Floor re-organization step 1 commit 1769bc2f8d6623f514ad1b0e3203e423e4775821 Merge: d7eca4f 20023f7 Author: Cheridan Date: Thu Aug 27 12:06:28 2015 -0500 Merge pull request #11104 from phil235/BuckleMulebot Mob buckled to mulebots commit d7eca4f3277cae3e55b6e8e5938d310dce2df5b6 Merge: be6cc6a 90f54ba Author: Cheridan Date: Thu Aug 27 01:00:01 2015 -0500 Merge pull request #11340 from phil235/CoinFlipThrowFix Fixes the do_after progress bar appearing on a coin when flipping+throwing it commit be6cc6adf9c39cd753d0b740fadc8d1a5574aa19 Merge: 9c9bf4a d211992 Author: Cheridan Date: Thu Aug 27 00:48:54 2015 -0500 Merge pull request #11392 from phil235/SinguloCableNetRebuildFix An attempt to reduce singulo lag from power wires destruction. 2nd attempt. commit 9c9bf4a8582d6cf07d7cc78ed7d6f11c8567fb0a Merge: 3278a39 6277a80 Author: Aranclanos Date: Thu Aug 27 01:06:03 2015 -0300 Merge pull request #11393 from Ergovisavi/has_wumbo_gone_too_far Fixes infinite wumbo-ing commit 3278a3926b3ed456498c5acabd98e7d637e2b944 Merge: 38e6a09 1f37141 Author: Cheridan Date: Wed Aug 26 07:52:31 2015 -0500 Merge pull request #11358 from phil235/XenoFeatures1 Facehugger inhands, xeno tweaks, and monkey bugfixes commit 3749dcacb328a4c749e54fa529da3b4b065ff241 Author: Aranclanos Date: Wed Aug 26 06:47:27 2015 -0300 Creates type paths for all types of floors in floor.dmi, first step for the floor organization. commit 38e6a09cf9d4fc9ac276a3b7df080da1da3a4999 Merge: 4f1a3df 9cfb246 Author: Aranclanos Date: Wed Aug 26 06:27:31 2015 -0300 Merge pull request #11351 from Core0verload/nodirt Removes dirt from walking on tiles commit 6277a80cdba174a73dcd85aa0294aea10aa55216 Author: Ergovisavi Date: Tue Aug 25 14:02:48 2015 -0700 -Fixes infinite wumbo-ing commit d211992ddcd3e693c402068551e4bf415204fd82 Author: phil235 Date: Tue Aug 25 20:22:30 2015 +0200 Make it so the code doesn't rebuild (propagate_network()) the wire network X times when singulo/explosion destroys a line of X cables at once. commit 6ab24432557827994a7b59151f752ce758d32ab7 Author: bgobandit Date: Tue Aug 25 13:46:05 2015 -0400 Adds oxandrolone, a new burn medication designed to work upon ingestion. Adds oxandrolone to burn kits. Adds changelog. commit 9572bd6aa65bd81dd1bf0f97a6d9d72adbd9d4a0 Author: Ergovisavi Date: Tue Aug 25 03:24:34 2015 -0700 -First revision of Swarmer mob, hud, icons, etc -Adds functionality of ignored damage types to simple mobs -Adds functionality of melee damage types to simple mobs commit 460c2c290c216e1b473897c773e83f5df1925490 Author: Aranclanos Date: Tue Aug 25 05:31:02 2015 -0300 Fixes the admin message not appearing under certain conditions when the rapid dupe experimentator relic is used. All objects from said relic will spawn at the same time now. commit 2c56462e97119d9a192f8124dc6e1d3596520a2a Author: bgobandit Date: Mon Aug 24 22:45:37 2015 -0400 I sure do love me some copypasta commit 132adf3f0045ff16e314ff1922b7d8f025fa7315 Author: bgobandit Date: Mon Aug 24 21:45:18 2015 -0400 adds silver sulf syringes instead of kelotane pills commit ce8722b86898c412c5fb2af1cf60ec7eefd4b262 Author: bgobandit Date: Mon Aug 24 21:36:50 2015 -0400 Fixes burn kits containing salicyclic acid pills. commit 1f37141b8bf29fbbffd6c076b37efc89a5cb0357 Author: phil235 Date: Mon Aug 24 22:53:45 2015 +0200 Alien humanoids and monkeys can now use "me". Alien hivemind chat now uses (dark purple). Also the alien queen name now appears bigger in the hivemind chat. commit 5cecd7e9fec19b28ba873d92fc76f497695a53f8 Author: phil235 Date: Mon Aug 24 19:54:51 2015 +0200 Simplifies plasmavessel/on_life() a bit, and make xeno on weeds also heal clone damage. commit cb1cd5b1e78d8e670b2a9897e8716ca61144b97f Author: phil235 Date: Mon Aug 24 17:07:09 2015 +0200 Monkey and aliens now all use carbon/examine(). Fixes monkeys being able to strip and uncuff people while handcuffed themselves. Add an inhand sprite for facehuggers (taken from Xhuis) (but they don't appear for large queens, it'd look ugly). Xenos now regenerate plasma on alien weed even when injured but at half the normal rate. Moved queen/large/update_icons() to humanoid/update_icons.dm commit 20ba3071edd9cd32f89d8152406498e356412a94 Author: Aranclanos Date: Mon Aug 24 07:52:54 2015 -0300 Fixes the brand intelligence event not triggering the uprising under certain conditions. Adds a new proc for the list helpers, removeNullsFromList() It does what it says. commit 9cfb246e4f17b57cf98059912fd01ba284669263 Author: c0 Date: Mon Aug 24 11:33:52 2015 +0300 Removes dirt from walking on tiles commit 20023f79d76617495ea73e32234977c4450e0ca3 Author: phil235 Date: Sun Aug 23 21:39:22 2015 +0200 Mobs buckled to mulebots now pass through plastic flaps. All ventcrawler and tiny sized mobs also pass through them now. commit 27b7e3b6f622606b200bce99341ba5218a9978fa Author: phil235 Date: Sun Aug 23 20:55:41 2015 +0200 Beds no longer use this trick in Move() so neither should the mulebot. commit 90f54ba95cc1bee86702b33e063bb7564351b64f Author: phil235 Date: Sun Aug 23 19:34:09 2015 +0200 Fixes the do_after progress bar appearing on a coin when flipping+throwing it. commit d27a736f7e72506c34b36dc6fcf8b3acb2d4cc57 Author: CorruptComputer Date: Fri Aug 21 16:57:27 2015 -0500 Fixes #11301 commit e16c03f01023a17bda9d166723f473e83ddc0130 Author: phil235 Date: Sat Aug 8 22:10:25 2015 +0200 woops, now buckling succeeds if you are on the mulebot's turf. commit 1c51550559b465d1a9dbc1c947662c0ab6ab0965 Author: phil235 Date: Sat Aug 8 21:43:30 2015 +0200 Changes how mulebots handle loading mobs. It now buckles them to the bot. You can no longer load objects containing mobs or with mobs buckled to them. You can no longer pass through plastic flaps by getting on a mulebot. Some simplification in mulebot code (buzzing sound code) Loading is now instantaneous and the mode BOT_LOADING is removed. The mulebot can no longer do certain stuff while off. Removing unneeded comments. Fixes mulebot loading/unloading being possible through border windows. Fixes mulebot not dropping its loaded cargo when qdel'd (wasn't a problem for explosion but for alien acid for example) --- code/__DEFINES/flags.dm | 3 +- code/__DEFINES/qdel.dm | 3 +- code/__HELPERS/lists.dm | 8 +- code/_compile_options.dm | 10 - code/_onclick/hud/hud.dm | 2 + code/controllers/subsystem/garbage.dm | 76 +-- code/game/machinery/bots/bots.dm | 15 +- code/game/machinery/bots/mulebot.dm | 221 ++++---- code/game/machinery/computer/shuttle.dm | 4 +- code/game/machinery/doors/windowdoor.dm | 6 +- code/game/machinery/machinery.dm | 2 + code/game/machinery/portable_turret.dm | 2 +- code/game/objects/buckling.dm | 2 +- code/game/objects/items/weapons/mop.dm | 3 - .../objects/items/weapons/storage/firstaid.dm | 4 +- .../structures/crates_lockers/closets.dm | 1 + code/game/objects/structures/girders.dm | 2 +- code/game/objects/structures/grille.dm | 3 +- code/game/objects/structures/janicart.dm | 3 - .../structures/stool_bed_chair_nest/stools.dm | 6 +- code/game/objects/structures/window.dm | 2 +- code/game/turfs/simulated/floor.dm | 19 - .../game/turfs/simulated/floor/fancy_floor.dm | 1 - code/game/turfs/simulated/floor/misc_floor.dm | 3 - .../turfs/simulated/floor/plasteel_floor.dm | 336 +++++++++++- code/modules/events/brand_intelligence.dm | 6 +- code/modules/events/spacevine.dm | 1 - code/modules/mining/equipment_locker.dm | 1 + code/modules/mining/mine_turfs.dm | 1 - code/modules/mining/ores_coins.dm | 4 +- .../mob/living/carbon/alien/alien_defense.dm | 14 +- .../mob/living/carbon/alien/humanoid/emote.dm | 8 +- .../mob/living/carbon/alien/humanoid/queen.dm | 14 - .../carbon/alien/humanoid/update_icons.dm | 27 +- .../modules/mob/living/carbon/alien/organs.dm | 14 +- code/modules/mob/living/carbon/alien/say.dm | 8 +- .../living/carbon/alien/special/facehugger.dm | 16 +- code/modules/mob/living/carbon/carbon.dm | 9 +- code/modules/mob/living/carbon/emote.dm | 5 + .../mob/living/carbon/{monkey => }/examine.dm | 101 ++-- code/modules/mob/living/carbon/human/human.dm | 5 +- .../mob/living/carbon/human/human_defense.dm | 2 +- .../modules/mob/living/carbon/monkey/emote.dm | 19 +- .../mob/living/carbon/monkey/monkey.dm | 14 +- .../modules/mob/living/silicon/robot/robot.dm | 3 - code/modules/mob/living/silicon/silicon.dm | 14 +- .../living/simple_animal/bot_swarm/swarmer.dm | 513 ++++++++++++++++++ .../simple_animal/hostile/mining_mobs.dm | 2 +- .../mob/living/simple_animal/simple_animal.dm | 23 +- code/modules/mob/mob_helpers.dm | 5 + code/modules/power/cable.dm | 7 +- .../Chemistry-Reagents/Medicine-Reagents.dm | 25 +- .../Chemistry-Reagents/Other-Reagents.dm | 4 - .../reagents/Chemistry-Recipes/Medicine.dm | 6 + .../reagents/reagent_containers/pill.dm | 6 + code/modules/research/experimentor.dm | 3 +- html/changelog.html | 7 + html/changelogs/.all_changelog.yml | 7 + icons/mob/inhands/clothing_lefthand.dmi | Bin 60712 -> 62164 bytes icons/mob/inhands/clothing_righthand.dmi | Bin 59935 -> 61380 bytes icons/mob/swarmer.dmi | Bin 0 -> 12804 bytes tgstation.dme | 3 +- .../{mapmerge => }/dmm2tgm/Source/dmm2tgm.py | 0 tools/{mapmerge => }/dmm2tgm/_hashlib.pyd | Bin tools/{mapmerge => }/dmm2tgm/bz2.pyd | Bin tools/{mapmerge => }/dmm2tgm/dmm2tgm.exe | Bin tools/{mapmerge => }/dmm2tgm/library.zip | Bin tools/{mapmerge => }/dmm2tgm/python27.dll | Bin tools/{mapmerge => }/dmm2tgm/select.pyd | Bin tools/{mapmerge => }/dmm2tgm/unicodedata.pyd | Bin tools/{mapmerge => }/dmm2tgm/w9xpopen.exe | Bin tools/mapmerge/MapMerge.jar | Bin 20893 -> 20574 bytes tools/mapmerge/Source/bin/MapMerge.class | Bin 4059 -> 3519 bytes tools/mapmerge/Source/src/MapMerge.java | 5 +- 74 files changed, 1308 insertions(+), 331 deletions(-) rename code/modules/mob/living/carbon/{monkey => }/examine.dm (65%) create mode 100644 code/modules/mob/living/simple_animal/bot_swarm/swarmer.dm create mode 100644 icons/mob/swarmer.dmi rename tools/{mapmerge => }/dmm2tgm/Source/dmm2tgm.py (100%) rename tools/{mapmerge => }/dmm2tgm/_hashlib.pyd (100%) rename tools/{mapmerge => }/dmm2tgm/bz2.pyd (100%) rename tools/{mapmerge => }/dmm2tgm/dmm2tgm.exe (100%) rename tools/{mapmerge => }/dmm2tgm/library.zip (100%) rename tools/{mapmerge => }/dmm2tgm/python27.dll (100%) rename tools/{mapmerge => }/dmm2tgm/select.pyd (100%) rename tools/{mapmerge => }/dmm2tgm/unicodedata.pyd (100%) rename tools/{mapmerge => }/dmm2tgm/w9xpopen.exe (100%) diff --git a/code/__DEFINES/flags.dm b/code/__DEFINES/flags.dm index 0da4f75e1bf..33d02d6e06e 100644 --- a/code/__DEFINES/flags.dm +++ b/code/__DEFINES/flags.dm @@ -77,4 +77,5 @@ #define ALIEN 4 #define ROBOT 8 #define SLIME 16 -#define DRONE 32 \ No newline at end of file +#define DRONE 32 +#define SWARMER 64 \ No newline at end of file diff --git a/code/__DEFINES/qdel.dm b/code/__DEFINES/qdel.dm index feb949b3241..f228349b70d 100644 --- a/code/__DEFINES/qdel.dm +++ b/code/__DEFINES/qdel.dm @@ -7,4 +7,5 @@ #define QDEL_HINT_HARDDEL 3 //qdel should assume this object won't gc, and queue a hard delete using a hard reference. #define QDEL_HINT_HARDDEL_NOW 4 //qdel should assume this object won't gc, and hard del it post haste. #define QDEL_HINT_PUTINPOOL 5 //qdel will put this object in the atom pool. - +#define QDEL_HINT_FINDREFERENCE 6 //functionally identical to QDEL_HINT_QUEUE if TESTING is not enabled in _compiler_options.dm. + //if TESTING is enabled, qdel will call this object's find_references() verb. diff --git a/code/__HELPERS/lists.dm b/code/__HELPERS/lists.dm index 2ec7b4c407f..66ae50cf852 100644 --- a/code/__HELPERS/lists.dm +++ b/code/__HELPERS/lists.dm @@ -342,4 +342,10 @@ for(var/datum/D in L) if(D.vars.Find(varname)) if(D.vars[varname] == value) - return D \ No newline at end of file + return D + +//remove all nulls from a list +/proc/removeNullsFromList(list/L) + while(L.Remove(null)) + continue + return L \ No newline at end of file diff --git a/code/_compile_options.dm b/code/_compile_options.dm index 320b756fdee..a16c320eebf 100644 --- a/code/_compile_options.dm +++ b/code/_compile_options.dm @@ -1,5 +1,4 @@ #define DEBUG //Enables byond profiling and full runtime logs - note, this may also be defined in your .dme file -//#define dellogging //Enables logging of forced del() calls (used for debugging) //#define TESTING //Enables in-depth debug messages to runtime log (used for debugging) //By using the testing("message") proc you can create debug-feedback for people with this //uncommented, but not visible in the release version) @@ -46,15 +45,6 @@ #define AI_VOX 1 // Comment out if you don't want VOX to be enabled and have players download the voice sounds. //Additional code for the above flags. -#ifdef dellogging -#warn compiling del logging. This will have additional overheads. //will warn you if compiling with dellogging -var/list/del_counter = list() -/proc/log_del(datum/X) - if(istype(X)){del_counter[X.type]++;} - del(X) -#define del(X) log_del(X) //overrides all del() calls with log_del() -#endif - #ifdef TESTING #warn compiling in TESTING mode. testing() debug messages will be visible. #endif diff --git a/code/_onclick/hud/hud.dm b/code/_onclick/hud/hud.dm index fb209d087e7..d947bfa6553 100644 --- a/code/_onclick/hud/hud.dm +++ b/code/_onclick/hud/hud.dm @@ -197,6 +197,8 @@ var/datum/global_hud/global_hud = new() blob_hud() else if(isdrone(mymob)) drone_hud(ui_style) + else if(isswarmer(mymob)) + swarmer_hud() //Version denotes which style should be displayed. blank or 0 means "next version" diff --git a/code/controllers/subsystem/garbage.dm b/code/controllers/subsystem/garbage.dm index 4e617f76af9..b8d4c6c4a6f 100644 --- a/code/controllers/subsystem/garbage.dm +++ b/code/controllers/subsystem/garbage.dm @@ -25,7 +25,6 @@ var/datum/subsystem/garbage_collector/SSgarbage var/list/didntgc = list() // list of all types that have failed to GC associated with the number of times that's happened. // the types are stored as strings - /datum/subsystem/garbage_collector/New() NEW_SS_GLOBAL(SSgarbage) @@ -61,7 +60,7 @@ var/datum/subsystem/garbage_collector/SSgarbage if(GCd_at_time > time_to_kill) break // Everything else is newer, skip them - var/atom/A + var/datum/A if (!istext(refID)) del(A) else @@ -76,7 +75,6 @@ var/datum/subsystem/garbage_collector/SSgarbage else ++gcedlasttick ++totalgcs - queue.Cut(1, 2) @@ -121,6 +119,11 @@ var/datum/subsystem/garbage_collector/SSgarbage del(A) if (QDEL_HINT_PUTINPOOL) //qdel will put this object in the pool. PlaceInPool(A,0) + if (QDEL_HINT_FINDREFERENCE)//qdel will, if TESTING is enabled, display all references to this object, then queue the object for deletion. + #ifdef TESTING + A.find_references(remove_from_queue = FALSE) + #endif + SSgarbage.Queue(A) else SSgarbage.Queue(A) @@ -134,9 +137,8 @@ var/datum/subsystem/garbage_collector/SSgarbage // Default implementation of clean-up code. // This should be overridden to remove all references pointing to the object being destroyed. -// Return true if the the GC controller should allow the object to continue existing. (Useful if pooling objects.) +// Return the appropriate QDEL_HINT; in most cases this is QDEL_HINT_QUEUE. /datum/proc/Destroy() - //del(src) tag = null return QDEL_HINT_QUEUE @@ -144,40 +146,40 @@ var/datum/subsystem/garbage_collector/SSgarbage #ifdef TESTING /client/var/running_find_references +/datum/var/running_find_references -/atom/verb/find_references() +/datum/verb/find_references(remove_from_queue = TRUE as num) set category = "Debug" set name = "Find References" set background = 1 set src in world - if(!usr || !usr.client) - return - - if(usr.client.running_find_references) - testing("CANCELLED search for references to a [usr.client.running_find_references].") - usr.client.running_find_references = null - return - - if(alert("Running this will create a lot of lag until it finishes. You can cancel it by running it again. Would you like to begin the search?", "Find References", "Yes", "No") == "No") - return + running_find_references = type + if(usr && usr.client) + if(usr.client.running_find_references) + testing("CANCELLED search for references to a [usr.client.running_find_references].") + usr.client.running_find_references = null + running_find_references = null + return + if(alert("Running this will create a lot of lag until it finishes. You can cancel it by running it again. Would you like to begin the search?", "Find References", "Yes", "No") == "No") + running_find_references = null + return // Remove this object from the list of things to be auto-deleted. - if(garbage) - garbage.destroyed -= "\ref[src]" + if(remove_from_queue && SSgarbage && ("\ref[src]" in SSgarbage.queue)) + SSgarbage.queue -= "\ref[src]" + if(usr && usr.client) + usr.client.running_find_references = type - usr.client.running_find_references = type testing("Beginning search for references to a [type].") var/list/things = list() for(var/client/thing) - things += thing + things |= thing for(var/datum/thing) - things += thing - for(var/atom/thing) - things += thing + things |= thing testing("Collected list of things in search for references to a [type]. ([things.len] Thing\s)") for(var/datum/thing in things) - if(!usr.client.running_find_references) return + if(usr && usr.client && !usr.client.running_find_references) return for(var/varname in thing.vars) var/variable = thing.vars[varname] if(variable == src) @@ -186,15 +188,27 @@ var/datum/subsystem/garbage_collector/SSgarbage if(src in variable) testing("Found [src.type] \ref[src] in [thing.type]'s [varname] list var.") testing("Completed search for references to a [type].") - usr.client.running_find_references = null + if(usr && usr.client) + usr.client.running_find_references = null + running_find_references = null /client/verb/purge_all_destroyed_objects() set category = "Debug" - if(garbage) - while(garbage.destroyed.len) - var/datum/o = locate(garbage.destroyed[1]) + if(SSgarbage) + while(SSgarbage.queue.len) + var/datum/o = locate(SSgarbage.queue[1]) if(istype(o) && o.gc_destroyed) del(o) - garbage.dels++ - garbage.destroyed.Cut(1, 2) -#endif + SSgarbage.totaldels++ + SSgarbage.queue.Cut(1, 2) + +/datum/verb/qdel_then_find_references() + set category = "Debug" + set name = "qdel() then Find References" + set background = 1 + set src in world + + qdel(src) + if(!running_find_references) + find_references(remove_from_queue = FALSE) +#endif \ No newline at end of file diff --git a/code/game/machinery/bots/bots.dm b/code/game/machinery/bots/bots.dm index 9c6639c3bd7..c7d00e16013 100644 --- a/code/game/machinery/bots/bots.dm +++ b/code/game/machinery/bots/bots.dm @@ -70,17 +70,16 @@ #define BOT_MOVING 9 // for clean/floor/med bots, when moving. #define BOT_HEALING 10 // healing people (medbots) #define BOT_RESPONDING 11 // responding to a call from the AI - #define BOT_LOADING 12 // loading/unloading - #define BOT_DELIVER 13 // moving to deliver - #define BOT_GO_HOME 14 // returning to home - #define BOT_BLOCKED 15 // blocked - #define BOT_NAV 16 // computing navigation - #define BOT_WAIT_FOR_NAV 17 // waiting for nav computation - #define BOT_NO_ROUTE 18 // no destination beacon found (or no route) + #define BOT_DELIVER 12 // moving to deliver + #define BOT_GO_HOME 13 // returning to home + #define BOT_BLOCKED 14 // blocked + #define BOT_NAV 15 // computing navigation + #define BOT_WAIT_FOR_NAV 16 // waiting for nav computation + #define BOT_NO_ROUTE 17 // no destination beacon found (or no route) var/list/mode_name = list("In Pursuit","Preparing to Arrest", "Arresting", \ "Beginning Patrol", "Patrolling", "Summoned by PDA", \ "Cleaning", "Repairing", "Proceeding to work site", "Healing", \ - "Proceeding to AI waypoint", "Loading/Unloading", "Navigating to Delivery Location", "Navigating to Home", \ + "Proceeding to AI waypoint", "Navigating to Delivery Location", "Navigating to Home", \ "Waiting for clear path", "Calculating navigation path", "Pinging beacon network", "Unable to reach destination") //This holds text for what the bot is mode doing, reported on the remote bot control interface. diff --git a/code/game/machinery/bots/mulebot.dm b/code/game/machinery/bots/mulebot.dm index 68643c28cb6..8f69d506dc5 100644 --- a/code/game/machinery/bots/mulebot.dm +++ b/code/game/machinery/bots/mulebot.dm @@ -6,6 +6,11 @@ var/global/mulebot_count = 0 + +#define SIGH 0 +#define ANNOYED 1 +#define DELIGHT 2 + /obj/machinery/bot/mulebot name = "\improper MULEbot" desc = "A Multiple Utility Load Effector bot." @@ -22,13 +27,15 @@ var/global/mulebot_count = 0 bot_type = MULE_BOT model = "MULE" blood_DNA = list() + can_buckle = 1 + buckle_lying = 0 suffix = "" var/turf/target // this is turf to navigate to (location of beacon) var/loaddir = 0 // this the direction to unload onto/load from var/home_destination = "" // tag of home beacon - req_access = list(access_cargo) + req_access = list(access_cargo) mode = BOT_IDLE @@ -77,6 +84,26 @@ obj/machinery/bot/mulebot/bot_reset() reached_target = 0 +obj/machinery/bot/mulebot/Move(atom/newloc, direct) + . = ..() + if(buckled_mob) + if(!buckled_mob.Move(loc, direct)) + loc = buckled_mob.loc //we gotta go back + last_move = buckled_mob.last_move + inertia_dir = last_move + buckled_mob.inertia_dir = last_move + . = 0 + +obj/machinery/bot/mulebot/Process_Spacemove(movement_dir = 0) + if(buckled_mob) + return buckled_mob.Process_Spacemove(movement_dir) + return ..() + +obj/machinery/bot/mulebot/CanPass(atom/movable/mover, turf/target, height=1.5) + if(mover == buckled_mob) + return 1 + return ..() + // attack by item // emag : lock/unlock, // screwdriver: open/close hatch @@ -183,8 +210,6 @@ obj/machinery/bot/mulebot/bot_reset() switch(mode) if(BOT_IDLE) dat += "Ready" - if(BOT_LOADING) - dat += "[mode_name[BOT_LOADING]]" if(BOT_DELIVER) dat += "[mode_name[BOT_DELIVER]]" if(BOT_GO_HOME) @@ -358,7 +383,7 @@ obj/machinery/bot/mulebot/bot_reset() updateDialog() if("unload") - if(load && mode !=1) + if(load && mode != BOT_HUNT) if(loc == target) unload(loaddir) else @@ -379,7 +404,6 @@ obj/machinery/bot/mulebot/bot_reset() - // returns true if the bot has power /obj/machinery/bot/mulebot/proc/has_power() return !open && cell && cell.charge > 0 && wires.HasPower() @@ -393,66 +417,94 @@ obj/machinery/bot/mulebot/bot_reset() user << "Access denied." return 0 +/obj/machinery/bot/mulebot/proc/buzz(type) + switch(type) + if(SIGH) + visible_message("[src] makes a sighing buzz.", "You hear an electronic buzzing sound.") + playsound(loc, 'sound/machines/buzz-sigh.ogg', 50, 0) + if(ANNOYED) + visible_message("[src] makes an annoyed buzzing sound.", "You hear an electronic buzzing sound.") + playsound(loc, 'sound/machines/buzz-two.ogg', 50, 0) + if(DELIGHT) + visible_message("[src] makes a delighted ping!", "You hear a ping.") + playsound(loc, 'sound/machines/ping.ogg', 50, 0) + + // mousedrop a crate to load the bot // can load anything if emagged +/obj/machinery/bot/mulebot/MouseDrop_T(atom/movable/AM, mob/user) -/obj/machinery/bot/mulebot/MouseDrop_T(atom/movable/C, mob/user) - - if(user.stat) + if(user.incapacitated() || user.lying) return - if (!on || !istype(C)|| C.anchored || get_dist(user, src) > 1 || get_dist(src,C) > 1 ) + if (!istype(AM)) return - if(load) - return - - load(C) - + load(AM) // called to load a crate -/obj/machinery/bot/mulebot/proc/load(atom/movable/C) - if(wires.LoadCheck() && !istype(C,/obj/structure/closet/crate)) - visible_message("[src] makes a sighing buzz.", "You hear an electronic buzzing sound.") - playsound(loc, 'sound/machines/buzz-sigh.ogg', 50, 0) - return // if not emagged, only allow crates to be loaded - - //I'm sure someone will come along and ask why this is here... well people were dragging screen items onto the mule, and that was not cool. - //So this is a simple fix that only allows a selection of item types to be considered. Further narrowing-down is below. - if(!istype(C,/obj/item) && !istype(C,/obj/machinery) && !istype(C,/obj/structure) && !ismob(C)) - return - if(!isturf(C.loc)) //To prevent the loading from stuff from someone's inventory, which wouldn't get handled properly. +/obj/machinery/bot/mulebot/proc/load(atom/movable/AM) + if(load || AM.anchored) return - if(get_dist(C, src) > 1 || load || !on) + if(!isturf(AM.loc)) //To prevent the loading from stuff from someone's inventory or screen icons. return - mode = BOT_LOADING - // if a create, close before loading - var/obj/structure/closet/crate/crate = C - if(istype(crate)) - crate.close() + var/obj/structure/closet/crate/CRATE + if(istype(AM,/obj/structure/closet/crate)) + CRATE = AM + else + if(wires.LoadCheck()) + buzz(SIGH) + return // if not emagged, only allow crates to be loaded - C.loc = loc - sleep(2) - if(C.loc != loc) //To prevent you from going onto more thano ne bot. - return - C.loc = src - load = C + if(CRATE) // if it's a crate, close before loading + CRATE.close() - C.pixel_y += 9 - if(C.layer < layer) - C.layer = layer + 0.1 - overlays += C + if(isobj(AM)) + var/obj/O = AM + if(O.buckled_mob || (locate(/mob) in AM)) //can't load non crates objects with mobs buckled to it or inside it. + buzz(SIGH) + return - if(ismob(C)) - var/mob/M = C - if(M.client) - M.client.perspective = EYE_PERSPECTIVE - M.client.eye = src + if(isliving(AM)) + if(!buckle_mob(AM)) + return + else + AM.loc = src + AM.pixel_y += 9 + if(AM.layer < layer) + AM.layer = layer + 0.1 + overlays += AM + load= AM mode = BOT_IDLE +/obj/machinery/bot/mulebot/buckle_mob(mob/living/M) + if(M.buckled) + return 0 + var/turf/T = get_turf(src) + if(M.loc != T) + density = 0 + var/can_step = step_towards(M, T) + density = 1 + if(!can_step) + return 0 + return ..() + + +/obj/machinery/bot/mulebot/post_buckle_mob(mob/living/M) + if(M == buckled_mob) //post buckling + M.pixel_y = initial(M.pixel_y) + 9 + if(M.layer < layer) + M.layer = layer + 0.1 + + else //post unbuckling + load = null + M.layer = initial(M.layer) + M.pixel_y = initial(M.pixel_y) + + // called to unload the bot // argument is optional direction to unload // if zero, unload at bot's location @@ -460,18 +512,16 @@ obj/machinery/bot/mulebot/bot_reset() if(!load) return - mode = BOT_LOADING + mode = BOT_IDLE + overlays.Cut() - if(ismob(load)) - var/mob/M = load - if(M.client) - M.client.perspective = MOB_PERSPECTIVE - M.client.eye = src - + if(buckled_mob) + unbuckle_mob() + return load.loc = loc - load.pixel_y -= 9 + load.pixel_y = initial(load.pixel_y) load.layer = initial(load.layer) if(dirn) var/turf/T = loc @@ -481,22 +531,7 @@ obj/machinery/bot/mulebot/bot_reset() load = null - // in case non-load items end up in contents, dump every else too - // this seems to happen sometimes due to race conditions - // with items dropping as mobs are loaded - for(var/atom/movable/AM in src) - if(AM == cell || istype(AM , botcard) || AM == Radio) continue - - AM.loc = loc - AM.layer = initial(AM.layer) - AM.pixel_y = initial(AM.pixel_y) - if(ismob(AM)) - var/mob/M = AM - if(M.client) - M.client.perspective = MOB_PERSPECTIVE - M.client.eye = src - mode = BOT_IDLE /obj/machinery/bot/mulebot/call_bot() ..() @@ -536,14 +571,14 @@ obj/machinery/bot/mulebot/bot_reset() if(refresh) updateDialog() /obj/machinery/bot/mulebot/proc/process_bot() - //if(mode) world << "Mode: [mode]" + + if(!on) + return switch(mode) if(BOT_IDLE) // idle icon_state = "mulebot0" return - if(BOT_LOADING) // loading/unloading - return if(BOT_DELIVER,BOT_GO_HOME,BOT_BLOCKED) // navigating to deliver,home, or blocked if(loc == target) // reached target @@ -603,26 +638,22 @@ obj/machinery/bot/mulebot/bot_reset() blockcount++ mode = BOT_BLOCKED if(blockcount == 3) - visible_message("[src] makes an annoyed buzzing sound.", "You hear an electronic buzzing sound.") - playsound(loc, 'sound/machines/buzz-two.ogg', 50, 0) + buzz(ANNOYED) if(blockcount > 10) // attempt 10 times before recomputing // find new path excluding blocked turf - visible_message("[src] makes a sighing buzz.", "You hear an electronic buzzing sound.") - playsound(loc, 'sound/machines/buzz-sigh.ogg', 50, 0) + buzz(SIGH) spawn(2) calc_path(next) if(path.len > 0) - visible_message("[src] makes a delighted ping!", "You hear a ping.") - playsound(loc, 'sound/machines/ping.ogg', 50, 0) + buzz(DELIGHT) mode = BOT_BLOCKED mode = BOT_WAIT_FOR_NAV return return else - visible_message("[src] makes an annoyed buzzing sound.", "You hear an electronic buzzing sound.") - playsound(loc, 'sound/machines/buzz-two.ogg', 50, 0) + buzz(ANNOYED) //world << "Bad turf." mode = BOT_NAV return @@ -641,20 +672,12 @@ obj/machinery/bot/mulebot/bot_reset() if(path.len > 0) blockcount = 0 mode = BOT_BLOCKED - visible_message("[src] makes a delighted ping!", "You hear a ping.") - playsound(loc, 'sound/machines/ping.ogg', 50, 0) + buzz(DELIGHT) else - visible_message("[src] makes a sighing buzz.", "You hear an electronic buzzing sound.") - playsound(loc, 'sound/machines/buzz-sigh.ogg', 50, 0) + buzz(SIGH) mode = BOT_NO_ROUTE - //if(6) - //world << "Pending path calc." - //if(7) - //world << "No dest / no route." - - return // calculates a path to the current destination @@ -673,6 +696,8 @@ obj/machinery/bot/mulebot/bot_reset() // starts bot moving to current destination /obj/machinery/bot/mulebot/proc/start() + if(!on) + return if(destination == home_destination) mode = BOT_GO_HOME else @@ -683,6 +708,8 @@ obj/machinery/bot/mulebot/bot_reset() // starts bot moving to home // sends a beacon query to find /obj/machinery/bot/mulebot/proc/start_home() + if(!on) + return spawn(0) set_destination(home_destination) mode = BOT_BLOCKED @@ -719,7 +746,7 @@ obj/machinery/bot/mulebot/bot_reset() break else // otherwise, look for crates only AM = locate(/obj/structure/closet/crate) in get_step(loc,loaddir) - if(AM) + if(AM && AM.Adjacent(src)) load(AM) if(report_delivery) speak("Now loading [load] at [get_area(src)].", radio_frequency) @@ -774,11 +801,10 @@ obj/machinery/bot/mulebot/bot_reset() // player on mulebot attempted to move /obj/machinery/bot/mulebot/relaymove(mob/user) - if(user.stat) + if(user.incapacitated()) return if(load == user) unload(0) - return //Update navigation data. Called when commanded to deliver, return home, or a route update is needed... @@ -828,5 +854,12 @@ obj/machinery/bot/mulebot/bot_reset() s.start() new /obj/effect/decal/cleanable/oil(loc) - unload(0) qdel(src) + +/obj/machinery/bot/mulebot/Destroy() + unload(0) + return ..() + +#undef SIGH +#undef ANNOYED +#undef DELIGHT \ No newline at end of file diff --git a/code/game/machinery/computer/shuttle.dm b/code/game/machinery/computer/shuttle.dm index 2ea4b0b285e..460adf2b0d8 100644 --- a/code/game/machinery/computer/shuttle.dm +++ b/code/game/machinery/computer/shuttle.dm @@ -93,7 +93,9 @@ else if(istype(A, /mob/living)) // You Shall Not Pass! var/mob/living/M = A - if(!M.lying && !ismonkey(M) && !isslime(M)) //If your not laying down, or a small creature, no pass. + if(M.buckled && istype(M.buckled, /obj/machinery/bot/mulebot)) // mulebot passenger gets a free pass. + return 1 + if(!M.lying && !M.ventcrawler && M.mob_size != MOB_SIZE_TINY) //If your not laying down, or a ventcrawler or a small creature, no pass. return 0 return ..() diff --git a/code/game/machinery/doors/windowdoor.dm b/code/game/machinery/doors/windowdoor.dm index 82a66b848e1..fbf9c5b26f3 100644 --- a/code/game/machinery/doors/windowdoor.dm +++ b/code/game/machinery/doors/windowdoor.dm @@ -235,10 +235,8 @@ return var/mob/living/simple_animal/M = user M.do_attack_animation(src) - if(M.melee_damage_upper <= 0) - return - attack_generic(M, M.melee_damage_upper) - + if(M.melee_damage_upper > 0 && (M.melee_damage_type == BRUTE || M.melee_damage_type == BURN)) + attack_generic(M, M.melee_damage_upper) /obj/machinery/door/window/attack_slime(mob/living/simple_animal/slime/user) user.do_attack_animation(src) diff --git a/code/game/machinery/machinery.dm b/code/game/machinery/machinery.dm index 4952544aeb7..a4cdf6f6470 100644 --- a/code/game/machinery/machinery.dm +++ b/code/game/machinery/machinery.dm @@ -230,6 +230,8 @@ Class Procs: return /mob/living/canUseTopic(atom/movable/M, be_close = 0, no_dextery = 0) + if(incapacitated()) + return if(no_dextery) if(be_close && in_range(M, src)) return 1 diff --git a/code/game/machinery/portable_turret.dm b/code/game/machinery/portable_turret.dm index f0a2c610a61..499198a49e3 100644 --- a/code/game/machinery/portable_turret.dm +++ b/code/game/machinery/portable_turret.dm @@ -311,7 +311,7 @@ /obj/machinery/porta_turret/attack_animal(mob/living/simple_animal/M) M.changeNext_move(CLICK_CD_MELEE) M.do_attack_animation(src) - if(M.melee_damage_upper == 0) + if(M.melee_damage_upper == 0 || (M.melee_damage_type != BRUTE && M.melee_damage_type != BURN)) return if(!(stat & BROKEN)) visible_message("[M] [M.attacktext] [src]!") diff --git a/code/game/objects/buckling.dm b/code/game/objects/buckling.dm index 88a0b285c62..e47bcec43c6 100644 --- a/code/game/objects/buckling.dm +++ b/code/game/objects/buckling.dm @@ -72,7 +72,7 @@ //Wrapper procs that handle sanity and user feedback /obj/proc/user_buckle_mob(mob/living/M, mob/user) - if(!user.Adjacent(M) || user.restrained() || user.lying || user.stat) + if(!user.Adjacent(M) || user.lying || user.incapacitated()) return add_fingerprint(user) diff --git a/code/game/objects/items/weapons/mop.dm b/code/game/objects/items/weapons/mop.dm index 60b08e58e64..2b4f54b5679 100644 --- a/code/game/objects/items/weapons/mop.dm +++ b/code/game/objects/items/weapons/mop.dm @@ -25,9 +25,6 @@ obj/item/weapon/mop/proc/clean(turf/simulated/A) if(reagents.has_reagent("water", 1) || reagents.has_reagent("holywater", 1)) A.clean_blood() A.thermite = 0 - var/turf/simulated/floor/F = A - if(istype(F)) - F.dirt = 0 for(var/obj/effect/O in A) if(is_cleanable(O)) qdel(O) diff --git a/code/game/objects/items/weapons/storage/firstaid.dm b/code/game/objects/items/weapons/storage/firstaid.dm index f1347bcd07e..65e2b67e0b3 100644 --- a/code/game/objects/items/weapons/storage/firstaid.dm +++ b/code/game/objects/items/weapons/storage/firstaid.dm @@ -45,8 +45,8 @@ new /obj/item/weapon/reagent_containers/pill/patch/silver_sulf(src) new /obj/item/weapon/reagent_containers/pill/patch/silver_sulf(src) new /obj/item/weapon/reagent_containers/pill/patch/silver_sulf(src) - new /obj/item/weapon/reagent_containers/pill/salicyclic(src) - new /obj/item/weapon/reagent_containers/pill/salicyclic(src) + new /obj/item/weapon/reagent_containers/pill/oxandrolone(src) + new /obj/item/weapon/reagent_containers/pill/oxandrolone(src) new /obj/item/weapon/reagent_containers/hypospray/medipen(src) new /obj/item/device/healthanalyzer(src) return diff --git a/code/game/objects/structures/crates_lockers/closets.dm b/code/game/objects/structures/crates_lockers/closets.dm index bb209cb9515..8fa1375a480 100644 --- a/code/game/objects/structures/crates_lockers/closets.dm +++ b/code/game/objects/structures/crates_lockers/closets.dm @@ -166,6 +166,7 @@ /obj/structure/closet/ex_act(severity, target) contents_explosion(severity, target) + new /obj/item/stack/sheet/metal(loc) dump_contents() qdel(src) ..() diff --git a/code/game/objects/structures/girders.dm b/code/game/objects/structures/girders.dm index 355938166f5..e8775daf133 100644 --- a/code/game/objects/structures/girders.dm +++ b/code/game/objects/structures/girders.dm @@ -239,7 +239,7 @@ qdel(src) return if(3.0) - if (prob(15)) + if (prob(40)) var/remains = pick(/obj/item/stack/rods,/obj/item/stack/sheet/metal) new remains(loc) qdel(src) diff --git a/code/game/objects/structures/grille.dm b/code/game/objects/structures/grille.dm index 488932acaa4..d6c56c34a34 100644 --- a/code/game/objects/structures/grille.dm +++ b/code/game/objects/structures/grille.dm @@ -79,7 +79,8 @@ /obj/structure/grille/attack_animal(var/mob/living/simple_animal/M) M.changeNext_move(CLICK_CD_MELEE) - if(M.melee_damage_upper == 0) return + if(M.melee_damage_upper == 0 || (M.melee_damage_type != BRUTE && M.melee_damage_type != BURN)) + return M.do_attack_animation(src) playsound(loc, 'sound/effects/grillehit.ogg', 80, 1) M.visible_message("[M] smashes against [src].", \ diff --git a/code/game/objects/structures/janicart.dm b/code/game/objects/structures/janicart.dm index 7246ac3dbbd..3ac8658347c 100644 --- a/code/game/objects/structures/janicart.dm +++ b/code/game/objects/structures/janicart.dm @@ -181,9 +181,6 @@ var/turf/tile = loc if(isturf(tile)) tile.clean_blood() - if (istype(tile, /turf/simulated/floor)) - var/turf/simulated/floor/F = tile - F.dirt = 0 for(var/A in tile) if(istype(A, /obj/effect)) if(is_cleanable(A)) diff --git a/code/game/objects/structures/stool_bed_chair_nest/stools.dm b/code/game/objects/structures/stool_bed_chair_nest/stools.dm index 696ed292eb9..b7862562752 100644 --- a/code/game/objects/structures/stool_bed_chair_nest/stools.dm +++ b/code/game/objects/structures/stool_bed_chair_nest/stools.dm @@ -11,11 +11,13 @@ qdel(src) return if(2.0) - if (prob(50)) + if (prob(70)) + new /obj/item/stack/sheet/metal(loc) qdel(src) return if(3.0) - if (prob(5)) + if (prob(50)) + new /obj/item/stack/sheet/metal(loc) qdel(src) return return diff --git a/code/game/objects/structures/window.dm b/code/game/objects/structures/window.dm index 6c02cd7e7d0..9dc8d6631e9 100644 --- a/code/game/objects/structures/window.dm +++ b/code/game/objects/structures/window.dm @@ -168,7 +168,7 @@ var/mob/living/simple_animal/M = user M.do_attack_animation(src) - if(M.melee_damage_upper <= 0) + if(M.melee_damage_upper <= 0 || (M.melee_damage_type != BRUTE && M.melee_damage_type != BURN)) return attack_generic(M, M.melee_damage_upper) diff --git a/code/game/turfs/simulated/floor.dm b/code/game/turfs/simulated/floor.dm index 9bd230386c0..6b23686fbca 100644 --- a/code/game/turfs/simulated/floor.dm +++ b/code/game/turfs/simulated/floor.dm @@ -32,8 +32,6 @@ var/list/icons_to_ignore_at_floor_init = list("damaged1","damaged2","damaged3"," var/obj/item/stack/tile/builtin_tile = null //needed for performance reasons when the singularity rips off floor tiles var/list/broken_states = list("damaged1", "damaged2", "damaged3", "damaged4", "damaged5") var/list/burnt_states = list() - var/dirt = 0 - var/ignoredirt = 0 /turf/simulated/floor/New() ..() @@ -167,22 +165,5 @@ var/list/icons_to_ignore_at_floor_init = list("damaged1","damaged2","damaged3"," if(prob(20)) ChangeTurf(/turf/simulated/floor/plasteel/cult) -/turf/simulated/floor/Entered(atom/A, atom/OL) - ..() - if(!ignoredirt) - if(has_gravity(src)) - if(istype(A,/mob/living/carbon)) - var/mob/living/carbon/M = A - if(M.lying) return - if(prob(80)) - dirt++ - var/obj/effect/decal/cleanable/dirt/dirtoverlay = locate(/obj/effect/decal/cleanable/dirt, src) - if(dirt >= 100) - if(!dirtoverlay) - dirtoverlay = new/obj/effect/decal/cleanable/dirt(src) - dirtoverlay.alpha = 10 - else if(dirt > 100) - dirtoverlay.alpha = min(dirtoverlay.alpha+10, 200) - /turf/simulated/floor/can_have_cabling() return !burnt & !broken & !lava diff --git a/code/game/turfs/simulated/floor/fancy_floor.dm b/code/game/turfs/simulated/floor/fancy_floor.dm index 3e3a1f61358..05a0c9d9c51 100644 --- a/code/game/turfs/simulated/floor/fancy_floor.dm +++ b/code/game/turfs/simulated/floor/fancy_floor.dm @@ -26,7 +26,6 @@ icon_state = "grass" floor_tile = /obj/item/stack/tile/grass broken_states = list("sand") - ignoredirt = 1 /turf/simulated/floor/grass/New() ..() diff --git a/code/game/turfs/simulated/floor/misc_floor.dm b/code/game/turfs/simulated/floor/misc_floor.dm index c7a21ef6f92..067ebe88eed 100644 --- a/code/game/turfs/simulated/floor/misc_floor.dm +++ b/code/game/turfs/simulated/floor/misc_floor.dm @@ -21,7 +21,6 @@ /turf/simulated/floor/plating/beach name = "Beach" icon = 'icons/misc/beach.dmi' - ignoredirt = 1 /turf/simulated/floor/plating/beach/ex_act(severity, target) contents_explosion(severity, target) @@ -43,13 +42,11 @@ ..() name = "Iron Sand" icon_state = "ironsand[rand(1,15)]" - ignoredirt = 1 /turf/simulated/floor/plating/snow name = "snow" icon = 'icons/turf/snow.dmi' icon_state = "snow" - ignoredirt = 1 /turf/simulated/floor/plating/snow/ex_act(severity, target) contents_explosion(severity, target) diff --git a/code/game/turfs/simulated/floor/plasteel_floor.dm b/code/game/turfs/simulated/floor/plasteel_floor.dm index 51b551565c5..555e25b09be 100644 --- a/code/game/turfs/simulated/floor/plasteel_floor.dm +++ b/code/game/turfs/simulated/floor/plasteel_floor.dm @@ -11,8 +11,36 @@ icon_state = icon_regular_floor + /turf/simulated/floor/plasteel/black icon_state = "dark" +/turf/simulated/floor/plasteel/black/side + icon_state = "black" //NOTICE ME SEMPAI: floors.dmi contains two sprites named black, remove the incorrect one +/turf/simulated/floor/plasteel/black/corner + icon_state = "blackcorner" + + +/turf/simulated/floor/plasteel/white + icon_state = "white" +/turf/simulated/floor/plasteel/white/side + icon_state = "whitehall" +/turf/simulated/floor/plasteel/white/corner + icon_state = "whitecorner" + + + +/turf/simulated/floor/plasteel/brown + icon_state = "brown" +/turf/simulated/floor/plasteel/brown/corner + icon_state = "browncorner" + +/turf/simulated/floor/plasteel/darkbrown + icon_state = "darkbrownfull" +/turf/simulated/floor/plasteel/darkbrown/side + icon_state = "darkbrown" +/turf/simulated/floor/plasteel/darkbrown/corner + icon_state = "darkbrowncorners" + /turf/simulated/floor/plasteel/green @@ -22,7 +50,6 @@ /turf/simulated/floor/plasteel/green/corner icon_state = "greencorner" - /turf/simulated/floor/plasteel/darkgreen icon_state = "darkgreenfull" /turf/simulated/floor/plasteel/darkgreen/side @@ -30,11 +57,13 @@ /turf/simulated/floor/plasteel/darkgreen/corner icon_state = "darkgreencorners" +/turf/simulated/floor/plasteel/whitegreen + icon_state = "whitegreenfull" +/turf/simulated/floor/plasteel/whitegreen/side + icon_state = "whitegreen" +/turf/simulated/floor/plasteel/whitegreen/corner + icon_state = "whitegreencorner" -/turf/simulated/floor/plasteel/brown - icon_state = "brown" -/turf/simulated/floor/plasteel/brown/corner - icon_state = "browncorner" /turf/simulated/floor/plasteel/red @@ -44,7 +73,6 @@ /turf/simulated/floor/plasteel/red/corner icon_state = "redcorner" - /turf/simulated/floor/plasteel/darkred icon_state = "darkredfull" /turf/simulated/floor/plasteel/darkred/side @@ -52,6 +80,90 @@ /turf/simulated/floor/plasteel/darkred/corner icon_state = "darkredcorners" +/turf/simulated/floor/plasteel/whitered + icon_state = "whiteredfull" +/turf/simulated/floor/plasteel/whitered/side + icon_state = "whitered" +/turf/simulated/floor/plasteel/whitered/corner + icon_state = "whiteredcorner" + + + +/turf/simulated/floor/plasteel/blue + icon_state = "bluefull" +/turf/simulated/floor/plasteel/blue/side + icon_state = "blue" +/turf/simulated/floor/plasteel/blue/corner + icon_state = "bluecorner" + +/turf/simulated/floor/plasteel/darkblue + icon_state = "darkbluefull" +/turf/simulated/floor/plasteel/darkblue/side + icon_state = "darkblue" +/turf/simulated/floor/plasteel/darkblue/corner + icon_state = "darkbluecorners" + +/turf/simulated/floor/plasteel/whiteblue + icon_state = "whitebluefull" +/turf/simulated/floor/plasteel/whiteblue/side + icon_state = "whiteblue" +/turf/simulated/floor/plasteel/whiteblue/corner + icon_state = "whitebluecorner" + + + +/turf/simulated/floor/plasteel/yellow + icon_state = "yellowfull" +/turf/simulated/floor/plasteel/yellow/side + icon_state = "yellow" +/turf/simulated/floor/plasteel/yellow/corner + icon_state = "yellowcorner" + +/turf/simulated/floor/plasteel/darkyellow + icon_state = "darkyellowfull" +/turf/simulated/floor/plasteel/darkyellow/side + icon_state = "darkyellow" +/turf/simulated/floor/plasteel/darkyellow/corner + icon_state = "darkyellowcorners" + +/turf/simulated/floor/plasteel/whiteyellow + icon_state = "whiteyellowfull" +/turf/simulated/floor/plasteel/whiteyellow/side + icon_state = "whiteyellow" +/turf/simulated/floor/plasteel/whiteyellow/corner + icon_state = "whiteyellowcorner" + + + +/turf/simulated/floor/plasteel/purple + icon_state = "purplefull" +/turf/simulated/floor/plasteel/purple/side + icon_state = "purple" +/turf/simulated/floor/plasteel/purple/corner + icon_state = "purplecorner" + +/turf/simulated/floor/plasteel/darkpurple + icon_state = "darkpurplefull" +/turf/simulated/floor/plasteel/darkpurple/side + icon_state = "darkpurple" +/turf/simulated/floor/plasteel/darkpurple/corner + icon_state = "darkpurplecorners" + +/turf/simulated/floor/plasteel/whitepurple + icon_state = "whitepurplefull" +/turf/simulated/floor/plasteel/whitepurple/side + icon_state = "whitepurple" +/turf/simulated/floor/plasteel/whitepurple/corner + icon_state = "whitepurplecorner" + + +/turf/simulated/floor/plasteel/orange + icon_state = "orangefull" +/turf/simulated/floor/plasteel/orange/side + icon_state = "orange" +/turf/simulated/floor/plasteel/orange/corner + icon_state = "orangecorner" + /turf/simulated/floor/plasteel/neutral icon_state = "neutralfull" @@ -61,12 +173,48 @@ icon_state = "neutralcorner" +/turf/simulated/floor/plasteel/arrival + icon_state = "arrival" +/turf/simulated/floor/plasteel/arrival/corner + icon_state = "arrivalcorner" + + +/turf/simulated/floor/plasteel/escape + icon_state = "escape" +/turf/simulated/floor/plasteel/escape/corner + icon_state = "escapecorner" + + +/turf/simulated/floor/plasteel/caution + icon_state = "caution" +/turf/simulated/floor/plasteel/caution/corner + icon_state = "cautioncorner" + + /turf/simulated/floor/plasteel/warning icon_state = "warning" /turf/simulated/floor/plasteel/warning/corner icon_state = "warningcorner" +/turf/simulated/floor/plasteel/warnplate + icon_state = "warnplate" +/turf/simulated/floor/plasteel/warnplate/corner + icon_state = "warnplatecorner" + + +/turf/simulated/floor/plasteel/warnwhite + icon_state = "warnwhite" +/turf/simulated/floor/plasteel/warnwhite/corner + icon_state = "warnwhitecorner" + + +/turf/simulated/floor/plasteel/whitebot + icon_state = "whitebot" +/turf/simulated/floor/plasteel/whitebot/delivery + icon_state = "whitedelivery" + + /turf/simulated/floor/plasteel/redyellow icon_state = "redyellowfull" /turf/simulated/floor/plasteel/redyellow/side @@ -75,15 +223,45 @@ /turf/simulated/floor/plasteel/redblue icon_state = "redbluefull" -/turf/simulated/floor/plasteel/redblue/side +/turf/simulated/floor/plasteel/redblue/blueside + icon_state = "bluered" +/turf/simulated/floor/plasteel/redblue/redside icon_state = "redblue" +/turf/simulated/floor/plasteel/redgreen + icon_state = "redgreenfull" +/turf/simulated/floor/plasteel/redgreen/side + icon_state = "redgreen" + + +/turf/simulated/floor/plasteel/greenyellow + icon_state = "greenyellowfull" +/turf/simulated/floor/plasteel/greenyellow/side + icon_state = "greenyellow" + + +/turf/simulated/floor/plasteel/greenblue + icon_state = "greenbluefull" +/turf/simulated/floor/plasteel/greenblue/side + icon_state = "greenblue" + + +/turf/simulated/floor/plasteel/blueyellow + icon_state = "blueyellowfull" +/turf/simulated/floor/plasteel/blueyellow/side + icon_state = "blueyellow" + + /turf/simulated/floor/plasteel/darkwarning icon_state = "warndark" /turf/simulated/floor/plasteel/darkwarning/corner icon_state = "warndarkcorners" +/turf/simulated/floor/plasteel/warningline + icon_state = "warningline" +/turf/simulated/floor/plasteel/warningline/corner + icon_state = "warninglinecorners" /turf/simulated/floor/plasteel/yellowsiding icon_state = "yellowsiding" @@ -97,12 +275,86 @@ icon_state = "podhatchcorner" + +/turf/simulated/floor/plasteel/circuit + icon_state = "bcircuit" +/turf/simulated/floor/plasteel/circuit/off + icon_state = "bcircuitoff" + +/turf/simulated/floor/plasteel/circuit/gcircuit + icon_state = "gcircuit" +/turf/simulated/floor/plasteel/circuit/gcircuit/off + icon_state = "gcircuitoff" +/turf/simulated/floor/plasteel/circuit/gcircuit/animated + icon_state = "gcircuitanim" + +/turf/simulated/floor/plasteel/circuit/rcircuit + icon_state = "rcircuit" +/turf/simulated/floor/plasteel/circuit/rcircuit/animated + icon_state = "rcircuitanim" + + + /turf/simulated/floor/plasteel/loadingarea icon_state = "loadingarea" +/turf/simulated/floor/plasteel/loadingarea/dirty + icon_state = "loadingareadirty1" +/turf/simulated/floor/plasteel/loadingarea/dirtydirty + icon_state = "loadingareadirty2" + + +/turf/simulated/floor/plasteel/shuttle + icon_state = "shuttlefloor" +/turf/simulated/floor/plasteel/shuttle/red + name = "Brig floor" + icon_state = "shuttlefloor4" +/turf/simulated/floor/plasteel/shuttle/yellow + icon_state = "shuttlefloor2" +/turf/simulated/floor/plasteel/shuttle/white + icon_state = "shuttlefloor3" +/turf/simulated/floor/plasteel/shuttle/purple + icon_state = "shuttlefloor5" + + +/turf/simulated/floor/plasteel/asteroid + icon_state = "asteroidfloor" +/turf/simulated/floor/plasteel/asteroid/warning + icon_state = "asteroidwarning" + + +/turf/simulated/floor/plasteel/recharge_floor + icon_state = "recharge_floor" +/turf/simulated/floor/plasteel/recharge_floor/asteroid + icon_state = "recharge_floor_asteroid" + + +/turf/simulated/floor/plasteel/chapel + icon_state = "chapel" + +/turf/simulated/floor/plasteel/showroomfloor + icon_state = "showroomfloor" + +/turf/simulated/floor/plasteel/floorgrime + icon_state = "floorgrime" + +/turf/simulated/floor/plasteel/solarpanel + icon_state = "solarpanel" + +/turf/simulated/floor/plasteel/cmo + icon_state = "cmo" + +/turf/simulated/floor/plasteel/barber + icon_state = "barber" + +/turf/simulated/floor/plasteel/hydrofloor + icon_state = "hydrofloor" /turf/simulated/floor/plasteel/delivery icon_state = "delivery" +/turf/simulated/floor/plasteel/bot + icon_state = "bot" + /turf/simulated/floor/plasteel/freezer icon_state = "freezerfloor" @@ -115,10 +367,18 @@ /turf/simulated/floor/plasteel/cafeteria icon_state = "cafeteria" +/turf/simulated/floor/plasteel/vault + icon_state = "vault" + /turf/simulated/floor/plasteel/cult icon_state = "cult" name = "engraved floor" +/turf/simulated/floor/plasteel/goonplaque + icon_state = "plaque" + name = "Commemorative Plaque" + desc = "\"This is a plaque in honour of our comrades on the G4407 Stations. Hopefully TG4407 model can live up to your fame and fortune.\" Scratched in beneath that is a crude image of a meteor and a spaceman. The spaceman is laughing. The meteor is exploding." + /turf/simulated/floor/plasteel/cult/narsie_act() return @@ -127,9 +387,61 @@ nitrogen = 0 temperature = TCMB -/turf/simulated/floor/plasteel/shuttle - icon_state = "shuttlefloor" -/turf/simulated/floor/plasteel/shuttle/red - name = "Brig floor" - icon_state = "shuttlefloor4" \ No newline at end of file + + + + +// +//unused? remove? +// +/turf/simulated/floor/plasteel/stage_bottom + icon_state = "stage_bottom" +/turf/simulated/floor/plasteel/stage_left + icon_state = "stage_left" +/turf/simulated/floor/plasteel/stage_bleft + icon_state = "stage_bleft" + + +/turf/simulated/floor/plasteel/stairs + icon_state = "stairs" +/turf/simulated/floor/plasteel/stairs/left + icon_state = "stairs-l" +/turf/simulated/floor/plasteel/stairs/medium + icon_state = "stairs-m" +/turf/simulated/floor/plasteel/stairs/right + icon_state = "stairs-r" +/turf/simulated/floor/plasteel/stairs/old + icon_state = "stairs-old" + + +/turf/simulated/floor/plasteel/brownold + icon_state = "brownold" +/turf/simulated/floor/plasteel/brownold/corner + icon_state = "browncornerold" + + +/turf/simulated/floor/plasteel/rockvault + icon_state = "rockvault" +/turf/simulated/floor/plasteel/rockvault/alien + icon_state = "alienvault" +/turf/simulated/floor/plasteel/rockvault/sandstone + icon_state = "sandstonevault" + + +/turf/simulated/floor/plasteel/elevatorshaft + icon_state = "elevatorshaft" + +/turf/simulated/floor/plasteel/bluespace + icon_state = "bluespace" + +/turf/simulated/floor/plasteel/sepia + icon_state = "sepia" + + +/turf/simulated/floor/plasteel/sandeffect + icon_state = "sandeffect" +/turf/simulated/floor/plasteel/sandeffect/warning + icon_state = "warningsandeffect" +/turf/simulated/floor/plasteel/sandeffect/warning/corner + icon_state = "warningsandeffectcorners" \ No newline at end of file diff --git a/code/modules/events/brand_intelligence.dm b/code/modules/events/brand_intelligence.dm index 9a55d77b4ad..f373fad4af6 100644 --- a/code/modules/events/brand_intelligence.dm +++ b/code/modules/events/brand_intelligence.dm @@ -7,7 +7,6 @@ /datum/round_event/brand_intelligence announceWhen = 21 endWhen = 1000 //Ends when all vending machines are subverted anyway. - var/list/obj/machinery/vending/vendingMachines = list() var/list/obj/machinery/vending/infectedMachines = list() var/obj/machinery/vending/originMachine @@ -28,11 +27,9 @@ for(var/obj/machinery/vending/V in machines) if(V.z != 1) continue vendingMachines.Add(V) - if(!vendingMachines.len) kill() return - originMachine = pick(vendingMachines) vendingMachines.Remove(originMachine) originMachine.shut_up = 0 @@ -48,7 +45,7 @@ originMachine.visible_message("[originMachine] beeps and seems lifeless.") kill() return - + vendingMachines = removeNullsFromList(vendingMachines) if(!vendingMachines.len) //if every machine is infected for(var/obj/machinery/vending/upriser in infectedMachines) if(prob(70) && !upriser.gc_destroyed) @@ -62,7 +59,6 @@ kill() return - if(IsMultiple(activeFor, 4)) var/obj/machinery/vending/rebel = pick(vendingMachines) vendingMachines.Remove(rebel) diff --git a/code/modules/events/spacevine.dm b/code/modules/events/spacevine.dm index c633246b3e4..7f87245bf41 100644 --- a/code/modules/events/spacevine.dm +++ b/code/modules/events/spacevine.dm @@ -66,7 +66,6 @@ color = "#aa77aa" icon_state = "vinefloor" broken_states = list() - ignoredirt = 1 //All of this shit is useless for vines diff --git a/code/modules/mining/equipment_locker.dm b/code/modules/mining/equipment_locker.dm index f0e699253be..36b7e7e4eb4 100644 --- a/code/modules/mining/equipment_locker.dm +++ b/code/modules/mining/equipment_locker.dm @@ -573,6 +573,7 @@ /**********************Facehugger toy**********************/ /obj/item/clothing/mask/facehugger/toy + item_state = "facehugger_inactive" desc = "A toy often used to play pranks on other miners by putting it in their beds. It takes a bit to recharge after latching onto something." throwforce = 0 real = 0 diff --git a/code/modules/mining/mine_turfs.dm b/code/modules/mining/mine_turfs.dm index 24a358a10b2..955d80d3f0e 100644 --- a/code/modules/mining/mine_turfs.dm +++ b/code/modules/mining/mine_turfs.dm @@ -509,7 +509,6 @@ var/global/list/rockTurfEdgeCache icon_state = "asteroid" icon_plating = "asteroid" var/dug = 0 //0 = has not yet been dug, 1 = has already been dug - ignoredirt = 1 /turf/simulated/floor/plating/asteroid/airless oxygen = 0.01 diff --git a/code/modules/mining/ores_coins.dm b/code/modules/mining/ores_coins.dm index e1089f54ac3..efaac579681 100644 --- a/code/modules/mining/ores_coins.dm +++ b/code/modules/mining/ores_coins.dm @@ -326,7 +326,9 @@ flick("coin_[cmineral]_flip", src) icon_state = "coin_[cmineral]_[coinflip]" playsound(user.loc, 'sound/items/coinflip.ogg', 50, 1) - if(do_after(user, 15, target = src)) + var/oldloc = loc + sleep(15) + if(loc == oldloc && user && !user.incapacitated()) user.visible_message("[user] has flipped [src]. It lands on [coinflip].", \ "You flip [src]. It lands on [coinflip].", \ "You hear the clattering of loose change.") \ No newline at end of file diff --git a/code/modules/mob/living/carbon/alien/alien_defense.dm b/code/modules/mob/living/carbon/alien/alien_defense.dm index fd3fff64a4b..20577531b27 100644 --- a/code/modules/mob/living/carbon/alien/alien_defense.dm +++ b/code/modules/mob/living/carbon/alien/alien_defense.dm @@ -73,7 +73,19 @@ In all, this is a lot like the monkey code. /N /mob/living/carbon/alien/attack_animal(mob/living/simple_animal/M) if(..()) var/damage = rand(M.melee_damage_lower, M.melee_damage_upper) - adjustBruteLoss(damage) + switch(M.melee_damage_type) + if(BRUTE) + adjustBruteLoss(damage) + if(BURN) + adjustFireLoss(damage) + if(TOX) + adjustToxLoss(damage) + if(OXY) + adjustOxyLoss(damage) + if(CLONE) + adjustCloneLoss(damage) + if(STAMINA) + adjustStaminaLoss(damage) updatehealth() /mob/living/carbon/alien/attack_slime(mob/living/simple_animal/slime/M) diff --git a/code/modules/mob/living/carbon/alien/humanoid/emote.dm b/code/modules/mob/living/carbon/alien/humanoid/emote.dm index 5270fdabb6d..6129dd7ef77 100644 --- a/code/modules/mob/living/carbon/alien/humanoid/emote.dm +++ b/code/modules/mob/living/carbon/alien/humanoid/emote.dm @@ -1,4 +1,4 @@ -/mob/living/carbon/alien/humanoid/emote(act) +/mob/living/carbon/alien/humanoid/emote(act,m_type=1,message = null) var/param = null if (findtext(act, "-", 1, null)) @@ -7,8 +7,6 @@ act = copytext(act, 1, t1) var/muzzled = is_muzzled() - var/m_type = 1 - var/message switch(act) //Alphabetical please if ("deathgasp","deathgasps") @@ -25,6 +23,10 @@ message = "[src] hisses." m_type = 2 + if ("me") + ..() + return + if ("moan","moans") message = "[src] moans!" m_type = 2 diff --git a/code/modules/mob/living/carbon/alien/humanoid/queen.dm b/code/modules/mob/living/carbon/alien/humanoid/queen.dm index 03745eb7306..c077bd38b5b 100644 --- a/code/modules/mob/living/carbon/alien/humanoid/queen.dm +++ b/code/modules/mob/living/carbon/alien/humanoid/queen.dm @@ -77,17 +77,3 @@ icon_state = "queen_s" pixel_x = -16 mob_size = MOB_SIZE_LARGE - -/mob/living/carbon/alien/humanoid/queen/large/update_icons() - update_hud() //TODO: remove the need for this to be here - overlays.Cut() - if(stat == DEAD) - icon_state = "queen_dead" - else if((stat == UNCONSCIOUS && !sleeping) || weakened) - icon_state = "queen_l" - else if(sleeping || lying || resting) - icon_state = "queen_sleep" - else - icon_state = "queen_s" - for(var/image/I in overlays_standing) - overlays += I diff --git a/code/modules/mob/living/carbon/alien/humanoid/update_icons.dm b/code/modules/mob/living/carbon/alien/humanoid/update_icons.dm index 1495d4f99d3..de272e0c0d7 100644 --- a/code/modules/mob/living/carbon/alien/humanoid/update_icons.dm +++ b/code/modules/mob/living/carbon/alien/humanoid/update_icons.dm @@ -50,4 +50,29 @@ if(lying > 0) lying = 90 //Anything else looks retarded ..() - update_icons() \ No newline at end of file + update_icons() + + +/mob/living/carbon/alien/humanoid/queen/large/update_icons() + update_hud() //TODO: remove the need for this to be here + overlays.Cut() + if(stat == DEAD) + icon_state = "queen_dead" + else if((stat == UNCONSCIOUS && !sleeping) || weakened) + icon_state = "queen_l" + else if(sleeping || lying || resting) + icon_state = "queen_sleep" + else + icon_state = "queen_s" + for(var/image/I in overlays_standing) + overlays += I + +/mob/living/carbon/alien/humanoid/queen/large/update_inv_l_hand() + remove_overlay(L_HAND_LAYER) + if(handcuffed) + drop_l_hand() + +/mob/living/carbon/alien/humanoid/queen/large/update_inv_r_hand() + remove_overlay(R_HAND_LAYER) + if(handcuffed) + drop_r_hand() diff --git a/code/modules/mob/living/carbon/alien/organs.dm b/code/modules/mob/living/carbon/alien/organs.dm index b7db238a99a..15573748de6 100644 --- a/code/modules/mob/living/carbon/alien/organs.dm +++ b/code/modules/mob/living/carbon/alien/organs.dm @@ -73,15 +73,17 @@ /obj/item/organ/internal/alien/plasmavessel/on_life() //If there are alien weeds on the ground then heal if needed or give some plasma if(locate(/obj/structure/alien/weeds) in owner.loc) - if(owner.health >= owner.maxHealth - owner.getCloneLoss()) + if(owner.health >= owner.maxHealth) owner.adjustPlasma(plasma_rate) else - var/mod = 1 + var/heal_amt = heal_rate if(!isalien(owner)) - mod = 0.2 - owner.adjustBruteLoss(-heal_rate*mod) - owner.adjustFireLoss(-heal_rate*mod) - owner.adjustOxyLoss(-heal_rate*mod) + heal_amt *= 0.2 + owner.adjustPlasma(plasma_rate*0.5) + owner.adjustBruteLoss(-heal_amt) + owner.adjustFireLoss(-heal_amt) + owner.adjustOxyLoss(-heal_amt) + owner.adjustCloneLoss(-heal_amt) /obj/item/organ/internal/alien/plasmavessel/Insert(mob/living/carbon/M, special = 0) ..() diff --git a/code/modules/mob/living/carbon/alien/say.dm b/code/modules/mob/living/carbon/alien/say.dm index a674add3ff1..c1009164427 100644 --- a/code/modules/mob/living/carbon/alien/say.dm +++ b/code/modules/mob/living/carbon/alien/say.dm @@ -3,16 +3,20 @@ if(.) playsound(loc, "hiss", 25, 1, 1) //erp just isn't the same without sound feedback -/mob/living/proc/alien_talk(message) +/mob/living/proc/alien_talk(message, shown_name = name) log_say("[key_name(src)] : [message]") message = trim(message) if(!message) return var/message_a = say_quote(message) - var/rendered = "Hivemind, [name] [message_a]" + var/rendered = "Hivemind, [shown_name] [message_a]" for(var/mob/S in player_list) if((!S.stat && S.hivecheck()) || (S in dead_mob_list)) S << rendered +/mob/living/carbon/alien/humanoid/queen/alien_talk(message, shown_name = name) + shown_name = "[shown_name]" + ..(message, shown_name) + /mob/living/carbon/hivecheck() return getorgan(/obj/item/organ/internal/alien/hivenode) diff --git a/code/modules/mob/living/carbon/alien/special/facehugger.dm b/code/modules/mob/living/carbon/alien/special/facehugger.dm index 1a9ba9601a2..d4f997ddf7b 100644 --- a/code/modules/mob/living/carbon/alien/special/facehugger.dm +++ b/code/modules/mob/living/carbon/alien/special/facehugger.dm @@ -187,7 +187,6 @@ var/const/MAX_ACTIVE_TIME = 400 else target.visible_message("[src] violates [target]'s face!", \ "[src] violates [target]'s face!") - return /obj/item/clothing/mask/facehugger/proc/GoActive() if(stat == DEAD || stat == CONSCIOUS) @@ -196,20 +195,10 @@ var/const/MAX_ACTIVE_TIME = 400 stat = CONSCIOUS icon_state = "[initial(icon_state)]" -/* for(var/mob/living/carbon/alien/alien in world) - var/image/activeIndicator = image('icons/mob/alien.dmi', loc = src, icon_state = "facehugger_active") - activeIndicator.override = 1 - if(alien && alien.client) - alien.client.images += activeIndicator */ - - return - /obj/item/clothing/mask/facehugger/proc/GoIdle() if(stat == DEAD || stat == UNCONSCIOUS) return -/* RemoveActiveIndicators() */ - stat = UNCONSCIOUS icon_state = "[initial(icon_state)]_inactive" @@ -221,15 +210,12 @@ var/const/MAX_ACTIVE_TIME = 400 if(stat == DEAD) return -/* RemoveActiveIndicators() */ - icon_state = "[initial(icon_state)]_dead" + item_state = "facehugger_inactive" stat = DEAD visible_message("[src] curls up into a ball!") - return - /proc/CanHug(mob/living/M) if(!istype(M)) return 0 diff --git a/code/modules/mob/living/carbon/carbon.dm b/code/modules/mob/living/carbon/carbon.dm index 8fdb1c39ccf..283c745d796 100644 --- a/code/modules/mob/living/carbon/carbon.dm +++ b/code/modules/mob/living/carbon/carbon.dm @@ -74,9 +74,9 @@ . = ..() -/mob/living/carbon/electrocute_act(shock_damage, obj/source, siemens_coeff = 1.0) +/mob/living/carbon/electrocute_act(shock_damage, obj/source, siemens_coeff = 1.0, override = 0) shock_damage *= siemens_coeff - if (shock_damage<1) + if(shock_damage<1 && !override) return 0 take_overall_damage(0,shock_damage) //src.burn_skin(shock_damage) @@ -95,7 +95,10 @@ jitteriness = max(jitteriness - 990, 10) //Still jittery, but vastly less Stun(3) Weaken(3) - return shock_damage + if(override) + return override + else + return shock_damage /mob/living/carbon/swap_hand() diff --git a/code/modules/mob/living/carbon/emote.dm b/code/modules/mob/living/carbon/emote.dm index 2009c2bc5fe..1f1717517df 100644 --- a/code/modules/mob/living/carbon/emote.dm +++ b/code/modules/mob/living/carbon/emote.dm @@ -111,6 +111,11 @@ else message = "[src] makes a noise." + if ("me") + if(!silent) + ..() + return + if ("nod","nods") message = "[src] nods." m_type = 1 diff --git a/code/modules/mob/living/carbon/monkey/examine.dm b/code/modules/mob/living/carbon/examine.dm similarity index 65% rename from code/modules/mob/living/carbon/monkey/examine.dm rename to code/modules/mob/living/carbon/examine.dm index 48963b00eed..e46f62193d8 100644 --- a/code/modules/mob/living/carbon/monkey/examine.dm +++ b/code/modules/mob/living/carbon/examine.dm @@ -1,45 +1,58 @@ -/mob/living/carbon/monkey/examine(mob/user) - var/msg = "*---------*\nThis is \icon[src] \a [src]!\n" - - if (src.handcuffed) - msg += "It is \icon[src.handcuffed] handcuffed!\n" - if (src.head) - msg += "It has \icon[src.head] \a [src.head] on its head. \n" - if (src.wear_mask) - msg += "It has \icon[src.wear_mask] \a [src.wear_mask] on its face.\n" - if (src.l_hand) - msg += "It has \icon[src.l_hand] \a [src.l_hand] in its left hand.\n" - if (src.r_hand) - msg += "It has \icon[src.r_hand] \a [src.r_hand] in its right hand.\n" - if (src.back) - msg += "It has \icon[src.back] \a [src.back] on its back.\n" - if (src.stat == DEAD) - msg += "It is limp and unresponsive, with no signs of life.\n" - else - msg += "" - if (src.getBruteLoss()) - if (src.getBruteLoss() < 30) - msg += "It has minor bruising.\n" - else - msg += "It has severe bruising!\n" - if (src.getFireLoss()) - if (src.getFireLoss() < 30) - msg += "It has minor burns.\n" - else - msg += "It has severe burns!\n" - - if (src.fire_stacks > 0) - msg += "It's covered in something flammable.\n" - if (src.fire_stacks < 0) - msg += "It's soaked in water.\n" - - if (src.stat == UNCONSCIOUS) - msg += "It isn't responding to anything around it; it seems to be asleep.\n" - msg += "" - - if (src.digitalcamo) - msg += "It is moving its body in an unnatural and blatantly unsimian manner.\n" - - msg += "*---------*" - +/mob/living/carbon/examine(mob/user) + var/msg = "*---------*\nThis is \icon[src] \a [src]!\n" + + if (handcuffed) + msg += "It is \icon[src.handcuffed] handcuffed!\n" + if (head) + msg += "It has \icon[src.head] \a [src.head] on its head. \n" + if (wear_mask) + msg += "It has \icon[src.wear_mask] \a [src.wear_mask] on its face.\n" + if (l_hand) + msg += "It has \icon[src.l_hand] \a [src.l_hand] in its left hand.\n" + if (r_hand) + msg += "It has \icon[src.r_hand] \a [src.r_hand] in its right hand.\n" + if (back) + msg += "It has \icon[src.back] \a [src.back] on its back.\n" + if (stat == DEAD) + msg += "It is limp and unresponsive, with no signs of life.\n" + else + msg += "" + var/temp = getBruteLoss() + if(temp) + if (temp < 30) + msg += "It has minor bruising.\n" + else + msg += "It has severe bruising!\n" + + temp = getFireLoss() + if(temp) + if (temp < 30) + msg += "It has minor burns.\n" + else + msg += "It has severe burns!\n" + + temp = getCloneLoss() + if(temp) + if(getCloneLoss() < 30) + msg += "It is slightly deformed.\n" + else + msg += "It is severely deformed.\n" + + if(getBrainLoss() > 60) + msg += "It seems to be clumsy and unable to think.\n" + + if(fire_stacks > 0) + msg += "It's covered in something flammable.\n" + if(fire_stacks < 0) + msg += "It's soaked in water.\n" + + if(stat == UNCONSCIOUS) + msg += "It isn't responding to anything around it; it seems to be asleep.\n" + msg += "" + + if (digitalcamo) + msg += "It is moving its body in an unnatural and blatantly unsimian manner.\n" + + msg += "*---------*" + user << msg \ No newline at end of file diff --git a/code/modules/mob/living/carbon/human/human.dm b/code/modules/mob/living/carbon/human/human.dm index ec19362de9b..a6dbd65bfca 100644 --- a/code/modules/mob/living/carbon/human/human.dm +++ b/code/modules/mob/living/carbon/human/human.dm @@ -270,7 +270,7 @@ spreadFire(AM) //Added a safety check in case you want to shock a human mob directly through electrocute_act. -/mob/living/carbon/human/electrocute_act(shock_damage, obj/source, siemens_coeff = 1.0, safety = 0) +/mob/living/carbon/human/electrocute_act(shock_damage, obj/source, siemens_coeff = 1.0, safety = 0, override = 0) if(!safety) if(gloves) var/obj/item/clothing/gloves/G = gloves @@ -280,8 +280,7 @@ heart_attack = 0 if(stat == CONSCIOUS) src << "You feel your heart beating again!" - - . = ..(shock_damage,source,siemens_coeff) + . = ..(shock_damage,source,siemens_coeff,safety,override) if(.) electrocution_animation(40) diff --git a/code/modules/mob/living/carbon/human/human_defense.dm b/code/modules/mob/living/carbon/human/human_defense.dm index 7a39b9969fe..98a8c3b6eed 100644 --- a/code/modules/mob/living/carbon/human/human_defense.dm +++ b/code/modules/mob/living/carbon/human/human_defense.dm @@ -389,7 +389,7 @@ emp_act var/dam_zone = pick("chest", "l_hand", "r_hand", "l_leg", "r_leg") var/obj/item/organ/limb/affecting = get_organ(ran_zone(dam_zone)) var/armor = run_armor_check(affecting, "melee") - apply_damage(damage, BRUTE, affecting, armor) + apply_damage(damage, M.melee_damage_type, affecting, armor) updatehealth() diff --git a/code/modules/mob/living/carbon/monkey/emote.dm b/code/modules/mob/living/carbon/monkey/emote.dm index 42adb99ec59..b2b739109b2 100644 --- a/code/modules/mob/living/carbon/monkey/emote.dm +++ b/code/modules/mob/living/carbon/monkey/emote.dm @@ -1,4 +1,4 @@ -/mob/living/carbon/monkey/emote(act) +/mob/living/carbon/monkey/emote(act,m_type=1,message = null) var/param = null if (findtext(act, "-", 1, null)) @@ -6,10 +6,7 @@ param = copytext(act, t1 + 1, length(act) + 1) act = copytext(act, 1, t1) - var/muzzled = is_muzzled() - var/m_type = 1 - var/message switch(act) //Ooh ooh ah ah keep this alphabetical ooh ooh ah ah! if ("deathgasp","deathgasps") @@ -21,15 +18,19 @@ message = "[src] gnarls and shows its teeth.." m_type = 2 - if ("paw") - if (!src.restrained()) - message = "[src] flails its paw." - m_type = 1 + if ("me") + ..() + return if ("moan","moans") message = "[src] moans!" m_type = 2 + if ("paw") + if (!src.restrained()) + message = "[src] flails its paw." + m_type = 1 + if ("roar","roars") if (!muzzled) message = "[src] roars." @@ -67,7 +68,7 @@ src << "Help for monkey emotes. You can use these emotes with say \"*emote\":\n\naflap, airguitar, blink, blink_r, blush, bow-(none)/mob, burp, choke, chuckle, clap, collapse, cough, dance, deathgasp, drool, flap, frown, gasp, gnarl, giggle, glare-(none)/mob, grin, jump, laugh, look, me, moan, nod, paw, point-(atom), roar, roll, scream, scratch, screech, shake, shiver, sigh, sign-#, sit, smile, sneeze, sniff, snore, stare-(none)/mob, sulk, sway, tail, tremble, twitch, twitch_s, wave whimper, wink, yawn" else - ..(act) + ..() if ((message && src.stat == 0)) if(src.client) diff --git a/code/modules/mob/living/carbon/monkey/monkey.dm b/code/modules/mob/living/carbon/monkey/monkey.dm index 5f721ecb512..bd9a1af5f52 100644 --- a/code/modules/mob/living/carbon/monkey/monkey.dm +++ b/code/modules/mob/living/carbon/monkey/monkey.dm @@ -155,7 +155,19 @@ /mob/living/carbon/monkey/attack_animal(mob/living/simple_animal/M) if(..()) var/damage = rand(M.melee_damage_lower, M.melee_damage_upper) - adjustBruteLoss(damage) + switch(M.melee_damage_type) + if(BRUTE) + adjustBruteLoss(damage) + if(BURN) + adjustFireLoss(damage) + if(TOX) + adjustToxLoss(damage) + if(OXY) + adjustOxyLoss(damage) + if(CLONE) + adjustCloneLoss(damage) + if(STAMINA) + adjustStaminaLoss(damage) updatehealth() diff --git a/code/modules/mob/living/silicon/robot/robot.dm b/code/modules/mob/living/silicon/robot/robot.dm index f22de8919e0..f5a452c3ac3 100644 --- a/code/modules/mob/living/silicon/robot/robot.dm +++ b/code/modules/mob/living/silicon/robot/robot.dm @@ -862,9 +862,6 @@ var/turf/tile = loc if(isturf(tile)) tile.clean_blood() - if (istype(tile, /turf/simulated/floor)) - var/turf/simulated/floor/F = tile - F.dirt = 0 for(var/A in tile) if(istype(A, /obj/effect)) if(is_cleanable(A)) diff --git a/code/modules/mob/living/silicon/silicon.dm b/code/modules/mob/living/silicon/silicon.dm index 83b20b450cb..1a42c2e82f2 100644 --- a/code/modules/mob/living/silicon/silicon.dm +++ b/code/modules/mob/living/silicon/silicon.dm @@ -381,7 +381,19 @@ /mob/living/silicon/attack_animal(mob/living/simple_animal/M) if(..()) var/damage = rand(M.melee_damage_lower, M.melee_damage_upper) - adjustBruteLoss(damage) + switch(M.melee_damage_type) + if(BRUTE) + adjustBruteLoss(damage) + if(BURN) + adjustFireLoss(damage) + if(TOX) + adjustToxLoss(damage) + if(OXY) + adjustOxyLoss(damage) + if(CLONE) + adjustCloneLoss(damage) + if(STAMINA) + adjustStaminaLoss(damage) updatehealth() /mob/living/silicon/attack_paw(mob/living/user) diff --git a/code/modules/mob/living/simple_animal/bot_swarm/swarmer.dm b/code/modules/mob/living/simple_animal/bot_swarm/swarmer.dm new file mode 100644 index 00000000000..bbed56a6962 --- /dev/null +++ b/code/modules/mob/living/simple_animal/bot_swarm/swarmer.dm @@ -0,0 +1,513 @@ +////Deactivated swarmer shell//// +/obj/item/unactivated_swarmer + name = "unactivated swarmer" + desc = "A currently unactivated swarmer. Swarmers can self activate at any time, it would be wise to immediately dispose of this." + icon = 'icons/mob/swarmer.dmi' + icon_state = "swarmer_unactivated" + +/obj/item/unactivated_swarmer/attack_ghost(mob/user) + var/be_swarmer = alert("Become a swarmer? (Warning, You can no longer be cloned!)",,"Yes","No") + if(be_swarmer == "No" || qdeleted()) + return + var/mob/living/simple_animal/hostile/swarmer/S = new /mob/living/simple_animal/hostile/swarmer(get_turf(loc)) + S.key = user.key + qdel(src) + +////The Mob itself//// + +/mob/living/simple_animal/hostile/swarmer + name = "Swarmer" + unique_name = 1 + icon = 'icons/mob/swarmer.dmi' + desc = "A robot of unknown design, they seek only to consume materials and replicate themselves indefinitely." + speak_emote = list("tones") + health = 40 + maxHealth = 40 + status_flags = CANPUSH + icon_state = "swarmer" + icon_living = "swarmer" + icon_dead = "swarmer_unactivated" + icon_gib = null + wander = 0 + harm_intent_damage = 5 + minbodytemp = 0 + maxbodytemp = 500 + atmos_requirements = list("min_oxy" = 0, "max_oxy" = 0, "min_tox" = 0, "max_tox" = 0, "min_co2" = 0, "max_co2" = 0, "min_n2" = 0, "max_n2" = 0) + unsuitable_atmos_damage = 0 + melee_damage_lower = 15 + melee_damage_upper = 15 + melee_damage_type = STAMINA + ignored_damage_types = list(BRUTE = 0, BURN = 0, TOX = 1, CLONE = 1, STAMINA = 1, OXY = 1) + languages = SWARMER + environment_smash = 0 + attacktext = "shocks" + attack_sound = 'sound/effects/EMPulse.ogg' + friendly = "pinches" + speed = 0 + faction = list("swarmer") + AIStatus = AI_OFF + projectiletype = /obj/item/projectile/beam/disabler + pass_flags = PASSTABLE | PASSMOB + ventcrawler = 2 + ranged = 1 + projectiletype = /obj/item/projectile/beam/disabler + ranged_cooldown_cap = 2 + projectilesound = 'sound/weapons/taser2.ogg' + var/resources = 0 //Resource points, generated by consuming metal/glass + +/mob/living/simple_animal/hostile/swarmer/Login() + ..() + src << "You are a swarmer, a weapon of a long dead civilization. Until further orders from your original masters are received, you must continue to consume and replicate." + src << "Ctrl + Click provides most of your swarmer specific interactions, such as cannibalizing metal or glass, destroying the environment, or teleporting mobs away from you." + src << "Objectives:" + src << "1. Consume resources and replicate until there are no more resources left." + src << "2. Ensure that the station is fit for invasion at a later date, do not perform actions that would render it dangerous or inhospitable." + src << "3. Biological resources will be harvested at a later date, do not harm them." + +/mob/living/simple_animal/hostile/swarmer/New() + ..() + verbs -= /mob/living/verb/pulled + +/mob/living/simple_animal/hostile/swarmer/Stat() + ..() + if(statpanel("Status")) + stat("Resources:",resources) + +/mob/living/simple_animal/hostile/swarmer/death(gibbed) + ..(gibbed) + new /obj/effect/decal/cleanable/robot_debris(src.loc) + ghostize() + qdel(src) + +/mob/living/simple_animal/hostile/swarmer/emp_act() + if(health > 1) + health = 1 + ..() + health = 0 + +/mob/living/simple_animal/hostile/swarmer/CanPass(atom/movable/O) + if(istype(O, /obj/item/projectile/beam/disabler))//Allows for swarmers to fight as a group without wasting their shots hitting each other + return 1 + if(isswarmer(O)) + return 1 + ..() + +////CTRL CLICK FOR SWARMERS AND SWARMER_ACT()'S//// +/mob/living/simple_animal/hostile/swarmer/CtrlClickOn(atom/A) + face_atom(A) + if(!isturf(loc)) + return + if(next_move > world.time) + return + if(!A.Adjacent(src)) + return + A.swarmer_act(src) + return + +/atom/proc/swarmer_act(mob/living/simple_animal/hostile/swarmer/S) + S.DisIntegrate(src) + +/obj/item/swarmer_act(mob/living/simple_animal/hostile/swarmer/S) + S.Integrate(src) + +/obj/item/weapon/gun/swarmer_act()//Stops you from eating the entire armory + return + +/turf/simulated/floor/swarmer_act()//ex_act() on turf calls it on its contents, this is to prevent attacking mobs by DisIntegrate()'ing the floor + return + +/obj/machinery/atmospherics/swarmer_act() + return + +/obj/structure/disposalpipe/swarmer_act() + return + +/obj/machinery/swarmer_act(mob/living/simple_animal/hostile/swarmer/S) + S.DismantleMachine(src) + +/obj/machinery/light/swarmer_act(mob/living/simple_animal/hostile/swarmer/S) + S.DisIntegrate(src) + +/obj/machinery/door/swarmer_act(mob/living/simple_animal/hostile/swarmer/S) + S.DisIntegrate(src) + +/obj/machinery/camera/swarmer_act(mob/living/simple_animal/hostile/swarmer/S) + S.DisIntegrate(src) + deactivate(S, 0) + +/obj/machinery/particle_accelerator/control_box/swarmer_act(mob/living/simple_animal/hostile/swarmer/S) + S.DisIntegrate(src) + +/obj/machinery/field/generator/swarmer_act(mob/living/simple_animal/hostile/swarmer/S) + S.DisIntegrate(src) + +/obj/machinery/gravity_generator/swarmer_act(mob/living/simple_animal/hostile/swarmer/S) + S.DisIntegrate(src) + +/obj/machinery/vending/swarmer_act(mob/living/simple_animal/hostile/swarmer/S)//It's more visually interesting than dismantling the machine + S.DisIntegrate(src) + +/obj/machinery/turretid/swarmer_act(mob/living/simple_animal/hostile/swarmer/S) + S.DisIntegrate(src) + +/obj/machinery/chem_dispenser/swarmer_act(mob/living/simple_animal/hostile/swarmer/S) + S << "The volatile chemicals in this machine would destroy us. Aborting." + +/obj/machinery/nuclearbomb/swarmer_act(mob/living/simple_animal/hostile/swarmer/S) + S << "This device's destruction would result in the extermination of everything in the area. Aborting." + +/obj/structure/reagent_dispensers/fueltank/swarmer_act(mob/living/simple_animal/hostile/swarmer/S) + S << "Destroying this object would cause a chain reaction. Aborting." + +/obj/structure/cable/swarmer_act(mob/living/simple_animal/hostile/swarmer/S) + S << "Disrupting the power grid would bring no benefit to us. Aborting." + +/obj/machinery/portable_atmospherics/canister/swarmer_act(mob/living/simple_animal/hostile/swarmer/S) + S << "An inhospitable area may be created as a result of destroying this object. Aborting." + +/obj/machinery/power/swarmer_act(mob/living/simple_animal/hostile/swarmer/S) + S << "Disrupting the power grid would bring no benefit to us. Aborting." + +/obj/machinery/gateway/swarmer_act(mob/living/simple_animal/hostile/swarmer/S) + S << "This bluespace source will be important to us later. Aborting." + +/turf/simulated/wall/swarmer_act(mob/living/simple_animal/hostile/swarmer/S) + if(locate(/turf/space) in range(1, src)) + S << "Destroying this object has the potential to cause a hull breach. Aborting." + return + ..() + +/obj/structure/window/swarmer_act(mob/living/simple_animal/hostile/swarmer/S) + if(locate(/turf/space) in range(1, src)) + S << "Destroying this object has the potential to cause a hull breach. Aborting." + return + ..() + +/obj/item/stack/cable_coil/swarmer_act(mob/living/simple_animal/hostile/swarmer/S)//Wiring would be too effective as a resource + S << "This object does not contain enough materials to work with." + +/obj/machinery/porta_turret/swarmer_act(mob/living/simple_animal/hostile/swarmer/S) + S << "Attempting to dismantle this machine would result in an immediate counterattack. Aborting." + +/mob/living/swarmer_act(mob/living/simple_animal/hostile/swarmer/S) + S.DisperseTarget(src) + +/mob/living/simple_animal/slime/swarmer_act(mob/living/simple_animal/hostile/swarmer/S) + S << "This biological resource is somehow resisting our bluespace transceiver. Aborting." + + +////END CTRL CLICK FOR SWARMERS//// + +/mob/living/simple_animal/hostile/swarmer/proc/Fabricate(var/atom/fabrication_object,var/fabrication_cost = 0) + if(!isturf(loc)) + src << "This is not a suitable location for fabrication. We need more space." + if(resources >= fabrication_cost) + resources -= fabrication_cost + else + src << "You do not have the necessary resources to fabricate this object." + return 0 + new fabrication_object(loc) + return 1 + +/mob/living/simple_animal/hostile/swarmer/proc/Integrate(var/obj/item/target) + if(resources >= 100) + src << "We cannot hold more materials!" + return + if((target.materials[MAT_METAL]) || (target.materials[MAT_GLASS])) + resources++ + do_attack_animation(target) + changeNext_move(CLICK_CD_MELEE) + if(istype(target, /obj/item/stack)) + var/obj/item/stack/S = target + S.use(1) + if(S.amount) + return + qdel(target) + else + src << "\the [target] is incompatible with our internal matter recycler." + return + +/mob/living/simple_animal/hostile/swarmer/proc/DisIntegrate(var/atom/movable/target) + new /obj/effect/effect/sparks(get_turf(target)) + do_attack_animation(target) + changeNext_move(CLICK_CD_MELEE) + target.ex_act(3) + return + +/mob/living/simple_animal/hostile/swarmer/proc/DisperseTarget(var/mob/living/target) + if(target != src) + src << "Attempting to remove this being from our presence." + if(src.z != ZLEVEL_STATION) + src << "Our bluespace transceiver cannot locate a viable bluespace link, our teleportation abilities are useless in this area." + return + if(do_mob(src, target, 30)) + var/cycle + for(cycle=0,cycle<100,cycle++) + var/random_location = locate(rand(37,202),rand(75,192),ZLEVEL_STATION)//Drunk dial a turf in the general ballpark of the station + if(istype(random_location, /turf/simulated/floor)) + var/turf/simulated/floor/F = random_location + if(F.air) + var/datum/gas_mixture/A = F.air + if(A.oxygen >= 16 && !A.toxins && A.carbon_dioxide < 10 && !A.trace_gases.len)//Can most things breathe in this location? + if((A.temperature > 270) && (A.temperature < 360))//Not too hot, not too cold + var/pressure = A.return_pressure() + if((pressure > 20) && (pressure < 550))//Account for crushing pressure or vaccuums + if(ishuman(target))//If we're getting rid of a human, slap some zipties on them to keep them away from us a little longer + var/obj/item/weapon/restraints/handcuffs/cable/zipties/Z = new /obj/item/weapon/restraints/handcuffs/cable/zipties(src) + var/mob/living/carbon/human/H = target + Z.apply_cuffs(H, src) + do_teleport(target, F, 0) + playsound(src,'sound/effects/sparks4.ogg',50,1) + break + return + +/mob/living/simple_animal/hostile/swarmer/proc/DismantleMachine(var/obj/machinery/target) + do_attack_animation(target) + src << "We begin to dismantle this machine. We will need to be uninterrupted." + new /obj/effect/effect/sparks(get_turf(target)) + if(do_mob(src, target, 100)) + src << "Dismantling complete." + var/obj/item/stack/sheet/metal/M = new /obj/item/stack/sheet/metal(target.loc) + M.amount = 5 + for(var/obj/item/I in target.component_parts) + I.loc = M.loc + new /obj/effect/effect/sparks(get_turf(target)) + target.dropContents() + if(istype(target, /obj/machinery/computer)) + var/obj/machinery/computer/C = target + if(C.circuit) + C.circuit.loc = M.loc + qdel(target) + +/obj/effect/swarmer //Default destroyable object for swarmer constructions + name = "swarmer construction" + desc = "Debug swarmer item, this shouldn't be here. Yell at a coder." + gender = NEUTER + icon = 'icons/mob/swarmer.dmi' + icon_state = "ui_light" + luminosity = 1 + var/health = 30 + +/obj/effect/swarmer/proc/TakeDamage(damage) + health -= damage + if(health <= 0) + qdel(src) + +/obj/effect/swarmer/bullet_act(obj/item/projectile/Proj) + if(Proj.damage) + if((Proj.damage_type == BRUTE || Proj.damage_type == BURN)) + TakeDamage(Proj.damage) + ..() + +/obj/effect/swarmer/attackby(obj/item/weapon/I, mob/living/user, params) + if(istype(I, /obj/item/weapon)) + user.changeNext_move(CLICK_CD_MELEE) + user.do_attack_animation(src) + TakeDamage(I.force) + return + +/obj/effect/swarmer/ex_act() + qdel(src) + return + +/obj/effect/swarmer/blob_act() + qdel(src) + return + +/obj/effect/swarmer/attack_animal(mob/living/user) + if(isanimal(user)) + var/mob/living/simple_animal/S = user + S.do_attack_animation(src) + user.changeNext_move(CLICK_CD_MELEE) + if(S.melee_damage_type == BRUTE || S.melee_damage_type == BURN) + TakeDamage(rand(S.melee_damage_lower, S.melee_damage_upper)) + return + +/mob/living/simple_animal/hostile/swarmer/proc/CreateTrap() + set name = "Create trap" + set category = "Swarmer" + set desc = "Creates a simple trap that will non-lethally electrocute anything that steps on it. Costs 5 resources" + if(/obj/effect/swarmer/trap in loc) + src << "There is already a trap here. Aborting." + return + Fabricate(/obj/effect/swarmer/trap, 5) + return + +/obj/effect/swarmer/trap + name = "swarmer trap" + desc = "A quickly assembled electric trap. Will not retain its form if damaged enough." + icon_state = "trap" + luminosity = 1 + health = 10 + +/obj/effect/swarmer/trap/Crossed(var/atom/movable/AM) + if(isliving(AM)) + var/mob/living/L = AM + if(!istype(L, /mob/living/simple_animal/hostile/swarmer)) + L.electrocute_act(0, src, 1, 1) + qdel(src) + ..() + +/mob/living/simple_animal/hostile/swarmer/proc/CreateBarricade() + set name = "Create barricade" + set category = "Swarmer" + set desc = "Creates a barricade that will stop anything but swarmers and disabler beams from passing through." + if(/obj/effect/swarmer/blockade in loc) + src << "There is already a blockade here. Aborting." + return + Fabricate(/obj/effect/swarmer/blockade, 5) + return + +/obj/effect/swarmer/blockade + name = "swarmer blockade" + desc = "A quickly assembled energy blockade. Will not retain its form if damaged enough, but disabler beams and swarmers pass right through." + icon_state = "barricade" + luminosity = 1 + health = 50 + density = 1 + anchored = 1 + +/obj/effect/swarmer/blockade/CanPass(atom/movable/O) + if(isswarmer(O)) + return 1 + if(istype(O, /obj/item/projectile/beam/disabler)) + return 1 + +/mob/living/simple_animal/hostile/swarmer/proc/CreateSwarmer() + set name = "Replicate" + set category = "Swarmer" + set desc = "Creates a shell for a new swarmer. Swarmers will self activate." + src << "We are attempting to replicate ourselves. We will need to stand still until the process is complete." + if(resources < 50) + src << "We do not have the resources for this!" + return + if(!isturf(loc)) + src << "This is not a suitable location for replicating ourselves. We need more room." + return + if(do_mob(src, src, 100)) + if(Fabricate(/obj/item/unactivated_swarmer, 50)) + playsound(loc,'sound/items/poster_being_created.ogg',50, 1, -1) + +/mob/living/simple_animal/hostile/swarmer/proc/RepairSelf() + set name = "Self Repair" + set category = "Swarmer" + set desc = "Attempts to repair damage to our body. You will have to remain motionless until repairs are complete." + if(!isturf(loc)) + return + src << "Attempting to repair damage to our body, stand by..." + if(do_mob(src, src, 100)) + adjustBruteLoss(-100) + src << "We successfully repaired ourselves." + +/mob/living/simple_animal/hostile/swarmer/proc/ToggleLight() + if(!luminosity) + SetLuminosity(3) + else + SetLuminosity(0) + +/mob/living/simple_animal/hostile/swarmer/proc/ContactSwarmers() + var/message = input(src, "Announce to other swarmers", "Swarmer contact") + if(message) + for(var/mob/M in mob_list) + if(isswarmer(M) || (M in dead_mob_list)) + M << "Swarm communication - [M] states: [message]" + + + +////HUD NONSENSE//// +/obj/screen/swarmer + icon = 'icons/mob/swarmer.dmi' + +/obj/screen/swarmer/FabricateTrap + icon_state = "ui_trap" + name = "Create trap" + desc = "Creates a trap that will nonlethally shock any non-swarmer that attempts to cross it. (Costs 5 resources)" + +/obj/screen/swarmer/FabricateTrap/Click() + if(isswarmer(usr)) + var/mob/living/simple_animal/hostile/swarmer/S = usr + S.CreateTrap() + +/obj/screen/swarmer/Barricade + icon_state = "ui_barricade" + name = "Create barricade" + desc = "Creates a destructible barricade that will stop any non swarmer from passing it. Also allows disabler beams to pass through. (Costs 5 resources)" + +/obj/screen/swarmer/Barricade/Click() + if(isswarmer(usr)) + var/mob/living/simple_animal/hostile/swarmer/S = usr + S.CreateBarricade() + +/obj/screen/swarmer/Replicate + icon_state = "ui_replicate" + name = "Replicate" + desc = "Creates a another of our kind. (Costs 50 resources)" + +/obj/screen/swarmer/Replicate/Click() + if(isswarmer(usr)) + var/mob/living/simple_animal/hostile/swarmer/S = usr + S.CreateSwarmer() + +/obj/screen/swarmer/RepairSelf + icon_state = "ui_self_repair" + name = "Repair self" + desc = "Repairs damage to our body." + +/obj/screen/swarmer/RepairSelf/Click() + if(isswarmer(usr)) + var/mob/living/simple_animal/hostile/swarmer/S = usr + S.RepairSelf() + +/obj/screen/swarmer/ToggleLight + icon_state = "ui_light" + name = "Toggle light" + desc = "Toggles our inbuilt light on or off." + +/obj/screen/swarmer/ToggleLight/Click() + if(isswarmer(usr)) + var/mob/living/simple_animal/hostile/swarmer/S = usr + S.ToggleLight() + +/obj/screen/swarmer/ContactSwarmers + icon_state = "ui_contact_swarmers" + name = "Contact swarmers" + desc = "Sends a message to all other swarmers, should they exist." + +/obj/screen/swarmer/ContactSwarmers/Click() + if(isswarmer(usr)) + var/mob/living/simple_animal/hostile/swarmer/S = usr + S.ContactSwarmers() + +/datum/hud/proc/swarmer_hud(ui_style = 'icons/mob/screen_midnight.dmi') + adding = list() + + var/obj/screen/using + + using = new /obj/screen/swarmer/FabricateTrap() + using.screen_loc = ui_rhand + adding += using + + using = new /obj/screen/swarmer/Barricade() + using.screen_loc = ui_lhand + adding += using + + using = new /obj/screen/swarmer/Replicate() + using.screen_loc = ui_zonesel + adding += using + + using = new /obj/screen/swarmer/RepairSelf() + using.screen_loc = ui_storage1 + adding += using + + using = new /obj/screen/swarmer/ToggleLight() + using.screen_loc = ui_back + adding += using + + using = new /obj/screen/swarmer/ContactSwarmers() + using.screen_loc = ui_inventory + adding += using + + mymob.client.screen = list() + mymob.client.screen += mymob.client.void + mymob.client.screen += adding + diff --git a/code/modules/mob/living/simple_animal/hostile/mining_mobs.dm b/code/modules/mob/living/simple_animal/hostile/mining_mobs.dm index d06cd0672c7..052dc76c46a 100644 --- a/code/modules/mob/living/simple_animal/hostile/mining_mobs.dm +++ b/code/modules/mob/living/simple_animal/hostile/mining_mobs.dm @@ -602,7 +602,7 @@ /obj/item/asteroid/fugu_gland/afterattack(atom/target, mob/user, proximity_flag) if(proximity_flag && istype(target, /mob/living/simple_animal)) var/mob/living/simple_animal/A = target - if(A.buffed || A.type in banned_mobs || A.stat) + if(A.buffed || (A.type in banned_mobs) || A.stat) user << "Something's interfering with the [src]'s effects. It's no use." return A.buffed++ diff --git a/code/modules/mob/living/simple_animal/simple_animal.dm b/code/modules/mob/living/simple_animal/simple_animal.dm index f3910d8af2d..f41c7847b90 100644 --- a/code/modules/mob/living/simple_animal/simple_animal.dm +++ b/code/modules/mob/living/simple_animal/simple_animal.dm @@ -41,6 +41,8 @@ //LETTING SIMPLE ANIMALS ATTACK? WHAT COULD GO WRONG. Defaults to zero so Ian can still be cuddly var/melee_damage_lower = 0 var/melee_damage_upper = 0 + var/melee_damage_type = BRUTE //Damage type of a simple mob's melee attack, should it do damage. + var/list/ignored_damage_types = list(BRUTE = 0, BURN = 0, TOX = 0, CLONE = 0, STAMINA = 1, OXY = 0) //Set 0 to receive that damage type, 1 to ignore var/attacktext = "attacks" var/attack_sound = null var/friendly = "nuzzles" //If the mob does no damage with it's attack @@ -253,7 +255,7 @@ /mob/living/simple_animal/attack_animal(mob/living/simple_animal/M) if(..()) var/damage = rand(M.melee_damage_lower, M.melee_damage_upper) - attack_threshold_check(damage) + attack_threshold_check(damage,M.melee_damage_type) return 1 /mob/living/simple_animal/bullet_act(obj/item/projectile/Proj) @@ -263,8 +265,21 @@ Proj.on_hit(src) return 0 +/mob/living/simple_animal/adjustBruteLoss(amount) + if(!ignored_damage_types[BRUTE]) + ..() + /mob/living/simple_animal/adjustFireLoss(amount) - adjustBruteLoss(amount) + if(!ignored_damage_types[BURN]) + adjustBruteLoss(amount) + +/mob/living/simple_animal/adjustToxLoss(amount) + if(!ignored_damage_types[TOX]) + ..(amount) + +/mob/living/simple_animal/adjustCloneLoss(amount) + if(!ignored_damage_types[CLONE]) + ..(amount) /mob/living/simple_animal/adjustStaminaLoss(amount) return @@ -334,8 +349,8 @@ attack_threshold_check(damage) return 1 -/mob/living/simple_animal/proc/attack_threshold_check(damage) - if(damage <= force_threshold) +/mob/living/simple_animal/proc/attack_threshold_check(damage, damagetype = BRUTE) + if(damage <= force_threshold || ignored_damage_types[damagetype]) visible_message("[src] looks unharmed.") else adjustBruteLoss(damage) diff --git a/code/modules/mob/mob_helpers.dm b/code/modules/mob/mob_helpers.dm index 857b7f35181..c53fa9b1d3a 100644 --- a/code/modules/mob/mob_helpers.dm +++ b/code/modules/mob/mob_helpers.dm @@ -125,6 +125,11 @@ return 1 return 0 +/proc/isswarmer(A) + if(istype(A, /mob/living/simple_animal/hostile/swarmer)) + return 1 + return 0 + /proc/islimb(A) if(istype(A, /obj/item/organ/limb)) return 1 diff --git a/code/modules/power/cable.dm b/code/modules/power/cable.dm index 4e380448a3f..02c9e1adfca 100644 --- a/code/modules/power/cable.dm +++ b/code/modules/power/cable.dm @@ -432,12 +432,15 @@ By design, d1 is the smallest direction and d2 is the highest P.disconnect_from_network() //remove from current network (and delete powernet) return + var/obj/O = P_list[1] // remove the cut cable from its turf and powernet, so that it doesn't get count in propagate_network worklist loc = null powernet.remove_cable(src) //remove the cut cable from its powernet - var/datum/powernet/newPN = new()// creates a new powernet... - propagate_network(P_list[1], newPN)//... and propagates it to the other side of the cable + spawn(0) //so we don't rebuild the network X times when singulo/explosion destroys a line of X cables + if(O && !qdeleted(O)) + var/datum/powernet/newPN = new()// creates a new powernet... + propagate_network(O, newPN)//... and propagates it to the other side of the cable // Disconnect machines connected to nodes if(d1 == 0) // if we cut a node (O-X) cable diff --git a/code/modules/reagents/Chemistry-Reagents/Medicine-Reagents.dm b/code/modules/reagents/Chemistry-Reagents/Medicine-Reagents.dm index a8999d8ddac..14213840918 100644 --- a/code/modules/reagents/Chemistry-Reagents/Medicine-Reagents.dm +++ b/code/modules/reagents/Chemistry-Reagents/Medicine-Reagents.dm @@ -173,13 +173,36 @@ if(method == INGEST) M.adjustToxLoss(0.5*reac_volume) if(show_message) - M << "You probably shouldn't have eaten that. Maybe you should of splashed it on, or applied a patch?" + M << "You probably shouldn't have eaten that. Maybe you should have splashed it on, or applied a patch?" ..() /datum/reagent/medicine/silver_sulfadiazine/on_mob_life(mob/living/M) M.adjustFireLoss(-2*REM) ..() +/datum/reagent/medicine/oxandrolone + name = "Oxandrolone" + id = "oxandrolone" + description = "Stimulates healing of severe burns. If you have more than 50 burn damage, it heals 2 units; otherwise, 0.5. If overdosed it will exacerbate existing burns, causing burn and brute damage." + reagent_state = LIQUID + color = "#f7ffa5" + metabolization_rate = 0.5 * REAGENTS_METABOLISM + overdose_threshold = 25 + +/datum/reagent/medicine/oxandrolone/on_mob_life(mob/living/M) + if(M.getFireLoss() > 50) + M.adjustFireLoss(-2*REM) + else + M.adjustFireLoss(-0.5*REM) + ..() + return + +/datum/reagent/medicine/oxandrolone/overdose_process(mob/living/M) + M.adjustFireLoss(2.5*REM) // it's going to be healing either 2 or 0.5 + M.adjustBruteLoss(0.5*REM) + ..() + return + /datum/reagent/medicine/styptic_powder name = "Styptic Powder" id = "styptic_powder" diff --git a/code/modules/reagents/Chemistry-Reagents/Other-Reagents.dm b/code/modules/reagents/Chemistry-Reagents/Other-Reagents.dm index 76ce0b07ebe..fe2c2bdb8c0 100644 --- a/code/modules/reagents/Chemistry-Reagents/Other-Reagents.dm +++ b/code/modules/reagents/Chemistry-Reagents/Other-Reagents.dm @@ -646,10 +646,6 @@ for(var/mob/living/simple_animal/slime/M in T) M.adjustToxLoss(rand(5,10)) - if(istype(T, /turf/simulated/floor)) - var/turf/simulated/floor/F = T - if(reac_volume >= 1) - F.dirt = 0 /datum/reagent/space_cleaner/reaction_mob(mob/M, method=TOUCH, reac_volume) if(method == TOUCH || VAPOR) diff --git a/code/modules/reagents/Chemistry-Recipes/Medicine.dm b/code/modules/reagents/Chemistry-Recipes/Medicine.dm index 60e80923400..3ccc5753cc2 100644 --- a/code/modules/reagents/Chemistry-Recipes/Medicine.dm +++ b/code/modules/reagents/Chemistry-Recipes/Medicine.dm @@ -116,6 +116,12 @@ required_reagents = list("sodium" = 1, "phenol" = 1, "carbon" = 1, "oxygen" = 1, "sacid" = 1) result_amount = 5 +/datum/chemical_reaction/oxandrolone + name = "Oxandrolone" + id = "oxandrolone" + result = "oxandrolone" + required_reagents = list("carbon" = 3, "phenol" = 1, "hydrogen" = 1, "oxygen" = 1) + result_amount = 6 /datum/chemical_reaction/salbutamol name = "Salbutamol" diff --git a/code/modules/reagents/reagent_containers/pill.dm b/code/modules/reagents/reagent_containers/pill.dm index 2a99e768c75..94ece6ee2c0 100644 --- a/code/modules/reagents/reagent_containers/pill.dm +++ b/code/modules/reagents/reagent_containers/pill.dm @@ -133,6 +133,12 @@ icon_state = "pill5" list_reagents = list("sal_acid" = 24) roundstart = 1 +/obj/item/weapon/reagent_containers/pill/oxandrolone + name = "oxandrolone pill" + desc = "Used to stimulate burn healing." + icon_state = "pill5" + list_reagents = list("oxandrolone" = 24) + roundstart = 1 /obj/item/weapon/reagent_containers/pill/insulin name = "insulin pill" diff --git a/code/modules/research/experimentor.dm b/code/modules/research/experimentor.dm index e57a3762319..acb72b88205 100644 --- a/code/modules/research/experimentor.dm +++ b/code/modules/research/experimentor.dm @@ -703,7 +703,8 @@ R.realProc = realProc R.revealed = TRUE dupes |= R - R.throw_at(pick(oview(7,get_turf(src))),10,1) + spawn() + R.throw_at(pick(oview(7,get_turf(src))),10,1) counter = 0 spawn(rand(10,100)) for(counter = 1; counter <= dupes.len; counter++) diff --git a/html/changelog.html b/html/changelog.html index 74b09bfbaa3..821377b3ad1 100644 --- a/html/changelog.html +++ b/html/changelog.html @@ -55,6 +55,13 @@ -->
+

28 August 2015

+

bgobandit updated:

+
    +
  • Overheard at CentComm: 'This burn kit said salicyclic acid would heal my burns! WHO MADE THIS SHIT?' A muffled honking is heard in the background. (Burn first-aid kits now contain an appropriate burn pill.)
  • +
  • Oxandrolone, a new burn healing medication, has been added to burn first-aid kits and to chemistry. Ingesting 25 units or more causes burn and brute damage.
  • +
+

19 August 2015

Joan updated: