diff --git a/baystation12.dme b/baystation12.dme index af63c3f88ab..fec88b02135 100644 --- a/baystation12.dme +++ b/baystation12.dme @@ -482,7 +482,6 @@ #include "code\game\objects\effects\aliens.dm" #include "code\game\objects\effects\anomalies.dm" #include "code\game\objects\effects\bump_teleporter.dm" -#include "code\game\objects\effects\chemsmoke.dm" #include "code\game\objects\effects\effect_system.dm" #include "code\game\objects\effects\gibs.dm" #include "code\game\objects\effects\glowshroom.dm" diff --git a/code/ATMOSPHERICS/pipes.dm b/code/ATMOSPHERICS/pipes.dm index 9efbcb8d88c..ebd35f470bc 100644 --- a/code/ATMOSPHERICS/pipes.dm +++ b/code/ATMOSPHERICS/pipes.dm @@ -161,7 +161,7 @@ obj/machinery/atmospherics/pipe proc/burst() src.visible_message("\red \bold [src] bursts!"); playsound(get_turf(src), 'sound/effects/bang.ogg', 25, 1) - var/datum/effect/effect/system/smoke_spread/smoke = new + var/datum/effect/effect/system/harmless_smoke_spread/smoke = new smoke.set_up(1,0, src.loc, 0) smoke.start() qdel(src) diff --git a/code/WorkInProgress/Cib/amorph/life.dm b/code/WorkInProgress/Cib/amorph/life.dm index ee2e822ff4b..e3eae759756 100644 --- a/code/WorkInProgress/Cib/amorph/life.dm +++ b/code/WorkInProgress/Cib/amorph/life.dm @@ -148,7 +148,7 @@ if(!block) - for(var/obj/effect/effect/smoke/chem/smoke in view(1, src)) + for(var/obj/effect/effect/chem_smoke/smoke in view(1, src)) if(smoke.reagents.total_volume) smoke.reagents.reaction(src, INGEST) spawn(5) diff --git a/code/WorkInProgress/computer3/computer.dm b/code/WorkInProgress/computer3/computer.dm index f537341096c..2b70c3b6e59 100644 --- a/code/WorkInProgress/computer3/computer.dm +++ b/code/WorkInProgress/computer3/computer.dm @@ -191,7 +191,7 @@ for(var/x in verbs) verbs -= x set_broken() - var/datum/effect/effect/system/smoke_spread/smoke = new /datum/effect/effect/system/smoke_spread() + var/datum/effect/effect/system/harmless_smoke_spread/smoke = new /datum/effect/effect/system/harmless_smoke_spread() smoke.set_up(5, 0, src) smoke.start() return diff --git a/code/WorkInProgress/explosion_particles.dm b/code/WorkInProgress/explosion_particles.dm index eb975303d28..b63eeb9aab5 100644 --- a/code/WorkInProgress/explosion_particles.dm +++ b/code/WorkInProgress/explosion_particles.dm @@ -66,6 +66,6 @@ P.set_up(10,location) P.start() spawn(5) - var/datum/effect/effect/system/smoke_spread/S = new/datum/effect/effect/system/smoke_spread() + var/datum/effect/effect/system/harmless_smoke_spread/S = new/datum/effect/effect/system/harmless_smoke_spread() S.set_up(5,0,location,null) S.start() \ No newline at end of file diff --git a/code/datums/spell.dm b/code/datums/spell.dm index 49d329ca7ca..f82f654a2d4 100644 --- a/code/datums/spell.dm +++ b/code/datums/spell.dm @@ -175,11 +175,11 @@ var/list/spells = typesof(/obj/effect/proc_holder/spell) //needed for the badmin sparks.start() if(smoke_spread) if(smoke_spread == 1) - var/datum/effect/effect/system/smoke_spread/smoke = new /datum/effect/effect/system/smoke_spread() + var/datum/effect/effect/system/harmless_smoke_spread/smoke = new /datum/effect/effect/system/harmless_smoke_spread() smoke.set_up(smoke_amt, 0, location) //no idea what the 0 is smoke.start() else if(smoke_spread == 2) - var/datum/effect/effect/system/smoke_spread/bad/smoke = new /datum/effect/effect/system/smoke_spread/bad() + var/datum/effect/effect/system/bad_smoke_spread/smoke = new /datum/effect/effect/system/bad_smoke_spread() smoke.set_up(smoke_amt, 0, location) //no idea what the 0 is smoke.start() diff --git a/code/game/gamemodes/blob/blobs/factory.dm b/code/game/gamemodes/blob/blobs/factory.dm index e197ff6dea8..35130546fcd 100644 --- a/code/game/gamemodes/blob/blobs/factory.dm +++ b/code/game/gamemodes/blob/blobs/factory.dm @@ -103,7 +103,7 @@ /mob/living/simple_animal/hostile/blobspore/Die() // On death, create a small smoke of harmful gas (s-Acid) - var/datum/effect/effect/system/smoke_spread/chem/S = new + var/datum/effect/effect/system/chem_smoke_spread/S = new var/turf/location = get_turf(src) // Create the reagents to put into the air, s-acid is yellow and stings a little diff --git a/code/game/gamemodes/events/ninja_abilities.dm b/code/game/gamemodes/events/ninja_abilities.dm index c1b762658da..691f2d84114 100644 --- a/code/game/gamemodes/events/ninja_abilities.dm +++ b/code/game/gamemodes/events/ninja_abilities.dm @@ -57,7 +57,7 @@ Not sure why this would be useful (it's not) but whatever. Ninjas need their smo if(!ninjacost(,2)) var/mob/living/carbon/human/U = affecting U << "\blue There are [s_bombs] smoke bombs remaining." - var/datum/effect/effect/system/smoke_spread/bad/smoke = new /datum/effect/effect/system/smoke_spread/bad() + var/datum/effect/effect/system/bad_smoke_spread/smoke = new /datum/effect/effect/system/bad_smoke_spread() smoke.set_up(10, 0, U.loc) smoke.start() playsound(U.loc, 'sound/effects/bamf.ogg', 50, 2) diff --git a/code/game/gamemodes/wizard/artefact.dm b/code/game/gamemodes/wizard/artefact.dm index cf2ea1f487b..37b2de5a3ee 100644 --- a/code/game/gamemodes/wizard/artefact.dm +++ b/code/game/gamemodes/wizard/artefact.dm @@ -54,7 +54,7 @@ if(candidates.len) src.used = 1 var/client/C = pick(candidates) - new /obj/effect/effect/smoke(H.loc) + new /obj/effect/effect/harmless_smoke(H.loc) var/mob/living/carbon/human/M = new/mob/living/carbon/human(H.loc) M.key = C.key M << "You are the [H.real_name]'s apprentice! You are bound by magic contract to follow their orders and help them in accomplishing their goals." diff --git a/code/game/machinery/computer/computer.dm b/code/game/machinery/computer/computer.dm index 0b73b0e5426..3ef385d0285 100644 --- a/code/game/machinery/computer/computer.dm +++ b/code/game/machinery/computer/computer.dm @@ -30,7 +30,7 @@ for(var/x in verbs) verbs -= x set_broken() - var/datum/effect/effect/system/smoke_spread/smoke = new /datum/effect/effect/system/smoke_spread() + var/datum/effect/effect/system/harmless_smoke_spread/smoke = new /datum/effect/effect/system/harmless_smoke_spread() smoke.set_up(5, 0, src) smoke.start() return diff --git a/code/game/mecha/combat/marauder.dm b/code/game/mecha/combat/marauder.dm index b0e2ff70af5..6e924e13ebb 100644 --- a/code/game/mecha/combat/marauder.dm +++ b/code/game/mecha/combat/marauder.dm @@ -14,7 +14,7 @@ var/smoke = 5 var/smoke_ready = 1 var/smoke_cooldown = 100 - var/datum/effect/effect/system/smoke_spread/smoke_system = new + var/datum/effect/effect/system/harmless_smoke_spread/smoke_system = new operation_req_access = list(access_cent_specops) wreckage = /obj/effect/decal/mecha_wreckage/marauder add_req_access = 0 diff --git a/code/game/objects/effects/anomalies.dm b/code/game/objects/effects/anomalies.dm index 8dca4ef26e1..4c2d0ae8fe0 100644 --- a/code/game/objects/effects/anomalies.dm +++ b/code/game/objects/effects/anomalies.dm @@ -27,7 +27,7 @@ /obj/effect/anomaly/proc/anomalyNeutralize() - new /obj/effect/effect/smoke/bad(loc) + new /obj/effect/effect/bad_smoke(loc) for(var/atom/movable/O in src) O.loc = src.loc diff --git a/code/game/objects/effects/chemsmoke.dm b/code/game/objects/effects/chemsmoke.dm deleted file mode 100644 index ee78cb5d5bc..00000000000 --- a/code/game/objects/effects/chemsmoke.dm +++ /dev/null @@ -1,246 +0,0 @@ -///////////////////////////////////////////// -// Chem smoke -///////////////////////////////////////////// -/obj/effect/effect/smoke/chem - icon = 'icons/effects/chemsmoke.dmi' - opacity = 0 - time_to_live = 300 - pass_flags = PASSTABLE | PASSGRILLE | PASSGLASS //PASSGLASS is fine here, it's just so the visual effect can "flow" around glass - -/obj/effect/effect/smoke/chem/New() - ..() - var/datum/reagents/R = new/datum/reagents(500) - reagents = R - R.my_atom = src - return - -/datum/effect/effect/system/smoke_spread/chem - smoke_type = /obj/effect/effect/smoke/chem - var/obj/chemholder - var/range - var/list/targetTurfs - var/list/wallList - var/floorArea - - -/datum/effect/effect/system/smoke_spread/chem/New() - ..() - chemholder = new/obj() - var/datum/reagents/R = new/datum/reagents(500) - chemholder.reagents = R - R.my_atom = chemholder - -//------------------------------------------ -//Sets up the chem smoke effect -// -// Calculates the max range smoke can travel, then gets all turfs in that view range. -// Culls the selected turfs to a (roughly) circle shape, then calls smokeFlow() to make -// sure the smoke can actually path to the turfs. This culls any turfs it can't reach. -//------------------------------------------ -/datum/effect/effect/system/smoke_spread/chem/set_up(var/datum/reagents/carry = null, n = 10, c = 0, loca, direct) - range = n * 0.3 - cardinals = c - carry.copy_to(chemholder, carry.total_volume) - - if(istype(loca, /turf/)) - location = loca - else - location = get_turf(loca) - - targetTurfs = new() - - //build affected area list - for(var/turf/T in view(range, location)) - //cull turfs to circle - if(cheap_pythag(T.x - location.x, T.y - location.y) <= range) - targetTurfs += T - - //make secondary list for reagents that affect walls - if(chemholder.reagents.has_reagent("thermite") || chemholder.reagents.has_reagent("plantbgone")) - wallList = new() - - //pathing check - smokeFlow(location, targetTurfs, wallList) - - floorArea = targetTurfs.len - - //Admin messaging - var/contained = "" - for(var/reagent in carry.reagent_list) - contained += " [reagent] " - if(contained) - contained = "\[[contained]\]" - var/area/A = get_area(location) - - var/where = "[A.name] | [location.x], [location.y]" - var/whereLink = "[where]" - - if(carry.my_atom.fingerprintslast) - var/mob/M = get_mob_by_key(carry.my_atom.fingerprintslast) - var/more = "" - if(M) - more = "(?)" - message_admins("A chemical smoke reaction has taken place in ([whereLink])[contained]. Last associated key is [carry.my_atom.fingerprintslast][more].", 0, 1) - log_game("A chemical smoke reaction has taken place in ([where])[contained]. Last associated key is [carry.my_atom.fingerprintslast].") - else - message_admins("A chemical smoke reaction has taken place in ([whereLink]). No associated key.", 0, 1) - log_game("A chemical smoke reaction has taken place in ([where])[contained]. No associated key.") - - -//------------------------------------------ -//Runs the chem smoke effect -// -// Spawns damage over time loop for each reagent held in the cloud. -// Applies reagents to walls that affect walls (only thermite and plant-b-gone at the moment). -// Also calculates target locations to spawn the visual smoke effect on, so the whole area -// is covered fairly evenly. -//------------------------------------------ -/datum/effect/effect/system/smoke_spread/chem/start() - - //reagent application - if(chemholder.reagents.reagent_list.len) - for(var/datum/reagent/R in chemholder.reagents.reagent_list) - var/proba = 100 - var/runs = 5 - - //dilute the reagents according to affected area - R.volume /= floorArea / 4 - chemholder.reagents.update_total() - - //apply wall affecting reagents to walls - if(R.id in list("thermite", "plantbgone")) - for(var/turf/T in wallList) - R.reaction_turf(T, R.volume) - - //reagents that should be applied to turfs in a random pattern - if(R.id == "carbon") - proba = 75 - else if(R.id in list("blood", "radium", "uranium")) - proba = 25 - - spawn(0) - for(var/i = 0, i < runs, i++) - for(var/turf/T in targetTurfs) - if(prob(proba)) - R.reaction_turf(T, R.volume) - for(var/atom/A in T.contents) - if(istype(A, /obj/effect/effect/smoke/chem)) //skip the item if it is chem smoke - continue - else if(istype(A, /mob)) - var/dist = cheap_pythag(T.x - location.x, T.y - location.y) - if(!dist) - dist = 1 - R.reaction_mob(A, volume = R.volume / dist) - else if(istype(A, /obj)) - R.reaction_obj(A, R.volume) - sleep(30) - - - //build smoke icon - var/color = mix_color_from_reagents(chemholder.reagents.reagent_list) - var/icon/I - if(color) - I = icon('icons/effects/chemsmoke.dmi') - I += color - else - I = icon('icons/effects/96x96.dmi', "smoke") - - - //distance between each smoke cloud - var/const/arcLength = 2.3559 - - - //calculate positions for smoke coverage - then spawn smoke - for(var/i = 0, i < range, i++) - var/radius = i * 1.5 - if(!radius) - spawn(0) - spawnSmoke(location, I, 1) - continue - - var/offset = 0 - var/points = round((radius * 2 * PI) / arcLength) - var/angle = round(ToDegrees(arcLength / radius), 1) - - if(!IsInteger(radius)) - offset = 45 //degrees - - for(var/j = 0, j < points, j++) - var/a = (angle * j) + offset - var/x = round(radius * cos(a) + location.x, 1) - var/y = round(radius * sin(a) + location.y, 1) - var/turf/T = locate(x,y,location.z) - if(T in targetTurfs) - var/dist = cheap_pythag(T.x - location.x, T.y - location.y) - if(!dist) - dist = 1 - spawn(0) - spawnSmoke(T, I, dist) - -//------------------------------------------ -// Randomizes and spawns the smoke effect. -// Also handles deleting the smoke once the effect is finished. -//------------------------------------------ -/datum/effect/effect/system/smoke_spread/chem/proc/spawnSmoke(var/turf/T, var/icon/I, var/dist = 1) - var/obj/effect/effect/smoke/chem/smoke = new(location) - chemholder.reagents.copy_to(smoke, chemholder.reagents.total_volume / dist, safety = 1) //copy reagents to the smoke so mob/breathe() can handle inhaling the reagents - smoke.icon = I - smoke.layer = 6 - smoke.dir = pick(cardinal) - smoke.pixel_x = -32 + rand(-8,8) - smoke.pixel_y = -32 + rand(-8,8) - walk_to(smoke, T) - smoke.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.opacity = 0 // lighting and view range updates - fadeOut(smoke) - smoke.delete() - -//------------------------------------------ -// Fades out the smoke smoothly using it's alpha variable. -//------------------------------------------ -/datum/effect/effect/system/smoke_spread/chem/proc/fadeOut(var/atom/A, var/frames = 16) - var/step = A.alpha / frames - for(var/i = 0, i < frames, i++) - A.alpha -= step - sleep(world.tick_lag) - return - -//------------------------------------------ -// Smoke pathfinder. Uses a flood fill method based on zones to -// quickly check what turfs the smoke (airflow) can actually reach. -//------------------------------------------ -/datum/effect/effect/system/smoke_spread/chem/proc/smokeFlow() - - var/list/pending = new() - var/list/complete = new() - - pending += location - - while(pending.len) - for(var/turf/simulated/current in pending) - for(var/D in cardinal) - var/turf/simulated/target = get_step(current, D) - - if(wallList) - if(istype(target, /turf/simulated/wall)) - if(!(target in wallList)) - wallList += target - continue - if(!target.zone) - continue - if(target in pending) - continue - if(target in complete) - continue - if(!(target in targetTurfs)) - continue - - pending += target - - pending -= current - complete += current - - targetTurfs = complete - - return \ No newline at end of file diff --git a/code/game/objects/effects/effect_system.dm b/code/game/objects/effects/effect_system.dm index ab9885db166..f6c56c2dc45 100644 --- a/code/game/objects/effects/effect_system.dm +++ b/code/game/objects/effects/effect_system.dm @@ -21,6 +21,15 @@ would spawn and follow the beaker, even if it is carried or thrown. flags = TABLEPASS mouse_opacity = 0 +/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/proc/delete() loc = null if(reagents) @@ -216,172 +225,504 @@ steam.start() -- spawns the effect ///////////////////////////////////////////// -/obj/effect/effect/smoke +/obj/effect/effect/harmless_smoke name = "smoke" icon_state = "smoke" opacity = 1 anchored = 0.0 mouse_opacity = 0 var/amount = 6.0 - var/time_to_live = 100 - //Remove this bit to use the old smoke icon = 'icons/effects/96x96.dmi' pixel_x = -32 pixel_y = -32 -/obj/effect/effect/smoke/New() +/obj/effect/effect/harmless_smoke/New() ..() - spawn (time_to_live) + spawn (100) delete() return -/obj/effect/effect/smoke/Crossed(mob/living/carbon/M as mob ) +/obj/effect/effect/harmless_smoke/Move() ..() - if(istype(M)) - affect(M) + return + +/datum/effect/effect/system/harmless_smoke_spread + var/total_smoke = 0 // To stop it being spammed and lagging! + var/direction + + 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 + + + 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 + cardinals = c + if(istype(loca, /turf/)) + location = loca + else + location = get_turf(loca) + if(direct) + direction = direct + + start() + var/i = 0 + 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++ + 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 + cardinals = c + carry.copy_to(chemholder, carry.total_volume) + + + if(istype(loca, /turf/)) + location = loca + else + location = get_turf(loca) + if(direct) + direction = direct + if(!silent) + var/contained = "" + for(var/reagent in carry.reagent_list) + contained += " [reagent] " + if(contained) + contained = "\[[contained]\]" + var/area/A = get_area(location) + + var/where = "[A.name] | [location.x], [location.y]" + var/whereLink = "[where]" + + if(carry.my_atom.fingerprintslast) + var/mob/M = get_mob_by_key(carry.my_atom.fingerprintslast) + var/more = "" + if(M) + more = "(?)" + message_admins("A chemical smoke reaction has taken place in ([whereLink])[contained]. Last associated key is [carry.my_atom.fingerprintslast][more].", 0, 1) + log_game("A chemical smoke reaction has taken place in ([where])[contained]. Last associated key is [carry.my_atom.fingerprintslast].") + else + message_admins("A chemical smoke reaction has taken place in ([whereLink]). No associated key.", 0, 1) + log_game("A chemical smoke reaction has taken place in ([where])[contained]. No associated key.") + + start() + var/i = 0 + + var/color = mix_color_from_reagents(chemholder.reagents.reagent_list) + + for(i=0, i 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++ + var/direction = src.direction + if(!direction) + if(src.cardinals) + direction = pick(cardinal) + else + direction = pick(alldirs) + + if(chemholder.reagents.total_volume != 1) // can't split 1 very well + chemholder.reagents.copy_to(smoke, chemholder.reagents.total_volume / number) // copy reagents to each smoke, divide evenly + + if(color) + smoke.icon += color // give the smoke color, if it has any to begin with + else + // if no color, just use the old smoke icon + smoke.icon = 'icons/effects/96x96.dmi' + smoke.icon_state = "smoke" + + for(i=0, i 20) + n = 20 + number = n + cardinals = c + + chemholder.reagents.add_reagent("space_drugs", rand(1,10)) + + if(istype(loca, /turf/)) + location = loca + else + location = get_turf(loca) + if(direct) + direction = direct + + var/contained = "\[[chemholder.reagents.get_reagent_ids()]\]" + var/area/A = get_area(location) + + var/where = "[A.name] | [location.x], [location.y]" + var/whereLink=formatJumpTo(location,where) + + var/more = "(?)" + message_admins("[M][more] produced a toxic fart in ([whereLink])[contained].", 0, 1) + log_game("[M][more] produced a toxic fart in ([where])[contained].") + + ///////////////////////////////////////////// // Sleep smoke ///////////////////////////////////////////// -/obj/effect/effect/smoke/sleepy +/obj/effect/effect/sleep_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/smoke/sleepy/Move() +/obj/effect/effect/sleep_smoke/New() + ..() + spawn (200+rand(10,30)) + delete() + return + +/obj/effect/effect/sleep_smoke/Move() ..() for(var/mob/living/carbon/M in get_turf(src)) - affect(M) + if (M.internal != null && M.wear_mask && (M.wear_mask.flags & MASKINTERNALS)) +// if (M.wear_suit, /obj/item/clothing/suit/wizrobe && (M.hat, /obj/item/clothing/head/wizard) && (M.shoes, /obj/item/clothing/shoes/sandal)) // I'll work on it later + else + M.drop_item() + M:sleeping += 1 + if (M.coughedtime != 1) + M.coughedtime = 1 + M.emote("cough") + spawn ( 20 ) + M.coughedtime = 0 + return -/obj/effect/effect/smoke/sleepy/affect(mob/living/carbon/M as mob ) - if (!..()) - return 0 +/obj/effect/effect/sleep_smoke/Crossed(mob/living/carbon/M as mob ) + ..() + if(istype(M, /mob/living/carbon)) + if (M.internal != null && M.wear_mask && (M.wear_mask.flags & MASKINTERNALS)) +// if (M.wear_suit, /obj/item/clothing/suit/wizrobe && (M.hat, /obj/item/clothing/head/wizard) && (M.shoes, /obj/item/clothing/shoes/sandal)) // Work on it later + return + else + M.drop_item() + M:sleeping += 1 + if (M.coughedtime != 1) + M.coughedtime = 1 + M.emote("cough") + spawn ( 20 ) + M.coughedtime = 0 + return + +/datum/effect/effect/system/sleep_smoke_spread + var/total_smoke = 0 // To stop it being spammed and lagging! + var/direction + + set_up(n = 5, c = 0, loca, direct) + if(n > 20) + n = 20 + number = n + cardinals = c + if(istype(loca, /turf/)) + location = loca + else + location = get_turf(loca) + if(direct) + direction = direct + + + 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 10) - n = 10 - number = n - cardinals = c - if(istype(loca, /turf/)) - location = loca - else - location = get_turf(loca) - if(direct) - direction = direct + set_up(n = 5, c = 0, loca, direct) + if(n > 20) + n = 20 + number = n + cardinals = c + if(istype(loca, /turf/)) + location = loca + else + location = get_turf(loca) + if(direct) + direction = direct -/datum/effect/effect/system/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/smoke/smoke = new smoke_type(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) + return + spawn(0) + if(holder) + src.location = get_turf(holder) + var/obj/effect/effect/mustard_gas/smoke = new /obj/effect/effect/mustard_gas(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\The [src] is full." return reagents.remove_reagent(25,"water") - var/datum/effect/effect/system/smoke_spread/bad/smoke = new /datum/effect/effect/system/smoke_spread/bad() + var/datum/effect/effect/system/bad_smoke_spread/smoke = new /datum/effect/effect/system/bad_smoke_spread() smoke.set_up(5, 0, user.loc) smoke.start() playsound(user.loc, 'sound/effects/bamf.ogg', 50, 2) diff --git a/code/game/objects/items/weapons/grenades/smokebomb.dm b/code/game/objects/items/weapons/grenades/smokebomb.dm index d518567a5dc..27a2d0580e2 100644 --- a/code/game/objects/items/weapons/grenades/smokebomb.dm +++ b/code/game/objects/items/weapons/grenades/smokebomb.dm @@ -7,11 +7,11 @@ item_state = "flashbang" flags = FPRINT | TABLEPASS slot_flags = SLOT_BELT - var/datum/effect/effect/system/smoke_spread/bad/smoke + var/datum/effect/effect/system/bad_smoke_spread/smoke New() ..() - src.smoke = new /datum/effect/effect/system/smoke_spread/bad + src.smoke = new /datum/effect/effect/system/bad_smoke_spread src.smoke.attach(src) prime() diff --git a/code/game/objects/items/weapons/scrolls.dm b/code/game/objects/items/weapons/scrolls.dm index bf38210373e..6ca0f327e20 100644 --- a/code/game/objects/items/weapons/scrolls.dm +++ b/code/game/objects/items/weapons/scrolls.dm @@ -55,7 +55,7 @@ if(!((user == loc || (in_range(src, user) && istype(src.loc, /turf))))) return - var/datum/effect/effect/system/smoke_spread/smoke = new /datum/effect/effect/system/smoke_spread() + var/datum/effect/effect/system/harmless_smoke_spread/smoke = new /datum/effect/effect/system/harmless_smoke_spread() smoke.set_up(5, 0, user.loc) smoke.attach(user) smoke.start() diff --git a/code/modules/awaymissions/trigger.dm b/code/modules/awaymissions/trigger.dm index 65ad8f543d6..7080179b9a6 100644 --- a/code/modules/awaymissions/trigger.dm +++ b/code/modules/awaymissions/trigger.dm @@ -31,11 +31,11 @@ s.start() if(entersmoke) - var/datum/effect/effect/system/smoke_spread/s = new /datum/effect/effect/system/smoke_spread + var/datum/effect/effect/system/harmless_smoke_spread/s = new /datum/effect/effect/system/harmless_smoke_spread s.set_up(4, 1, src, 0) s.start() if(exitsmoke) - var/datum/effect/effect/system/smoke_spread/s = new /datum/effect/effect/system/smoke_spread + var/datum/effect/effect/system/harmless_smoke_spread/s = new /datum/effect/effect/system/harmless_smoke_spread s.set_up(4, 1, dest, 0) s.start() diff --git a/code/modules/events/tgevents/vent_clog.dm b/code/modules/events/tgevents/vent_clog.dm index 492b4480352..d12631be36a 100755 --- a/code/modules/events/tgevents/vent_clog.dm +++ b/code/modules/events/tgevents/vent_clog.dm @@ -30,7 +30,7 @@ R.my_atom = vent R.add_reagent(pick(gunk), 50) - var/datum/effect/effect/system/smoke_spread/chem/smoke = new + var/datum/effect/effect/system/chem_smoke_spread/smoke = new smoke.set_up(R, rand(1, 2), 0, vent, 0, silent = 1) playsound(vent.loc, 'sound/effects/smoke.ogg', 50, 1, -3) smoke.start() diff --git a/code/modules/mob/living/carbon/alien/humanoid/life.dm b/code/modules/mob/living/carbon/alien/humanoid/life.dm index 45ed9d5e00c..67e3134fdb9 100644 --- a/code/modules/mob/living/carbon/alien/humanoid/life.dm +++ b/code/modules/mob/living/carbon/alien/humanoid/life.dm @@ -130,7 +130,7 @@ breath = loc.remove_air(breath_moles) // Handle chem smoke effect -- Doohl - for(var/obj/effect/effect/smoke/chem/smoke in view(1, src)) + for(var/obj/effect/effect/chem_smoke/smoke in view(1, src)) if(smoke.reagents.total_volume) smoke.reagents.reaction(src, INGEST) spawn(5) diff --git a/code/modules/mob/living/carbon/alien/larva/life.dm b/code/modules/mob/living/carbon/alien/larva/life.dm index b6468fb45e8..1d3ad72d612 100644 --- a/code/modules/mob/living/carbon/alien/larva/life.dm +++ b/code/modules/mob/living/carbon/alien/larva/life.dm @@ -103,7 +103,7 @@ breath = loc.remove_air(breath_moles) // Handle chem smoke effect -- Doohl - for(var/obj/effect/effect/smoke/chem/smoke in view(1, src)) + for(var/obj/effect/effect/chem_smoke/smoke in view(1, src)) if(smoke.reagents.total_volume) smoke.reagents.reaction(src, INGEST) spawn(5) diff --git a/code/modules/mob/living/carbon/human/life.dm b/code/modules/mob/living/carbon/human/life.dm index 6d56ae5e02c..3963b054d62 100644 --- a/code/modules/mob/living/carbon/human/life.dm +++ b/code/modules/mob/living/carbon/human/life.dm @@ -395,7 +395,7 @@ if(!block) - for(var/obj/effect/effect/smoke/chem/smoke in view(1, src)) + for(var/obj/effect/effect/chem_smoke/smoke in view(1, src)) if(smoke.reagents.total_volume) smoke.reagents.reaction(src, INGEST) spawn(5) diff --git a/code/modules/mob/living/carbon/monkey/life.dm b/code/modules/mob/living/carbon/monkey/life.dm index ccdab077e65..f5385fbafd3 100644 --- a/code/modules/mob/living/carbon/monkey/life.dm +++ b/code/modules/mob/living/carbon/monkey/life.dm @@ -134,7 +134,6 @@ heal_overall_damage(rads,rads) adjustOxyLoss(-(rads)) adjustToxLoss(-(rads)) - updatehealth() return if (radiation > 100) @@ -148,7 +147,6 @@ radiation-- if(prob(25)) adjustToxLoss(1) - updatehealth() if(50 to 74) radiation -= 2 @@ -158,7 +156,6 @@ Weaken(3) src << "\red You feel weak." emote("collapse") - updatehealth() if(75 to 100) radiation -= 3 @@ -257,7 +254,8 @@ block = 1 if(!block) - for(var/obj/effect/effect/smoke/chem/smoke in view(1, src)) + + for(var/obj/effect/effect/chem_smoke/smoke in view(1, src)) if(smoke.reagents.total_volume) smoke.reagents.reaction(src, INGEST) spawn(5) @@ -483,12 +481,9 @@ else dizziness = max(0, dizziness - 1) - updatehealth() - return //TODO: DEFERRED proc/handle_regular_status_updates() - updatehealth() if(stat == DEAD) //DEAD. BROWN BREAD. SWIMMING WITH THE SPESS CARP blinded = 1 diff --git a/code/modules/mob/living/simple_animal/bees.dm b/code/modules/mob/living/simple_animal/bees.dm index 48146f46886..773b5601010 100644 --- a/code/modules/mob/living/simple_animal/bees.dm +++ b/code/modules/mob/living/simple_animal/bees.dm @@ -92,7 +92,7 @@ //smoke, water and steam calms us down var/calming = 0 - var/list/calmers = list(/obj/effect/effect/smoke/chem, \ + var/list/calmers = list(/obj/effect/effect/chem_smoke, \ /obj/effect/effect/water, \ /obj/effect/effect/foam, \ /obj/effect/effect/steam, \ diff --git a/code/modules/mob/living/simple_animal/hostile/hivebot.dm b/code/modules/mob/living/simple_animal/hostile/hivebot.dm index 486ceee905c..70602dc4b77 100644 --- a/code/modules/mob/living/simple_animal/hostile/hivebot.dm +++ b/code/modules/mob/living/simple_animal/hostile/hivebot.dm @@ -79,7 +79,7 @@ New() ..() - var/datum/effect/effect/system/smoke_spread/smoke = new /datum/effect/effect/system/smoke_spread() + var/datum/effect/effect/system/harmless_smoke_spread/smoke = new /datum/effect/effect/system/harmless_smoke_spread() smoke.set_up(5, 0, src.loc) smoke.start() visible_message("\red The [src] warps in!") diff --git a/code/modules/organs/organ_external.dm b/code/modules/organs/organ_external.dm index b9dbd662a8c..dae55670eb0 100644 --- a/code/modules/organs/organ_external.dm +++ b/code/modules/organs/organ_external.dm @@ -319,7 +319,6 @@ This function completely restores a damaged organ to perfect condition. perma_injury = 0 update_germs() - update_icon() return //Updating germ levels. Handles organ germ levels and necrosis. @@ -451,10 +450,6 @@ This function completely restores a damaged organ to perfect condition. var/n_is = damage_state_text() if (n_is != damage_state) damage_state = n_is - if(status & ORGAN_DESTROYED) - owner.update_body(1) - else - owner.UpdateDamageIcon(1) return 1 return 0 diff --git a/code/modules/power/apc.dm b/code/modules/power/apc.dm index 5c8859a8145..344121c27af 100644 --- a/code/modules/power/apc.dm +++ b/code/modules/power/apc.dm @@ -1009,7 +1009,7 @@ cell.corrupt() src.malfhack = 1 update_icon() - var/datum/effect/effect/system/smoke_spread/smoke = new /datum/effect/effect/system/smoke_spread() + var/datum/effect/effect/system/harmless_smoke_spread/smoke = new /datum/effect/effect/system/harmless_smoke_spread() smoke.set_up(3, 0, src.loc) smoke.attach(src) smoke.start() diff --git a/code/modules/power/smes.dm b/code/modules/power/smes.dm index d20eb54b389..c47efa5ceb2 100644 --- a/code/modules/power/smes.dm +++ b/code/modules/power/smes.dm @@ -274,7 +274,7 @@ for(var/mob/M in viewers(src)) M.show_message("\red The [src.name] is making strange noises!", 3, "\red You hear sizzling electronics.", 2) sleep(10*pick(4,5,6,7,10,14)) - var/datum/effect/effect/system/smoke_spread/smoke = new /datum/effect/effect/system/smoke_spread() + var/datum/effect/effect/system/harmless_smoke_spread/smoke = new /datum/effect/effect/system/harmless_smoke_spread() smoke.set_up(3, 0, src.loc) smoke.attach(src) smoke.start() @@ -292,7 +292,7 @@ emp_act(2) if(prob(5)) //smoke only world << "\red SMES smoke in [src.loc.loc]" - var/datum/effect/effect/system/smoke_spread/smoke = new /datum/effect/effect/system/smoke_spread() + var/datum/effect/effect/system/harmless_smoke_spread/smoke = new /datum/effect/effect/system/harmless_smoke_spread() smoke.set_up(3, 0, src.loc) smoke.attach(src) smoke.start() diff --git a/code/modules/projectiles/guns/magic/wand.dm b/code/modules/projectiles/guns/magic/wand.dm index 76e08259018..c14e9f73f75 100644 --- a/code/modules/projectiles/guns/magic/wand.dm +++ b/code/modules/projectiles/guns/magic/wand.dm @@ -106,7 +106,7 @@ /obj/item/weapon/gun/magic/wand/teleport/zap_self(mob/living/user as mob) do_teleport(user, user, 10) - var/datum/effect/effect/system/smoke_spread/smoke = new /datum/effect/effect/system/smoke_spread() + var/datum/effect/effect/system/harmless_smoke_spread/smoke = new /datum/effect/effect/system/harmless_smoke_spread() smoke.set_up(10, 0, user.loc) smoke.start() charges-- diff --git a/code/modules/projectiles/projectile/magic.dm b/code/modules/projectiles/projectile/magic.dm index 695794eece4..e2ce8735182 100644 --- a/code/modules/projectiles/projectile/magic.dm +++ b/code/modules/projectiles/projectile/magic.dm @@ -87,7 +87,7 @@ if(!stuff.anchored && stuff.loc) teleammount++ do_teleport(stuff, stuff, 10) - var/datum/effect/effect/system/smoke_spread/smoke = new /datum/effect/effect/system/smoke_spread() + var/datum/effect/effect/system/harmless_smoke_spread/smoke = new /datum/effect/effect/system/harmless_smoke_spread() smoke.set_up(max(round(10 - teleammount),1), 0, stuff.loc) //Smoke drops off if a lot of stuff is moved for the sake of sanity smoke.start() diff --git a/code/modules/reagents/Chemistry-Reagents.dm b/code/modules/reagents/Chemistry-Reagents.dm index 6f59f3f6c40..8801b6dcf58 100644 --- a/code/modules/reagents/Chemistry-Reagents.dm +++ b/code/modules/reagents/Chemistry-Reagents.dm @@ -39,32 +39,31 @@ datum var/datum/reagent/self = src src = null //of the reagent to the mob on TOUCHING it. - if(self.holder) //for catching rare runtimes - if(!istype(self.holder.my_atom, /obj/effect/effect/smoke/chem)) - // If the chemicals are in a smoke cloud, do not try to let the chemicals "penetrate" into the mob's system (balance station 13) -- Doohl + if(!istype(self.holder.my_atom, /obj/effect/effect/chem_smoke)) + // If the chemicals are in a smoke cloud, do not try to let the chemicals "penetrate" into the mob's system (balance station 13) -- Doohl - if(method == TOUCH) + if(method == TOUCH) - var/chance = 1 - var/block = 0 + var/chance = 1 + var/block = 0 - for(var/obj/item/clothing/C in M.get_equipped_items()) - if(C.permeability_coefficient < chance) chance = C.permeability_coefficient - if(istype(C, /obj/item/clothing/suit/bio_suit)) - // bio suits are just about completely fool-proof - Doohl - // kind of a hacky way of making bio suits more resistant to chemicals but w/e - if(prob(75)) - block = 1 + for(var/obj/item/clothing/C in M.get_equipped_items()) + if(C.permeability_coefficient < chance) chance = C.permeability_coefficient + if(istype(C, /obj/item/clothing/suit/bio_suit)) + // bio suits are just about completely fool-proof - Doohl + // kind of a hacky way of making bio suits more resistant to chemicals but w/e + if(prob(75)) + block = 1 - if(istype(C, /obj/item/clothing/head/bio_hood)) - if(prob(75)) - block = 1 + if(istype(C, /obj/item/clothing/head/bio_hood)) + if(prob(75)) + block = 1 - chance = chance * 100 + chance = chance * 100 - if(prob(chance) && !block) - if(M.reagents) - M.reagents.add_reagent(self.id,self.volume/2) + if(prob(chance) && !block) + if(M.reagents) + M.reagents.add_reagent(self.id,self.volume/2) return 1 reaction_obj(var/obj/O, var/volume) //By default we transfer a small part of the reagent to the object @@ -791,12 +790,7 @@ datum reaction_turf(var/turf/T, var/volume) src = null if(!istype(T, /turf/space)) - var/obj/effect/decal/cleanable/dirt/dirtoverlay = locate(/obj/effect/decal/cleanable/dirt, T) - if (!dirtoverlay) - dirtoverlay = new/obj/effect/decal/cleanable/dirt(T) - dirtoverlay.alpha = volume*30 - else - dirtoverlay.alpha = min(dirtoverlay.alpha+volume*30, 255) + new /obj/effect/decal/cleanable/dirt(T) chlorine name = "Chlorine" @@ -1091,9 +1085,7 @@ datum src = null if(volume >= 3) if(!istype(T, /turf/space)) - var/obj/effect/decal/cleanable/greenglow/glow = locate(/obj/effect/decal/cleanable/greenglow, T) - if(!glow) - new /obj/effect/decal/cleanable/greenglow(T) + new /obj/effect/decal/cleanable/greenglow(T) return @@ -1132,9 +1124,9 @@ datum src = null if(volume >= 5) if(istype(T, /turf/simulated/wall)) - var/turf/simulated/wall/W = T - W.thermite = 1 - W.overlays += image('icons/effects/effects.dmi',icon_state = "#673910") + T:thermite = 1 + T.overlays.Cut() + T.overlays = image('icons/effects/effects.dmi',icon_state = "thermite") return on_mob_life(var/mob/living/M as mob) @@ -1289,10 +1281,7 @@ datum src = null if(volume >= 3) if(!istype(T, /turf/space)) - var/obj/effect/decal/cleanable/greenglow/glow = locate(/obj/effect/decal/cleanable/greenglow, T) - if(!glow) - new /obj/effect/decal/cleanable/greenglow(T) - return + new /obj/effect/decal/cleanable/greenglow(T) aluminum name = "Aluminum" @@ -1351,6 +1340,7 @@ datum O.clean_blood() reaction_turf(var/turf/T, var/volume) if(volume >= 1) + T.overlays.Cut() T.clean_blood() for(var/obj/effect/decal/cleanable/C in src) del(C) @@ -2402,16 +2392,11 @@ datum victim.Weaken(5) //victim.Paralyse(10) //victim.drop_item() - on_mob_life(var/mob/living/M as mob) - if(!M) M = holder.my_atom - if(prob(5)) - M.visible_message("[M] [pick("dry heaves!","coughs!","splutters!")]") - return frostoil name = "Frost Oil" id = "frostoil" - description = "A special oil that noticably chills the body. Extracted from Ice Peppers." + description = "A special oil that noticably chills the body. Extraced from Icepeppers." reagent_state = LIQUID color = "#B31008" // rgb: 139, 166, 233 @@ -2473,7 +2458,7 @@ datum hot_coco name = "Hot Chocolate" id = "hot_coco" - description = "Made with love! And cocoa beans." + description = "Made with love! And coco beans." reagent_state = LIQUID nutriment_factor = 2 * REAGENTS_METABOLISM color = "#403010" // rgb: 64, 48, 16 diff --git a/code/modules/reagents/Chemistry-Recipes.dm b/code/modules/reagents/Chemistry-Recipes.dm index 8c227b1a589..3895d1ccee9 100644 --- a/code/modules/reagents/Chemistry-Recipes.dm +++ b/code/modules/reagents/Chemistry-Recipes.dm @@ -448,12 +448,14 @@ datum secondary = 1 on_reaction(var/datum/reagents/holder, var/created_volume) var/location = get_turf(holder.my_atom) - var/datum/effect/effect/system/smoke_spread/chem/S = new /datum/effect/effect/system/smoke_spread/chem + var/datum/effect/effect/system/chem_smoke_spread/S = new /datum/effect/effect/system/chem_smoke_spread S.attach(location) S.set_up(holder, 10, 0, location) playsound(location, 'sound/effects/smoke.ogg', 50, 1, -3) spawn(0) S.start() + sleep(10) + S.start() holder.clear_reagents() return diff --git a/code/modules/recycling/sortingmachinery.dm b/code/modules/recycling/sortingmachinery.dm index 28dad70da25..ae3dd52b4cc 100755 --- a/code/modules/recycling/sortingmachinery.dm +++ b/code/modules/recycling/sortingmachinery.dm @@ -218,7 +218,7 @@ return Bumped(var/atom/movable/AM) //Go straight into the chute - if(istype(AM, /obj/item/projectile) || istype(AM, /obj/effect)) return + if(istype(AM, /obj/item/projectile)) return switch(dir) if(NORTH) if(AM.loc.y != src.loc.y+1) return diff --git a/code/modules/research/xenoarchaeology/machinery/coolant.dm b/code/modules/research/xenoarchaeology/machinery/coolant.dm index 6c0652f4084..bc03553bee0 100644 --- a/code/modules/research/xenoarchaeology/machinery/coolant.dm +++ b/code/modules/research/xenoarchaeology/machinery/coolant.dm @@ -37,7 +37,7 @@ datum/chemical_reaction/coolant explode() /obj/structure/reagent_dispensers/coolanttank/proc/explode() - var/datum/effect/effect/system/smoke_spread/S = new /datum/effect/effect/system/smoke_spread + var/datum/effect/effect/system/harmless_smoke_spread/S = new /datum/effect/effect/system/harmless_smoke_spread //S.attach(src) S.set_up(5, 0, src.loc) diff --git a/code/unused/new_year.dm b/code/unused/new_year.dm index c21617f4648..9dba4f3e59c 100644 --- a/code/unused/new_year.dm +++ b/code/unused/new_year.dm @@ -95,7 +95,7 @@ playsound(src.loc, 'sound/effects/bang.ogg', 25, 1) var/turf/T = get_turf(src) if(T) - var/datum/effect/effect/system/smoke_spread/smoke = new + var/datum/effect/effect/system/harmless_smoke_spread/smoke = new smoke.set_up(3, 0, src.loc) smoke.attach(src) smoke.start() diff --git a/code/unused/spells.dm b/code/unused/spells.dm index cb1fcc27425..a1dbbb9e3e1 100644 --- a/code/unused/spells.dm +++ b/code/unused/spells.dm @@ -318,7 +318,7 @@ if(T.y>world.maxy-4 || T.y<4) continue turfs += T if(!turfs.len) turfs += pick(/turf in orange(6)) - var/datum/effect/effect/system/smoke_spread/smoke = new /datum/effect/effect/system/smoke_spread() + var/datum/effect/effect/system/harmless_smoke_spread/smoke = new /datum/effect/effect/system/harmless_smoke_spread() smoke.set_up(10, 0, usr.loc) smoke.start() var/turf/picked = pick(turfs) @@ -360,7 +360,7 @@ usr.say("SCYAR NILA [uppertext(A)]") - var/datum/effect/effect/system/smoke_spread/smoke = new /datum/effect/effect/system/smoke_spread() + var/datum/effect/effect/system/harmless_smoke_spread/smoke = new /datum/effect/effect/system/harmless_smoke_spread() smoke.set_up(5, 0, usr.loc) smoke.attach(usr) smoke.start() diff --git a/icons/effects/96x96.dmi b/icons/effects/96x96.dmi index 9deb1803262..bc5d4929381 100644 Binary files a/icons/effects/96x96.dmi and b/icons/effects/96x96.dmi differ diff --git a/icons/effects/chemsmoke.dmi b/icons/effects/chemsmoke.dmi index 4308e3d40bb..5be1b638edd 100644 Binary files a/icons/effects/chemsmoke.dmi and b/icons/effects/chemsmoke.dmi differ