From 810d6267008d71af49e92f2019dbb5202b5fc833 Mon Sep 17 00:00:00 2001 From: DZD Date: Tue, 7 Apr 2015 17:41:19 -0400 Subject: [PATCH] Smoke changes - Changes smoke so that it immediately affects all mobs in its area of effect, smoke clouds are purely visual. - Any mobs in the area of effect of a smoke reaction will be affected by the smoke's touch reaction, and have all reagents in the smoke container transferred into them. - Smoke clouds are no longer opaque. - Mixing 10u potassium, 10u sugar, and 10u phosphorus or higher will cause an area of effect with a radius of 3 from the point of reaction. Any less will have a radius of 2. - Same with heating 10u smoke powder. - Smoke powder reaction now only yields 1 powder instead of 3. - Vent clog event has a radius 3 area of effect. Fixes and uncommenting - Uncomments honey turf reaction. - Uncomments synthflesh turf reaction. - Adds list for reagents to not copy via smoke (or more specifically, delete when a smoke reaction happens without copying). This includes sugar, phosphorus, potassium, and the smoke "reagent" produced in a smoke reaction. --- code/game/objects/effects/effect_system.dm | 33 +++------- code/game/objects/items/devices/PDA/PDA.dm | 30 ++++----- code/modules/events/tgevents/vent_clog.dm | 2 +- code/modules/mob/living/carbon/alien/life.dm | 9 --- code/modules/mob/living/carbon/human/life.dm | 22 ------- code/modules/mob/living/carbon/monkey/life.dm | 15 ----- code/modules/reagents/newchem/food.dm | 4 +- code/modules/reagents/newchem/medicine.dm | 3 +- code/modules/reagents/newchem/pyro.dm | 62 ++++++++----------- 9 files changed, 55 insertions(+), 125 deletions(-) diff --git a/code/game/objects/effects/effect_system.dm b/code/game/objects/effects/effect_system.dm index 42d917cb405..5057bb1d3b0 100644 --- a/code/game/objects/effects/effect_system.dm +++ b/code/game/objects/effects/effect_system.dm @@ -404,7 +404,7 @@ steam.start() -- spawns the effect /obj/effect/effect/chem_smoke name = "smoke" - opacity = 1 + opacity = 0 anchored = 0.0 mouse_opacity = 0 var/amount = 6.0 @@ -415,28 +415,12 @@ steam.start() -- spawns the effect /obj/effect/effect/chem_smoke/New() ..() - var/datum/reagents/R = new/datum/reagents(500) - reagents = R - R.my_atom = src - spawn (200+rand(10,30)) delete() return /obj/effect/effect/chem_smoke/Move() ..() - for(var/atom/A in view(2, src)) - if(reagents.has_reagent("radium")||reagents.has_reagent("uranium")||reagents.has_reagent("carbon")||reagents.has_reagent("thermite")||reagents.has_reagent("synthflesh")||reagents.has_reagent("firefighting_foam")||reagents.has_reagent("honey"))//Prevents unholy radium spam by reducing the number of 'greenglows' down to something reasonable -Sieve - if(prob(5)) - reagents.reaction(A) - else - reagents.reaction(A) - - return - -/obj/effect/effect/chem_smoke/Crossed(mob/living/carbon/M as mob ) - ..() - reagents.reaction(M) return @@ -488,11 +472,18 @@ steam.start() -- spawns the effect msg_admin_attack("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() + 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) + for(var/atom/A in view(effect_range, smokeholder)) + chemholder.reagents.reaction(A) + if(iscarbon(A)) + var/mob/living/carbon/C = A + if(!(C.wear_mask && (C.internals != null || C.wear_mask.flags & BLOCK_GAS_SMOKE_EFFECT))) + chemholder.reagents.copy_to(C, chemholder.reagents.total_volume) + qdel(smokeholder) for(i=0, i 20) return @@ -508,16 +499,12 @@ steam.start() -- spawns the effect 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=25 && i<=40) //Smoke - var/datum/effect/effect/system/chem_smoke_spread/S = new /datum/effect/effect/system/chem_smoke_spread + var/datum/effect/effect/system/harmless_smoke_spread/S = new /datum/effect/effect/system/harmless_smoke_spread //Why was this chem_smoke_spread when there are no chems involved? S.attach(P.loc) S.set_up(P, 10, 0, P.loc) playsound(P.loc, 'sound/effects/smoke.ogg', 50, 1, -3) @@ -884,9 +884,9 @@ var/global/list/obj/item/device/pda/PDAs = list() message += "It melts in a puddle of plastic." else message += "Your [P] shatters in a thousand pieces!" - + JFLOG("[M]'s PDA Detonated >>> [message]") - + if(M && isliving(M)) message = "\red" + message M.show_message(message, 1) @@ -1402,26 +1402,26 @@ var/global/list/obj/item/device/pda/PDAs = list() A.emp_act(severity) /** -* +* * JFLOG -* +* * These functions as well as all the log statements are being used to gather user data for how -* people are using the PDA files with the intent of revising them based on this data. -* -* They are being added on 28/03/2015 and the intent is to remove them in two weeks. If you're -* reading this and it's substantially past that point, you should remove anything marked with -* 'JFLOG'. -* -* All changes should be contained to PDA.dm except the creation function which is contained in +* people are using the PDA files with the intent of revising them based on this data. +* +* They are being added on 28/03/2015 and the intent is to remove them in two weeks. If you're +* reading this and it's substantially past that point, you should remove anything marked with +* 'JFLOG'. +* +* All changes should be contained to PDA.dm except the creation function which is contained in * job_controller.dm. -* -* - Jack Fractal +* +* - Jack Fractal **/ /obj/item/device/pda/proc/JFLOG_DescribeSelf() return "([src]|[cartridge ? cartridge.name : "None"])" - + /obj/item/device/pda/proc/JFLOG(message as text) if (config) log_pda("[JFLOG_DescribeSelf()] >>> [message]") \ No newline at end of file diff --git a/code/modules/events/tgevents/vent_clog.dm b/code/modules/events/tgevents/vent_clog.dm index 10b25a37eb8..1e31e08485d 100755 --- a/code/modules/events/tgevents/vent_clog.dm +++ b/code/modules/events/tgevents/vent_clog.dm @@ -32,5 +32,5 @@ 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() + smoke.start(3) R.delete() //GC the reagents diff --git a/code/modules/mob/living/carbon/alien/life.dm b/code/modules/mob/living/carbon/alien/life.dm index 2a2d6214e71..4a249312ba2 100644 --- a/code/modules/mob/living/carbon/alien/life.dm +++ b/code/modules/mob/living/carbon/alien/life.dm @@ -54,15 +54,6 @@ breath = loc.remove_air(breath_moles) - // Handle chem smoke effect -- Doohl - for(var/obj/effect/effect/chem_smoke/smoke in view(1, src)) - if(smoke.reagents.total_volume) - smoke.reagents.reaction(src, INGEST) - spawn(5) - if(smoke) - smoke.reagents.copy_to(src, 10) // I dunno, maybe the reagents enter the blood stream through the lungs? - break // If they breathe in the nasty stuff once, no need to continue checking - else //Still give containing object the chance to interact if(istype(loc, /obj/)) diff --git a/code/modules/mob/living/carbon/human/life.dm b/code/modules/mob/living/carbon/human/life.dm index 5d43f5a91ec..079a653efe7 100644 --- a/code/modules/mob/living/carbon/human/life.dm +++ b/code/modules/mob/living/carbon/human/life.dm @@ -369,28 +369,6 @@ var/global/list/brutefireloss_overlays = list("1" = image("icon" = 'icons/mob/sc if(prob(5)) rupture_lung() - // Handle chem smoke effect -- Doohl - var/block = 0 - if(wear_mask) - if(wear_mask.flags & BLOCK_GAS_SMOKE_EFFECT) - block = 1 - if(glasses) - if(glasses.flags & BLOCK_GAS_SMOKE_EFFECT) - block = 1 - if(head) - if(head.flags & BLOCK_GAS_SMOKE_EFFECT) - block = 1 - - if(!block) - - for(var/obj/effect/effect/chem_smoke/smoke in view(1, src)) - if(smoke.reagents.total_volume) - smoke.reagents.reaction(src, INGEST) - spawn(5) - if(smoke) - smoke.reagents.copy_to(src, 10) // I dunno, maybe the reagents enter the blood stream through the lungs? - break // If they breathe in the nasty stuff once, no need to continue checking - else //Still give containing object the chance to interact if(istype(loc, /obj/)) var/obj/location_as_object = loc diff --git a/code/modules/mob/living/carbon/monkey/life.dm b/code/modules/mob/living/carbon/monkey/life.dm index cd0db0092b4..51162a425ff 100644 --- a/code/modules/mob/living/carbon/monkey/life.dm +++ b/code/modules/mob/living/carbon/monkey/life.dm @@ -250,21 +250,6 @@ var/breath_moles = environment.total_moles()*BREATH_PERCENTAGE breath = loc.remove_air(breath_moles) - // Handle chem smoke effect -- Doohl - var/block = 0 - if(wear_mask) - if(istype(wear_mask, /obj/item/clothing/mask/gas)) - block = 1 - - if(!block) - - for(var/obj/effect/effect/chem_smoke/smoke in view(1, src)) - if(smoke.reagents.total_volume) - smoke.reagents.reaction(src, INGEST) - spawn(5) - if(smoke) - smoke.reagents.copy_to(src, 10) // I dunno, maybe the reagents enter the blood stream through the lungs? - break // If they breathe in the nasty stuff once, no need to continue checking else //Still give containing object the chance to interact diff --git a/code/modules/reagents/newchem/food.dm b/code/modules/reagents/newchem/food.dm index cd6e852f580..9b5f2c0db8f 100644 --- a/code/modules/reagents/newchem/food.dm +++ b/code/modules/reagents/newchem/food.dm @@ -119,12 +119,12 @@ datum/reagent/honey/on_mob_life(var/mob/living/M as mob) M.reagents.add_reagent("sugar", 0.8) ..() return -/* //Commenting this out until smoke is rewritten, otherwise, this spam so much honeycomb it's not funny + datum/reagent/honey/reaction_turf(var/turf/T, var/volume) src = null if(volume >= 5) new /obj/item/weapon/reagent_containers/food/snacks/honeycomb(T) - return */ + return /datum/reagent/mugwort name = "Mugwort" diff --git a/code/modules/reagents/newchem/medicine.dm b/code/modules/reagents/newchem/medicine.dm index 8c56c30bdd2..4040c61b505 100644 --- a/code/modules/reagents/newchem/medicine.dm +++ b/code/modules/reagents/newchem/medicine.dm @@ -94,13 +94,12 @@ datum/reagent/synthflesh/reaction_mob(var/mob/living/M, var/method=TOUCH, var/vo ..() return -/* //again, not until smoke rewrite--so many gibs,aghh! datum/reagent/synthflesh/reaction_turf(var/turf/T, var/volume) //let's make a mess! src = null if(volume >= 5) new /obj/effect/decal/cleanable/blood/gibs(T) playsound(T, 'sound/effects/splat.ogg', 50, 1, -3) - return */ + return datum/reagent/charcoal name = "Charcoal" diff --git a/code/modules/reagents/newchem/pyro.dm b/code/modules/reagents/newchem/pyro.dm index 7739795bae6..ae53d8db3c3 100644 --- a/code/modules/reagents/newchem/pyro.dm +++ b/code/modules/reagents/newchem/pyro.dm @@ -260,50 +260,40 @@ name = "smoke_powder" id = "smoke_powder" result = "smoke_powder" + required_reagents = list("stabilizing_agent" = 1, "potassium" = 1, "sugar" = 1, "phosphorus" = 1) + result_amount = 1 + +/datum/chemical_reaction/smoke + name = "smoke" + id = "smoke" + result = null required_reagents = list("potassium" = 1, "sugar" = 1, "phosphorus" = 1) - result_amount = 3 + result_amount = 1 +/datum/chemical_reaction/smoke/on_reaction(var/datum/reagents/holder, var/created_volume) + var/forbidden_reagents = list(id, "sugar", "phosphorus", "potassium") //Do not transfer this stuff through smoke. + for(var/f_reagent in forbidden_reagents) + if(holder.has_reagent(f_reagent)) + holder.remove_reagent(f_reagent, holder.get_reagent_amount(f_reagent)) + var/location = get_turf(holder.my_atom) + var/datum/effect/effect/system/chem_smoke_spread/S = new /datum/effect/effect/system/chem_smoke_spread + S.attach(location) + playsound(location, 'sound/effects/smoke.ogg', 50, 1, -3) + spawn(0) + if(S) + S.set_up(holder, 10, 0, location) + S.start(created_volume >= 10 ? 3 : 2) + if(holder && holder.my_atom) + holder.clear_reagents() + return -/datum/chemical_reaction/smoke_powder_smoke +/datum/chemical_reaction/smoke/smoke_powder name = "smoke_powder_smoke" id = "smoke_powder_smoke" - result = null required_reagents = list("smoke_powder" = 1) required_temp = 374 secondary = 1 - -/datum/chemical_reaction/smoke_powder_smoke/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 - S.attach(location) - playsound(location, 'sound/effects/smoke.ogg', 50, 1, -3) - spawn(0) - if(S) - S.set_up(holder, 10, 0, location) - S.start() - sleep(10) - S.start() - if(holder && holder.my_atom) - holder.clear_reagents() - return - -/datum/chemical_reaction/smoke_powder/on_reaction(var/datum/reagents/holder, var/created_volume) - if(holder.has_reagent("stabilizing_agent")) - return - holder.remove_reagent("smoke_powder", 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 - S.attach(location) - playsound(location, 'sound/effects/smoke.ogg', 50, 1, -3) - spawn(0) - if(S) - S.set_up(holder, 10, 0, location) - S.start() - sleep(10) - S.start() - if(holder && holder.my_atom) - holder.clear_reagents() - return + result_amount = 1 /datum/reagent/sonic_powder name = "Sonic Powder"