diff --git a/maps/ministation/ministation-1.dmm b/maps/ministation/ministation-1.dmm index 9ab4635ba0c4..34871f8e955d 100644 --- a/maps/ministation/ministation-1.dmm +++ b/maps/ministation/ministation-1.dmm @@ -5716,9 +5716,9 @@ /obj/item/tool/hoe/mini, /obj/item/tool/spade, /obj/item/tool/spade, -/obj/item/honey_frame, -/obj/item/honey_frame, -/obj/item/honey_frame, +/obj/item/hive_frame/crafted, +/obj/item/hive_frame/crafted, +/obj/item/hive_frame/crafted, /turf/floor/tiled, /area/ministation/hydro) "yg" = ( diff --git a/mods/content/beekeeping/_beekeeping.dm b/mods/content/beekeeping/_beekeeping.dm index d026d7d1f576..d3b58be746d6 100644 --- a/mods/content/beekeeping/_beekeeping.dm +++ b/mods/content/beekeeping/_beekeeping.dm @@ -3,15 +3,5 @@ /datum/storage/hopper/industrial/centrifuge/New() ..() - can_hold |= /obj/item/honey_frame + can_hold |= /obj/item/hive_frame -// Terrible, will be replaced in beewrite. -/datum/storage/hopper/industrial/centrifuge/should_ingest(mob/user, obj/item/thing) - if(istype(thing, /obj/item/honey_frame)) - var/obj/item/honey_frame/frame = thing - if(frame.honey > 0) - return TRUE - if(user) - to_chat(user, SPAN_WARNING("\The [thing] is empty.")) - return FALSE - return ..() diff --git a/mods/content/beekeeping/_beekeeping.dme b/mods/content/beekeeping/_beekeeping.dme index 2d950fe7a392..75778704f368 100644 --- a/mods/content/beekeeping/_beekeeping.dme +++ b/mods/content/beekeeping/_beekeeping.dme @@ -2,8 +2,8 @@ #define MODPACK_BEEKEEPING // BEGIN_INCLUDE #include "_beekeeping.dm" -#include "centrifuge.dm" #include "closets.dm" +#include "hive_frame.dm" #include "items.dm" #include "recipes.dm" #include "trading.dm" diff --git a/mods/content/beekeeping/centrifuge.dm b/mods/content/beekeeping/centrifuge.dm deleted file mode 100644 index 9b04168d744a..000000000000 --- a/mods/content/beekeeping/centrifuge.dm +++ /dev/null @@ -1,53 +0,0 @@ -/obj/machinery/honey_extractor - name = "honey extractor" - desc = "A machine used to extract honey and wax from a beehive frame." - icon = 'icons/obj/virology.dmi' - icon_state = "centrifuge" - anchored = TRUE - density = TRUE - construct_state = /decl/machine_construction/default/panel_closed - uncreated_component_parts = null - stat_immune = 0 - - var/processing = 0 - var/honey = 0 - -/obj/machinery/honey_extractor/components_are_accessible(path) - return !processing && ..() - -/obj/machinery/honey_extractor/cannot_transition_to(state_path, mob/user) - if(processing) - return SPAN_NOTICE("You must wait for \the [src] to finish first!") - return ..() - -/obj/machinery/honey_extractor/attackby(var/obj/item/I, var/mob/user) - if(processing) - to_chat(user, "\The [src] is currently spinning, wait until it's finished.") - return - if((. = component_attackby(I, user))) - return - if(istype(I, /obj/item/honey_frame)) - var/obj/item/honey_frame/H = I - if(!H.honey) - to_chat(user, "\The [H] is empty, put it into a beehive.") - return - user.visible_message("\The [user] loads \the [H] into \the [src] and turns it on.", "You load \the [H] into \the [src] and turn it on.") - processing = H.honey - icon_state = "centrifuge_moving" - qdel(H) - spawn(50) - new /obj/item/honey_frame(loc) - new /obj/item/stack/material/bar/wax(loc, 1) - honey += processing - processing = 0 - icon_state = "centrifuge" - else if(istype(I, /obj/item/chems/glass)) - if(!honey) - to_chat(user, "There is no honey in \the [src].") - return - var/obj/item/chems/glass/G = I - var/transferred = min(G.reagents.maximum_volume - G.reagents.total_volume, honey) - G.add_to_reagents(/decl/material/liquid/nutriment/honey, transferred) - honey -= transferred - user.visible_message("\The [user] collects honey from \the [src] into \the [G].", "You collect [transferred] units of honey from \the [src] into \the [G].") - return 1 diff --git a/mods/content/beekeeping/closets.dm b/mods/content/beekeeping/closets.dm index 224ff0561eb8..c39e70dbb457 100644 --- a/mods/content/beekeeping/closets.dm +++ b/mods/content/beekeeping/closets.dm @@ -6,10 +6,10 @@ . = ..() new /obj/item/beehive_assembly(src) new /obj/item/bee_smoker(src) - new /obj/item/honey_frame(src) - new /obj/item/honey_frame(src) - new /obj/item/honey_frame(src) - new /obj/item/honey_frame(src) - new /obj/item/honey_frame(src) + new /obj/item/hive_frame/crafted(src) + new /obj/item/hive_frame/crafted(src) + new /obj/item/hive_frame/crafted(src) + new /obj/item/hive_frame/crafted(src) + new /obj/item/hive_frame/crafted(src) new /obj/item/bee_pack(src) new /obj/item/crowbar(src) diff --git a/mods/content/beekeeping/hive_frame.dm b/mods/content/beekeeping/hive_frame.dm new file mode 100644 index 000000000000..787210811ac4 --- /dev/null +++ b/mods/content/beekeeping/hive_frame.dm @@ -0,0 +1,62 @@ +/obj/item/hive_frame + abstract_type = /obj/item/hive_frame + icon_state = ICON_STATE_WORLD + w_class = ITEM_SIZE_SMALL + material_alteration = MAT_FLAG_ALTERATION_ALL + var/destroy_on_centrifuge = FALSE + +/obj/item/hive_frame/Initialize(ml, material_key) + . = ..() + initialize_reagents() + +/obj/item/hive_frame/initialize_reagents(populate = TRUE) + create_reagents(20) + . = ..() + +/obj/item/hive_frame/on_reagent_change() + . = ..() + if(reagents?.total_volume) + SetName("filled [initial(name)] ([reagents.get_primary_reagent_name()])") + else + SetName(initial(name)) + queue_icon_update() + +/obj/item/hive_frame/on_update_icon() + . = ..() + var/mesh_state = "[icon_state]-mesh" + if(check_state_in_icon(mesh_state, icon)) + add_overlay(overlay_image(icon, mesh_state, COLOR_WHITE, RESET_COLOR)) + if(reagents?.total_volume) + var/comb_state = "[icon_state]-comb" + if(check_state_in_icon(comb_state, icon)) + add_overlay(overlay_image(icon, comb_state, reagents.get_color(), RESET_COLOR)) + compile_overlays() + +/obj/item/hive_frame/handle_centrifuge_process(obj/machinery/centrifuge/centrifuge) + if(!(. = ..())) + return + if(reagents.total_volume) + reagents.trans_to_holder(centrifuge.loaded_beaker.reagents, reagents.total_volume) + for(var/obj/item/thing in contents) + thing.dropInto(centrifuge.loc) + if(destroy_on_centrifuge) + for(var/atom/movable/thing in convert_matter_to_lumps()) + thing.dropInto(centrifuge.loc) + +// Crafted frame used in apiaries. +/obj/item/hive_frame/crafted + name = "hive frame" + desc = "A wooden frame for insect hives that the workers will fill with products like honey." + icon = 'mods/content/beekeeping/icons/frame.dmi' + material = /decl/material/solid/organic/wood + material_alteration = MAT_FLAG_ALTERATION_ALL + +// TEMP until beewrite redoes hives. +/obj/item/hive_frame/crafted/filled/Initialize() + . = ..() + new /obj/item/stack/material/bar/wax(src) + update_icon() + +/obj/item/hive_frame/crafted/filled/populate_reagents() + . = ..() + reagents.add_reagent(/decl/material/liquid/nutriment/honey, reagents?.maximum_volume) diff --git a/mods/content/beekeeping/hives/_hive.dm b/mods/content/beekeeping/hives/_hive.dm index edea2885862b..515fe39f8dc0 100644 --- a/mods/content/beekeeping/hives/_hive.dm +++ b/mods/content/beekeeping/hives/_hive.dm @@ -63,15 +63,15 @@ smoked = 30 update_icon() return TRUE - else if(istype(I, /obj/item/honey_frame)) + else if(istype(I, /obj/item/hive_frame/crafted)) if(closed) to_chat(user, "You need to open \the [src] with a crowbar before inserting \the [I].") return TRUE if(frames >= maxFrames) to_chat(user, "There is no place for an another frame.") return TRUE - var/obj/item/honey_frame/H = I - if(H.honey) + var/obj/item/hive_frame/crafted/H = I + if(H.reagents?.total_volume) to_chat(user, "\The [I] is full with beeswax and honey, empty it in the extractor first.") return TRUE ++frames @@ -140,7 +140,7 @@ return user.visible_message("\The [user] starts taking the honeycombs out of \the [src].", "You start taking the honeycombs out of \the [src]...") while(honeycombs >= 100 && do_after(user, 30, src)) - new /obj/item/honey_frame/filled(loc) + new /obj/item/hive_frame/crafted/filled(loc) honeycombs -= 100 --frames update_icon() diff --git a/mods/content/beekeeping/apiary_bees_etc.dmi b/mods/content/beekeeping/icons/apiary_bees_etc.dmi similarity index 100% rename from mods/content/beekeeping/apiary_bees_etc.dmi rename to mods/content/beekeeping/icons/apiary_bees_etc.dmi diff --git a/mods/content/beekeeping/icons/frame.dmi b/mods/content/beekeeping/icons/frame.dmi new file mode 100644 index 000000000000..136c77b72d6f Binary files /dev/null and b/mods/content/beekeeping/icons/frame.dmi differ diff --git a/mods/content/beekeeping/items.dm b/mods/content/beekeeping/items.dm index 58778d369034..c55a11d7d20f 100644 --- a/mods/content/beekeeping/items.dm +++ b/mods/content/beekeeping/items.dm @@ -1,7 +1,7 @@ /obj/item/beehive_assembly name = "beehive assembly" desc = "Contains everything you need to build a beehive." - icon = 'mods/content/beekeeping/apiary_bees_etc.dmi' + icon = 'mods/content/beekeeping/icons/apiary_bees_etc.dmi' icon_state = "apiary" material = /decl/material/solid/organic/wood @@ -12,15 +12,6 @@ new /obj/machinery/beehive(get_turf(user)) qdel(src) -/obj/item/stock_parts/circuitboard/honey - name = "circuitboard (honey extractor)" - build_path = /obj/machinery/honey_extractor - board_type = "machine" - origin_tech = @'{"biotech":2,"engineering":1}' - req_components = list( - /obj/item/stock_parts/manipulator = 2, - /obj/item/stock_parts/matter_bin = 2) - /obj/item/bee_smoker name = "bee smoker" desc = "A device used to calm down bees before harvesting honey." @@ -29,35 +20,6 @@ w_class = ITEM_SIZE_SMALL material = /decl/material/solid/metal/steel -/obj/item/honey_frame - name = "beehive frame" - desc = "A frame for the beehive that the bees will fill with honeycombs." - icon = 'mods/content/beekeeping/icons/beekeeping.dmi' - icon_state = "honeyframe" - w_class = ITEM_SIZE_SMALL - material = /decl/material/solid/organic/wood - var/honey = 0 - -/obj/item/honey_frame/filled - name = "filled beehive frame" - desc = "A frame for the beehive that the bees have filled with honeycombs." - honey = 20 - material = /decl/material/solid/organic/wood - -/obj/item/honey_frame/filled/Initialize() - . = ..() - overlays += "honeycomb" - -// This is crap, will be replaced in beewrite PR. -/obj/item/honey_frame/handle_centrifuge_process(obj/machinery/centrifuge/centrifuge) - if(!(. = ..()) || !honey) - return - centrifuge?.loaded_beaker?.add_to_reagents(/decl/material/liquid/nutriment/honey, honey) - honey = 0 - new /obj/item/honey_frame(centrifuge.loc) - new /obj/item/stack/material/bar(centrifuge.loc, 1, /decl/material/solid/organic/wax) - qdel(src) - /obj/item/bee_pack name = "bee pack" desc = "Contains a queen bee and some worker bees. Everything you'll need to start a hive!" diff --git a/mods/content/beekeeping/recipes.dm b/mods/content/beekeeping/recipes.dm index 03089d932ab9..8494617d3477 100644 --- a/mods/content/beekeeping/recipes.dm +++ b/mods/content/beekeeping/recipes.dm @@ -1,10 +1,6 @@ - /decl/stack_recipe/planks/beehive_assembly result_type = /obj/item/beehive_assembly category = "furniture" /decl/stack_recipe/planks/beehive_frame - result_type = /obj/item/honey_frame - -/datum/fabricator_recipe/imprinter/circuit/honey_extractor - path = /obj/item/stock_parts/circuitboard/honey + result_type = /obj/item/hive_frame/crafted diff --git a/mods/content/beekeeping/trading.dm b/mods/content/beekeeping/trading.dm index 1a119ddc99be..45009265f1bf 100644 --- a/mods/content/beekeeping/trading.dm +++ b/mods/content/beekeeping/trading.dm @@ -1,15 +1,17 @@ /datum/trader/trading_beacon/manufacturing/New() - LAZYSET(possible_trading_items, /obj/item/bee_pack, TRADER_THIS_TYPE) - LAZYSET(possible_trading_items, /obj/item/bee_smoker, TRADER_THIS_TYPE) - LAZYSET(possible_trading_items, /obj/item/beehive_assembly, TRADER_THIS_TYPE) - LAZYSET(possible_trading_items, /obj/item/honey_frame, TRADER_THIS_TYPE) + LAZYSET(possible_trading_items, /obj/item/bee_pack, TRADER_THIS_TYPE) + LAZYSET(possible_trading_items, /obj/item/bee_smoker, TRADER_THIS_TYPE) + LAZYSET(possible_trading_items, /obj/item/beehive_assembly, TRADER_THIS_TYPE) + LAZYSET(possible_trading_items, /obj/item/hive_frame/crafted, TRADER_THIS_TYPE) ..() /decl/hierarchy/supply_pack/hydroponics/bee_keeper name = "Equipment - Beekeeping" - contains = list(/obj/item/beehive_assembly, - /obj/item/bee_smoker, - /obj/item/honey_frame = 5, - /obj/item/bee_pack) + contains = list( + /obj/item/beehive_assembly, + /obj/item/bee_smoker, + /obj/item/hive_frame/crafted = 5, + /obj/item/bee_pack + ) containername = "beekeeping crate" access = access_hydroponics