From 47d9783d70e5b648f5dc62431b63b3c8750cbb5b Mon Sep 17 00:00:00 2001 From: FloFluoro <3611705+FloFluoro@users.noreply.github.com> Date: Sat, 8 Oct 2022 07:03:43 -0400 Subject: [PATCH] Plant data disks can now be cmagged (#19273) * Plant data disks can now be cmagged * Changed usr to user * Now uses update_appearance() --- code/game/atoms.dm | 3 +++ code/game/objects/cleaning.dm | 1 + code/modules/hydroponics/gene_modder.dm | 35 +++++++++++++++++++++++-- 3 files changed, 37 insertions(+), 2 deletions(-) diff --git a/code/game/atoms.dm b/code/game/atoms.dm index 7102c6e8e32..643d4d3923b 100644 --- a/code/game/atoms.dm +++ b/code/game/atoms.dm @@ -517,6 +517,9 @@ /atom/proc/cmag_act() return +/atom/proc/uncmag() + return + /** * Respond to a radioactive wave hitting this atom * diff --git a/code/game/objects/cleaning.dm b/code/game/objects/cleaning.dm index 6c00a1f5f60..e63d3fe9e03 100644 --- a/code/game/objects/cleaning.dm +++ b/code/game/objects/cleaning.dm @@ -38,6 +38,7 @@ if(is_cmagged) //If we've cleaned a cmagged object REMOVE_TRAIT(src, TRAIT_CMAGGED, "clown_emag") + uncmag() return TRUE else //Generic cleaning functionality diff --git a/code/modules/hydroponics/gene_modder.dm b/code/modules/hydroponics/gene_modder.dm index 2ffeec2e297..6780c913b17 100644 --- a/code/modules/hydroponics/gene_modder.dm +++ b/code/modules/hydroponics/gene_modder.dm @@ -480,19 +480,50 @@ /obj/item/disk/plantgene/update_name() . = ..() + if(HAS_TRAIT(src, TRAIT_CMAGGED)) + name = "nuclear authentication disk" + return if(gene) name = "[gene.get_name()] (Plant Data Disk)" else name = "plant data disk" +/obj/item/disk/plantgene/update_desc() + . = ..() + if(HAS_TRAIT(src, TRAIT_CMAGGED)) + desc = "Better keep this safe." + else + desc = "A disk for storing plant genetic data." + +/obj/item/disk/plantgene/update_icon_state() + . = ..() + if(HAS_TRAIT(src, TRAIT_CMAGGED)) + icon_state = "nucleardisk" + else + icon_state = "datadisk_hydro" + /obj/item/disk/plantgene/attack_self(mob/user) + if(HAS_TRAIT(src, TRAIT_CMAGGED)) + return read_only = !read_only to_chat(user, "You flip the write-protect tab to [read_only ? "protected" : "unprotected"].") +/obj/item/disk/plantgene/cmag_act(mob/user) + if(!HAS_TRAIT(src, TRAIT_CMAGGED)) + to_chat(user, "The bananium ooze flips a couple bits on the plant disk's display, making it look just like the..!") + ADD_TRAIT(src, TRAIT_CMAGGED, "clown_emag") + update_appearance(UPDATE_NAME|UPDATE_DESC|UPDATE_ICON) + +/obj/item/disk/plantgene/uncmag() + update_appearance(UPDATE_NAME|UPDATE_DESC|UPDATE_ICON) + /obj/item/disk/plantgene/examine(mob/user) . = ..() - . += "The write-protect tab is set to [read_only ? "protected" : "unprotected"]." - + if(!HAS_TRAIT(src, TRAIT_CMAGGED)) + . += "The write-protect tab is set to [read_only ? "protected" : "unprotected"]." + return + if((user.mind.assigned_role == "Captain" || user.mind.special_role == SPECIAL_ROLE_NUKEOPS) && (user.Adjacent(src))) + . += "... Wait. This isn't the nuclear authentication disk! It's a clever forgery!" /* * Plant DNA Disks Box