mirror of
https://github.com/VOREStation/VOREStation.git
synced 2026-07-20 03:26:37 +01:00
Explosion subsystem (#17499)
* Initial port * pause air * decoupled input from processing * explosion condition tweak * closer to original recursive code * accurate explosions * better defer calls * glob fix * fix * DON'T DO THAT * initial deferral code * small explosions ignored * lower thresholds * better thresholds again * forbid powernet defer during init, explosions too * don't block your own network regen * use procs * better thresholds, always defer at least * admin notice * subsytem updated * Allow removal from networks * defer till rebuild * dir * Update breaker_box.dm * no init means no init * then flag it... --------- Co-authored-by: Selis <12716288+ItsSelis@users.noreply.github.com> Co-authored-by: C.L. <killer65311@gmail.com> Co-authored-by: Kashargul <144968721+Kashargul@users.noreply.github.com>
This commit is contained in:
@@ -26,7 +26,7 @@
|
||||
for(var/obj/structure/cable/C in src.loc)
|
||||
qdel(C)
|
||||
. = ..()
|
||||
for(var/datum/tgui_module/rcon/R in world)
|
||||
for(var/datum/tgui_module/rcon/R in SStgui.all_uis)
|
||||
R.FindDevices()
|
||||
|
||||
/obj/machinery/power/breakerbox/Initialize(mapload)
|
||||
|
||||
@@ -281,6 +281,7 @@ GLOBAL_LIST_INIT(possible_cable_coil_colours, list(
|
||||
//handles merging diagonally matching cables
|
||||
//for info : direction^3 is flipping horizontally, direction^12 is flipping vertically
|
||||
/obj/structure/cable/proc/mergeDiagonalsNetworks(var/direction)
|
||||
if(SSmachines.powernet_is_defered()) return;
|
||||
|
||||
//search for and merge diagonally matching cables from the first direction component (north/south)
|
||||
var/turf/T = get_step(src, direction&3)//go north/south
|
||||
@@ -325,6 +326,7 @@ GLOBAL_LIST_INIT(possible_cable_coil_colours, list(
|
||||
|
||||
// merge with the powernets of power objects in the given direction
|
||||
/obj/structure/cable/proc/mergeConnectedNetworks(var/direction)
|
||||
if(SSmachines.powernet_is_defered()) return;
|
||||
|
||||
var/fdir = direction ? GLOB.reverse_dir[direction] : 0 //flip the direction, to match with the source position on its turf
|
||||
|
||||
@@ -353,6 +355,8 @@ GLOBAL_LIST_INIT(possible_cable_coil_colours, list(
|
||||
|
||||
// merge with the powernets of power objects in the source turf
|
||||
/obj/structure/cable/proc/mergeConnectedNetworksOnTurf()
|
||||
if(SSmachines.powernet_is_defered()) return;
|
||||
|
||||
var/list/to_connect = list()
|
||||
|
||||
if(!powernet) //if we somehow have no powernet, make one (should not happen for cables)
|
||||
@@ -441,6 +445,8 @@ GLOBAL_LIST_INIT(possible_cable_coil_colours, list(
|
||||
//should be called after placing a cable which extends another cable, creating a "smooth" cable that no longer terminates in the centre of a turf.
|
||||
//needed as this can, unlike other placements, disconnect cables
|
||||
/obj/structure/cable/proc/denode()
|
||||
if(SSmachines.powernet_is_defered()) return;
|
||||
|
||||
var/turf/T1 = loc
|
||||
if(!T1) return
|
||||
|
||||
@@ -476,8 +482,9 @@ GLOBAL_LIST_INIT(possible_cable_coil_colours, list(
|
||||
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
|
||||
if(!SSmachines.powernet_is_defered()) // Deferring until rebuild
|
||||
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
|
||||
|
||||
// Disconnect machines connected to nodes
|
||||
if(d1 == 0) // if we cut a node (O-X) cable
|
||||
|
||||
@@ -74,10 +74,11 @@
|
||||
anchored = !anchored
|
||||
playsound(src, 'sound/items/Deconstruct.ogg', 50, 1)
|
||||
if(anchored)
|
||||
connect_to_network()
|
||||
to_chat(user, span_blue("You secure the generator to the floor."))
|
||||
else
|
||||
disconnect_from_network()
|
||||
to_chat(user, span_blue("You unsecure the generator from the floor."))
|
||||
SSmachines.makepowernets()
|
||||
else if(O.has_tool_quality(TOOL_SCREWDRIVER))
|
||||
open = !open
|
||||
playsound(src, O.usesound, 50, 1)
|
||||
|
||||
@@ -66,6 +66,8 @@
|
||||
|
||||
// connect the machine to a powernet if a node cable is present on the turf
|
||||
/obj/machinery/power/proc/connect_to_network()
|
||||
if(SSmachines.powernet_is_defered()) return 0;
|
||||
|
||||
var/turf/T = src.loc
|
||||
if(!T || !istype(T))
|
||||
return 0
|
||||
|
||||
Reference in New Issue
Block a user