[MIRROR] Add blended dust warning to grinder beakers (#3243)

* Add blended dust warning to grinder beakers (#56759)

* Add blended dust warning to grinder beakers

🆑 coiax
tweak: All beakers, bottles and containers that have been used in the
All-in-One Grinder will have a warning not to inhale the dust on
examine.
/🆑

The initial spawned beakers in the grinder already had this description,
and now it is applied to any beakers that have been used for grinding
purposes (and only grinding purposes).

Co-authored-by: cacogen <25089914+cacogen@ users.noreply.github.com>

* Add blended dust warning to grinder beakers

Co-authored-by: coiax <yellowbounder@gmail.com>
Co-authored-by: cacogen <25089914+cacogen@ users.noreply.github.com>
This commit is contained in:
SkyratBot
2021-02-10 00:40:54 +00:00
committed by GitHub
co-authored by cacogen coiax
parent a098c69eaa
commit 533313ba7e
2 changed files with 13 additions and 1 deletions
+3
View File
@@ -368,6 +368,9 @@ Remember to update _globalvars/traits.dm if you're adding/removing/renaming trai
#define TRAIT_VENTCRAWLER_ALWAYS "ventcrawler_always"
#define TRAIT_VENTCRAWLER_NUDE "ventcrawler_nude"
/// Minor trait used for beakers, or beaker-ishes. [/obj/item/reagent_containers], to show that they've been used in a reagent grinder.
#define TRAIT_MAY_CONTAIN_BLENDED_DUST "may_contain_blended_dust"
//Medical Categories for quirks
#define CAT_QUIRK_ALL 0
#define CAT_QUIRK_NOTES 1
@@ -28,7 +28,15 @@
. = ..()
holdingitems = list()
beaker = new /obj/item/reagent_containers/glass/beaker/large(src)
beaker.desc += " May contain blended dust. Don't breathe this in!"
warn_of_dust()
/// Add a description to the current beaker warning of blended dust, if it doesn't already have that warning.
/obj/machinery/reagentgrinder/proc/warn_of_dust()
if(HAS_TRAIT(beaker, TRAIT_MAY_CONTAIN_BLENDED_DUST))
return
beaker.desc += " May contain blended dust. Don't breathe this!"
ADD_TRAIT(beaker, TRAIT_MAY_CONTAIN_BLENDED_DUST, TRAIT_GENERIC)
/obj/machinery/reagentgrinder/constructed/Initialize()
. = ..()
@@ -284,6 +292,7 @@
if(!beaker || machine_stat & (NOPOWER|BROKEN) || beaker.reagents.total_volume >= beaker.reagents.maximum_volume)
return
operate_for(60)
warn_of_dust() // don't breathe this.
for(var/i in holdingitems)
if(beaker.reagents.total_volume >= beaker.reagents.maximum_volume)
break