chemical analyzer bloodtyping (#91722)

Co-authored-by: SmArtKar <44720187+SmArtKar@users.noreply.github.com>
Co-authored-by: SyncIt21 <110812394+SyncIt21@users.noreply.github.com>
This commit is contained in:
bigbakedbean
2025-07-16 02:06:50 +01:00
committed by GitHub
parent 0e403e8405
commit dbe9acda20
+11 -2
View File
@@ -124,12 +124,21 @@
out_message += "Chemicals found in [interacting_with.name]:</b>\n"
if(cont.reagents.is_reacting)
out_message += "[span_warning("A reaction appears to be occuring currently.")]<span class='notice'>\n"
for(var/datum/reagent/reagent in cont.reagents.reagent_list)
for(var/datum/reagent/reagent as anything in cont.reagents.reagent_list) // bloodtyping if blood present in container
var/blood_info = null
if(reagent.data)
var/blood = reagent.data["blood_type"]
if(istype(blood, /datum/blood_type))
var/datum/blood_type/blood_type = blood
var/type = blood_type.get_type()
blood_info = "[blood_type.get_blood_name()] [type ? "(type: [type])" : ""]"
else if(blood)
blood_info = "[reagent.name] (type: [blood])"
if(reagent.purity < reagent.inverse_chem_val && reagent.inverse_chem) //If the reagent is impure
var/datum/reagent/inverse_reagent = GLOB.chemical_reagents_list[reagent.inverse_chem]
out_message += "[span_warning("Inverted reagent detected: ")]<span class='notice'><b>[round(reagent.volume, 0.01)]u of [inverse_reagent.name]</b>, <b>Purity:</b> [round(1 - reagent.purity, 0.000001)*100]%, [(scanmode?"[(inverse_reagent.overdose_threshold?"<b>Overdose:</b> [inverse_reagent.overdose_threshold]u, ":"")]<b>Base pH:</b> [initial(inverse_reagent.ph)], <b>Current pH:</b> [reagent.ph].":"<b>Current pH:</b> [reagent.ph].")]\n"
else
out_message += "<b>[round(reagent.volume, 0.01)]u of [reagent.name]</b>, <b>Purity:</b> [round(reagent.purity, 0.000001)*100]%, [(scanmode?"[(reagent.overdose_threshold?"<b>Overdose:</b> [reagent.overdose_threshold]u, ":"")]<b>Base pH:</b> [initial(reagent.ph)], <b>Current pH:</b> [reagent.ph].":"<b>Current pH:</b> [reagent.ph].")]\n"
out_message += "<b>[round(reagent.volume, CHEMICAL_VOLUME_ROUNDING)]u of [blood_info || reagent.name]</b>, <b>Purity:</b> [round(reagent.purity, 0.000001)*100]%, [(scanmode?"[(reagent.overdose_threshold?"<b>Overdose:</b> [reagent.overdose_threshold]u, ":"")]<b>Base pH:</b> [initial(reagent.ph)], <b>Current pH:</b> [reagent.ph].":"<b>Current pH:</b> [reagent.ph].")]\n"
if(scanmode)
out_message += "<b>Analysis:</b> [reagent.description]\n"
to_chat(user, boxed_message(span_notice("[out_message.Join()]")))