From 5b5ff67201996572417ce5fd4d94a53115ce9295 Mon Sep 17 00:00:00 2001 From: kevinz000 <2003111+kevinz000@users.noreply.github.com> Date: Wed, 16 Oct 2019 03:51:57 -0700 Subject: [PATCH 1/2] Update medbot.dm --- .../mob/living/simple_animal/bot/medbot.dm | 20 +++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/code/modules/mob/living/simple_animal/bot/medbot.dm b/code/modules/mob/living/simple_animal/bot/medbot.dm index 1bff7dc10c..339f608879 100644 --- a/code/modules/mob/living/simple_animal/bot/medbot.dm +++ b/code/modules/mob/living/simple_animal/bot/medbot.dm @@ -51,6 +51,7 @@ var/treatment_fire = "kelotane" var/treatment_tox_avoid = "tricordrazine" var/treatment_tox = "charcoal" + var/treatment_tox_toxlover = "toxin" var/treatment_virus_avoid = null var/treatment_virus = "spaceacillin" var/treat_virus = 1 //If on, the bot will attempt to treat viral infections, curing them if possible. @@ -381,8 +382,8 @@ if((!C.reagents.has_reagent(treatment_fire_avoid)) && (C.getFireLoss() >= heal_threshold) && (!C.reagents.has_reagent(treatment_fire))) return TRUE - - if((!C.reagents.has_reagent(treatment_tox_avoid)) && (C.getToxLoss() >= heal_threshold) && (!C.reagents.has_reagent(treatment_tox))) + var/treatment_toxavoid = get_avoidchem_toxin(C) + if(((treatment_toxavoid && !C.reagents.has_reagent(treatment_toxavoid))) && (C.getToxLoss() >= heal_threshold) && (!C.reagents.has_reagent(get_healchem_toxin(C)))) return TRUE if(treat_virus && !C.reagents.has_reagent(treatment_virus_avoid) && !C.reagents.has_reagent(treatment_virus)) @@ -396,6 +397,15 @@ return FALSE +/mob/living/simple_animal/bot/medbot/proc/get_avoidchem_toxin(mob/M) + return toxlover_check(M)? null : treatment_tox_avoid + +/mob/living/simple_animal/bot/medbot/proc/get_healchem_toxin(mob/M) + return toxlover_check(M)? treatment_tox_toxlover : treatment_tox + +/mob/living/simple_animal/bot/medbot/proc/toxlover_check(mob/M) + return HAS_TRAIT(M, TRAIT_TOXINLOVER) + /mob/living/simple_animal/bot/medbot/UnarmedAttack(atom/A) if(iscarbon(A)) var/mob/living/carbon/C = A @@ -463,8 +473,10 @@ reagent_id = treatment_fire if(!reagent_id && (C.getToxLoss() >= heal_threshold)) - if(!C.reagents.has_reagent(treatment_tox) && !C.reagents.has_reagent(treatment_tox_avoid)) - reagent_id = treatment_tox + var/toxin_heal_avoid = get_avoidchem_toxin(C) + var/toxin_healchem = get_healchem_toxin(C) + if(!C.reagents.has_reagent(toxin_healchem) && (toxin_heal_avoid && !C.reagents.has_reagent(toxin_heal_avoid))) + reagent_id = toxin_healchem //If the patient is injured but doesn't have our special reagent in them then we should give it to them first if(reagent_id && use_beaker && reagent_glass && reagent_glass.reagents.total_volume) From 7c4e2c68601deb044ef0f83b11998b5dea99fc99 Mon Sep 17 00:00:00 2001 From: kevinz000 <2003111+kevinz000@users.noreply.github.com> Date: Thu, 17 Oct 2019 12:49:49 -0700 Subject: [PATCH 2/2] Update medbot.dm --- code/modules/mob/living/simple_animal/bot/medbot.dm | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/code/modules/mob/living/simple_animal/bot/medbot.dm b/code/modules/mob/living/simple_animal/bot/medbot.dm index 339f608879..6b26b7cb23 100644 --- a/code/modules/mob/living/simple_animal/bot/medbot.dm +++ b/code/modules/mob/living/simple_animal/bot/medbot.dm @@ -398,13 +398,10 @@ return FALSE /mob/living/simple_animal/bot/medbot/proc/get_avoidchem_toxin(mob/M) - return toxlover_check(M)? null : treatment_tox_avoid + return HAS_TRAIT(M, TRAIT_TOXINLOVER)? null : treatment_tox_avoid /mob/living/simple_animal/bot/medbot/proc/get_healchem_toxin(mob/M) - return toxlover_check(M)? treatment_tox_toxlover : treatment_tox - -/mob/living/simple_animal/bot/medbot/proc/toxlover_check(mob/M) - return HAS_TRAIT(M, TRAIT_TOXINLOVER) + return HAS_TRAIT(M, TRAIT_TOXINLOVER)? treatment_tox_toxlover : treatment_tox /mob/living/simple_animal/bot/medbot/UnarmedAttack(atom/A) if(iscarbon(A))