Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MIRROR] Fixes snail backpack bluespace anomaly core interaction #5045

Merged
merged 2 commits into from
Sep 20, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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)
Expand Down
Loading