From 9c8f096c977cada6b6b5f4b04167cec6b35b1481 Mon Sep 17 00:00:00 2001 From: Alan Date: Fri, 24 Jul 2026 15:44:04 -0400 Subject: [PATCH] Migrate data disks to the new attack chain. (#32235) * Migrate data disks to the new attack chain. * Call parent in activate_self() * Migrate plant disks too. * Call parent in activate_self() in gene_modder.dm. * Prevent runtime on examine. * Add fingerprints. --- code/game/objects/items/disks.dm | 11 ++++++++--- code/modules/hydroponics/gene_modder.dm | 22 +++++++++++++++------- 2 files changed, 23 insertions(+), 10 deletions(-) diff --git a/code/game/objects/items/disks.dm b/code/game/objects/items/disks.dm index 69c9b4353bb..061ed2a4729 100644 --- a/code/game/objects/items/disks.dm +++ b/code/game/objects/items/disks.dm @@ -6,11 +6,12 @@ pickup_sound = 'sound/items/handling/disk_pickup.ogg' w_class = WEIGHT_CLASS_TINY materials = list(MAT_METAL = 300, MAT_GLASS = 100) + new_attack_chain = TRUE /obj/item/disk/data name = "Cloning Data Disk" var/datum/dna2_record/buf = null - var/read_only = FALSE //Well,it's still a floppy disk + var/read_only = FALSE // Well, it's still a floppy disk. /obj/item/disk/data/proc/initialize_data() buf = new @@ -57,9 +58,13 @@ var/diskcolor = pick(0, 1, 2, 3, 4, 5) icon_state = "datadisk[diskcolor]" -/obj/item/disk/data/attack_self__legacy__attackchain(mob/user) +/obj/item/disk/data/activate_self(mob/user) + if(..()) + return ITEM_INTERACT_COMPLETE read_only = !read_only - to_chat(user, "You flip the write-protect tab to [read_only ? "protected" : "unprotected"].") + add_fingerprint(user) + to_chat(user, SPAN_NOTICE("You flip the write-protect tab to [read_only ? "protected" : "unprotected"].")) + return ITEM_INTERACT_COMPLETE /obj/item/disk/data/examine(mob/user) . = ..() diff --git a/code/modules/hydroponics/gene_modder.dm b/code/modules/hydroponics/gene_modder.dm index 1b83c5dab4a..681f7af9d45 100644 --- a/code/modules/hydroponics/gene_modder.dm +++ b/code/modules/hydroponics/gene_modder.dm @@ -601,10 +601,13 @@ QDEL_NULL(gene) return ..() -/obj/item/disk/plantgene/attackby__legacy__attackchain(obj/item/W, mob/user, params) - ..() - if(is_pen(W)) - rename_interactive(user, W) +/obj/item/disk/plantgene/item_interaction(mob/living/user, obj/item/used, list/modifiers) + if(..()) + return ITEM_INTERACT_COMPLETE + if(is_pen(used)) + rename_interactive(user, used) + add_fingerprint(user) + return ITEM_INTERACT_COMPLETE /obj/item/disk/plantgene/update_name() . = ..() @@ -662,11 +665,15 @@ icon_state = "datadisk_hydro" -/obj/item/disk/plantgene/attack_self__legacy__attackchain(mob/user) +/obj/item/disk/plantgene/activate_self(mob/user) + if(..()) + return ITEM_INTERACT_COMPLETE if(HAS_TRAIT(src, TRAIT_CMAGGED)) - return + return ITEM_INTERACT_COMPLETE read_only = !read_only to_chat(user, SPAN_NOTICE("You flip the write-protect tab to [read_only ? "protected" : "unprotected"].")) + add_fingerprint(user) + return ITEM_INTERACT_COMPLETE /obj/item/disk/plantgene/cmag_act(mob/user) if(!HAS_TRAIT(src, TRAIT_CMAGGED)) @@ -694,7 +701,8 @@ . = ..() if(!HAS_TRAIT(src, TRAIT_CMAGGED)) return - + if(!user) // Prevents a runtime when examine is called. Yes, regular examine(). + user = usr if((user.mind.assigned_role == "Captain" || user.mind.special_role == SPECIAL_ROLE_NUKEOPS) && user.Adjacent(src)) . += SPAN_DANGER("Yes, even closer examination confirms it's not a trick of the light, it really is just a regular plant disk.") . += SPAN_USERDANGER("Now stop staring at this worthless fake and FIND THE REAL ONE!")