mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2025-12-25 09:31:13 +00:00
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.
59 lines
1.5 KiB
Plaintext
59 lines
1.5 KiB
Plaintext
// explosion logic is in code/controllers/Processes/explosives.dm now
|
|
|
|
/proc/explosion(turf/epicenter, devastation_range, heavy_impact_range, light_impact_range, flash_range, adminlog = 1, z_transfer = UP|DOWN, spreading = config.use_spreading_explosions)
|
|
src = null //so we don't abort once src is deleted
|
|
var/datum/explosiondata/data = new
|
|
data.epicenter = epicenter
|
|
data.devastation_range = devastation_range
|
|
data.heavy_impact_range = heavy_impact_range
|
|
data.light_impact_range = light_impact_range
|
|
data.flash_range = flash_range
|
|
data.adminlog = adminlog
|
|
data.z_transfer = z_transfer
|
|
data.spreading = spreading
|
|
data.rec_pow = max(0,devastation_range) * 2 + max(0,heavy_impact_range) + max(0,light_impact_range)
|
|
|
|
// queue work
|
|
SSexplosives.queue(data)
|
|
|
|
// == Recursive Explosions stuff ==
|
|
|
|
/client/proc/kaboom()
|
|
var/power = input(src, "power?", "power?") as num
|
|
var/turf/T = get_turf(src.mob)
|
|
var/datum/explosiondata/d = new
|
|
d.spreading = TRUE
|
|
d.epicenter = T
|
|
d.rec_pow = power
|
|
SSexplosives.queue(d)
|
|
|
|
/atom
|
|
var/explosion_resistance
|
|
|
|
/turf/space
|
|
explosion_resistance = 3
|
|
|
|
/turf/simulated/open
|
|
explosion_resistance = 3
|
|
|
|
/turf/simulated/floor
|
|
explosion_resistance = 1
|
|
|
|
/turf/simulated/mineral
|
|
explosion_resistance = 2
|
|
|
|
/turf/simulated/shuttle/floor
|
|
explosion_resistance = 1
|
|
|
|
/turf/simulated/shuttle/floor4
|
|
explosion_resistance = 1
|
|
|
|
/turf/simulated/shuttle/plating
|
|
explosion_resistance = 1
|
|
|
|
/turf/simulated/shuttle/wall
|
|
explosion_resistance = 10
|
|
|
|
/turf/simulated/wall
|
|
explosion_resistance = 10
|