Update items.dm
This commit is contained in:
@@ -578,21 +578,22 @@ GLOBAL_VAR_INIT(rpg_loot_items, FALSE)
|
||||
itempush = 0 //too light to push anything
|
||||
return A.hitby(src, 0, itempush)
|
||||
|
||||
/obj/item/throw_at(atom/target, range, speed, mob/thrower, spin=1, diagonals_first = 0, datum/callback/callback)
|
||||
/obj/item/throw_at(atom/target, range, speed, mob/thrower, spin=1, diagonals_first = 0, datum/callback/callback, messy_throw = TRUE)
|
||||
thrownby = thrower
|
||||
callback = CALLBACK(src, .proc/after_throw, callback) //replace their callback with our own
|
||||
callback = CALLBACK(src, .proc/after_throw, callback, messy_throw) //replace their callback with our own
|
||||
. = ..(target, range, speed, thrower, spin, diagonals_first, callback)
|
||||
|
||||
/obj/item/proc/after_throw(datum/callback/callback)
|
||||
/obj/item/proc/after_throw(datum/callback/callback, messy_throw)
|
||||
if (callback) //call the original callback
|
||||
. = callback.Invoke()
|
||||
throw_speed = initial(throw_speed) //explosions change this.
|
||||
item_flags &= ~IN_INVENTORY
|
||||
var/matrix/M = matrix(transform)
|
||||
M.Turn(rand(-170, 170))
|
||||
transform = M
|
||||
pixel_x = rand(-8, 8)
|
||||
pixel_y = rand(-8, 8)
|
||||
if(messy_throw)
|
||||
var/matrix/M = matrix(transform)
|
||||
M.Turn(rand(-170, 170))
|
||||
transform = M
|
||||
pixel_x = rand(-8, 8)
|
||||
pixel_y = rand(-8, 8)
|
||||
|
||||
/obj/item/proc/remove_item_from_storage(atom/newLoc) //please use this if you're going to snowflake an item out of a obj/item/storage
|
||||
if(!newLoc)
|
||||
|
||||
Reference in New Issue
Block a user