diff --git a/code/datums/supplypacks/engineering_vr.dm b/code/datums/supplypacks/engineering_vr.dm index 321269a2eac..72b0073371e 100644 --- a/code/datums/supplypacks/engineering_vr.dm +++ b/code/datums/supplypacks/engineering_vr.dm @@ -17,4 +17,11 @@ name = "Algae Sheets (10)" cost = 20 containertype = /obj/structure/closet/crate - containername = "algae sheets crate" \ No newline at end of file + containername = "algae sheets crate" + +/datum/supply_packs/eng/engine/tesla_gen + name = "Tesla Generator crate" + contains = list(/obj/machinery/the_singularitygen/tesla) + containertype = /obj/structure/closet/crate/secure/engineering + containername = "Tesla Generator crate" + access = access_ce diff --git a/code/game/machinery/pipe/_pipe_datum.dm b/code/game/machinery/pipe/_pipe_datum.dm new file mode 100644 index 00000000000..ec207702aeb --- /dev/null +++ b/code/game/machinery/pipe/_pipe_datum.dm @@ -0,0 +1,117 @@ + +/obj/machinery/atmospherics/pipe + var/datum/pipe_construction/construction_type // The PATH of the construction method to use + +// +// Datum that describes and regulates how pipes are constructed! +// +/datum/pipe_construction + +/** Normalize the dir of the pipe fitting to ensure its sane for construction. */ +/datum/pipe_construction/proc/normalize_dir() + return + +/** Calulate in which directions directions the constructed pipe will be able to connect. */ +/datum/pipe_construction/proc/calculate_initialize_directions() + return + +/** Check if we can actually construct in the given location. */ +/datum/pipe_construction/proc/can_construct(var/turf/T) + return + +/** Actually construct the pipe! Return TRUE on failure. */ +/datum/pipe_construction/proc/construct(var/turf/T, var/obj/item/pipe/fitting, var/construct_type) + return + +// For constructing pipe segments with two nodes +/datum/pipe_construction/pipe/simple/binary/construct(var/mob/user, var/turf/T, var/obj/item/pipe/fitting, var/construct_type) + var/obj/machinery/atmospherics/pipe/simple/P = new construct_type(T) + P.pipe_color = fitting.color + P.set_dir(fitting.dir) + P.init_dir() + P.level = !T.is_plating() ? 2 : 1 // Standard to decide if we are making hidden or not + P.atmos_init() + if (QDELETED(P)) // Should do this for legacy reasons, but hopefully will never happen + usr << pipefailtext + return 1 + P.build_network() + if (P.node1) + P.node1.atmos_init() + P.node1.build_network() + if (P.node2) + P.node2.atmos_init() + P.node2.build_network() + return + +/datum/pipe_construction/pipe/simple/trinary/construct(var/mob/user, var/turf/T, var/obj/item/pipe/fitting, var/construct_type) + var/obj/machinery/atmospherics/pipe/manifold/M = new( src.loc ) + M.pipe_color = fitting.color + M.set_dir(fitting.dir) + M.init_dir() + M.level = !T.is_plating() ? 2 : 1 + M.atmos_init() + if (QDELETED(M)) + usr << pipefailtext + return 1 + M.build_network() + if (M.node1) + M.node1.atmos_init() + M.node1.build_network() + if (M.node2) + M.node2.atmos_init() + M.node2.build_network() + if (M.node3) + M.node3.atmos_init() + M.node3.build_network() + return + + + + + + + + + + + + + + + + + + + +// For constructing pipe segments with two nodes +/datum/pipe_construction/pipe/simple/binary/he/construct(var/mob/user, var/turf/T, var/obj/item/pipe/fitting, var/construct_type) + var/obj/machinery/atmospherics/pipe/simple/heat_exchanging/P = new construct_type(T) + P.set_dir(fitting.dir) + P.init_dir() + P.atmos_init() + if (QDELETED(P)) // Should do this for legacy reasons, but hopefully will never happen + usr << pipefailtext + return 1 + P.build_network() + if (P.node1) + P.node1.atmos_init() + P.node1.build_network() + if (P.node2) + P.node2.atmos_init() + P.node2.build_network() + return + + +/datum/pipe_construction/pipe/component/unary/construct(var/mob/user, var/turf/T, var/obj/item/pipe/fitting, var/construct_type) + var/obj/machinery/atmospherics/C = new construct_type(T) + C.set_dir(fitting.dir) + C.init_dir() + if(fitting.pipename) + C.name = fitting.pipename + C.level = !T.is_plating() ? 2 : 1 // Standard to decide if we are making hidden or not + C.atmos_init() + P.build_network() + if (P.node) + P.node.atmos_init() + P.node.build_network() + return diff --git a/code/modules/power/tesla/energy_ball.dm b/code/modules/power/tesla/energy_ball.dm index 9b89e35b77e..795aeb8c94b 100644 --- a/code/modules/power/tesla/energy_ball.dm +++ b/code/modules/power/tesla/energy_ball.dm @@ -61,7 +61,7 @@ playsound(src.loc, 'sound/effects/lightningbolt.ogg', 100, 1, extrarange = 30) - set_dir(tesla_zap(src.loc, 7, TESLA_DEFAULT_POWER, TRUE)) + set_dir(tesla_zap(src, 7, TESLA_DEFAULT_POWER, TRUE)) for (var/ball in orbiting_balls) var/range = rand(1, Clamp(orbiting_balls.len, 3, 7)) @@ -265,11 +265,14 @@ //Alright, we've done our loop, now lets see if was anything interesting in range if(closest_atom) //common stuff - source.Beam(closest_atom, icon_state="lightning[rand(1,12)]", time=5, maxdistance = INFINITY) + var/atom/srcLoc = get_turf(source) // VOREStation Edit - Makes beams look nicer + srcLoc.Beam(closest_atom, icon_state="lightning[rand(1,12)]", time=5, maxdistance = INFINITY) // VOREStation Edit - Makes beams look nicer var/zapdir = get_dir(source, closest_atom) if(zapdir) . = zapdir + var/drain_energy = FALSE // VOREStation Edit - Safety First! Drain Tesla fast when its loose + //per type stuff: if(closest_tesla_coil) closest_tesla_coil.tesla_act(power, explosive, stun_mobs) @@ -289,10 +292,20 @@ tesla_zap(closest_mob, 5, power / 1.5, explosive, stun_mobs) else if(closest_machine) + drain_energy = TRUE // VOREStation Edit - Safety First! Drain Tesla fast when its loose closest_machine.tesla_act(power, explosive, stun_mobs) else if(closest_blob) + drain_energy = TRUE // VOREStation Edit - Safety First! Drain Tesla fast when its loose closest_blob.tesla_act(power, explosive, stun_mobs) else if(closest_structure) + drain_energy = TRUE // VOREStation Edit - Safety First! Drain Tesla fast when its loose closest_structure.tesla_act(power, explosive, stun_mobs) + + // VOREStation Edit Start - Safety First! Drain Tesla fast when its loose + if(drain_energy && istype(source, /obj/singularity/energy_ball)) + var/obj/singularity/energy_ball/EB = source + if (EB.energy > 0) + EB.energy -= min(EB.energy, max(10, round(EB.energy * 0.05))) + // VOREStation Edit End diff --git a/code/modules/power/tesla/tesla_act.dm b/code/modules/power/tesla/tesla_act.dm index 8e3f1c69969..41a86d188e0 100644 --- a/code/modules/power/tesla/tesla_act.dm +++ b/code/modules/power/tesla/tesla_act.dm @@ -30,7 +30,7 @@ /obj/machinery/tesla_act(power, explosive = FALSE) ..() if(prob(85) && explosive) - explosion(loc, 1, 2, 4, /*flame_range = 2,*/ adminlog = FALSE/*, smoke = FALSE*/) + explosion(loc, 0, 2, 4, /*flame_range = 2,*/ adminlog = FALSE/*, smoke = FALSE*/) // VOREStation Edit - No devastation range else if(prob(50)) emp_act(2) else