Fixes patches and pills not being grindable, and fixes a runtime with xenos (#23430)

* Ezpz

* Kras Review

* Whoops
This commit is contained in:
DGamerL
2023-12-10 02:27:26 +01:00
committed by GitHub
parent ba96ed4686
commit 1927a4c76e
3 changed files with 28 additions and 8 deletions

View File

@@ -290,3 +290,22 @@ and carry the owner just to make sure*/
/mob/living/carbon/alien/on_lying_down(new_lying_angle)
. = ..()
ADD_TRAIT(src, TRAIT_IMMOBILIZED, LYING_DOWN_TRAIT) //Xenos can't crawl
/mob/living/carbon/alien/consume_patch_or_pill(obj/item/reagent_containers/medicine, mob/user)
var/apply_method = "swallow"
var/how_many_reagents = medicine.reagents.total_volume
var/reagent_application = REAGENT_INGEST
if(ispatch(medicine))
apply_method = "apply"
how_many_reagents = clamp(medicine.reagents.total_volume, 0.1, 2)
reagent_application = REAGENT_TOUCH
visible_message("<span class='warning'>[user] attempts to force [src] to [apply_method] [medicine].</span>")
if(!do_after(user, 5 SECONDS, TRUE, src)) // You try feeding a xenomorph a pill
return
visible_message("<span class='warning'>[user] forces [src] to [apply_method] [medicine].</span>")
var/fraction = min(1 / medicine.reagents.total_volume, 1)
medicine.reagents.reaction(src, reagent_application, fraction)
medicine.reagents.trans_to(src, how_many_reagents)
return TRUE

View File

@@ -1239,11 +1239,10 @@ so that different stomachs can handle things in different ways VB*/
if(to_eat.reagents.total_volume)
taste(to_eat.reagents)
var/fraction = min(this_bite / to_eat.reagents.total_volume, 1)
if(fraction)
to_eat.reagents.reaction(src, REAGENT_INGEST, fraction)
to_eat.reagents.trans_to(src, this_bite)
to_eat.reagents.reaction(src, REAGENT_INGEST, fraction)
to_eat.reagents.trans_to(src, this_bite)
/mob/living/carbon/proc/consume_patch_or_pill(obj/item/reagent_containers/medicine, user) // medicine = patch or pill
/mob/living/carbon/proc/consume_patch_or_pill(obj/item/reagent_containers/medicine, mob/user) // medicine = patch or pill
// The reason why this is bundled up is to avoid 2 procs that will be practically identical
if(!medicine.reagents.total_volume)
return TRUE // Doesn't have reagents, would be fine to use up
@@ -1256,13 +1255,13 @@ so that different stomachs can handle things in different ways VB*/
var/reagent_application = REAGENT_INGEST
var/requires_mouth = TRUE
var/instant = FALSE
var/efficiency = 1
var/how_many_reagents = medicine.reagents.total_volume
if(ispatch(medicine))
apply_method = "apply"
reagent_application = REAGENT_TOUCH
requires_mouth = FALSE
efficiency = 0.5 // Patches aren't that good at transporting reagents into the bloodstream
how_many_reagents = clamp(medicine.reagents.total_volume, 0.1, 2) // Patches aren't that good at transporting reagents into the bloodstream
var/obj/item/reagent_containers/patch/patch = medicine
if(patch.instant_application)
instant = TRUE
@@ -1281,7 +1280,7 @@ so that different stomachs can handle things in different ways VB*/
var/fraction = min(1 / medicine.reagents.total_volume, 1)
medicine.reagents.reaction(src, reagent_application, fraction)
medicine.reagents.trans_to(src, medicine.reagents.total_volume * efficiency)
medicine.reagents.trans_to(src, how_many_reagents)
return TRUE
/mob/living/carbon/get_access()

View File

@@ -53,7 +53,9 @@
//All types that you can put into the grinder to transfer the reagents to the beaker. !Put all recipes above this.!
/obj/item/slime_extract = list(),
/obj/item/reagent_containers/food = list()
/obj/item/reagent_containers/food = list(),
/obj/item/reagent_containers/pill = list(),
/obj/item/reagent_containers/patch = list()
)
var/list/juice_items = list (