mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2025-12-09 07:46:20 +00:00
My original plan was to just implement materials into crafting so that items would inherit the materials of their components, allowing for some interesting stuff if the material flags of the item allow it. However to my dismay crafting is a pile of old tech debt, starting from the old `del_reqs` and `CheckParts` which still contain lines about old janky bandaids that are no longer in use nor reachable, up to the `customizable_reagent_holder` component which has some harddel issues when your custom food is sliced, and items used in food recipes not being deleted and instead stored inside the result with no purpose as well as other inconsistencies like stack recipes that transfer materials having counterparts in the UI that don't do that. EDIT: Several things have come up while working on this, so I apologise that it ended up changing over 100+ files. I managed to atomize some of the changes, but it's a bit tedious. EDIT: TLDR because I was told this section is too vague and there's too much going on. This PR: - Improves the dated crafting code (not the UI). - replaced `atom/CheckParts` and `crafting_recipe/on_craft_completion` with `atom/on_craft_completion`. - Reqs used in food recipes are now deleted by default and not stored inside the result (they did nothing). - Renames the customizable_reagent_holder comp and improves it (No harddels/ref issues). - Adds a unit test that tries to craft all recipes to see what's wrong (it skips some of the much more specific reqs for now). - In the unit test is also the code to make sure materials of the crafted item and a non-crafted item of the same type are roughly the same, so far only applied to food. - Some mild material/food refactoring around the fact that food item code has been changed to support materials. Improving the backbone of the crafting system. Also materials and food code. 🆑 refactor: Refactored crafting backend. Report possible pesky bugs. balance: the MEAT backpack (from the MEAT cargo pack) may be a smidge different because of code standardization. /🆑
84 lines
3.4 KiB
Plaintext
84 lines
3.4 KiB
Plaintext
///If the machine is used/deleted in the crafting process
|
|
#define CRAFTING_MACHINERY_CONSUME 1
|
|
///If the structure is used/deleted in the crafting process
|
|
#define CRAFTING_STRUCTURE_CONSUME 1
|
|
///If the machine is only "used" i.e. it checks to see if it's nearby and allows crafting, but doesn't delete it
|
|
#define CRAFTING_MACHINERY_USE 0
|
|
///If the structure is only "used" i.e. it checks to see if it's nearby and allows crafting, but doesn't delete it
|
|
#define CRAFTING_STRUCTURE_USE 0
|
|
|
|
//stack recipe placement check types
|
|
/// Checks if there is an object of the result type in any of the cardinal directions
|
|
#define STACK_CHECK_CARDINALS (1<<0)
|
|
/// Checks if there is an object of the result type within one tile
|
|
#define STACK_CHECK_ADJACENT (1<<1)
|
|
|
|
//---- Defines for var/crafting_flags
|
|
///If this craft must be learned before it becomes available
|
|
#define CRAFT_MUST_BE_LEARNED (1<<0)
|
|
///Should only one object exist on the same turf?
|
|
#define CRAFT_ONE_PER_TURF (1<<1)
|
|
/// Setting this to true will effectively set check_direction to true.
|
|
#define CRAFT_IS_FULLTILE (1<<2)
|
|
/// If this craft should run the direction check, for use when building things like directional windows where you can have more than one per turf
|
|
#define CRAFT_CHECK_DIRECTION (1<<3)
|
|
/// If the craft requires a floor below
|
|
#define CRAFT_ON_SOLID_GROUND (1<<4)
|
|
/// If the craft checks that there are objects with density in the same turf when being built
|
|
#define CRAFT_CHECK_DENSITY (1<<5)
|
|
/// If the created atom will gain custom mat datums
|
|
#define CRAFT_APPLIES_MATS (1<<6)
|
|
/// Crafting passes reagents of components to the finished product
|
|
#define CRAFT_TRANSFERS_REAGENTS (1<<7)
|
|
/// Crafting clears all reagents present in the finished product
|
|
#define CRAFT_CLEARS_REAGENTS (1<<8)
|
|
/// For the crafting unit test, ensures that the custom materials of an item are the same when crafted and spawned.
|
|
#define CRAFT_ENFORCE_MATERIALS_PARITY (1<<9)
|
|
/// Exclusive to the personal_crafting component, skips the time spent crafting the recipe.
|
|
#define CRAFT_IGNORE_DO_AFTER (1<<10)
|
|
|
|
//food/drink crafting defines
|
|
//When adding new defines, please make sure to also add them to the encompassing list
|
|
#define CAT_FOOD "Foods"
|
|
#define CAT_BREAD "Breads"
|
|
#define CAT_BURGER "Burgers"
|
|
#define CAT_CAKE "Cakes"
|
|
#define CAT_EGG "Egg-Based Food"
|
|
#define CAT_LIZARD "Lizard Food"
|
|
#define CAT_MEAT "Meats"
|
|
#define CAT_SEAFOOD "Seafood"
|
|
#define CAT_MARTIAN "Martian Food"
|
|
#define CAT_MISCFOOD "Misc. Food"
|
|
#define CAT_MEXICAN "Mexican Food"
|
|
#define CAT_MOTH "Mothic Food"
|
|
#define CAT_PASTRY "Pastries"
|
|
#define CAT_PIE "Pies"
|
|
#define CAT_PIZZA "Pizzas"
|
|
#define CAT_SALAD "Salads"
|
|
#define CAT_SANDWICH "Sandwiches"
|
|
#define CAT_SOUP "Soups"
|
|
#define CAT_SPAGHETTI "Spaghettis"
|
|
#define CAT_ICE "Frozen"
|
|
#define CAT_DRINK "Drinks"
|
|
|
|
//crafting defines
|
|
//When adding new defines, please make sure to also add them to the encompassing list
|
|
#define CAT_WEAPON_RANGED "Weapons Ranged"
|
|
#define CAT_WEAPON_MELEE "Weapons Melee"
|
|
#define CAT_WEAPON_AMMO "Weapon Ammo"
|
|
#define CAT_ROBOT "Robotics"
|
|
#define CAT_MISC "Misc"
|
|
#define CAT_CLOTHING "Clothing"
|
|
#define CAT_CHEMISTRY "Chemistry"
|
|
#define CAT_ATMOSPHERIC "Atmospherics"
|
|
#define CAT_STRUCTURE "Structures"
|
|
#define CAT_TILES "Tiles"
|
|
#define CAT_WINDOWS "Windows"
|
|
#define CAT_DOORS "Doors"
|
|
#define CAT_FURNITURE "Furniture"
|
|
#define CAT_EQUIPMENT "Equipment"
|
|
#define CAT_CONTAINERS "Containers"
|
|
#define CAT_ENTERTAINMENT "Entertainment"
|
|
#define CAT_TOOLS "Tools"
|
|
#define CAT_CULT "Blood Cult"
|