From 4cfa12aae3486371f8d6d6bb68862a292b88be53 Mon Sep 17 00:00:00 2001 From: ZomgPonies Date: Tue, 17 Jun 2014 04:51:06 -0400 Subject: [PATCH] Chemistry Reagent runtime --- code/modules/reagents/Chemistry-Reagents.dm | 63 +++++++++++---------- 1 file changed, 32 insertions(+), 31 deletions(-) diff --git a/code/modules/reagents/Chemistry-Reagents.dm b/code/modules/reagents/Chemistry-Reagents.dm index 8359a655b48..879f8e9b9b2 100644 --- a/code/modules/reagents/Chemistry-Reagents.dm +++ b/code/modules/reagents/Chemistry-Reagents.dm @@ -40,45 +40,46 @@ 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 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/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) - if(method == INGEST && istype(M, /mob/living/carbon)) - if(prob(1 * self.addictiveness)) - if(prob(5 * volume)) - var/datum/disease/addiction/A = new /datum/disease/addiction - A.addicted_to = self - A.name = "[self.name] Addiction" - A.addiction ="[self.name]" - A.cure = self.id - M.viruses += A - A.affected_mob = M - A.holder = M - return 1 + if(method == INGEST && istype(M, /mob/living/carbon)) + if(prob(1 * self.addictiveness)) + if(prob(5 * volume)) + var/datum/disease/addiction/A = new /datum/disease/addiction + A.addicted_to = self + A.name = "[self.name] Addiction" + A.addiction ="[self.name]" + A.cure = self.id + M.viruses += A + A.affected_mob = M + A.holder = M + return 1 reaction_obj(var/obj/O, var/volume) //By default we transfer a small part of the reagent to the object src = null //if it can hold reagents. nope!