From 6d36af8e5b2bedf50537244fcf493812fb180a0c Mon Sep 17 00:00:00 2001 From: Alan Date: Fri, 24 Jul 2026 15:35:48 -0400 Subject: [PATCH] Migrate seeds to the new attack chain. (#32326) * Migrate 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/grown/kudzu.dm | 6 ++- code/modules/hydroponics/grown/replicapod.dm | 42 ++++++++++---------- code/modules/hydroponics/seeds.dm | 17 ++++---- 3 files changed, 36 insertions(+), 29 deletions(-) diff --git a/code/modules/hydroponics/grown/kudzu.dm b/code/modules/hydroponics/grown/kudzu.dm index 7c0d0d786ff..e4fc89e7b36 100644 --- a/code/modules/hydroponics/grown/kudzu.dm +++ b/code/modules/hydroponics/grown/kudzu.dm @@ -36,9 +36,13 @@ user.drop_item() qdel(src) -/obj/item/seeds/kudzu/attack_self__legacy__attackchain(mob/user) +/obj/item/seeds/kudzu/activate_self(mob/user) + if(..()) + return ITEM_INTERACT_COMPLETE + plant(user) to_chat(user, SPAN_NOTICE("You plant the kudzu. You monster.")) + return ITEM_INTERACT_COMPLETE /obj/item/seeds/kudzu/get_analyzer_text() var/text = ..() diff --git a/code/modules/hydroponics/grown/replicapod.dm b/code/modules/hydroponics/grown/replicapod.dm index 3566be0b0fe..d13db244b4f 100644 --- a/code/modules/hydroponics/grown/replicapod.dm +++ b/code/modules/hydroponics/grown/replicapod.dm @@ -25,27 +25,28 @@ mind = null return ..() -/obj/item/seeds/replicapod/attackby__legacy__attackchain(obj/item/W, mob/user, params) - if(istype(W,/obj/item/reagent_containers/syringe)) - if(!contains_sample) - for(var/datum/reagent/blood/bloodSample in W.reagents.reagent_list) - var/datum/dna/dna = bloodSample.data["dna"] - if(bloodSample.data["mind"] && bloodSample.data["cloneable"] && !(NO_CLONESCAN in dna.species.species_traits)) - mind = bloodSample.data["mind"] - ckey = bloodSample.data["ckey"] - realName = bloodSample.data["real_name"] - blood_gender = bloodSample.data["gender"] - blood_type = bloodSample.data["blood_type"] - factions = bloodSample.data["factions"] - W.reagents.clear_reagents() - to_chat(user, SPAN_NOTICE("You inject the contents of the syringe into the seeds.")) - contains_sample = 1 - else - to_chat(user, SPAN_WARNING("The seeds reject the sample!")) - else - to_chat(user, SPAN_WARNING("The seeds already contain a genetic sample!")) - else +/obj/item/seeds/replicapod/item_interaction(mob/user, obj/item/used, list/modifiers) + if(!istype(used, /obj/item/reagent_containers/syringe)) return ..() + if(contains_sample) + to_chat(user, SPAN_WARNING("The seeds already contain a genetic sample!")) + return ITEM_INTERACT_COMPLETE + for(var/datum/reagent/blood/bloodSample in used.reagents.reagent_list) + var/datum/dna/dna = bloodSample.data["dna"] + if(!(bloodSample.data["mind"] && bloodSample.data["cloneable"] && !(NO_CLONESCAN in dna.species.species_traits))) + to_chat(user, SPAN_WARNING("The seeds reject the sample!")) + return ITEM_INTERACT_COMPLETE + mind = bloodSample.data["mind"] + ckey = bloodSample.data["ckey"] + realName = bloodSample.data["real_name"] + blood_gender = bloodSample.data["gender"] + blood_type = bloodSample.data["blood_type"] + factions = bloodSample.data["factions"] + used.reagents.clear_reagents() + to_chat(user, SPAN_NOTICE("You inject the contents of the syringe into the seeds.")) + contains_sample = 1 + add_fingerprint(user) + return ITEM_INTERACT_COMPLETE /obj/item/seeds/replicapod/get_analyzer_text() var/text = ..() @@ -53,7 +54,6 @@ text += "\n It contains a blood sample!" return text - /obj/item/seeds/replicapod/harvest(mob/user, obj/item/storage/bag/plants/bag) var/obj/machinery/hydroponics/parent = loc var/make_podman = 0 diff --git a/code/modules/hydroponics/seeds.dm b/code/modules/hydroponics/seeds.dm index c54b0574e2e..c492ba2d3f0 100644 --- a/code/modules/hydroponics/seeds.dm +++ b/code/modules/hydroponics/seeds.dm @@ -37,6 +37,7 @@ var/weed_chance = 5 /// If weed chance passes, this many weeds sprout during growth var/weed_rate = 1 + new_attack_chain = TRUE /// The size of a small mutation for each stat. var/static/list/stat_mutation_sizes = list( @@ -394,19 +395,21 @@ /obj/item/seeds/proc/on_chem_reaction(datum/reagents/S) // In case seeds have some special interaction with special chems return -/obj/item/seeds/attackby__legacy__attackchain(obj/item/O, mob/user, params) - if(istype(O, /obj/item/plant_analyzer)) +/obj/item/seeds/item_interaction(mob/user, obj/item/used, list/modifiers) + if(istype(used, /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]")) + to_chat(user, SPAN_NOTICE(text)) - return - if(is_pen(O)) + return ITEM_INTERACT_COMPLETE + + if(is_pen(used)) variant_prompt(user) - return - ..() // Fallthrough to item/attackby() so that bags can pick seeds up + add_fingerprint(user) + return ITEM_INTERACT_COMPLETE + return ..() // Fall through to parent so that bags can pick seeds up. /obj/item/seeds/proc/variant_prompt(mob/user, obj/item/container = null) var/prev = variant