From 48a05001abd6d7447d9bb3a843c88b596f700431 Mon Sep 17 00:00:00 2001 From: Alan Date: Sun, 23 Aug 2026 15:24:29 +0000 Subject: [PATCH] Migrate unsorted seeds to the new attack chain. (#32399) * Migrate unsorted seeds to the new attack chain. * Apply suggestion from CRUNCH review. Co-authored-by: CRUNCH <143041327+CRUNCH-Borg@users.noreply.github.com> Signed-off-by: Alan --------- Signed-off-by: Alan Co-authored-by: CRUNCH <143041327+CRUNCH-Borg@users.noreply.github.com> --- code/modules/hydroponics/seeds.dm | 36 +++++++++++++++++++------------ 1 file changed, 22 insertions(+), 14 deletions(-) diff --git a/code/modules/hydroponics/seeds.dm b/code/modules/hydroponics/seeds.dm index c492ba2d3f0..f2828512e52 100644 --- a/code/modules/hydroponics/seeds.dm +++ b/code/modules/hydroponics/seeds.dm @@ -619,7 +619,7 @@ icon_state = "seed" // Unknown plant seed - these shouldn't exist in-game. w_class = WEIGHT_CLASS_TINY resistance_flags = FLAMMABLE - + new_attack_chain = TRUE var/datum/unsorted_seed/seed_data /obj/item/unsorted_seeds/Initialize(mapload, obj/item/seeds/template, mutation_level, list/mutation_focus, seed_data_in = null) @@ -645,23 +645,31 @@ /obj/item/unsorted_seeds/proc/sort(depth = 1) seed_data.transform(src, depth) -/obj/item/unsorted_seeds/attack_self__legacy__attackchain(mob/user) - user.visible_message(SPAN_NOTICE("[user] crudely sorts through [src] by hand."), "You crudely sort through [src] by hand. This would be easier and more effective with some sort of tool.") +/obj/item/unsorted_seeds/activate_self(mob/user) + if(..()) + return ITEM_INTERACT_COMPLETE + user.visible_message( + SPAN_NOTICE("[user] crudely sorts through [src] by hand."), + SPAN_NOTICE("You crudely sort through [src] by hand. This would be easier and more effective with some sort of tool."), + SPAN_HEAR("You hear shuffling seeds.") + ) if(do_after(user, 3 SECONDS, TRUE, src, must_be_held = TRUE)) sort() + return ITEM_INTERACT_COMPLETE -/obj/item/unsorted_seeds/attackby__legacy__attackchain(obj/item/O, mob/user, params) - if(istype(O, /obj/item/plant_analyzer)) - to_chat(user, SPAN_NOTICE("This is \a [SPAN_NAME("[src].")]")) - var/text = get_analyzer_text() - if(text) - to_chat(user, SPAN_NOTICE("[text]")) +/obj/item/unsorted_seeds/item_interaction(mob/living/user, obj/item/used, list/modifiers) + if(is_pen(used)) + to_chat(user, SPAN_WARNING("Sort it first.")) + return ITEM_INTERACT_COMPLETE - return - if(is_pen(O)) - to_chat(user, SPAN_NOTICE("Sort it first.")) - return - ..() // Fallthrough to item/attackby() so that bags can pick seeds up + if(!istype(used, /obj/item/plant_analyzer)) + return ..() + + to_chat(user, SPAN_NOTICE("This is \a [SPAN_NAME("[src].")]")) + var/text = get_analyzer_text() + if(text) + to_chat(user, SPAN_NOTICE("[text]")) + return ITEM_INTERACT_COMPLETE /obj/item/unsorted_seeds/proc/get_analyzer_text(show_detail = TRUE) var/list/output = list()