Ports table item autoalign from Bay (#6946)

Made it so items get their pixel x/y reset on pickup.
    Thrown items now also get their pixel placement slightly randomized.
    Tweaked the center of mass on a boatload of items to be more accurate to their sprite art.
    Replaced a bunch of randomized pixel placement code into a unifying proc; randpixel_xy() that uses an item's randpixel var.
This commit is contained in:
fernerr
2019-09-08 22:51:49 +03:00
committed by Erki
parent de748e0607
commit 2a2cc7d52e
57 changed files with 286 additions and 159 deletions
+2
View File
@@ -5,6 +5,8 @@ var/list/holder_mob_icon_cache = list()
name = "holder"
desc = "You shouldn't ever see this."
icon = 'icons/mob/npc/held_mobs.dmi'
randpixel = 0
center_of_mass = null
slot_flags = 0
sprite_sheets = list("Vox" = 'icons/mob/species/vox/head.dmi')
origin_tech = null
+6 -3
View File
@@ -164,7 +164,7 @@ var/list/slot_equipment_priority = list( \
// Removes an item from inventory and places it in the target atom.
// If canremove or other conditions need to be checked then use unEquip instead.
/mob/proc/drop_from_inventory(var/obj/item/W, var/atom/target = null)
/mob/proc/drop_from_inventory(var/obj/item/W, var/atom/target)
if(W)
if(!target)
target = loc
@@ -252,10 +252,10 @@ var/list/slot_equipment_priority = list( \
return slot
//This differs from remove_from_mob() in that it checks if the item can be unequipped first.
/mob/proc/unEquip(obj/item/I, force = 0) //Force overrides NODROP for things like wizarditis and admin undress.
/mob/proc/unEquip(obj/item/I, force = 0, var/atom/target) //Force overrides NODROP for things like wizarditis and admin undress.
if(!(force || canUnEquip(I)))
return
drop_from_inventory(I)
drop_from_inventory(I, target)
return 1
@@ -375,6 +375,9 @@ var/list/slot_equipment_priority = list( \
step(src, inertia_dir)
*/
if(istype(item,/obj/item))
var/obj/item/W = item
W.randpixel_xy()
item.throw_at(target, item.throw_range, item.throw_speed, src)