mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-25 04:57:12 +01:00
Rods now change sprite depending on how much in the stack
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
desc = "Some rods. Can be used for building, or something."
|
||||
singular_name = "metal rod"
|
||||
icon_state = "rods"
|
||||
item_state = "rods"
|
||||
flags = CONDUCT
|
||||
w_class = 3.0
|
||||
force = 9.0
|
||||
@@ -13,6 +14,16 @@
|
||||
max_amount = 60
|
||||
attack_verb = list("hit", "bludgeoned", "whacked")
|
||||
|
||||
/obj/item/stack/rods/New(var/loc, var/amount=null)
|
||||
update_icon()
|
||||
return ..()
|
||||
|
||||
/obj/item/stack/rods/update_icon()
|
||||
if(get_amount() <= 5)
|
||||
icon_state = "rods-[get_amount()]"
|
||||
else
|
||||
icon_state = "rods"
|
||||
|
||||
/obj/item/stack/rods/attackby(obj/item/W as obj, mob/user as mob, params)
|
||||
..()
|
||||
if (istype(W, /obj/item/weapon/weldingtool))
|
||||
|
||||
@@ -169,6 +169,7 @@
|
||||
if(usr)
|
||||
usr.unEquip(src, 1)
|
||||
qdel(src)
|
||||
update_icon()
|
||||
return 1
|
||||
|
||||
/obj/item/stack/proc/add_to_stacks(mob/usr as mob)
|
||||
@@ -185,6 +186,7 @@
|
||||
usr << "You add new [item.singular_name] to the stack. It now contains [item.amount] [item.singular_name]\s."
|
||||
if(!oldsrc)
|
||||
break
|
||||
update_icon()
|
||||
|
||||
/obj/item/stack/proc/get_amount()
|
||||
return amount
|
||||
@@ -201,6 +203,7 @@
|
||||
spawn(0) src.interact(usr)
|
||||
else
|
||||
..()
|
||||
update_icon()
|
||||
return
|
||||
|
||||
/obj/item/stack/attackby(obj/item/W as obj, mob/user as mob, params)
|
||||
@@ -220,6 +223,7 @@
|
||||
src.use(to_transfer)
|
||||
if (src && usr.machine==src)
|
||||
spawn(0) src.interact(usr)
|
||||
S.update_icon()
|
||||
else return ..()
|
||||
|
||||
/obj/item/stack/proc/copy_evidences(obj/item/stack/from as obj)
|
||||
|
||||
Reference in New Issue
Block a user