From 7f4388c5a3b0aa4601d15b4fa3056acbc2c6e228 Mon Sep 17 00:00:00 2001 From: Chinsky Date: Tue, 5 Nov 2013 02:44:39 +0400 Subject: [PATCH] Cleaned the fuck out of smoke. Conflicts: code/ATMOSPHERICS/pipes.dm code/game/objects/effects/effect_system.dm code/modules/mob/living/carbon/monkey/life.dm code/modules/organs/organ_external.dm --- code/ATMOSPHERICS/pipes.dm | 2 +- code/WorkInProgress/Cib/amorph/life.dm | 2 +- code/WorkInProgress/explosion_particles.dm | 2 +- code/datums/spell.dm | 4 +- code/game/gamemodes/events/ninja_abilities.dm | 2 +- code/game/machinery/computer/computer.dm | 2 +- code/game/mecha/combat/marauder.dm | 2 +- code/game/objects/effects/effect_system.dm | 492 +++++------------- .../items/weapons/grenades/smokebomb.dm | 4 +- code/game/objects/items/weapons/scrolls.dm | 2 +- code/modules/awaymissions/trigger.dm | 4 +- .../mob/living/carbon/alien/humanoid/life.dm | 2 +- .../mob/living/carbon/alien/larva/life.dm | 2 +- code/modules/mob/living/carbon/human/life.dm | 2 +- code/modules/mob/living/carbon/monkey/life.dm | 25 +- code/modules/mob/living/simple_animal/bees.dm | 2 +- .../living/simple_animal/hostile/hivebot.dm | 2 +- code/modules/organs/organ_external.dm | 5 + code/modules/power/apc.dm | 2 +- code/modules/power/smes.dm | 4 +- code/modules/reagents/Chemistry-Reagents.dm | 2 +- code/modules/reagents/Chemistry-Recipes.dm | 2 +- code/unused/new_year.dm | 2 +- code/unused/spells.dm | 4 +- 24 files changed, 184 insertions(+), 390 deletions(-) diff --git a/code/ATMOSPHERICS/pipes.dm b/code/ATMOSPHERICS/pipes.dm index ebd35f470bc..9efbcb8d88c 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/harmless_smoke_spread/smoke = new + var/datum/effect/effect/system/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 e3eae759756..ee2e822ff4b 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/chem_smoke/smoke in view(1, src)) + for(var/obj/effect/effect/smoke/chem/smoke in view(1, src)) if(smoke.reagents.total_volume) smoke.reagents.reaction(src, INGEST) spawn(5) diff --git a/code/WorkInProgress/explosion_particles.dm b/code/WorkInProgress/explosion_particles.dm index b63eeb9aab5..eb975303d28 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/harmless_smoke_spread/S = new/datum/effect/effect/system/harmless_smoke_spread() + var/datum/effect/effect/system/smoke_spread/S = new/datum/effect/effect/system/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 f82f654a2d4..49d329ca7ca 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/harmless_smoke_spread/smoke = new /datum/effect/effect/system/harmless_smoke_spread() + var/datum/effect/effect/system/smoke_spread/smoke = new /datum/effect/effect/system/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/bad_smoke_spread/smoke = new /datum/effect/effect/system/bad_smoke_spread() + var/datum/effect/effect/system/smoke_spread/bad/smoke = new /datum/effect/effect/system/smoke_spread/bad() smoke.set_up(smoke_amt, 0, location) //no idea what the 0 is smoke.start() diff --git a/code/game/gamemodes/events/ninja_abilities.dm b/code/game/gamemodes/events/ninja_abilities.dm index 691f2d84114..c1b762658da 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/bad_smoke_spread/smoke = new /datum/effect/effect/system/bad_smoke_spread() + var/datum/effect/effect/system/smoke_spread/bad/smoke = new /datum/effect/effect/system/smoke_spread/bad() smoke.set_up(10, 0, U.loc) smoke.start() playsound(U.loc, 'sound/effects/bamf.ogg', 50, 2) diff --git a/code/game/machinery/computer/computer.dm b/code/game/machinery/computer/computer.dm index 3ef385d0285..0b73b0e5426 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/harmless_smoke_spread/smoke = new /datum/effect/effect/system/harmless_smoke_spread() + var/datum/effect/effect/system/smoke_spread/smoke = new /datum/effect/effect/system/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 6e924e13ebb..b0e2ff70af5 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/harmless_smoke_spread/smoke_system = new + var/datum/effect/effect/system/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/effect_system.dm b/code/game/objects/effects/effect_system.dm index f6c56c2dc45..4273a5f8595 100644 --- a/code/game/objects/effects/effect_system.dm +++ b/code/game/objects/effects/effect_system.dm @@ -21,15 +21,6 @@ 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) @@ -225,196 +216,186 @@ steam.start() -- spawns the effect ///////////////////////////////////////////// -/obj/effect/effect/harmless_smoke +/obj/effect/effect/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/harmless_smoke/New() +/obj/effect/effect/smoke/New() ..() - spawn (100) + spawn (time_to_live) delete() return -/obj/effect/effect/harmless_smoke/Move() +/obj/effect/effect/smoke/HasEntered(mob/living/carbon/M as mob ) ..() - 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 +/datum/effect/effect/system/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 - 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) + 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) - 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/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/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)) - 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/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 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/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 100) @@ -147,6 +148,7 @@ radiation-- if(prob(25)) adjustToxLoss(1) + updatehealth() if(50 to 74) radiation -= 2 @@ -156,6 +158,7 @@ Weaken(3) src << "\red You feel weak." emote("collapse") + updatehealth() if(75 to 100) radiation -= 3 @@ -247,6 +250,22 @@ var/breath_moles = environment.total_moles()*BREATH_PERCENTAGE breath = loc.remove_air(breath_moles) + if(istype(wear_mask, /obj/item/clothing/mask/gas)) + var/obj/item/clothing/mask/gas/G = wear_mask + var/datum/gas_mixture/filtered = new + + filtered.copy_from(breath) + filtered.toxins *= G.gas_filter_strength + for(var/datum/gas/gas in filtered.trace_gases) + gas.moles *= G.gas_filter_strength + filtered.update_values() + loc.assume_air(filtered) + + breath.toxins *= 1 - G.gas_filter_strength + for(var/datum/gas/gas in breath.trace_gases) + gas.moles *= 1 - G.gas_filter_strength + breath.update_values() + // Handle chem smoke effect -- Doohl var/block = 0 if(wear_mask) @@ -254,8 +273,7 @@ block = 1 if(!block) - - for(var/obj/effect/effect/chem_smoke/smoke in view(1, src)) + for(var/obj/effect/effect/smoke/chem/smoke in view(1, src)) if(smoke.reagents.total_volume) smoke.reagents.reaction(src, INGEST) spawn(5) @@ -481,9 +499,12 @@ 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 773b5601010..48146f46886 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/chem_smoke, \ + var/list/calmers = list(/obj/effect/effect/smoke/chem, \ /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 70602dc4b77..486ceee905c 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/harmless_smoke_spread/smoke = new /datum/effect/effect/system/harmless_smoke_spread() + var/datum/effect/effect/system/smoke_spread/smoke = new /datum/effect/effect/system/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 dae55670eb0..b9dbd662a8c 100644 --- a/code/modules/organs/organ_external.dm +++ b/code/modules/organs/organ_external.dm @@ -319,6 +319,7 @@ 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. @@ -450,6 +451,10 @@ 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 bd61edb7ec0..33350791007 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/harmless_smoke_spread/smoke = new /datum/effect/effect/system/harmless_smoke_spread() + var/datum/effect/effect/system/smoke_spread/smoke = new /datum/effect/effect/system/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 c47efa5ceb2..d20eb54b389 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/harmless_smoke_spread/smoke = new /datum/effect/effect/system/harmless_smoke_spread() + var/datum/effect/effect/system/smoke_spread/smoke = new /datum/effect/effect/system/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/harmless_smoke_spread/smoke = new /datum/effect/effect/system/harmless_smoke_spread() + var/datum/effect/effect/system/smoke_spread/smoke = new /datum/effect/effect/system/smoke_spread() smoke.set_up(3, 0, src.loc) smoke.attach(src) smoke.start() diff --git a/code/modules/reagents/Chemistry-Reagents.dm b/code/modules/reagents/Chemistry-Reagents.dm index 8801b6dcf58..8fb7fefb84d 100644 --- a/code/modules/reagents/Chemistry-Reagents.dm +++ b/code/modules/reagents/Chemistry-Reagents.dm @@ -39,7 +39,7 @@ datum var/datum/reagent/self = src src = null //of the reagent to the mob on TOUCHING it. - if(!istype(self.holder.my_atom, /obj/effect/effect/chem_smoke)) + 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(method == TOUCH) diff --git a/code/modules/reagents/Chemistry-Recipes.dm b/code/modules/reagents/Chemistry-Recipes.dm index 3895d1ccee9..6e51abec59c 100644 --- a/code/modules/reagents/Chemistry-Recipes.dm +++ b/code/modules/reagents/Chemistry-Recipes.dm @@ -448,7 +448,7 @@ datum secondary = 1 on_reaction(var/datum/reagents/holder, var/created_volume) var/location = get_turf(holder.my_atom) - var/datum/effect/effect/system/chem_smoke_spread/S = new /datum/effect/effect/system/chem_smoke_spread + var/datum/effect/effect/system/smoke_spread/chem/S = new /datum/effect/effect/system/smoke_spread/chem S.attach(location) S.set_up(holder, 10, 0, location) playsound(location, 'sound/effects/smoke.ogg', 50, 1, -3) diff --git a/code/unused/new_year.dm b/code/unused/new_year.dm index 9dba4f3e59c..c21617f4648 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/harmless_smoke_spread/smoke = new + var/datum/effect/effect/system/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 a1dbbb9e3e1..cb1fcc27425 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/harmless_smoke_spread/smoke = new /datum/effect/effect/system/harmless_smoke_spread() + var/datum/effect/effect/system/smoke_spread/smoke = new /datum/effect/effect/system/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/harmless_smoke_spread/smoke = new /datum/effect/effect/system/harmless_smoke_spread() + var/datum/effect/effect/system/smoke_spread/smoke = new /datum/effect/effect/system/smoke_spread() smoke.set_up(5, 0, usr.loc) smoke.attach(usr) smoke.start()