From af0593e07b784a9daa42cf70dae1293f9b06856c Mon Sep 17 00:00:00 2001 From: Ater Ignis Date: Fri, 9 Nov 2012 20:53:20 +0400 Subject: [PATCH] Chemistry on child reagents and in mobs Ethanol childs (most drinks in general) are treated as ethanol in reactions Reactions are going inside mobs, but not make bubbling effect --- code/modules/mob/mob_defines.dm | 2 +- code/modules/reagents/Chemistry-Holder.dm | 34 ++++++++++++++--------- html/changelog.html | 2 ++ 3 files changed, 24 insertions(+), 14 deletions(-) diff --git a/code/modules/mob/mob_defines.dm b/code/modules/mob/mob_defines.dm index 8fa35edf2d..068851304c 100644 --- a/code/modules/mob/mob_defines.dm +++ b/code/modules/mob/mob_defines.dm @@ -2,7 +2,7 @@ density = 1 layer = 4.0 animate_movement = 2 - flags = NOREACT +// flags = NOREACT var/datum/mind/mind var/stat = 0 //Whether a mob is alive or dead. TODO: Move this to living - Nodrak diff --git a/code/modules/reagents/Chemistry-Holder.dm b/code/modules/reagents/Chemistry-Holder.dm index cffc5986f3..f73c1797fa 100644 --- a/code/modules/reagents/Chemistry-Holder.dm +++ b/code/modules/reagents/Chemistry-Holder.dm @@ -251,8 +251,9 @@ datum multiplier = max(multiplier, 1) //this shouldnt happen ... add_reagent(C.result, C.result_amount*multiplier) - for(var/mob/M in viewers(4, get_turf(my_atom)) ) - M << "\blue \icon[my_atom] The solution begins to bubble." + if(!isliving(my_atom)) + for(var/mob/M in viewers(4, get_turf(my_atom)) ) + M << "\blue \icon[my_atom] The solution begins to bubble." if(istype(my_atom, /obj/item/metroid_core)) var/obj/item/metroid_core/ME = my_atom @@ -396,13 +397,17 @@ datum for(var/A in reagent_list) var/datum/reagent/R = A - if (R.id == reagent) - R.volume -= amount - update_total() - if(!safety)//So it does not handle reactions when it need not to - handle_reactions() - my_atom.on_reagent_change() - return 0 + var/datum/compare = chemical_reagents_list[reagent] + if(istype(R,compare)) + var/amt = max(0,min(R.volume,amount)) + R.volume -= amt + amount -= amt + if(amount<=0) + update_total() + if(!safety)//So it does not handle reactions when it need not to + handle_reactions() + my_atom.on_reagent_change() + return 0 return 1 @@ -410,7 +415,8 @@ datum for(var/A in reagent_list) var/datum/reagent/R = A - if (R.id == reagent) + var/datum/compare = chemical_reagents_list[reagent] + if(istype(R,compare)) if(!amount) return R else if(R.volume >= amount) return R @@ -419,12 +425,14 @@ datum return 0 get_reagent_amount(var/reagent) + var/amnt = 0 for(var/A in reagent_list) var/datum/reagent/R = A - if (R.id == reagent) - return R.volume + var/datum/compare = chemical_reagents_list[reagent] + if(istype(R,compare)) + amnt += R.volume - return 0 + return amnt get_reagents() var/res = "" diff --git a/html/changelog.html b/html/changelog.html index f65c1ea974..6d272ef81e 100644 --- a/html/changelog.html +++ b/html/changelog.html @@ -61,6 +61,8 @@ should be listed in the changelog upon commit though. Thanks. -->

AterIgnis updated: