From 99751c041669cb9d2d123a9f72b6cd4a2b5c1e4f Mon Sep 17 00:00:00 2001 From: Loganbacca Date: Sat, 22 Feb 2014 00:56:12 +1300 Subject: [PATCH] Reagent reaction_mob/turf tweaks - Adds an if() check to reaction_mob for catching a very rare runtime related to mobs inhaling smoke reagents from just deleted smoke. - Carbons reaction_turf proc now modifies a single dirt overlay layer, instead of just adding more decal objects to the turf. - Added some checks to the radium and uranium reaction_turf proc so it doesn't stack multiple greenglow decals. - Performed colon removal surgery on thermites reaction_turf proc, also tweaked it's overlay operation to correctly overlay a chemical puddle effect, instead of a melted wall effect. - Removed space_cleaners overlays.Cut() code, since it was removing decals from turfs. Conflicts: code/modules/reagents/Chemistry-Reagents.dm --- code/modules/reagents/Chemistry-Reagents.dm | 71 +++++++++++++-------- 1 file changed, 43 insertions(+), 28 deletions(-) diff --git a/code/modules/reagents/Chemistry-Reagents.dm b/code/modules/reagents/Chemistry-Reagents.dm index 8fb7fefb84d..6f59f3f6c40 100644 --- a/code/modules/reagents/Chemistry-Reagents.dm +++ b/code/modules/reagents/Chemistry-Reagents.dm @@ -39,31 +39,32 @@ 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/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(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(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 @@ -790,7 +791,12 @@ datum reaction_turf(var/turf/T, var/volume) src = null if(!istype(T, /turf/space)) - new /obj/effect/decal/cleanable/dirt(T) + 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) chlorine name = "Chlorine" @@ -1085,7 +1091,9 @@ datum src = null if(volume >= 3) if(!istype(T, /turf/space)) - new /obj/effect/decal/cleanable/greenglow(T) + var/obj/effect/decal/cleanable/greenglow/glow = locate(/obj/effect/decal/cleanable/greenglow, T) + if(!glow) + new /obj/effect/decal/cleanable/greenglow(T) return @@ -1124,9 +1132,9 @@ datum src = null if(volume >= 5) if(istype(T, /turf/simulated/wall)) - T:thermite = 1 - T.overlays.Cut() - T.overlays = image('icons/effects/effects.dmi',icon_state = "thermite") + var/turf/simulated/wall/W = T + W.thermite = 1 + W.overlays += image('icons/effects/effects.dmi',icon_state = "#673910") return on_mob_life(var/mob/living/M as mob) @@ -1281,7 +1289,10 @@ datum src = null if(volume >= 3) if(!istype(T, /turf/space)) - new /obj/effect/decal/cleanable/greenglow(T) + var/obj/effect/decal/cleanable/greenglow/glow = locate(/obj/effect/decal/cleanable/greenglow, T) + if(!glow) + new /obj/effect/decal/cleanable/greenglow(T) + return aluminum name = "Aluminum" @@ -1340,7 +1351,6 @@ 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) @@ -2392,11 +2402,16 @@ 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. Extraced from Icepeppers." + description = "A special oil that noticably chills the body. Extracted from Ice Peppers." reagent_state = LIQUID color = "#B31008" // rgb: 139, 166, 233 @@ -2458,7 +2473,7 @@ datum hot_coco name = "Hot Chocolate" id = "hot_coco" - description = "Made with love! And coco beans." + description = "Made with love! And cocoa beans." reagent_state = LIQUID nutriment_factor = 2 * REAGENTS_METABOLISM color = "#403010" // rgb: 64, 48, 16