mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-22 19:47:22 +01:00
Adds explosion particles! (#25410)
* Adds explosion particles * Adds back the smoke explosion system * Removes whitespace * Fixes CI * Adds TGMC explosion * Fixes explosions, removes smoke explosions * More particle tweaks * Removes a random extra kickup * Fixes CI by properly removing kickups
This commit is contained in:
@@ -19,41 +19,3 @@
|
||||
for(var/j in 1 to steps_amt)
|
||||
sleep(1)
|
||||
step(expl,direct)
|
||||
|
||||
/obj/effect/explosion
|
||||
name = "explosive particles"
|
||||
icon = 'icons/effects/96x96.dmi'
|
||||
icon_state = "explosion"
|
||||
opacity = TRUE
|
||||
mouse_opacity = MOUSE_OPACITY_TRANSPARENT
|
||||
pixel_x = -32
|
||||
pixel_y = -32
|
||||
|
||||
/obj/effect/explosion/New()
|
||||
..()
|
||||
QDEL_IN(src, 10)
|
||||
|
||||
/datum/effect_system/explosion
|
||||
|
||||
/datum/effect_system/explosion/set_up(loca)
|
||||
if(isturf(loca))
|
||||
location = loca
|
||||
else
|
||||
location = get_turf(loca)
|
||||
|
||||
/datum/effect_system/explosion/start()
|
||||
new/obj/effect/explosion(location)
|
||||
var/datum/effect_system/expl_particles/P = new/datum/effect_system/expl_particles()
|
||||
P.set_up(10, 0, location)
|
||||
P.start()
|
||||
|
||||
/datum/effect_system/explosion/smoke
|
||||
|
||||
/datum/effect_system/explosion/smoke/proc/create_smoke()
|
||||
var/datum/effect_system/smoke_spread/S = new
|
||||
S.set_up(5, FALSE, location, null)
|
||||
S.start()
|
||||
|
||||
/datum/effect_system/explosion/smoke/start()
|
||||
..()
|
||||
addtimer(CALLBACK(src, PROC_REF(create_smoke)), 5)
|
||||
|
||||
@@ -0,0 +1,64 @@
|
||||
/obj/effect/temp_visual/explosion
|
||||
name = "boom"
|
||||
icon = 'icons/effects/96x96.dmi'
|
||||
icon_state = "explosion2"
|
||||
duration = 6 SECONDS
|
||||
/// Smoke wave particle holder
|
||||
var/obj/effect/abstract/particle_holder/smoke_wave
|
||||
/// Explosion smoke particle holder
|
||||
var/obj/effect/abstract/particle_holder/explosion_smoke
|
||||
/// Sparks particle holder
|
||||
var/obj/effect/abstract/particle_holder/sparks
|
||||
|
||||
/obj/effect/temp_visual/explosion/Initialize(mapload, radius, color, small = FALSE, large = FALSE)
|
||||
. = ..()
|
||||
set_light(radius, radius, LIGHT_COLOR_ORANGE)
|
||||
generate_particles(radius, small, large)
|
||||
var/image/I = image(icon, src, icon_state, 10, -32, -32)
|
||||
var/matrix/rotate = matrix()
|
||||
rotate.Turn(rand(0, 359))
|
||||
I.transform = rotate
|
||||
overlays += I // We use an overlay so the explosion and light source are both in the correct location plus so the particles don't rotate with the explosion
|
||||
icon_state = null
|
||||
|
||||
/// Generate the particles
|
||||
/obj/effect/temp_visual/explosion/proc/generate_particles(radius, small = FALSE, large = FALSE)
|
||||
if(small)
|
||||
smoke_wave = new(src, /particles/smoke_wave/small)
|
||||
else
|
||||
smoke_wave = new(src, /particles/smoke_wave)
|
||||
|
||||
if(large)
|
||||
explosion_smoke = new(src, /particles/explosion_smoke/deva)
|
||||
else if(small)
|
||||
explosion_smoke = new(src, /particles/explosion_smoke/small)
|
||||
else
|
||||
explosion_smoke = new(src, /particles/explosion_smoke)
|
||||
|
||||
sparks = new(src, /particles/sparks_outwards)
|
||||
|
||||
if(large)
|
||||
smoke_wave.particles.velocity = generator(GEN_CIRCLE, 6 * radius, 6 * radius)
|
||||
else if(small)
|
||||
smoke_wave.particles.velocity = generator(GEN_CIRCLE, 3 * radius, 3 * radius)
|
||||
else
|
||||
smoke_wave.particles.velocity = generator(GEN_CIRCLE, 5 * radius, 5 * radius)
|
||||
|
||||
explosion_smoke.layer = layer + 0.1
|
||||
sparks.particles.velocity = generator(GEN_CIRCLE, 8 * radius, 8 * radius)
|
||||
|
||||
// The reason for these timers is to set the count to 0
|
||||
// This causes any particle systems to not spawn in new particles, but not delete the currently existing ones
|
||||
addtimer(CALLBACK(src, PROC_REF(set_count_short)), 1 SECONDS)
|
||||
|
||||
/obj/effect/temp_visual/explosion/proc/set_count_short()
|
||||
remove_light()
|
||||
explosion_smoke.particles.count = 0
|
||||
sparks.particles.count = 0
|
||||
smoke_wave.particles.count = 0
|
||||
|
||||
/obj/effect/temp_visual/explosion/Destroy()
|
||||
QDEL_NULL(smoke_wave)
|
||||
QDEL_NULL(explosion_smoke)
|
||||
QDEL_NULL(sparks)
|
||||
return ..()
|
||||
@@ -231,16 +231,12 @@
|
||||
layer = ABOVE_MOB_LAYER
|
||||
duration = 4
|
||||
|
||||
/obj/effect/temp_visual/explosion
|
||||
/obj/effect/temp_visual/pka_explosion
|
||||
name = "explosion"
|
||||
icon = 'icons/effects/96x96.dmi'
|
||||
icon_state = "explosion"
|
||||
icon_state = "explosionfast"
|
||||
pixel_x = -32
|
||||
pixel_y = -32
|
||||
duration = 8
|
||||
|
||||
/obj/effect/temp_visual/explosion/fast
|
||||
icon_state = "explosionfast"
|
||||
duration = 4
|
||||
|
||||
/obj/effect/temp_visual/heart
|
||||
|
||||
@@ -109,14 +109,12 @@
|
||||
if(creaking_explosion) // 5 seconds after the bang, the station begins to creak
|
||||
addtimer(CALLBACK(M, TYPE_PROC_REF(/mob, playsound_local), epicenter, null, rand(FREQ_LOWER, FREQ_UPPER), 1, frequency, null, null, FALSE, hull_creaking_sound, 0), CREAK_DELAY)
|
||||
|
||||
if(heavy_impact_range > 1)
|
||||
var/datum/effect_system/explosion/E
|
||||
if(smoke)
|
||||
E = new /datum/effect_system/explosion/smoke
|
||||
else
|
||||
E = new
|
||||
E.set_up(epicenter)
|
||||
E.start()
|
||||
if(devastation_range > 0)
|
||||
new /obj/effect/temp_visual/explosion(epicenter, max_range, FALSE, TRUE)
|
||||
else if(heavy_impact_range > 0)
|
||||
new /obj/effect/temp_visual/explosion(epicenter, max_range, FALSE, FALSE)
|
||||
else if(light_impact_range > 0)
|
||||
new /obj/effect/temp_visual/explosion(epicenter, max_range, TRUE, FALSE)
|
||||
|
||||
var/list/affected_turfs = spiral_range_turfs(max_range, epicenter)
|
||||
|
||||
|
||||
@@ -113,7 +113,7 @@
|
||||
M.gib()
|
||||
for(var/obj/mecha/E in range(30, T))
|
||||
E.take_damage(E.max_integrity)
|
||||
explosion(get_turf(src), 25, 35, 45, 55, 1, 1, 60, 0, 0)
|
||||
explosion(get_turf(src), 25, 35, 45, 55, 1, 1, 60, 0)
|
||||
STOP_PROCESSING(SSobj, src)
|
||||
qdel(src)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user