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,6 +2,7 @@
name = "ashtray"
icon = 'icons/obj/ashtray.dmi'
icon_state = "blank"
randpixel = 5
force_divisor = 0.1
thrown_force_divisor = 0.1
var/image/base_image
@@ -13,8 +14,7 @@
qdel(src)
return
max_butts = round(material.hardness/10) //This is arbitrary but whatever.
src.pixel_y = rand(-5, 5)
src.pixel_x = rand(-6, 6)
randpixel_xy()
update_icon()
return
@@ -5,6 +5,7 @@
icon = 'icons/obj/shards.dmi'
desc = "Made of nothing. How does this even exist?" // set based on material, if this desc is visible it's a bug (shards default to being made of glass)
icon_state = "large"
randpixel = 8
sharp = 1
edge = 1
w_class = 2
@@ -22,8 +23,7 @@
return
icon_state = "[material.shard_icon][pick("large", "medium", "small")]"
pixel_x = rand(-8, 8)
pixel_y = rand(-8, 8)
randpixel_xy()
update_icon()
if(material.shard_type)
@@ -85,6 +85,7 @@
item_state = icon_state
/obj/item/weapon/material/twohanded/pickup(mob/user)
..()
unwield()
/obj/item/weapon/material/twohanded/attack_self(mob/user as mob)