Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MIRROR] Plumbing machinery power & processing tweaks #2985

Merged
merged 2 commits into from
Apr 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions code/datums/components/plumbing/splitter.dm
Original file line number Diff line number Diff line change
Expand Up @@ -43,5 +43,6 @@
if(EAST)
if(amount >= S.transfer_side)
amount = S.transfer_side
S.use_energy(S.active_power_usage)
return ..()

17 changes: 12 additions & 5 deletions code/modules/plumbing/plumbers/_plumb_machinery.dm
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
icon = 'icons/obj/pipes_n_cables/hydrochem/plumbers.dmi'
icon_state = "pump"
density = TRUE
idle_power_usage = BASE_MACHINE_IDLE_CONSUMPTION * 7.5
processing_flags = START_PROCESSING_MANUALLY
active_power_usage = BASE_MACHINE_ACTIVE_CONSUMPTION * 2.75
resistance_flags = FIRE_PROOF | UNACIDABLE | ACID_PROOF
///Plumbing machinery is always gonna need reagents, so we might aswell put it here
var/buffer = 50
Expand All @@ -26,11 +27,17 @@
. = ..()
. += span_notice("The maximum volume display reads: <b>[reagents.maximum_volume] units</b>.")


/obj/machinery/plumbing/wrench_act(mob/living/user, obj/item/tool)
. = ..()
default_unfasten_wrench(user, tool)
return ITEM_INTERACT_SUCCESS
if(user.combat_mode)
return NONE

. = ITEM_INTERACT_BLOCKING
if(default_unfasten_wrench(user, tool) == SUCCESSFUL_UNFASTEN)
if(anchored)
begin_processing()
else
end_processing()
return ITEM_INTERACT_SUCCESS

/obj/machinery/plumbing/plunger_act(obj/item/plunger/P, mob/living/user, reinforced)
user.balloon_alert_to_viewers("furiously plunging...")
Expand Down
3 changes: 1 addition & 2 deletions code/modules/plumbing/plumbers/acclimator.dm
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
icon_state = "acclimator"
base_icon_state = "acclimator"
buffer = 200
active_power_usage = BASE_MACHINE_ACTIVE_CONSUMPTION * 2

///towards wich temperature do we build?
var/target_temperature = 300
Expand All @@ -32,7 +31,7 @@
AddComponent(/datum/component/plumbing/acclimator, bolt, layer)

/obj/machinery/plumbing/acclimator/process(seconds_per_tick)
if(machine_stat & NOPOWER || !enabled || !reagents.total_volume || reagents.chem_temp == target_temperature)
if(!is_operational || !enabled || !reagents.total_volume || reagents.chem_temp == target_temperature)
if(acclimate_state != NEUTRAL)
acclimate_state = NEUTRAL
update_appearance()
Expand Down
4 changes: 1 addition & 3 deletions code/modules/plumbing/plumbers/bottler.dm
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,8 @@
icon_state = "bottler"
layer = ABOVE_ALL_MOB_LAYER
plane = ABOVE_GAME_PLANE

reagent_flags = TRANSPARENT | DRAINABLE
buffer = 100
active_power_usage = BASE_MACHINE_ACTIVE_CONSUMPTION * 2

///how much do we fill
var/wanted_amount = 10
Expand Down Expand Up @@ -71,7 +69,7 @@
to_chat(user, span_notice(" The [src] will now fill for [wanted_amount]u."))

/obj/machinery/plumbing/bottler/process(seconds_per_tick)
if(machine_stat & NOPOWER)
if(!is_operational)
return
// Sanity check the result locations and stop processing if they don't exist
if(goodspot == null || badspot == null || inputspot == null)
Expand Down
3 changes: 1 addition & 2 deletions code/modules/plumbing/plumbers/destroyer.dm
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
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
Expand All @@ -13,7 +12,7 @@
AddComponent(/datum/component/plumbing/simple_demand, bolt, layer)

/obj/machinery/plumbing/disposer/process(seconds_per_tick)
if(machine_stat & NOPOWER)
if(!is_operational)
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
Expand Down
3 changes: 1 addition & 2 deletions code/modules/plumbing/plumbers/fermenter.dm
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
plane = ABOVE_GAME_PLANE
reagent_flags = TRANSPARENT | DRAINABLE
buffer = 400
active_power_usage = BASE_MACHINE_ACTIVE_CONSUMPTION * 2

///input dir
var/eat_dir = SOUTH
Expand Down Expand Up @@ -36,7 +35,7 @@

/// uses fermentation proc similar to fermentation barrels
/obj/machinery/plumbing/fermenter/proc/ferment(atom/AM)
if(machine_stat & NOPOWER)
if(!is_operational)
return
if(reagents.holder_full())
return
Expand Down
17 changes: 7 additions & 10 deletions code/modules/plumbing/plumbers/grinder_chemical.dm
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,8 @@
icon_state = "grinder_chemical"
layer = ABOVE_ALL_MOB_LAYER
plane = ABOVE_GAME_PLANE

reagent_flags = TRANSPARENT | DRAINABLE
buffer = 400
active_power_usage = BASE_MACHINE_ACTIVE_CONSUMPTION * 2

/obj/machinery/plumbing/grinder_chemical/Initialize(mapload, bolt, layer)
. = ..()
Expand Down Expand Up @@ -47,7 +45,7 @@
* * [AM][atom] - the atom to grind or juice
*/
/obj/machinery/plumbing/grinder_chemical/proc/grind(atom/AM)
if(machine_stat & NOPOWER)
if(!is_operational)
return
if(reagents.holder_full())
return
Expand All @@ -56,11 +54,10 @@

var/obj/item/I = AM
var/result
if(I.grind_results || I.juice_typepath)
if(I.grind_results)
result = I.grind(reagents, usr)
else
result = I.juice(reagents, usr)
if(result)
use_energy(active_power_usage)
if(I.grind_results)
result = I.grind(reagents, usr)
else if (I.juice_typepath)
result = I.juice(reagents, usr)
if(result)
qdel(I)
qdel(I)
13 changes: 9 additions & 4 deletions code/modules/plumbing/plumbers/iv_drip.dm
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
base_icon_state = "plumb"
density = TRUE
use_internal_storage = TRUE
processing_flags = START_PROCESSING_MANUALLY

/obj/machinery/iv_drip/plumbing/Initialize(mapload, bolt, layer)
. = ..()
Expand All @@ -29,10 +30,14 @@
reagents.expose(get_turf(src), TOUCH) //splash on the floor
reagents.clear_reagents()


/obj/machinery/iv_drip/plumbing/wrench_act(mob/living/user, obj/item/tool)
if(user.combat_mode)
return NONE

. = ITEM_INTERACT_BLOCKING
if(default_unfasten_wrench(user, tool) == SUCCESSFUL_UNFASTEN)
if(anchored)
begin_processing()
else
end_processing()
return ITEM_INTERACT_SUCCESS

/obj/machinery/iv_drip/plumbing/on_deconstruction(disassembled)
qdel(src)
3 changes: 1 addition & 2 deletions code/modules/plumbing/plumbers/pill_press.dm
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
name = "chemical press"
desc = "A press that makes pills, patches and bottles."
icon_state = "pill_press"
active_power_usage = BASE_MACHINE_ACTIVE_CONSUMPTION * 2

/// current operating product (pills or patches)
var/product = "pill"
Expand Down Expand Up @@ -80,7 +79,7 @@
return container

/obj/machinery/plumbing/pill_press/process(seconds_per_tick)
if(machine_stat & NOPOWER)
if(!is_operational)
return

//shift & check to account for floating point inaccuracies
Expand Down
4 changes: 3 additions & 1 deletion code/modules/plumbing/plumbers/reaction_chamber.dm
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
icon_state = "reaction_chamber"
buffer = 200
reagent_flags = TRANSPARENT | NO_REACT
active_power_usage = BASE_MACHINE_ACTIVE_CONSUMPTION * 2

/**
* list of set reagents that the reaction_chamber allows in, and must all be present before mixing is enabled.
Expand Down Expand Up @@ -49,6 +48,9 @@
return NONE

/obj/machinery/plumbing/reaction_chamber/process(seconds_per_tick)
if(!is_operational)
return

//half the power for getting reagents in
var/power_usage = active_power_usage * 0.5

Expand Down
1 change: 0 additions & 1 deletion code/modules/plumbing/plumbers/splitters.dm
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
name = "chemical splitter"
desc = "A chemical splitter for smart chemical factorization. Waits till a set of conditions is met and then stops all input and splits the buffer evenly or other in two ducts."
icon_state = "splitter"
active_power_usage = BASE_MACHINE_ACTIVE_CONSUMPTION * 2
buffer = 100
density = FALSE

Expand Down
5 changes: 2 additions & 3 deletions code/modules/plumbing/plumbers/synthesizer.dm
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
desc = "Produces a single chemical at a given volume. Must be plumbed. Most effective when working in unison with other chemical synthesizers, heaters and filters."
icon_state = "synthesizer"
icon = 'icons/obj/pipes_n_cables/hydrochem/plumbers.dmi'
active_power_usage = BASE_MACHINE_ACTIVE_CONSUMPTION * 2

///Amount we produce for every process. Ideally keep under 5 since thats currently the standard duct capacity
var/amount = 1
Expand Down Expand Up @@ -49,15 +48,15 @@
dispensable_reagents = default_reagents

/obj/machinery/plumbing/synthesizer/process(seconds_per_tick)
if(machine_stat & NOPOWER || !reagent_id || !amount)
if(!is_operational || !reagent_id || !amount)
return

//otherwise we get leftovers, and we need this to be precise
if(reagents.total_volume >= amount)
return
reagents.add_reagent(reagent_id, amount)

use_energy(active_power_usage)
use_energy(active_power_usage * seconds_per_tick)

/obj/machinery/plumbing/synthesizer/ui_interact(mob/user, datum/tgui/ui)
ui = SStgui.try_update_ui(user, src, ui)
Expand Down
2 changes: 1 addition & 1 deletion code/modules/plumbing/plumbers/teleporter.dm
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@
return TRUE

/obj/machinery/plumbing/receiver/process(seconds_per_tick)
if(machine_stat & NOPOWER || panel_open)
if(!is_operational || panel_open)
return

if(senders.len)
Expand Down
3 changes: 2 additions & 1 deletion code/modules/plumbing/plumbers/vatgrower.dm
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
return NONE

///When we process, we make use of our reagents to try and feed the samples we have.
/obj/machinery/plumbing/growing_vat/process()
/obj/machinery/plumbing/growing_vat/process(seconds_per_tick)
if(!is_operational)
return
if(!biological_sample)
Expand All @@ -37,6 +37,7 @@
return
playsound(loc, 'sound/effects/slosh.ogg', 25, TRUE)
audible_message(pick(list(span_notice("[src] grumbles!"), span_notice("[src] makes a splashing noise!"), span_notice("[src] sloshes!"))))
use_energy(active_power_usage * seconds_per_tick)

///Handles the petri dish depositing into the vat.
/obj/machinery/plumbing/growing_vat/attacked_by(obj/item/I, mob/living/user)
Expand Down
Loading