chemscanning (reads: health analyzers mostly) show reagents in grey if not processable due to being invalid
This commit is contained in:
DeltaFire
2021-11-12 19:38:10 +01:00
parent 4f8848cfb8
commit b4e6b0785d
4 changed files with 10 additions and 3 deletions

View File

@@ -101,3 +101,9 @@
return GLOB.chemical_reagents_list[input]
else
return null
//Checks for if the given reagent R is invalid to process for its passed owner.
/proc/is_reagent_processing_invalid(datum/reagent/R, mob/living/owner)
if(!R || !owner)
return TRUE
return ((HAS_TRAIT(owner, TRAIT_ROBOTIC_ORGANISM) && !(R.chemical_flags & REAGENT_ROBOTIC_PROCESS)) || (!HAS_TRAIT(owner, TRAIT_ROBOTIC_ORGANISM) && !(R.chemical_flags & REAGENT_ORGANIC_PROCESS)))

View File

@@ -467,7 +467,8 @@ GENETICS SCANNER
if(length(reagents))
msg += "<span class='notice'>Subject contains the following reagents:</span>\n"
for(var/datum/reagent/R in reagents)
msg += "<span class='notice'>[R.volume] units of [R.name][R.overdosed == 1 ? "</span> - <span class='boldannounce'>OVERDOSING</span>" : ".</span>"]\n"
var/invalid_reagent = is_reagent_processing_invalid(R, M)
msg += "<span class='notice'>[invalid_reagent ? "<font color='grey'>" : ""][R.volume] units of [R.name][invalid_reagent ? "</font>" : ""][R.overdosed == 1 ? "</span> - <span class='boldannounce'>OVERDOSING</span>" : ".</span>"]\n"
else
msg += "<span class='notice'>Subject contains no reagents.</span>\n"

View File

@@ -39,7 +39,7 @@
//Procs called while dead
/mob/living/carbon/proc/handle_death()
for(var/datum/reagent/R in reagents.reagent_list)
if(R.chemical_flags & REAGENT_DEAD_PROCESS && ((HAS_TRAIT(src, TRAIT_ROBOTIC_ORGANISM) && (R.chemical_flags & REAGENT_ROBOTIC_PROCESS)) || (!HAS_TRAIT(src, TRAIT_ROBOTIC_ORGANISM) && (R.chemical_flags & REAGENT_ORGANIC_PROCESS))))
if(R.chemical_flags & REAGENT_DEAD_PROCESS && !is_reagent_processing_invalid(R, src))
R.on_mob_dead(src)
///////////////

View File

@@ -345,7 +345,7 @@
if(owner && reagent)
if(!owner.reagent_check(reagent, delta_time, times_fired) != TRUE)
return
if((HAS_TRAIT(owner, TRAIT_ROBOTIC_ORGANISM) && !(reagent.chemical_flags & REAGENT_ROBOTIC_PROCESS)) || (!HAS_TRAIT(owner, TRAIT_ROBOTIC_ORGANISM) && !(reagent.chemical_flags & REAGENT_ORGANIC_PROCESS)))
if(is_reagent_processing_invalid(reagent, owner))
return reagent.on_invalid_process(owner, delta_time, times_fired)
if(liverless && !reagent.self_consuming) //need to be metabolized
return