More blob work. Blob core chunk added.

This commit is contained in:
Mechoid
2020-03-24 14:26:27 -07:00
parent f0b15993a3
commit 48c54fc43b
17 changed files with 534 additions and 12 deletions

View File

@@ -3,7 +3,7 @@
/////////////////////////////////////////////
/obj/effect/effect/smoke/chem
icon = 'icons/effects/chemsmoke.dmi'
opacity = 0
opacity = TRUE
time_to_live = 300
pass_flags = PASSTABLE | PASSGRILLE | PASSGLASS //PASSGLASS is fine here, it's just so the visual effect can "flow" around glass
@@ -16,6 +16,9 @@
walk(src, 0) // Because we might have called walk_to, we must stop the walk loop or BYOND keeps an internal reference to us forever.
return ..()
/obj/effect/effect/smoke/chem/transparent
opacity = FALSE
/datum/effect/effect/system/smoke_spread/chem
smoke_type = /obj/effect/effect/smoke/chem
var/obj/chemholder
@@ -36,6 +39,10 @@
qdel(src)
..()
/datum/effect/effect/system/smoke_spread/chem/blob
show_log = 0
smoke_type = /obj/effect/effect/smoke/chem/transparent
/datum/effect/effect/system/smoke_spread/chem/New()
..()
chemholder = new/obj()
@@ -156,7 +163,7 @@
if(passed_smoke)
smoke = passed_smoke
else
smoke = new /obj/effect/effect/smoke/chem(location)
smoke = new smoke_type(location)
if(chemholder.reagents.reagent_list.len)
chemholder.reagents.trans_to_obj(smoke, chemholder.reagents.total_volume / dist, copy = 1) //copy reagents to the smoke so mob/breathe() can handle inhaling the reagents
@@ -166,7 +173,8 @@
smoke.pixel_x = -32 + rand(-8, 8)
smoke.pixel_y = -32 + rand(-8, 8)
walk_to(smoke, T)
smoke.set_opacity(1) //switching opacity on after the smoke has spawned, and then
if(initial(smoke.opacity))
smoke.set_opacity(1) //switching opacity on after the smoke has spawned, and then
sleep(150+rand(0,20)) // turning it off before it is deleted results in cleaner
smoke.set_opacity(0) // lighting and view range updates
fadeOut(smoke)