mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-07-16 18:45:22 +01:00
Converts pills and patches into interact_with_atom (#88157)
## About The Pull Request Title. Code maintenance, code sanity and because overriding attack() like this is bad ## Changelog 🆑 code: Converted pills and patches into interact_with_atom /🆑
This commit is contained in:
@@ -11,20 +11,21 @@
|
||||
self_delay = 30 // three seconds
|
||||
dissolvable = FALSE
|
||||
|
||||
/obj/item/reagent_containers/pill/patch/attack(mob/living/L, mob/user)
|
||||
if(ishuman(L))
|
||||
var/obj/item/bodypart/affecting = L.get_bodypart(check_zone(user.zone_selected))
|
||||
if(!affecting)
|
||||
to_chat(user, span_warning("The limb is missing!"))
|
||||
return
|
||||
if(!IS_ORGANIC_LIMB(affecting))
|
||||
to_chat(user, span_notice("Medicine won't work on an inorganic limb!"))
|
||||
return
|
||||
..()
|
||||
|
||||
/obj/item/reagent_containers/pill/patch/canconsume(mob/eater, mob/user)
|
||||
if(!iscarbon(eater))
|
||||
return FALSE
|
||||
if(!ishuman(eater))
|
||||
return TRUE
|
||||
var/mob/living/carbon/human/human_eater = eater
|
||||
var/obj/item/bodypart/affecting = human_eater.get_bodypart(check_zone(user.zone_selected))
|
||||
if(!affecting)
|
||||
to_chat(user, span_warning("The limb is missing!"))
|
||||
return FALSE
|
||||
|
||||
if(!IS_ORGANIC_LIMB(affecting))
|
||||
to_chat(user, span_notice("Medicine won't work on an inorganic limb!"))
|
||||
return FALSE
|
||||
|
||||
return TRUE // Masks were stopping people from "eating" patches. Thanks, inheritance.
|
||||
|
||||
/obj/item/reagent_containers/pill/patch/libital
|
||||
|
||||
Reference in New Issue
Block a user