Merge pull request #9513 from Citadel-Station-13/kevinz000-patch-98
medibots are now TOXINLOVER (so slimes) friendly
This commit is contained in:
@@ -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,12 @@
|
||||
|
||||
return FALSE
|
||||
|
||||
/mob/living/simple_animal/bot/medbot/proc/get_avoidchem_toxin(mob/M)
|
||||
return HAS_TRAIT(M, TRAIT_TOXINLOVER)? null : treatment_tox_avoid
|
||||
|
||||
/mob/living/simple_animal/bot/medbot/proc/get_healchem_toxin(mob/M)
|
||||
return HAS_TRAIT(M, TRAIT_TOXINLOVER)? treatment_tox_toxlover : treatment_tox
|
||||
|
||||
/mob/living/simple_animal/bot/medbot/UnarmedAttack(atom/A)
|
||||
if(iscarbon(A))
|
||||
var/mob/living/carbon/C = A
|
||||
@@ -463,8 +470,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)
|
||||
|
||||
Reference in New Issue
Block a user