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
This commit is contained in:
Ater Ignis
2012-11-09 20:53:20 +04:00
parent 3c6f8193af
commit af0593e07b
3 changed files with 24 additions and 14 deletions

View File

@@ -2,7 +2,7 @@
density = 1 density = 1
layer = 4.0 layer = 4.0
animate_movement = 2 animate_movement = 2
flags = NOREACT // flags = NOREACT
var/datum/mind/mind var/datum/mind/mind
var/stat = 0 //Whether a mob is alive or dead. TODO: Move this to living - Nodrak var/stat = 0 //Whether a mob is alive or dead. TODO: Move this to living - Nodrak

View File

@@ -251,8 +251,9 @@ datum
multiplier = max(multiplier, 1) //this shouldnt happen ... multiplier = max(multiplier, 1) //this shouldnt happen ...
add_reagent(C.result, C.result_amount*multiplier) add_reagent(C.result, C.result_amount*multiplier)
for(var/mob/M in viewers(4, get_turf(my_atom)) ) if(!isliving(my_atom))
M << "\blue \icon[my_atom] The solution begins to bubble." 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)) if(istype(my_atom, /obj/item/metroid_core))
var/obj/item/metroid_core/ME = my_atom var/obj/item/metroid_core/ME = my_atom
@@ -396,13 +397,17 @@ datum
for(var/A in reagent_list) for(var/A in reagent_list)
var/datum/reagent/R = A var/datum/reagent/R = A
if (R.id == reagent) var/datum/compare = chemical_reagents_list[reagent]
R.volume -= amount if(istype(R,compare))
update_total() var/amt = max(0,min(R.volume,amount))
if(!safety)//So it does not handle reactions when it need not to R.volume -= amt
handle_reactions() amount -= amt
my_atom.on_reagent_change() if(amount<=0)
return 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 return 1
@@ -410,7 +415,8 @@ datum
for(var/A in reagent_list) for(var/A in reagent_list)
var/datum/reagent/R = A var/datum/reagent/R = A
if (R.id == reagent) var/datum/compare = chemical_reagents_list[reagent]
if(istype(R,compare))
if(!amount) return R if(!amount) return R
else else
if(R.volume >= amount) return R if(R.volume >= amount) return R
@@ -419,12 +425,14 @@ datum
return 0 return 0
get_reagent_amount(var/reagent) get_reagent_amount(var/reagent)
var/amnt = 0
for(var/A in reagent_list) for(var/A in reagent_list)
var/datum/reagent/R = A var/datum/reagent/R = A
if (R.id == reagent) var/datum/compare = chemical_reagents_list[reagent]
return R.volume if(istype(R,compare))
amnt += R.volume
return 0 return amnt
get_reagents() get_reagents()
var/res = "" var/res = ""

View File

@@ -61,6 +61,8 @@ should be listed in the changelog upon commit though. Thanks. -->
<h3 class="author">AterIgnis updated:</h3> <h3 class="author">AterIgnis updated:</h3>
<ul class="changes bgimages16"> <ul class="changes bgimages16">
<li class="tweak">Chemistry explosions try to damage their holder first - potassium-water mixes and nitroglycerol tend to gib human if injected instead of creating crater around them</li> <li class="tweak">Chemistry explosions try to damage their holder first - potassium-water mixes and nitroglycerol tend to gib human if injected instead of creating crater around them</li>
<li class="tweak">Reagents mix and react inside humans, but they don't bubble in that case (try not to give patient water and potassium at the same time)</li>
<li class="tweak">Ethanol-based drinks (alcohol) is treated like ethanol now and can be used in reactions. Ethanol->water reaction now properly makes drunk people sober by removing alcohol, not just temporarily sobering them.</li>
</ul> </ul>
</div> </div>