diff --git a/code/__HELPERS/unsorted.dm b/code/__HELPERS/unsorted.dm index 620c592d93..87524c4ae6 100644 --- a/code/__HELPERS/unsorted.dm +++ b/code/__HELPERS/unsorted.dm @@ -1239,6 +1239,20 @@ GLOBAL_REAL_VAR(list/stack_trace_storage) pixel_x = initialpixelx pixel_y = initialpixely +/atom/proc/do_jiggle(targetangle = 45) + var/matrix/OM = matrix(transform) + var/matrix/M = matrix(transform) + M.Turn(pick(-targetangle, targetangle)) + animate(src, transform = M, time = 10, easing = ELASTIC_EASING) + animate(src, transform = OM, time = 10, easing = ELASTIC_EASING) + +/atom/proc/do_squish(squishx = -1, squishy = 2) + var/matrix/OM = matrix(transform) + var/matrix/M = matrix(transform) + M.Scale(squishx, squishy) + animate(src, transform = M, time = 10, easing = ELASTIC_EASING) + animate(src, transform = OM, time = 10, easing = ELASTIC_EASING) + /proc/weightclass2text(var/w_class) switch(w_class) if(WEIGHT_CLASS_TINY) diff --git a/code/datums/components/storage/storage.dm b/code/datums/components/storage/storage.dm index 55af26b6b2..b969f35972 100644 --- a/code/datums/components/storage/storage.dm +++ b/code/datums/components/storage/storage.dm @@ -169,10 +169,12 @@ if(locked) to_chat(M, "[parent] seems to be locked!") return FALSE + var/atom/A = parent var/obj/item/I = O if(collection_mode == COLLECT_ONE) if(can_be_inserted(I, null, M)) handle_item_insertion(I, null, M) + A.do_squish() return if(!isturf(I.loc)) return @@ -189,6 +191,7 @@ stoplag(1) qdel(progress) to_chat(M, "You put everything you could [insert_preposition] [parent].") + A.do_squish(-1, 3) /datum/component/storage/proc/handle_mass_item_insertion(list/things, datum/component/storage/src_object, mob/user, datum/progressbar/progress) var/atom/source_real_location = src_object.real_location() @@ -246,6 +249,7 @@ while (do_after(M, 10, TRUE, T, FALSE, CALLBACK(src, .proc/mass_remove_from_storage, T, things, progress))) stoplag(1) qdel(progress) + A.do_squish(2, 0) /datum/component/storage/proc/mass_remove_from_storage(atom/target, list/things, datum/progressbar/progress, trigger_on_found = TRUE) var/atom/real_location = real_location() @@ -455,6 +459,7 @@ return FALSE if(dump_destination.storage_contents_dump_act(src, M)) playsound(A, "rustle", 50, 1, -5) + A.do_squish(2, 0) return TRUE return FALSE @@ -473,6 +478,8 @@ return TRUE return FALSE handle_item_insertion(I, FALSE, M) + var/atom/A = parent + A.do_squish() /datum/component/storage/proc/return_inv(recursive) var/list/ret = list() @@ -514,6 +521,7 @@ if(A.loc != M) return playsound(A, "rustle", 50, 1, -5) + A.do_jiggle() if(istype(over_object, /obj/screen/inventory/hand)) var/obj/screen/inventory/hand/H = over_object M.putItemFromInventoryInHandIfPossible(A, H.held_index) @@ -539,6 +547,8 @@ if(!L.incapacitated() && I == L.get_active_held_item()) if(!SEND_SIGNAL(I, COMSIG_CONTAINS_STORAGE) && can_be_inserted(I, FALSE)) //If it has storage it should be trying to dump, not insert. handle_item_insertion(I, FALSE, L) + var/atom/A = parent + A.do_squish() //This proc return 1 if the item can be picked up and 0 if it can't. //Set the stop_messages to stop it from printing messages @@ -712,6 +722,7 @@ to_chat(user, "[parent] seems to be locked!") else show_to(user) + A.do_jiggle() /datum/component/storage/proc/signal_on_pickup(datum/source, mob/user) var/atom/A = parent