mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2026-08-22 12:29:46 +01:00
Iterative Explosions (#3838)
This PR replaces recursive explosions with a new spreading engine: iterative explosions. Should behave similarly, but also be more reliable, potentially faster. Iterative explosions also support simple-explosion-esque directional explosion sounds/shake, and will now traverse Z-levels if the explosion is strong enough. Also changes playsound() to transmit sounds across Z-levels. Uses BYOND's 3rd coordinate on /sound to make sound sound above/below the player if they're using headphones. Removed for now, can't get Z-falloff working right. Fixes #2199.
This commit is contained in:
@@ -44,12 +44,28 @@ var/z_levels = 0 // Each bit represents a connection between adjacent levels. S
|
||||
/proc/GetConnectedZlevels(z)
|
||||
. = list(z)
|
||||
for(var/level = z, HasBelow(level), level--)
|
||||
. |= level-1
|
||||
. += level-1
|
||||
for(var/level = z, HasAbove(level), level++)
|
||||
. |= level+1
|
||||
. += level+1
|
||||
|
||||
proc/AreConnectedZLevels(var/zA, var/zB)
|
||||
return zA == zB || (zB in GetConnectedZlevels(zA))
|
||||
/proc/AreConnectedZLevels(var/zA, var/zB)
|
||||
if (zA == zB)
|
||||
return TRUE
|
||||
|
||||
if (SSatlas.connected_z_cache.len >= zA && SSatlas.connected_z_cache[zA])
|
||||
return SSatlas.connected_z_cache[zA][zB]
|
||||
|
||||
var/list/levels = GetConnectedZlevels(zA)
|
||||
var/list/new_entry = new(max(levels))
|
||||
for (var/entry in levels)
|
||||
new_entry[entry] = TRUE
|
||||
|
||||
if (SSatlas.connected_z_cache.len < zA)
|
||||
SSatlas.connected_z_cache.len = zA
|
||||
|
||||
SSatlas.connected_z_cache[zA] = new_entry
|
||||
|
||||
return new_entry[zB]
|
||||
|
||||
/proc/get_zstep(ref, dir)
|
||||
if(dir == UP)
|
||||
|
||||
Reference in New Issue
Block a user