mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-07-11 23:23:28 +01:00
tweak: Better stacks (#21861)
* tweak: Better stacks * review changes * del return * that's it
This commit is contained in:
@@ -514,6 +514,7 @@ GLOBAL_LIST_INIT(brass_recipes, list (
|
||||
throw_range = 3
|
||||
turf_type = /turf/simulated/floor/clockwork
|
||||
table_type = /obj/structure/table/reinforced/brass
|
||||
dynamic_icon_state = TRUE
|
||||
|
||||
/obj/item/stack/tile/brass/narsie_act()
|
||||
new /obj/item/stack/sheet/runed_metal(loc, amount)
|
||||
|
||||
@@ -55,11 +55,12 @@
|
||||
. = ..()
|
||||
if(!dynamic_icon_state)
|
||||
return
|
||||
var/temp_amount = get_amount()
|
||||
if(temp_amount > 1)
|
||||
icon_state = "[initial(icon_state)]_[min(temp_amount, 3)]" //2 if amount is 2, 3 if more.
|
||||
var/state = CEILING((amount/max_amount) * 3, 1)
|
||||
if(state <= 1)
|
||||
icon_state = initial(icon_state)
|
||||
return
|
||||
icon_state = initial(icon_state)
|
||||
|
||||
icon_state = "[initial(icon_state)]_[state]"
|
||||
|
||||
/obj/item/stack/Crossed(obj/O, oldloc)
|
||||
if(amount >= max_amount || ismob(loc)) // Prevents unnecessary call. Also prevents merging stack automatically in a mob's inventory
|
||||
|
||||
Reference in New Issue
Block a user