[MIRROR] Refactor rolling paper to use customizable reagent holder [MDB IGNORE] (#8905)

* Refactor rolling paper to use customizable reagent holder (#61758)

The component can accept dryable items and food items now. Any instance of the component can be set to use dryable items, just like normally food items are used. To add the dryable item, it's the same as with food. You attack with the item in hand. I am currently thinking about more uses for dryable items and also more ways the component can be used.

* Refactor rolling paper to use customizable reagent holder

Co-authored-by: Jack LeCroy <3073035+jacklecroy@users.noreply.github.com>
This commit is contained in:
SkyratBot
2021-10-18 11:11:11 -04:00
committed by GitHub
co-authored by Jack LeCroy
parent 17b68bf12c
commit b4a3597388
3 changed files with 7 additions and 18 deletions
@@ -33,7 +33,8 @@
if(!isatom(parent))
return COMPONENT_INCOMPATIBLE
var/atom/atom_parent = parent
if (!atom_parent.reagents)
// assume replacement is OK
if (!atom_parent.reagents && !replacement)
return COMPONENT_INCOMPATIBLE
src.replacement = replacement
@@ -108,6 +109,8 @@
switch (ingredient_type)
if (CUSTOM_INGREDIENT_TYPE_EDIBLE)
valid_ingredient = IS_EDIBLE(ingredient)
if (CUSTOM_INGREDIENT_TYPE_DRYABLE)
valid_ingredient = HAS_TRAIT(ingredient, TRAIT_DRYABLE)
// only accept valid ingredients
if (!valid_ingredient || HAS_TRAIT(ingredient, TRAIT_CUSTOMIZABLE_REAGENT_HOLDER))