changes:

Smoke no longer leaves mysterious patches of darkness.
Smoke now uses client-side animations instead of while loops.
Fixes #1985.
This commit is contained in:
Lohikar
2017-03-26 12:37:35 +03:00
committed by skull132
parent 425aa4d28c
commit f3b0edf03e
4 changed files with 23 additions and 21 deletions
@@ -24,20 +24,11 @@
pixel_x = -32 + rand(-8, 8)
pixel_y = -32 + rand(-8, 8)
//switching opacity on after the smoke has spawned, and then turning it off before it is deleted results in cleaner
//lighting and view range updates (Is this still true with the new lighting system?)
set_opacity(1)
//float over to our destination, if we have one
destination = dest_turf
if(destination)
walk_to(src, destination)
/obj/effect/effect/smoke/chem/Destroy()
set_opacity(0)
fadeOut()
..()
/obj/effect/effect/smoke/chem/Move()
var/list/oldlocs = view(1, src)
. = ..()
@@ -61,16 +52,6 @@
if(!istype(AM, /obj/effect/effect/smoke/chem))
reagents.splash(AM, splash_amount, copy = 1)
// Fades out the smoke smoothly using it's alpha variable.
/obj/effect/effect/smoke/chem/proc/fadeOut(var/frames = 16)
if(!alpha) return //already transparent
frames = max(frames, 1) //We will just assume that by 0 frames, the coder meant "during one frame".
var/alpha_step = round(alpha / frames)
while(alpha > 0)
alpha = max(0, alpha - alpha_step)
sleep(world.tick_lag)
/////////////////////////////////////////////
// Chem Smoke Effect System
/////////////////////////////////////////////
+13 -2
View File
@@ -113,7 +113,18 @@ steam.start() -- spawns the effect
if (duration)
time_to_live = duration
spawn (time_to_live)
qdel(src)
kill()
/obj/effect/effect/smoke/proc/kill()
set waitfor = FALSE
animate(src, alpha = 0, time = 2 SECONDS, easing = QUAD_EASING)
set_opacity(FALSE)
var/turf/T = get_turf(src)
if (T)
T.force_update_lights() // I hate it, but nothing else seems to work.
QDEL_IN(src, 2 SECONDS)
/obj/effect/effect/smoke/Crossed(mob/living/carbon/M as mob )
..()
@@ -271,8 +282,8 @@ steam.start() -- spawns the effect
sleep(10)
step(smoke,direction)
spawn(smoke.time_to_live*0.75+rand(10,30))
if (smoke) qdel(smoke)
src.total_smoke--
qdel(smoke)
/datum/effect/effect/system/smoke_spread/bad