mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-24 05:30:05 +01:00
Adds juice to picking up stuff (#39231)
* Adds juice to picking up stuff Stolen completely from https://github.com/OracleStation/OracleStation/pull/1072 * perfection * Pickup animation now tweens to the correct spot if you move * mutable appearance
This commit is contained in:
@@ -771,3 +771,39 @@
|
||||
if(anchored || throwing)
|
||||
return FALSE
|
||||
return TRUE
|
||||
|
||||
|
||||
/obj/item/proc/do_pickup_animation(atom/target)
|
||||
set waitfor = FALSE
|
||||
var/mutable_appearance/I = new(icon = src, loc = loc, layer = layer + 0.1)
|
||||
I.plane = GAME_PLANE
|
||||
I.transform *= 0.75
|
||||
I.appearance_flags = APPEARANCE_UI_IGNORE_ALPHA
|
||||
var/turf/T = get_turf(src)
|
||||
var/direction
|
||||
var/to_x = 0
|
||||
var/to_y = 0
|
||||
|
||||
flick_overlay(I, GLOB.clients, 6)
|
||||
var/static/matrix/M = new
|
||||
M.Turn(pick(-30, 30))
|
||||
|
||||
animate(I, transform = M, time = 1)
|
||||
sleep(1)
|
||||
animate(I, transform = matrix(), time = 1)
|
||||
sleep(1)
|
||||
if(!QDELETED(T) && !QDELETED(target))
|
||||
direction = get_dir(T, target)
|
||||
if(direction & NORTH)
|
||||
to_y = 32
|
||||
else if(direction & SOUTH)
|
||||
to_y = -32
|
||||
if(direction & EAST)
|
||||
to_x = 32
|
||||
else if(direction & WEST)
|
||||
to_x = -32
|
||||
if(!direction)
|
||||
to_y = 16
|
||||
animate(I, alpha = 175, pixel_x = to_x, pixel_y = to_y, time = 3, easing = CUBIC_EASING)
|
||||
sleep(1)
|
||||
animate(I, alpha = 0, time = 1)
|
||||
|
||||
@@ -172,6 +172,8 @@
|
||||
|
||||
/mob/proc/put_in_hand(obj/item/I, hand_index, forced = FALSE)
|
||||
if(forced || can_put_in_hand(I, hand_index))
|
||||
if(isturf(I.loc))
|
||||
I.do_pickup_animation(src)
|
||||
if(hand_index == null)
|
||||
return FALSE
|
||||
if(get_item_for_held_index(hand_index) != null)
|
||||
|
||||
Reference in New Issue
Block a user