mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-28 02:53:11 +00:00
Oxygen Generator improvements
This commit is contained in:
@@ -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 << "<span class='notice'>You cannot insert this item into \the [src]!</span>"
|
||||
to_chat(user, "<span class='notice'>You cannot insert this item into \the [src]!</span>")
|
||||
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 << "<span class='warning'>\The [src] doesn't accept [material_display_name(S.material)]!</span>"
|
||||
to_chat(user, "<span class='warning'>\The [src] doesn't accept [material_display_name(S.material)]!</span>")
|
||||
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].", "<span class='notice'>You insert [count] [S.name] into \the [src].</span>")
|
||||
updateUsrDialog()
|
||||
else
|
||||
user << "<span class='warning'>\The [src] cannot hold more [S.name].</span>"
|
||||
to_chat(user, "<span class='warning'>\The [src] cannot hold more [S.name].</span>")
|
||||
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
|
||||
|
||||
@@ -11,3 +11,10 @@
|
||||
/obj/item/clothing/suit/radiation/taur = 1,
|
||||
/obj/item/clothing/head/radiation = 3
|
||||
)
|
||||
|
||||
/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"
|
||||
@@ -123,6 +123,7 @@
|
||||
dat += "<A href='?src=\ref[src];action=create;item=leathercoat;cost=500'>Leather Coat</A> <FONT COLOR=blue>([round(500/build_eff)])</FONT><BR>"
|
||||
dat += "<A href='?src=\ref[src];action=create;item=leatherjacket;cost=500'>Leather Jacket</A> <FONT COLOR=blue>([round(500/build_eff)])</FONT><BR>"
|
||||
dat += "<A href='?src=\ref[src];action=create;item=wintercoat;cost=500'>Winter Coat</A> <FONT COLOR=blue>([round(500/build_eff)])</FONT><BR>"
|
||||
dat += "<A href='?src=\ref[src];action=create;item=algae;cost=400'>4 Algae Sheets</A> <FONT COLOR=blue>([round(400/build_eff)])</FONT><BR>" //VOREStation Edit - Algae for oxygen generator
|
||||
//dat += "Other<BR>"
|
||||
//dat += "<A href='?src=\ref[src];action=create;item=monkey;cost=500'>Monkey</A> <FONT COLOR=blue>(500)</FONT><BR>"
|
||||
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()
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -7,6 +7,13 @@ Used In File(s): \code\game\machinery\partslathe.dm
|
||||
{{/if}}
|
||||
|
||||
<div class="statusDisplay">
|
||||
<div class="line">
|
||||
{{if data.usePower==2}}
|
||||
{{:helper.link('Deactivate Processing', 'power', {'deactivate' : 1})}}
|
||||
{{else}}
|
||||
{{:helper.link('Activate Processing', 'power', {'activate' : 1})}}
|
||||
{{/if}}
|
||||
</div>
|
||||
<div class="line">
|
||||
<div class="statusLabel">Flow Rate</div>
|
||||
<div class="statusValue">{{:helper.fixed(data.last_flow_rate)}} L/s</div>
|
||||
|
||||
Reference in New Issue
Block a user