Files
Bubberstation/code/game/objects/effects/effect_system/effects_explosion.dm
SkyratBot 72c69368b6 [MIRROR] Opacity refactor (#405)
* Opacity refactor (#52881)

    Moves all opacity var manipulation to a proc which sends a signal.
    light_blocker element for movable opaque atoms made, which tracks its movement and updates the affected turfs for proper lighting updates.
    has_opaque_atom boolean replaced by the opacity_sources lazylist to keep track of the sources, and a directional_opacity which serves a similar function but also allows for future expansion with on-border opaque objects (not yet implemented).
    Some opacity-related sight procs optimized as a result of this.
    Some variables moved to the object's definition.
    A define or two added into the mix for clarity.
    Some code cleaning, like turning booleans into their defines.
    One file renamed for clarity.

Changelog

cl
balance: Mechs no longer block sight. It's a non-trivial cost for the lighting system with little to no gain.
/cl

* Opacity refactor

Co-authored-by: Rohesie <rohesie@gmail.com>
2020-08-19 04:48:14 +02:00

63 lines
1.5 KiB
Plaintext

/obj/effect/particle_effect/expl_particles
name = "fire"
icon_state = "explosion_particle"
opacity = TRUE
anchored = TRUE
/obj/effect/particle_effect/expl_particles/Initialize()
..()
return INITIALIZE_HINT_LATELOAD
/obj/effect/particle_effect/expl_particles/LateInitialize()
var/direct = pick(GLOB.alldirs)
var/steps_amt = pick(1;25,2;50,3,4;200)
for(var/j in 1 to steps_amt)
step(src, direct)
sleep(1)
qdel(src)
/datum/effect_system/expl_particles
number = 10
/datum/effect_system/expl_particles/start()
for(var/i in 1 to number)
new /obj/effect/particle_effect/expl_particles(location)
/obj/effect/explosion
name = "fire"
icon = 'icons/effects/96x96.dmi'
icon_state = "explosion"
opacity = TRUE
anchored = TRUE
mouse_opacity = MOUSE_OPACITY_TRANSPARENT
pixel_x = -32
pixel_y = -32
/obj/effect/explosion/Initialize()
. = ..()
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(2, location)
S.start()
/datum/effect_system/explosion/smoke/start()
..()
addtimer(CALLBACK(src, .proc/create_smoke), 5)