Skip to content

Commit

Permalink
Reworks mineral extractor
Browse files Browse the repository at this point in the history
  • Loading branch information
NataKilar authored and comma committed Oct 11, 2023
1 parent 8821b02 commit 1eec959
Show file tree
Hide file tree
Showing 8 changed files with 366 additions and 380 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@
)

/obj/item/stock_parts/circuitboard/mining_extractor
name = "circuitboard (gas extractor)"
build_path = /obj/machinery/atmospherics/unary/material/extractor
name = "circuitboard (mineral extractor)"
build_path = /obj/machinery/material_processing/extractor
board_type = "machine"
origin_tech = "{'programming':2,'engineering':2}"
req_components = list(
Expand Down
19 changes: 17 additions & 2 deletions code/modules/materials/_materials.dm
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,12 @@ INITIALIZE_IMMEDIATE(/obj/effect/gas_overlay)
var/boiling_point = 3000
/// kJ/kg, enthalpy of vaporization
var/latent_heat = 7000
/// kg/mol,
/// kg/mol
var/molar_mass = 0.06
/// g/ml
var/liquid_density = 0.997
/// g/ml
var/solid_density = 0.9168
/// Brute damage to a wall is divided by this value if the wall is reinforced by this material.
var/brute_armor = 2
/// Same as above, but for Burn damage type. If blank brute_armor's value is used.
Expand Down Expand Up @@ -441,6 +445,17 @@ INITIALIZE_IMMEDIATE(/obj/effect/gas_overlay)
return MAT_PHASE_LIQUID
return MAT_PHASE_SOLID

// Returns the number of mols of material for the amount of solid or liquid units passed.
/decl/material/proc/get_mols_from_units(units, phase)
var/ml = units*10 // Rough estimation.
switch(phase)
if(MAT_PHASE_LIQUID)
var/kg = (liquid_density*ml)/1000
return kg/molar_mass
if(MAT_PHASE_SOLID)
var/kg = (solid_density*ml)/1000
return kg/molar_mass

// Used by walls when qdel()ing to avoid neighbor merging.
/decl/material/placeholder
name = "placeholder"
Expand Down Expand Up @@ -817,4 +832,4 @@ INITIALIZE_IMMEDIATE(/obj/effect/gas_overlay)
.[interaction] = interacted_units
total_interacted_units -= interacted_units
if(total_interacted_units <= 0)
return
return
16 changes: 8 additions & 8 deletions code/modules/materials/definitions/solids/materials_solid_ice.dm
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,8 @@
use_name = null
codex_name = null
heating_products = list(
/decl/material/gas/ammonia = 0.4,
/decl/material/liquid/water = 0.2,
/decl/material/gas/ammonia = 0.05,
/decl/material/liquid/water = 0.55,
/decl/material/liquid/ethanol = 0.4
)
uid = "solid_ice_ediroite"
Expand All @@ -101,10 +101,10 @@
codex_name = null
uid = "solid_ice_hydrogen"
heating_products = list(
/decl/material/gas/hydrogen = 0.2,
/decl/material/liquid/water = 0.65,
/decl/material/gas/hydrogen/deuterium = 0.1,
/decl/material/gas/hydrogen/tritium = 0.05
/decl/material/gas/hydrogen = 0.05,
/decl/material/liquid/water = 0.92,
/decl/material/gas/hydrogen/deuterium = 0.02,
/decl/material/gas/hydrogen/tritium = 0.01
)
value = 0.3
sparse_material_weight = 20
Expand All @@ -128,8 +128,8 @@
/decl/material/solid/ice/hydrate/##NAME/uid = "solid_hydrate_" + #NAME; \
/decl/material/solid/ice/hydrate/##NAME/name = #DISPLAY_NAME + " hydrate"; \
/decl/material/solid/ice/hydrate/##NAME/heating_products = list( \
PATH = 0.2, \
/decl/material/liquid/water = 0.8 \
PATH = 0.1, \
/decl/material/liquid/water = 0.9 \
); \
/decl/material/solid/ice/hydrate/##NAME

Expand Down
Loading

0 comments on commit 1eec959

Please sign in to comment.