mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-01-19 13:35:10 +00:00
## About The Pull Request - Removed the `category` var from all plumbing machinery, now all the designs are organized by category in a single static list(1 list for each plumbing rcd type). This makes it easy to add new designs to 1 list in the future and since the list is static memory is saved when multiple plumbing RCDs are made in game - Removed redundant `machinery_data` list. This list simply stored the cost of designs from the `plumbing_designs` list. Rather than wasting memory with this list we can derive the cost from `plumbing_designs` list ourselves - Removed unused list `choices`. No idea what that did back then - When low on ammo the plumbing RCD would display multiple balloon alerts. That's fixed now - Made the icon sizes of designs in the UI slightly smaller so they don't clip and look blurry ## Changelog 🆑 fix: multiple balloon alerts when the plumbing RCD is low on ammo code: organized all plumbing designs into static lists for memory savings refactor: removed unused vars for further memory savings /🆑
27 lines
942 B
Plaintext
27 lines
942 B
Plaintext
/obj/machinery/plumbing/disposer
|
|
name = "chemical disposer"
|
|
desc = "Breaks down chemicals and annihilates them."
|
|
icon_state = "disposal"
|
|
pass_flags_self = PASSMACHINE | LETPASSTHROW // Small
|
|
active_power_usage = BASE_MACHINE_ACTIVE_CONSUMPTION * 2
|
|
|
|
///we remove 5 reagents per second
|
|
var/disposal_rate = 5
|
|
|
|
/obj/machinery/plumbing/disposer/Initialize(mapload, bolt, layer)
|
|
. = ..()
|
|
AddComponent(/datum/component/plumbing/simple_demand, bolt, layer)
|
|
|
|
/obj/machinery/plumbing/disposer/process(seconds_per_tick)
|
|
if(machine_stat & NOPOWER)
|
|
return
|
|
if(reagents.total_volume)
|
|
if(icon_state != initial(icon_state) + "_working") //threw it here instead of update icon since it only has two states
|
|
icon_state = initial(icon_state) + "_working"
|
|
reagents.remove_any(disposal_rate * seconds_per_tick)
|
|
use_power(active_power_usage * seconds_per_tick)
|
|
else
|
|
if(icon_state != initial(icon_state))
|
|
icon_state = initial(icon_state)
|
|
|