mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-23 21:18:37 +01:00
Random pixel shift for dropped/thrown objects (#45155)
* pixels * offset for any throw, critical bedsheet bugfix * nyeh * might as well (autodoc) * renamed proc * removed redundant src * moved call from dropped() to dropItemToGround() * handles storage dumping, customizable max offset * adjusted values * inline
This commit is contained in:
@@ -284,6 +284,8 @@
|
||||
if(I.loc != real_location)
|
||||
continue
|
||||
remove_from_storage(I, target)
|
||||
I.pixel_x = rand(-10,10)
|
||||
I.pixel_y = rand(-10,10)
|
||||
if(trigger_on_found && I.on_found())
|
||||
return FALSE
|
||||
if(TICK_CHECK)
|
||||
|
||||
@@ -537,6 +537,10 @@ GLOBAL_VAR_INIT(rpg_loot_items, FALSE)
|
||||
if (callback) //call the original callback
|
||||
. = callback.Invoke()
|
||||
item_flags &= ~IN_INVENTORY
|
||||
if(!pixel_y && !pixel_x)
|
||||
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)
|
||||
|
||||
@@ -34,6 +34,8 @@ LINEN BINS
|
||||
if(layer == initial(layer))
|
||||
layer = ABOVE_MOB_LAYER
|
||||
to_chat(user, "<span class='notice'>You cover yourself with [src].</span>")
|
||||
pixel_x = 0
|
||||
pixel_y = 0
|
||||
else
|
||||
layer = initial(layer)
|
||||
to_chat(user, "<span class='notice'>You smooth [src] out beneath you.</span>")
|
||||
|
||||
@@ -292,6 +292,8 @@
|
||||
//for when you want the item to end up on the ground
|
||||
//will force move the item to the ground and call the turf's Entered
|
||||
/mob/proc/dropItemToGround(obj/item/I, force = FALSE)
|
||||
I.pixel_x = rand(-6,6)
|
||||
I.pixel_y = rand(-6,6)
|
||||
return doUnEquip(I, force, drop_location(), FALSE)
|
||||
|
||||
//for when the item will be immediately placed in a loc other than the ground
|
||||
|
||||
Reference in New Issue
Block a user