diff --git a/code/ATMOSPHERICS/components/binary_devices/algae_generator_vr.dm b/code/ATMOSPHERICS/components/binary_devices/algae_generator_vr.dm index 50758f324bf..1429b9b30a3 100644 --- a/code/ATMOSPHERICS/components/binary_devices/algae_generator_vr.dm +++ b/code/ATMOSPHERICS/components/binary_devices/algae_generator_vr.dm @@ -9,12 +9,13 @@ circuit = /obj/item/weapon/circuitboard/algae_farm anchored = 1 density = 1 - use_power = 2 + power_channel = EQUIP + use_power = 1 idle_power_usage = 100 // Minimal lights to keep algae alive active_power_usage = 5000 // Powerful grow lights to stimulate oxygen production //power_rating = 7500 //7500 W ~ 10 HP - var/list/stored_material = list(MATERIAL_ALGAE = 10000, MATERIAL_CARBON = 0) + var/list/stored_material = list(MATERIAL_ALGAE = 0, MATERIAL_CARBON = 0) // Capacity increases with matter bin quality var/list/storage_capacity = list(MATERIAL_ALGAE = 10000, MATERIAL_CARBON = 10000) // Speed at which we convert CO2 to O2. Increases with manipulator quality @@ -32,6 +33,9 @@ var/const/input_gas = "carbon_dioxide" var/const/output_gas = "oxygen" +/obj/machinery/atmospherics/binary/algae_farm/filled + stored_material = list(MATERIAL_ALGAE = 10000, MATERIAL_CARBON = 0) + /obj/machinery/atmospherics/binary/algae_farm/New() ..() desc = initial(desc) + " Its outlet port is to the [dir2text(dir)]." @@ -54,6 +58,8 @@ recent_moles_transferred = 0 if(inoperable() || use_power < 2) + ui_error = null + update_icon() if(use_power == 1) last_power_draw = idle_power_usage else @@ -65,9 +71,11 @@ // STEP 1 - Check material resources if(stored_material[MATERIAL_ALGAE] < algae_per_mole) ui_error = "Insufficient [material_display_name(MATERIAL_ALGAE)] to process." + update_icon() return if(stored_material[MATERIAL_CARBON] + carbon_per_mole > storage_capacity[MATERIAL_CARBON]) ui_error = "[material_display_name(MATERIAL_CARBON)] output storage is full." + update_icon() return var/moles_to_convert = min(moles_per_tick,\ stored_material[MATERIAL_ALGAE] * algae_per_mole,\ @@ -85,6 +93,7 @@ var/co2_moles = internal.gas[input_gas] if(co2_moles < MINIMUM_MOLES_TO_FILTER) ui_error = "Insufficient [gas_data.name[input_gas]] to process." + update_icon() return // STEP 4 - Consume the resources @@ -104,7 +113,7 @@ update_icon() /obj/machinery/atmospherics/binary/algae_farm/update_icon() - if(inoperable() || !anchored) + if(inoperable() || !anchored || use_power < 2) icon_state = "algae-off" else if(recent_moles_transferred >= moles_per_tick) icon_state = "algae-full" @@ -120,6 +129,8 @@ return if(default_deconstruction_crowbar(user, W)) return + if(default_part_replacement(user, W)) + return if(try_load_materials(user, W)) return else @@ -131,6 +142,29 @@ return 1 ui_interact(user) +/obj/machinery/atmospherics/binary/algae_farm/RefreshParts() + ..() + + var/cap_rating = 0 + var/bin_rating = 0 + var/manip_rating = 0 + + for(var/obj/item/weapon/stock_parts/P in component_parts) + if(istype(P, /obj/item/weapon/stock_parts/capacitor)) + cap_rating += P.rating + if(istype(P, /obj/item/weapon/stock_parts/matter_bin)) + bin_rating += P.rating + if(istype(P, /obj/item/weapon/stock_parts/manipulator)) + manip_rating += P.rating + + power_per_mole = round(initial(power_per_mole) / cap_rating) + + var/storage = 5000 * (bin_rating**2)/2 + for(var/mat in storage_capacity) + storage_capacity[mat] = storage + + moles_per_tick = initial(moles_per_tick) + (manip_rating**2 - 1) + /obj/machinery/atmospherics/binary/algae_farm/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1, var/datum/nano_ui/master_ui = null, var/datum/topic_state/state = default_state) var/data[0] data["panelOpen"] = panel_open @@ -255,6 +289,9 @@ color = "#557722" default_type = MATERIAL_ALGAE +/obj/item/stack/material/algae/ten + amount = 10 + /material/carbon name = MATERIAL_CARBON stack_type = /obj/item/stack/material/carbon diff --git a/code/datums/supplypacks/engineering_vr.dm b/code/datums/supplypacks/engineering_vr.dm index f41a134e7b9..321269a2eac 100644 --- a/code/datums/supplypacks/engineering_vr.dm +++ b/code/datums/supplypacks/engineering_vr.dm @@ -10,4 +10,11 @@ /obj/item/clothing/suit/radiation = 2, /obj/item/clothing/suit/radiation/taur = 1, /obj/item/clothing/head/radiation = 3 - ) \ No newline at end of file + ) + +/datum/supply_packs/eng/algae + contains = list(/obj/item/stack/material/algae/ten) + name = "Algae Sheets (10)" + cost = 20 + containertype = /obj/structure/closet/crate + containername = "algae sheets crate" \ No newline at end of file diff --git a/code/game/machinery/biogenerator.dm b/code/game/machinery/biogenerator.dm index 4a8b4f2d3c7..5203d7ec2e9 100644 --- a/code/game/machinery/biogenerator.dm +++ b/code/game/machinery/biogenerator.dm @@ -123,6 +123,7 @@ dat += "Leather Coat ([round(500/build_eff)])
" dat += "Leather Jacket ([round(500/build_eff)])
" dat += "Winter Coat ([round(500/build_eff)])
" + dat += "4 Algae Sheets ([round(400/build_eff)])
" //VOREStation Edit - Algae for oxygen generator //dat += "Other
" //dat += "Monkey (500)
" else @@ -236,6 +237,9 @@ new/obj/item/clothing/suit/storage/toggle/brown_jacket(loc) if("wintercoat") new/obj/item/clothing/suit/storage/hooded/wintercoat(loc) + if("algae") //VOREStation Edit - Algae for oxygen generator + var/obj/item/stack/material/algae/A = new(loc) + A.amount = 4 //VOREStation Edit End processing = 0 menustat = "complete" update_icon() diff --git a/maps/tether/tether-01-surface.dmm b/maps/tether/tether-01-surface.dmm index c936787bd65..2aaeb3fd7e4 100644 --- a/maps/tether/tether-01-surface.dmm +++ b/maps/tether/tether-01-surface.dmm @@ -1831,7 +1831,7 @@ "aJk" = (/turf/simulated/floor/tiled/techmaint,/area/engineering/atmos/processing) "aJl" = (/obj/effect/floor_decal/industrial/warning{dir = 8},/obj/machinery/atmospherics/pipe/simple/visible/blue{dir = 6},/turf/simulated/floor/tiled/techfloor,/area/engineering/atmos/processing) "aJm" = (/obj/effect/floor_decal/industrial/warning{dir = 9},/obj/machinery/atmospherics/pipe/simple/visible/blue{dir = 4},/turf/simulated/floor/tiled/techmaint,/area/engineering/atmos/processing) -"aJn" = (/obj/effect/floor_decal/industrial/warning{dir = 1},/obj/structure/closet/crate/hydroponics,/obj/item/stack/material/algae,/obj/item/stack/material/algae,/obj/item/stack/material/algae,/obj/machinery/atmospherics/pipe/simple/visible/blue{dir = 4},/turf/simulated/floor/tiled/techmaint,/area/engineering/atmos/processing) +"aJn" = (/obj/effect/floor_decal/industrial/warning{dir = 1},/obj/structure/closet/crate/hydroponics,/obj/item/stack/material/algae,/obj/item/stack/material/algae,/obj/item/stack/material/algae,/obj/machinery/atmospherics/pipe/simple/visible/blue{dir = 4},/obj/item/stack/material/algae,/turf/simulated/floor/tiled/techmaint,/area/engineering/atmos/processing) "aJo" = (/obj/effect/floor_decal/industrial/warning{dir = 5},/obj/machinery/atmospherics/pipe/simple/visible/blue{dir = 10},/turf/simulated/floor/tiled/techmaint,/area/engineering/atmos/processing) "aJp" = (/obj/effect/floor_decal/industrial/warning{icon_state = "warning"; dir = 4},/obj/machinery/atmospherics/pipe/simple/hidden/supply,/obj/machinery/atmospherics/pipe/simple/hidden/scrubbers,/turf/simulated/floor/tiled/techfloor,/area/engineering/atmos/processing) "aJq" = (/obj/machinery/portable_atmospherics/canister/empty,/turf/simulated/floor/tiled/techmaint,/area/engineering/atmos/processing) @@ -1850,7 +1850,7 @@ "aJD" = (/obj/machinery/atmospherics/pipe/tank/phoron{dir = 8; start_pressure = 1215.9},/obj/effect/floor_decal/industrial/outline/yellow,/turf/simulated/floor/tiled/techmaint,/area/engineering/atmos/processing) "aJE" = (/obj/effect/floor_decal/industrial/warning{dir = 8},/obj/machinery/atmospherics/binary/pump,/turf/simulated/floor/tiled/techfloor,/area/engineering/atmos/processing) "aJF" = (/obj/effect/floor_decal/industrial/warning{icon_state = "warning"; dir = 8},/obj/machinery/atmospherics/pipe/simple/visible/black{tag = "icon-intact (SOUTHEAST)"; icon_state = "intact"; dir = 6},/turf/simulated/floor/tiled/techmaint,/area/engineering/atmos/processing) -"aJG" = (/obj/machinery/atmospherics/binary/algae_farm{dir = 4},/turf/simulated/floor/tiled/techmaint,/area/engineering/atmos/processing) +"aJG" = (/obj/machinery/atmospherics/binary/algae_farm/filled{dir = 4},/turf/simulated/floor/tiled/techmaint,/area/engineering/atmos/processing) "aJH" = (/obj/effect/floor_decal/industrial/warning{icon_state = "warning"; dir = 4},/obj/machinery/atmospherics/pipe/manifold/visible/blue{dir = 4},/turf/simulated/floor/tiled/techmaint,/area/engineering/atmos/processing) "aJI" = (/obj/machinery/portable_atmospherics/canister/empty,/obj/machinery/camera/network/engineering{dir = 8},/turf/simulated/floor/tiled/techmaint,/area/engineering/atmos/processing) "aJJ" = (/obj/machinery/atmospherics/pipe/simple/heat_exchanging{dir = 6},/turf/simulated/floor/tiled/steel_dirty/virgo3b,/area/engineering/atmos/intake) diff --git a/nano/templates/algae_farm_vr.tmpl b/nano/templates/algae_farm_vr.tmpl index 86a6357b523..be730d9d650 100644 --- a/nano/templates/algae_farm_vr.tmpl +++ b/nano/templates/algae_farm_vr.tmpl @@ -7,6 +7,13 @@ Used In File(s): \code\game\machinery\partslathe.dm {{/if}}
+
+ {{if data.usePower==2}} + {{:helper.link('Deactivate Processing', 'power', {'deactivate' : 1})}} + {{else}} + {{:helper.link('Activate Processing', 'power', {'activate' : 1})}} + {{/if}} +
Flow Rate
{{:helper.fixed(data.last_flow_rate)}} L/s