mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2026-07-24 06:18:13 +01:00
4ecb0bc21c
Repaths obj/machinery to obj/structure/machinery. **Note for reviewers:** the only meaningful changed code exists within **code/game/objects/structures.dm** and **code/game/objects/structures/_machinery.dm**, largely concerning damage procs. With the exception of moving airlock defines to their own file, ALL OTHER CHANGES ARE STRICTLY PATH CHANGES. Objects, _categorically_, are largely divided between those you can hold in your hand/inventory and those you can't. Machinery objects are already subtypes of Structures behaviorally, this PR just makes their pathing reflect that, and allows for future work (tool actions, more health/destruction functionality) to be developed without unnecessary code duplication. I have tested this PR by loading up the Horizon and dismantling various machines and structures with tools, shooting guns of various types throughout the ship, and detonating a bunch of explosions throughout the ship.
34 lines
1.3 KiB
Plaintext
34 lines
1.3 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 = GLOB.config.use_spreading_explosions)
|
|
UNLINT(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)
|
|
|
|
//Machines which report explosions.
|
|
for(var/thing in GLOB.doppler_arrays)
|
|
var/obj/structure/machinery/doppler_array/Array = thing
|
|
Array.sense_explosion(epicenter.x,epicenter.y,epicenter.z,devastation_range,heavy_impact_range,light_impact_range)
|
|
|
|
// == 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)
|