diff --git a/code/ATMOSPHERICS/components/binary_devices/algae_generator_vr.dm b/code/ATMOSPHERICS/components/binary_devices/algae_generator_vr.dm
index 5e6dcb95cb..14f4d32651 100644
--- a/code/ATMOSPHERICS/components/binary_devices/algae_generator_vr.dm
+++ b/code/ATMOSPHERICS/components/binary_devices/algae_generator_vr.dm
@@ -9,6 +9,7 @@
circuit = /obj/item/weapon/circuitboard/algae_farm
anchored = 1
density = 1
+ power_channel = EQUIP
use_power = 2
idle_power_usage = 100 // Minimal lights to keep algae alive
active_power_usage = 5000 // Powerful grow lights to stimulate oxygen production
@@ -37,7 +38,7 @@
desc = initial(desc) + " Its outlet port is to the [dir2text(dir)]."
default_apply_parts()
update_icon()
- // TODO - Make these in acutal icon states so its not silly like this
+ // TODO - Make these in actual icon states so its not silly like this
var/image/I = image(icon = icon, icon_state = "algae-pipe-overlay", dir = dir)
I.color = PIPE_COLOR_BLUE
overlays += I
@@ -54,18 +55,28 @@
recent_moles_transferred = 0
if(inoperable() || use_power < 2)
+ ui_error = null
+ if(use_power == 1)
+ last_power_draw = idle_power_usage
+ else
+ last_power_draw = 0
+ update_icon()
return 0
+ last_power_draw = active_power_usage
+
// 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,\
- storage_capacity[MATERIAL_CARBON] - stored_material[MATERIAL_CARBON] * carbon_per_mole)
+ storage_capacity[MATERIAL_CARBON] - stored_material[MATERIAL_CARBON])
// STEP 2 - Take the CO2 out of the input!
var/power_draw = scrub_gas(src, list(input_gas), air1, internal, moles_to_convert)
@@ -79,6 +90,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
@@ -98,7 +110,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"
@@ -109,21 +121,47 @@
return 1
/obj/machinery/atmospherics/binary/algae_farm/attackby(obj/item/weapon/W as obj, mob/user as mob)
- src.add_fingerprint(user)
+ add_fingerprint(user)
if(default_deconstruction_screwdriver(user, W))
return
if(default_deconstruction_crowbar(user, W))
return
+ if(default_part_replacement(user, W))
+ return
if(try_load_materials(user, W))
return
else
- user << "You cannot insert this item into \the [src]!"
+ to_chat(user, "You cannot insert this item into \the [src]!")
return
/obj/machinery/atmospherics/binary/algae_farm/attack_hand(mob/user)
- if(..()) return 1
+ if(..())
+ 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
@@ -217,7 +255,7 @@
if(!istype(S))
return 0
if(!(S.material.name in stored_material))
- user << "\The [src] doesn't accept [material_display_name(S.material)]!"
+ to_chat(user, "\The [src] doesn't accept [material_display_name(S.material)]!")
return 1
var/max_res_amount = storage_capacity[S.material.name]
if(stored_material[S.material.name] + S.perunit <= max_res_amount)
@@ -229,7 +267,7 @@
user.visible_message("\The [user] inserts [S.name] into \the [src].", "You insert [count] [S.name] into \the [src].")
updateUsrDialog()
else
- user << "\The [src] cannot hold more [S.name]."
+ to_chat(user, "\The [src] cannot hold more [S.name].")
return 1
/material/algae
@@ -248,6 +286,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 f41a134e7b..321269a2ea 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 4a8b4f2d3c..5203d7ec2e 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 9104541c22..9b31d994b7 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{dir = 4; use_power = 1},/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 86a6357b52..be730d9d65 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}}