From fa1a4f1c6791132d5344fd73646f5082651fca8e Mon Sep 17 00:00:00 2001 From: Bloop <13398309+vinylspiders@users.noreply.github.com> Date: Thu, 19 Sep 2024 17:12:23 -0400 Subject: [PATCH 1/2] Fixes snail backpack bluespace anomaly core interaction (#4411) * Fixes snail backpack bluespace anomaly core interaction * Spruce this code up a bit while we are here * Make this proc self-contained so it can be called on its own * Update snail.dm --- .../living/carbon/human/species_type/snail.dm | 42 ++++++++++++------- 1 file changed, 26 insertions(+), 16 deletions(-) diff --git a/modular_nova/master_files/code/modules/mob/living/carbon/human/species_type/snail.dm b/modular_nova/master_files/code/modules/mob/living/carbon/human/species_type/snail.dm index af85f3bb6f5..1fb98d7b0cc 100644 --- a/modular_nova/master_files/code/modules/mob/living/carbon/human/species_type/snail.dm +++ b/modular_nova/master_files/code/modules/mob/living/carbon/human/species_type/snail.dm @@ -89,22 +89,6 @@ . = ..() atom_storage.max_total_storage = 30 -/obj/item/storage/backpack/snail/attackby(obj/item/core, mob/user) - if(!istype(core, /obj/item/assembly/signaler/anomaly/bluespace)) - return ..() - - to_chat(user, span_notice("You insert [core] into your shell, and it starts to glow blue with expanded storage potential!")) - playsound(src, 'sound/machines/click.ogg', 50, TRUE) - add_filter("bluespace_shell", 2, list("type" = "outline", "color" = COLOR_BLUE_LIGHT, "size" = 1)) - storage_core = TRUE - qdel(core) - emptyStorage() - create_storage(max_specific_storage = WEIGHT_CLASS_GIGANTIC, max_total_storage = 35, max_slots = 30, storage_type = /datum/storage/bag_of_holding) - atom_storage.allow_big_nesting = TRUE - name = "snail shell of holding" - user.update_worn_back() - update_appearance() - /obj/item/storage/backpack/snail/build_worn_icon( default_layer = 0, default_icon_file = null, @@ -120,6 +104,32 @@ standing.add_filter("bluespace_shell", 2, list("type" = "outline", "color" = COLOR_BLUE_LIGHT, "alpha" = SHELL_TRANSPARENCY_ALPHA, "size" = 1)) return standing +/obj/item/storage/backpack/snail/item_interaction(mob/living/user, obj/item/tool, list/modifiers) + if(!istype(tool, /obj/item/assembly/signaler/anomaly/bluespace)) + return NONE + + qdel(tool) + upgrade_to_bluespace(user) + to_chat(user, span_notice("You insert [tool] into your shell, and it starts to glow blue with expanded storage potential!")) + return ITEM_INTERACT_SUCCESS + +/// Upgrades the storage capacity of the snail shell and gives it a glowy blue outline +/obj/item/storage/backpack/snail/proc/upgrade_to_bluespace(mob/living/wearer) + add_filter("bluespace_shell", 2, list("type" = "outline", "color" = COLOR_BLUE_LIGHT, "size" = 1)) + playsound(src, 'sound/machines/click.ogg', 50, TRUE) + storage_core = TRUE + emptyStorage() + create_storage(max_specific_storage = WEIGHT_CLASS_GIGANTIC, max_total_storage = 35, max_slots = 30, storage_type = /datum/storage/bag_of_holding) + atom_storage.allow_big_nesting = TRUE + name = "snail shell of holding" + update_appearance() + + // Update the worn sprite with the blue outline too if applicable + if(isnull(wearer)) + wearer = loc + if(istype(wearer)) + wearer.update_worn_back() + /datum/species/snail/prepare_human_for_preview(mob/living/carbon/human/snail) snail.dna.features["mcolor"] = "#adaba7" snail.update_body(TRUE) From f55fee2e35e5b3fb18cbb174cf2e5b8743826d6f Mon Sep 17 00:00:00 2001 From: StealsThePRs Date: Fri, 20 Sep 2024 00:12:38 +0300 Subject: [PATCH 2/2] [MIRROR] Fixes snail backpack bluespace anomaly core interaction