diff --git a/code/game/machinery/cryo.dm b/code/game/machinery/cryo.dm index b7e0296e6bb39..0203342af7576 100644 --- a/code/game/machinery/cryo.dm +++ b/code/game/machinery/cryo.dm @@ -31,6 +31,10 @@ var/temperature_warning_threshhold = 170 var/temperature_danger_threshhold = T0C + var/fast_stasis_mult = 0.8 + var/slow_stasis_mult = 1.25 + var/current_stasis_mult = 1 + /obj/machinery/atmospherics/unary/cryo_cell/Initialize() . = ..() icon = 'icons/obj/machines/medical/cryogenics_split.dmi' @@ -155,6 +159,10 @@ data["beakerLabel"] = beaker.name data["beakerVolume"] = beaker.reagents.total_volume + data["fast_stasis_mult"] = fast_stasis_mult + data["slow_stasis_mult"] = slow_stasis_mult + data["current_stasis_mult"] = current_stasis_mult + // update the ui if it exists, returns null if no ui is passed/found ui = SSnano.try_update_ui(user, src, ui_key, ui, data, force_open) if (!ui) @@ -196,6 +204,21 @@ go_out() return TOPIC_REFRESH + if(href_list["goFast"]) + current_stasis_mult = fast_stasis_mult + update_icon() + return TOPIC_REFRESH + + if(href_list["goRegular"]) + current_stasis_mult = 1 + update_icon() + return TOPIC_REFRESH + + if(href_list["goSlow"]) + current_stasis_mult = slow_stasis_mult + update_icon() + return TOPIC_REFRESH + /obj/machinery/atmospherics/unary/cryo_cell/state_transition(singleton/machine_construction/default/new_state) . = ..() if(istype(new_state)) @@ -408,6 +431,12 @@ else return null +/obj/machinery/atmospherics/unary/cryo_cell/RefreshParts() + ..() + var/stasis_coeff = total_component_rating_of_type(/obj/item/stock_parts/manipulator) + fast_stasis_mult = max(1 - (stasis_coeff * 0.06), 0.66) + slow_stasis_mult = min(1 + (stasis_coeff * 0.08), 1.5) + /datum/data/function/proc/reset() return diff --git a/code/modules/mob/living/carbon/human/human_helpers.dm b/code/modules/mob/living/carbon/human/human_helpers.dm index 3cbcbf8141b12..9d93238a9fedc 100644 --- a/code/modules/mob/living/carbon/human/human_helpers.dm +++ b/code/modules/mob/living/carbon/human/human_helpers.dm @@ -159,6 +159,11 @@ else . = 80 * (1 - bodytemperature / species.cold_level_3) . = max(20, .) + if(istype(loc, /obj/machinery/atmospherics/unary/cryo_cell)) + var/obj/machinery/atmospherics/unary/cryo_cell/cryo = loc + if(cryo.current_stasis_mult) + var/gcf_stasis_mult = cryo.current_stasis_mult + . = . * gcf_stasis_mult return round(.) /mob/living/carbon/human diff --git a/nano/templates/cryo.tmpl b/nano/templates/cryo.tmpl index 60709f5077332..5a61be7611bb9 100644 --- a/nano/templates/cryo.tmpl +++ b/nano/templates/cryo.tmpl @@ -50,4 +50,16 @@ Used In File(s): \code\game\machinery\cryo.dm