Cryocell works with all gases now ; Cryox requires being KOd (#65513)

* refactored cryo

* fixes

* always forget maps

* requested changes, cryoxadone only heal if sleeping
This commit is contained in:
Ghilker
2022-03-22 09:58:45 -04:00
committed by GitHub
parent a21274e56a
commit e5ed4b3dea
10 changed files with 57 additions and 35 deletions
@@ -26023,13 +26023,13 @@
/turf/open/floor/iron,
/area/engineering/atmos)
"flk" = (
/obj/machinery/portable_atmospherics/canister/oxygen,
/obj/effect/turf_decal/stripes/line{
dir = 6
},
/obj/machinery/atmospherics/components/unary/portables_connector/visible{
dir = 1
},
/obj/machinery/portable_atmospherics/canister/anesthetic_mix,
/turf/open/floor/iron,
/area/medical/cryo)
"fll" = (
@@ -74952,13 +74952,13 @@
/turf/open/floor/iron/dark,
/area/command/bridge)
"tBh" = (
/obj/machinery/portable_atmospherics/canister/oxygen,
/obj/effect/turf_decal/stripes/line{
dir = 10
},
/obj/machinery/atmospherics/components/unary/portables_connector/visible{
dir = 1
},
/obj/machinery/portable_atmospherics/canister/anesthetic_mix,
/turf/open/floor/iron,
/area/medical/cryo)
"tBt" = (
@@ -11668,7 +11668,7 @@
/obj/machinery/atmospherics/components/unary/portables_connector/visible{
dir = 8
},
/obj/machinery/portable_atmospherics/canister/oxygen,
/obj/machinery/portable_atmospherics/canister/anesthetic_mix,
/turf/open/floor/iron/white,
/area/medical/cryo)
"dgf" = (
@@ -52465,7 +52465,7 @@
/obj/machinery/atmospherics/components/unary/portables_connector/visible{
dir = 4
},
/obj/machinery/portable_atmospherics/canister/oxygen,
/obj/machinery/portable_atmospherics/canister/anesthetic_mix,
/turf/open/floor/iron/white,
/area/medical/cryo)
"xwY" = (
+2 -2
View File
@@ -5851,13 +5851,13 @@
/turf/closed/wall,
/area/medical/exam_room)
"aFp" = (
/obj/machinery/portable_atmospherics/canister/oxygen,
/obj/machinery/atmospherics/components/unary/portables_connector/visible,
/obj/effect/turf_decal/bot,
/obj/effect/turf_decal/tile/neutral,
/obj/effect/turf_decal/tile/neutral{
dir = 8
},
/obj/machinery/portable_atmospherics/canister/anesthetic_mix,
/turf/open/floor/iron/dark,
/area/medical/medbay/central)
"aFq" = (
@@ -7842,9 +7842,9 @@
/obj/effect/turf_decal/tile/neutral{
dir = 8
},
/obj/machinery/portable_atmospherics/canister/oxygen,
/obj/machinery/atmospherics/components/unary/portables_connector/visible,
/obj/effect/turf_decal/bot,
/obj/machinery/portable_atmospherics/canister/anesthetic_mix,
/turf/open/floor/iron/dark,
/area/medical/medbay/central)
"aSe" = (
+2 -2
View File
@@ -21319,10 +21319,10 @@
/obj/effect/turf_decal/stripes/line{
dir = 9
},
/obj/machinery/portable_atmospherics/canister/oxygen,
/obj/machinery/atmospherics/components/unary/portables_connector/visible{
dir = 1
},
/obj/machinery/portable_atmospherics/canister/anesthetic_mix,
/turf/open/floor/iron/dark,
/area/medical/cryo)
"gtG" = (
@@ -29899,13 +29899,13 @@
/turf/open/floor/iron,
/area/security/brig)
"jJq" = (
/obj/machinery/portable_atmospherics/canister/oxygen,
/obj/machinery/atmospherics/components/unary/portables_connector/visible{
dir = 1
},
/obj/effect/turf_decal/stripes/line{
dir = 1
},
/obj/machinery/portable_atmospherics/canister/anesthetic_mix,
/turf/open/floor/iron/dark,
/area/medical/cryo)
"jJK" = (
+2 -2
View File
@@ -17106,8 +17106,8 @@
/obj/machinery/atmospherics/components/unary/portables_connector/visible{
dir = 8
},
/obj/machinery/portable_atmospherics/canister/oxygen,
/obj/machinery/light/directional/east,
/obj/machinery/portable_atmospherics/canister/anesthetic_mix,
/turf/open/floor/iron/dark,
/area/medical/treatment_center)
"eNN" = (
@@ -33293,7 +33293,7 @@
/obj/machinery/atmospherics/components/unary/portables_connector/visible{
dir = 8
},
/obj/machinery/portable_atmospherics/canister/oxygen,
/obj/machinery/portable_atmospherics/canister/anesthetic_mix,
/turf/open/floor/iron/dark,
/area/medical/treatment_center)
"kCT" = (
@@ -151,6 +151,11 @@
/// liters in a cell
#define CELL_VOLUME 2500
///O2 value for anesthetic canister
#define O2_ANESTHETIC 0.65
///N2O value for anesthetic canister
#define N2O_ANESTHETIC 0.35
//CANATMOSPASS
#define ATMOS_PASS_YES 1
#define ATMOS_PASS_NO 0
@@ -121,6 +121,8 @@
occupant_vis = new(null, src)
vis_contents += occupant_vis
if(airs[1])
airs[1].volume = CELL_VOLUME * 0.5
/obj/machinery/atmospherics/components/unary/cryo_cell/set_occupant(atom/movable/new_occupant)
. = ..()
@@ -262,10 +264,7 @@ GLOBAL_VAR_INIT(cryo_overlay_cover_off, mutable_appearance('icons/obj/cryogenics
var/datum/gas_mixture/air1 = airs[1]
if(air1.gases[/datum/gas/oxygen][MOLES] > CRYO_MIN_GAS_MOLES)
if(mob_occupant.bodytemperature < T0C) // Sleepytime. Why? More cryo magic.
mob_occupant.Sleeping((mob_occupant.bodytemperature * sleep_factor) * 1000 * delta_time)
mob_occupant.Unconscious((mob_occupant.bodytemperature * unconscious_factor) * 1000 * delta_time)
if(air1.total_moles() > CRYO_MIN_GAS_MOLES)
if(beaker)
beaker.reagents.trans_to(occupant, (CRYO_TX_QTY / (efficiency * CRYO_MULTIPLY_FACTOR)) * delta_time, efficiency * CRYO_MULTIPLY_FACTOR, methods = VAPOR) // Transfer reagents.
consume_gas = TRUE
@@ -279,7 +278,7 @@ GLOBAL_VAR_INIT(cryo_overlay_cover_off, mutable_appearance('icons/obj/cryogenics
var/datum/gas_mixture/air1 = airs[1]
if(!nodes[1] || !airs[1] || !air1.gases.len || air1.gases[/datum/gas/oxygen][MOLES] < CRYO_MIN_GAS_MOLES) // Turn off if the machine won't work.
if(!nodes[1] || !airs[1] || !air1.gases.len || air1.total_moles() < CRYO_MIN_GAS_MOLES) // Turn off if the machine won't work.
var/msg = "Insufficient cryogenic gas, shutting down."
radio.talk_into(src, msg, radio_channel)
set_on(FALSE)
@@ -307,11 +306,7 @@ GLOBAL_VAR_INIT(cryo_overlay_cover_off, mutable_appearance('icons/obj/cryogenics
var/mob/living/carbon/human/humi = mob_occupant
humi.adjust_coretemperature(humi.bodytemperature - humi.coretemperature)
if(consume_gas) // Transferring reagent costs us extra gas
air1.gases[/datum/gas/oxygen][MOLES] -= max(0, 2 / efficiency + 1 / efficiency) // Magically consume gas? Why not, we run on cryo magic.
consume_gas = FALSE
if(!consume_gas)
air1.gases[/datum/gas/oxygen][MOLES] -= max(0, 2 / efficiency)
air1.garbage_collect()
if(air1.temperature > 2000)
@@ -319,6 +314,17 @@ GLOBAL_VAR_INIT(cryo_overlay_cover_off, mutable_appearance('icons/obj/cryogenics
update_parents()
/obj/machinery/atmospherics/components/unary/cryo_cell/handle_internal_lifeform(mob/lifeform_inside_me, breath_request)
if(breath_request <= 0)
return null
var/datum/gas_mixture/air1 = airs[1]
var/breath_percentage = breath_request / air1.volume
return air1.remove(air1.total_moles() * breath_percentage)
/obj/machinery/atmospherics/components/unary/cryo_cell/assume_air(datum/gas_mixture/giver)
airs[1].merge(giver)
/obj/machinery/atmospherics/components/unary/cryo_cell/relaymove(mob/living/user, direction)
if(message_cooldown <= world.time)
message_cooldown = world.time + 50
@@ -297,6 +297,18 @@ GLOBAL_LIST_INIT(gas_id_to_canister, init_gas_id_to_canister())
air_contents.temperature = 10000
SSair.start_processing_machine(src)
/obj/machinery/portable_atmospherics/canister/anesthetic_mix
name = "Anesthetic mix"
desc = "A mixture of N2O and Oxygen"
greyscale_config = /datum/greyscale_config/canister/double_stripe
greyscale_colors = "#9fba6c#3d4680"
/obj/machinery/portable_atmospherics/canister/anesthetic_mix/create_gas()
air_contents.add_gases(/datum/gas/oxygen, /datum/gas/nitrous_oxide)
air_contents.gases[/datum/gas/oxygen][MOLES] = (O2_ANESTHETIC * maximum_pressure * filled) * air_contents.volume / (R_IDEAL_GAS_EQUATION * air_contents.temperature)
air_contents.gases[/datum/gas/nitrous_oxide][MOLES] = (N2O_ANESTHETIC * maximum_pressure * filled) * air_contents.volume / (R_IDEAL_GAS_EQUATION * air_contents.temperature)
SSair.start_processing_machine(src)
/**
* Getter for the amount of time left in the timer of prototype canisters
*/
@@ -413,7 +425,7 @@ GLOBAL_LIST_INIT(gas_id_to_canister, init_gas_id_to_canister())
if((10) to (5 * ONE_ATMOSPHERE))
. += mutable_appearance(canister_overlay_file, "can-0")
. += emissive_appearance(canister_overlay_file, "can-0-light", alpha = src.alpha)
update_window()
/obj/machinery/portable_atmospherics/canister/update_greyscale()
-2
View File
@@ -73,8 +73,6 @@
var/obj/item/organ/lungs = getorganslot(ORGAN_SLOT_LUNGS)
if(reagents.has_reagent(/datum/reagent/toxin/lexorin, needs_metabolizing = TRUE))
return
if(istype(loc, /obj/machinery/atmospherics/components/unary/cryo_cell))
return
var/datum/gas_mixture/environment
if(loc)
@@ -161,18 +161,19 @@
chemical_flags = REAGENT_CAN_BE_SYNTHESIZED
/datum/reagent/medicine/cryoxadone/on_mob_life(mob/living/carbon/M, delta_time, times_fired)
var/power = -0.00003 * (M.bodytemperature ** 2) + 3
if(M.bodytemperature < T0C)
M.adjustOxyLoss(-3 * power * REM * delta_time, 0)
M.adjustBruteLoss(-power * REM * delta_time, 0)
M.adjustFireLoss(-power * REM * delta_time, 0)
M.adjustToxLoss(-power * REM * delta_time, 0, TRUE) //heals TOXINLOVERs
M.adjustCloneLoss(-power * REM * delta_time, 0)
for(var/i in M.all_wounds)
var/datum/wound/iter_wound = i
iter_wound.on_xadone(power * REAGENTS_EFFECT_MULTIPLIER * delta_time)
REMOVE_TRAIT(M, TRAIT_DISFIGURED, TRAIT_GENERIC) //fixes common causes for disfiguration
. = TRUE
if(M.IsSleeping() || M.IsUnconscious())
var/power = -0.00003 * (M.bodytemperature ** 2) + 3
if(M.bodytemperature < T0C)
M.adjustOxyLoss(-3 * power * REM * delta_time, 0)
M.adjustBruteLoss(-power * REM * delta_time, 0)
M.adjustFireLoss(-power * REM * delta_time, 0)
M.adjustToxLoss(-power * REM * delta_time, 0, TRUE) //heals TOXINLOVERs
M.adjustCloneLoss(-power * REM * delta_time, 0)
for(var/i in M.all_wounds)
var/datum/wound/iter_wound = i
iter_wound.on_xadone(power * REAGENTS_EFFECT_MULTIPLIER * delta_time)
REMOVE_TRAIT(M, TRAIT_DISFIGURED, TRAIT_GENERIC) //fixes common causes for disfiguration
. = TRUE
metabolization_rate = REAGENTS_METABOLISM * (0.00001 * (M.bodytemperature ** 2) + 0.5)
..()