diff --git a/code/game/objects/effects/effect_system/effects_smoke.dm b/code/game/objects/effects/effect_system/effects_smoke.dm index 634babed1f1..5d906945503 100644 --- a/code/game/objects/effects/effect_system/effects_smoke.dm +++ b/code/game/objects/effects/effect_system/effects_smoke.dm @@ -6,138 +6,49 @@ /obj/effect/effect/smoke name = "smoke" - icon = 'icons/effects/water.dmi' icon_state = "smoke" - opacity = 1 - anchored = 0.0 - mouse_opacity = 0 - var/amount = 8.0 - -/obj/effect/effect/harmless_smoke - name = "smoke" - icon_state = "smoke" - opacity = 1 - anchored = 0.0 - mouse_opacity = 0 - var/amount = 6.0 - //Remove this bit to use the old smoke icon = 'icons/effects/96x96.dmi' pixel_x = -32 pixel_y = -32 - -/obj/effect/effect/harmless_smoke/New() - ..() - spawn(100) - delete() - return - -/obj/effect/effect/harmless_smoke/Move() - ..() - return - -/datum/effect/system/harmless_smoke_spread - var/total_smoke = 0 // To stop it being spammed and lagging! - var/direction - -/datum/effect/system/harmless_smoke_spread/set_up(n = 5, c = 0, loca, direct) - if(n > 10) - n = 10 - number = n - cardinals = c - if(istype(loca, /turf/)) - location = loca - else - location = get_turf(loca) - if(direct) - direction = direct - -/datum/effect/system/harmless_smoke_spread/start() - var/i = 0 - for(i=0, i 20) - return - spawn(0) - if(holder) - src.location = get_turf(holder) - var/obj/effect/effect/harmless_smoke/smoke = new /obj/effect/effect/harmless_smoke(src.location) - src.total_smoke++ - var/direction = src.direction - if(!direction) - if(src.cardinals) - direction = pick(cardinal) - else - direction = pick(alldirs) - for(i=0, i 20) n = 20 number = n @@ -149,77 +60,165 @@ if(direct) direction = direct -/datum/effect/system/bad_smoke_spread/start() +/datum/effect/system/smoke_spread/start() var/i = 0 - for(i=0, i 20) + for(i=0, i 20) return spawn(0) if(holder) - src.location = get_turf(holder) - var/obj/effect/effect/bad_smoke/smoke = new /obj/effect/effect/bad_smoke(src.location) - src.total_smoke++ + location = get_turf(holder) + var/obj/effect/effect/harmless_smoke/smoke = new /obj/effect/effect/harmless_smoke(location) + total_smoke++ var/direction = src.direction if(!direction) - if(src.cardinals) + if(cardinals) direction = pick(cardinal) else direction = pick(alldirs) for(i=0, i[V] was frozen shut!") + for(var/mob/living/L in T) + L.ExtinguishMob() + for(var/obj/item/Item in T) + Item.extinguish() + +/datum/effect/system/smoke_spread/freezing/set_up(n = 5, c = 0, loca, direct, blasting = 0) + ..() + blast = blasting + +/datum/effect/system/smoke_spread/freezing/start() + if(blast) + for(var/turf/T in trange(2, location)) + Chilled(T) + ..() + +///////////////////////////////////////////// +// Sleep smoke +///////////////////////////////////////////// + +/obj/effect/effect/smoke/sleeping + color = "#9C3636" + +/obj/effect/effect/smoke/sleeping/Move() + ..() + for(var/mob/living/carbon/M in get_turf(src)) + smoke_mob(M) + +/obj/effect/effect/smoke/sleeping/smoke_mob() + if(..()) + M.drop_item() + M.AdjustSleeping(5) + if(M.coughedtime != 1) + M.coughedtime = 1 + M.emote("cough") + spawn(20) + if(M && M.loc) + M.coughedtime = 0 + +/datum/effect/system/smoke_spread/sleeping + smoke_type = /obj/effect/effect/smoke/sleeping ///////////////////////////////////////////// // Chem smoke ///////////////////////////////////////////// -/obj/effect/effect/chem_smoke - name = "smoke" - opacity = 0 - anchored = 0.0 - mouse_opacity = 0 - var/amount = 6.0 - +/obj/effect/effect/smoke/chem icon = 'icons/effects/chemsmoke.dmi' - pixel_x = -32 - pixel_y = -32 + opacity = 0 + time_to_live = 200+rand(10,30) -/obj/effect/effect/chem_smoke/New() - ..() - spawn(200+rand(10,30)) - delete() - return - -/obj/effect/effect/chem_smoke/Move() - ..() - -/datum/effect/system/chem_smoke_spread/New() - ..() - chemholder = new/obj() - var/datum/reagents/R = new/datum/reagents(500) - chemholder.reagents = R - R.my_atom = chemholder - -/datum/effect/system/chem_smoke_spread +/datum/effect/system/smoke_spread/chem + smoke_type = /obj/effect/effect/smoke/chem var/total_smoke = 0 // To stop it being spammed and lagging! var/direction var/obj/chemholder -/datum/effect/system/chem_smoke_spread/New() +/datum/effect/system/smoke_spread/chem/New() ..() chemholder = new/obj() var/datum/reagents/R = new/datum/reagents(500) chemholder.reagents = R R.my_atom = chemholder -/datum/effect/system/chem_smoke_spread/Destroy() +/datum/effect/system/smoke_spread/chem/Destroy() QDEL_NULL(chemholder) return ..() -/datum/effect/system/chem_smoke_spread/set_up(datum/reagents/carry = null, n = 5, c = 0, loca, direct, silent = 0) +/datum/effect/system/smoke_spread/chem/set_up(datum/reagents/carry = null, n = 5, c = 0, loca, direct, silent = 0) if(n > 20) n = 20 number = n @@ -258,11 +257,11 @@ msg_admin_attack("A chemical smoke reaction has taken place in ([whereLink]). No associated key. CODERS: carry.my_atom may be null.", 0, 1) log_game("A chemical smoke reaction has taken place in ([where])[contained]. No associated key. CODERS: carry.my_atom may be null.") -/datum/effect/system/chem_smoke_spread/start(effect_range = 2) +/datum/effect/system/smoke_spread/chem/start(effect_range = 2) var/i = 0 var/color = mix_color_from_reagents(chemholder.reagents.reagent_list) - var/obj/effect/effect/chem_smoke/smokeholder = new /obj/effect/effect/chem_smoke(src.location) + var/obj/effect/effect/smoke/chem/smokeholder = new smoke_type(location) for(var/atom/A in view(effect_range, smokeholder)) chemholder.reagents.reaction(A) if(iscarbon(A)) @@ -271,16 +270,16 @@ chemholder.reagents.copy_to(C, chemholder.reagents.total_volume) qdel(smokeholder) for(i=0, i 20) + if(total_smoke > 20) return spawn(0) if(holder) - src.location = get_turf(holder) - var/obj/effect/effect/chem_smoke/smoke = new /obj/effect/effect/chem_smoke(src.location) - src.total_smoke++ + location = get_turf(holder) + var/obj/effect/effect/smoke/chem/smoke = new smoke_type(location) + total_smoke++ var/direction = src.direction if(!direction) - if(src.cardinals) + if(cardinals) direction = pick(cardinal) else direction = pick(alldirs) @@ -294,102 +293,10 @@ for(i=0, i 20) - n = 20 - number = n - cardinals = c - if(istype(loca, /turf/)) - location = loca - else - location = get_turf(loca) - if(direct) - direction = direct - -/datum/effect/system/sleep_smoke_spread/start() - var/i = 0 - for(i=0, i 20) - return - spawn(0) - if(holder) - src.location = get_turf(holder) - var/obj/effect/effect/sleep_smoke/smoke = new /obj/effect/effect/sleep_smoke(src.location) - src.total_smoke++ - var/direction = src.direction - if(!direction) - if(src.cardinals) - direction = pick(cardinal) - else - direction = pick(alldirs) - for(i=0, i[V] was frozen shut!") - for(var/mob/living/L in T) - L.ExtinguishMob() - for(var/obj/item/Item in T) - Item.extinguish() - -/datum/effect/system/freezing_smoke_spread - -/datum/effect/system/freezing_smoke_spread/set_up(n = 6, c = 0, loca) - number = n - if(istype(loca, /turf/)) - location = loca - else - location = get_turf(loca) - -/datum/effect/system/freezing_smoke_spread/start() - var/i = 0 - for(i=0, i