Anim bugfixes (#39311)

* 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

* Fixes the item pickup animation

* eh whatever

* Update atoms_movable.dm
This commit is contained in:
Iamgoofball
2018-07-25 17:54:35 -07:00
committed by Ling
parent 18623f212e
commit 8d1c48a78e
3 changed files with 13 additions and 16 deletions

View File

@@ -781,6 +781,8 @@
/obj/item/proc/do_pickup_animation(atom/target) /obj/item/proc/do_pickup_animation(atom/target)
set waitfor = FALSE set waitfor = FALSE
if(!istype(loc, /turf))
return
var/image/I = image(icon = src, loc = loc, layer = layer + 0.1) var/image/I = image(icon = src, loc = loc, layer = layer + 0.1)
I.plane = GAME_PLANE I.plane = GAME_PLANE
I.transform *= 0.75 I.transform *= 0.75
@@ -790,14 +792,6 @@
var/to_x = 0 var/to_x = 0
var/to_y = 0 var/to_y = 0
flick_overlay(I, GLOB.clients, 6)
var/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)) if(!QDELETED(T) && !QDELETED(target))
direction = get_dir(T, target) direction = get_dir(T, target)
if(direction & NORTH) if(direction & NORTH)
@@ -810,6 +804,9 @@
to_x = -32 to_x = -32
if(!direction) if(!direction)
to_y = 16 to_y = 16
animate(I, alpha = 175, pixel_x = to_x, pixel_y = to_y, time = 3, easing = CUBIC_EASING) flick_overlay(I, GLOB.clients, 6)
var/matrix/M = new
M.Turn(pick(-30, 30))
animate(I, alpha = 175, pixel_x = to_x, pixel_y = to_y, time = 3, transform = M, easing = CUBIC_EASING)
sleep(1) sleep(1)
animate(I, alpha = 0, time = 1) animate(I, alpha = 0, transform = matrix(), time = 1)

View File

@@ -295,7 +295,7 @@ GLOBAL_VAR_INIT(rpg_loot_items, FALSE)
pickup(user) pickup(user)
add_fingerprint(user) add_fingerprint(user)
if(!user.put_in_active_hand(src)) if(!user.put_in_active_hand(src, FALSE, FALSE))
user.dropItemToGround(src) user.dropItemToGround(src)
/obj/item/proc/allow_attack_hand_drop(mob/user) /obj/item/proc/allow_attack_hand_drop(mob/user)
@@ -317,7 +317,7 @@ GLOBAL_VAR_INIT(rpg_loot_items, FALSE)
pickup(user) pickup(user)
add_fingerprint(user) add_fingerprint(user)
if(!user.put_in_active_hand(src)) if(!user.put_in_active_hand(src, FALSE, FALSE))
user.dropItemToGround(src) user.dropItemToGround(src)
/obj/item/attack_alien(mob/user) /obj/item/attack_alien(mob/user)

View File

@@ -170,9 +170,9 @@
return FALSE return FALSE
return !held_items[hand_index] return !held_items[hand_index]
/mob/proc/put_in_hand(obj/item/I, hand_index, forced = FALSE) /mob/proc/put_in_hand(obj/item/I, hand_index, forced = FALSE, ignore_anim = TRUE)
if(forced || can_put_in_hand(I, hand_index)) if(forced || can_put_in_hand(I, hand_index))
if(isturf(I.loc)) if(isturf(I.loc) && !ignore_anim)
I.do_pickup_animation(src) I.do_pickup_animation(src)
if(hand_index == null) if(hand_index == null)
return FALSE return FALSE
@@ -210,8 +210,8 @@
//Puts the item into our active hand if possible. returns TRUE on success. //Puts the item into our active hand if possible. returns TRUE on success.
/mob/proc/put_in_active_hand(obj/item/I, forced = FALSE) /mob/proc/put_in_active_hand(obj/item/I, forced = FALSE, ignore_animation = TRUE)
return put_in_hand(I, active_hand_index, forced) return put_in_hand(I, active_hand_index, forced, ignore_animation)
//Puts the item into our inactive hand if possible, returns TRUE on success //Puts the item into our inactive hand if possible, returns TRUE on success