Skip to content

Commit

Permalink
Feat: add autocryo
Browse files Browse the repository at this point in the history
  • Loading branch information
Dimach committed Jun 8, 2023
1 parent 3b7440d commit 28c24cc
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 0 deletions.
2 changes: 2 additions & 0 deletions config/ss220/ss220_config.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,5 @@
## CPU Affinity for FFmpeg. Check out taskset man page.
## Example valid values: "0-3" or "1,4-7"
#FFMPEG_CPUAFFINITY 24-31

AUTO_CRYO_SSD_MIN 10
20 changes: 20 additions & 0 deletions modular_ss220/modules/auto_cryo/autocryo.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
/mob/living/carbon
var/is_logout = FALSE

/mob/living/carbon/Life(seconds_per_tick = SSMOBS_DT, times_fired)
. = ..()
if(is_logout && stat != DEAD && job && CONFIG_GET(number/auto_cryo_ssd_min) && world.time - lastclienttime > CONFIG_GET(number/auto_cryo_ssd_min) MINUTES)
if(istype(loc, /obj/machinery/cryopod))
return
var/turf/T = get_turf(src)
if(!is_station_level(T.z))
return
send_to_cryo()

/mob/living/carbon/Logout()
. = ..()
is_logout = TRUE

/mob/living/carbon/Login()
. = ..()
is_logout = FALSE
3 changes: 3 additions & 0 deletions modular_ss220/modules/auto_cryo/autocryo_config.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
/datum/config_entry/number/auto_cryo_ssd_min
default = 10
min_val = 0
2 changes: 2 additions & 0 deletions tgstation.dme
Original file line number Diff line number Diff line change
Expand Up @@ -7061,6 +7061,8 @@
#include "modular_skyrat\modules\xenos_skyrat_redo\code\xeno_types\spitter.dm"
#include "modular_skyrat\modules\xenos_skyrat_redo\code\xeno_types\warrior.dm"
#include "modular_ss220\master_files_skyrat\code\modules\client\preferences\emote_panel.dm"
#include "modular_ss220\modules\auto_cryo\autocryo.dm"
#include "modular_ss220\modules\auto_cryo\autocryo_config.dm"
#include "modular_ss220\modules\cyrillic_key_fixes\code\client_procs.dm"
#include "modular_ss220\modules\cyrillic_key_fixes\code\communication.dm"
#include "modular_ss220\modules\cyrillic_key_fixes\code\keybindings.dm"
Expand Down

0 comments on commit 28c24cc

Please sign in to comment.