diff --git a/code/game/machinery/seed_extractor.dm b/code/game/machinery/seed_extractor.dm index 0b4574cc9fb4..8af80704b0cc 100644 --- a/code/game/machinery/seed_extractor.dm +++ b/code/game/machinery/seed_extractor.dm @@ -8,6 +8,43 @@ /obj/structure/machinery/seed_extractor/attackby(obj/item/O as obj, mob/user as mob) + // Plant bag and other storage containers. + if(istype(O,/obj/item/storage)) + var/obj/item/storage/container = O + if(container.contents.len > 0) + to_chat(user, SPAN_NOTICE("You start dumping the contents of [container] into [src].")) + if(!do_after(user, 1.5 SECONDS, INTERRUPT_ALL, BUSY_ICON_GENERIC)) + return + for(var/obj/item/item in container) + if(!istype(item, /obj/item/reagent_container/food/snacks/grown) && !istype(item, /obj/item/grown)) + to_chat(user, SPAN_WARNING("Cannot get seeds from [item].")) + break + else + if(user.temp_drop_inv_item(item)) + var/datum/seed/new_seed_type + if(istype(item, /obj/item/grown)) + var/obj/item/grown/F = item + new_seed_type = GLOB.seed_types[F.plantname] + else + var/obj/item/reagent_container/food/snacks/grown/F = item + new_seed_type = GLOB.seed_types[F.plantname] + + if(new_seed_type) + to_chat(user, SPAN_NOTICE("You extract some seeds from [item].")) + var/produce = rand(1,4) + for(var/i = 0;i<=produce;i++) + var/obj/item/seeds/seeds = new (get_turf(src)) + seeds.seed_type = new_seed_type.name + seeds.update_seed() + else + to_chat(user, "[item] doesn't seem to have any usable seeds inside it.") + qdel(item) + + playsound(user.loc, "rustle", 15, 1, 6) + else + to_chat(user, SPAN_NOTICE("[container] is empty.")) + + // Fruits and vegetables. if(istype(O, /obj/item/reagent_container/food/snacks/grown) || istype(O, /obj/item/grown)) if(user.temp_drop_inv_item(O))