From ed896c0563c211b0cada7b17e67ea95cec0c7368 Mon Sep 17 00:00:00 2001 From: Skies-Of-Blue Date: Tue, 4 Jun 2024 14:22:19 -0700 Subject: [PATCH 1/4] SSD Indicators will be real in 2020 --- .../mob/living/carbon/human/examine.dm | 2 +- code/modules/mob/living/carbon/life.dm | 9 ++++--- code/modules/mob/living/living.dm | 25 ++++++++++++++++++ icons/mob/ssd_indicator.dmi | Bin 0 -> 311 bytes 4 files changed, 32 insertions(+), 4 deletions(-) create mode 100644 icons/mob/ssd_indicator.dmi diff --git a/code/modules/mob/living/carbon/human/examine.dm b/code/modules/mob/living/carbon/human/examine.dm index 64882c75ec4e..283976adceae 100644 --- a/code/modules/mob/living/carbon/human/examine.dm +++ b/code/modules/mob/living/carbon/human/examine.dm @@ -327,7 +327,7 @@ if(!key) msg += "[t_He] [t_is] totally catatonic. The stresses of life in deep-space must have been too much for [t_him]. Any recovery is unlikely.\n" else if(!client) - msg += "[t_He] appears to be suffering from SSD - Space Sleep Disorder. [t_He] may snap out of it at any time! Or maybe never. It's best to leave [t_him] be.\n" + msg += "[t_He] [t_has] been suffering from SSD - Space Sleep Disorder - for [trunc(((world.time - lastclienttime) / (1 MINUTES)))] minutes. [t_He] may snap out of it at any time! Or maybe never. It's best to leave [t_him] be.\n" if (length(msg)) . += "[msg.Join("")]" diff --git a/code/modules/mob/living/carbon/life.dm b/code/modules/mob/living/carbon/life.dm index 0fc21db37d8c..c5145600bbf8 100644 --- a/code/modules/mob/living/carbon/life.dm +++ b/code/modules/mob/living/carbon/life.dm @@ -25,9 +25,12 @@ if(.) //not dead handle_blood() - if(isLivingSSD())//if you're disconnected, you're going to sleep - if(AmountSleeping() < 20) - AdjustSleeping(20)//adjust every 10 seconds + if(isLivingSSD()) // If you're disconnected, you're going to sleep + if(trunc((world.time - lastclienttime) / (3 MINUTES)) > 0) // After a three minute grace period, your character will fall asleep + if(AmountSleeping() < 20) + AdjustSleeping(20) // Adjust every 10 seconds + if(ssd_indicator) + cut_overlay(GLOB.ssd_indicator_overlay) // Prevents chronically SSD players from breaking immersion if(stat != DEAD) var/bprv = handle_bodyparts() diff --git a/code/modules/mob/living/living.dm b/code/modules/mob/living/living.dm index cb0ec02ced34..e20d2e4b8d49 100644 --- a/code/modules/mob/living/living.dm +++ b/code/modules/mob/living/living.dm @@ -1410,6 +1410,31 @@ if(player_logged && stat != DEAD) return TRUE +// The above code is kept to prevent old SSD behavior from breaking, while the code below is dedicated to the SSD Indicator + +GLOBAL_VAR_INIT(ssd_indicator_overlay, mutable_appearance('icons/mob/ssd_indicator.dmi', "default0", RUNECHAT_PLANE)) + +/mob/living + var/ssd_indicator = FALSE + var/lastclienttime = 0 + +/mob/living/proc/set_ssd_indicator(var/state) + if(state == ssd_indicator) + return + ssd_indicator = state + if(ssd_indicator) + add_overlay(GLOB.ssd_indicator_overlay) + else + cut_overlay(GLOB.ssd_indicator_overlay) + +/mob/living/Login() + . = ..() + set_ssd_indicator(FALSE) + +/mob/living/Logout() + lastclienttime = world.time + set_ssd_indicator(TRUE) + /mob/living/vv_get_header() . = ..() var/refid = REF(src) diff --git a/icons/mob/ssd_indicator.dmi b/icons/mob/ssd_indicator.dmi new file mode 100644 index 0000000000000000000000000000000000000000..3f7d100b6c67e725055ef21a964cbcbb113dca6c GIT binary patch literal 311 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1|*BCs=ffJ{HliLl8Vm$j4_H-qwSRlG-d9=Bb7470iYcT0gf&&Q+`DHA9k#g1nzrpr!Ksf{3onM7 zt~9UWyzn9_sPVDb6Mr#vp58;BU%iWc)ikAF(|NJtR<-gE?}Z*GC8T-FPfC$i=+qJG z0$Sbd>Eaj?(fam^A>RQ74%UGE9|QLOf3o&PfT5_*@}|@3hKi<|{#~sdQzl#Xud3cD(Xnp937P3qET zuudpu*edNf;oHvH1)_z&{9m+BU|`} Date: Tue, 4 Jun 2024 15:50:52 -0700 Subject: [PATCH 2/4] me when I don't check all of the ported code --- code/modules/mob/living/living.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/modules/mob/living/living.dm b/code/modules/mob/living/living.dm index e20d2e4b8d49..fa62cefab53b 100644 --- a/code/modules/mob/living/living.dm +++ b/code/modules/mob/living/living.dm @@ -1418,7 +1418,7 @@ GLOBAL_VAR_INIT(ssd_indicator_overlay, mutable_appearance('icons/mob/ssd_indicat var/ssd_indicator = FALSE var/lastclienttime = 0 -/mob/living/proc/set_ssd_indicator(var/state) +/mob/living/proc/set_ssd_indicator(state) if(state == ssd_indicator) return ssd_indicator = state From 23941a956ae1740bc46a71fadd6426dfe4395ba2 Mon Sep 17 00:00:00 2001 From: Skies-Of-Blue Date: Tue, 4 Jun 2024 17:07:12 -0700 Subject: [PATCH 3/4] let's make sure the dead stay dead, yeah? whoops --- code/modules/mob/living/living.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/modules/mob/living/living.dm b/code/modules/mob/living/living.dm index fa62cefab53b..98f70fc3cc29 100644 --- a/code/modules/mob/living/living.dm +++ b/code/modules/mob/living/living.dm @@ -1422,7 +1422,7 @@ GLOBAL_VAR_INIT(ssd_indicator_overlay, mutable_appearance('icons/mob/ssd_indicat if(state == ssd_indicator) return ssd_indicator = state - if(ssd_indicator) + if(ssd_indicator && stat != DEAD) add_overlay(GLOB.ssd_indicator_overlay) else cut_overlay(GLOB.ssd_indicator_overlay) From 5397dd493abebd05b9934a1611677e76ef029eb7 Mon Sep 17 00:00:00 2001 From: Skies-Of-Blue Date: Wed, 12 Jun 2024 14:05:41 -0700 Subject: [PATCH 4/4] this is why we testmerge teehee --- code/modules/mob/living/living.dm | 1 + 1 file changed, 1 insertion(+) diff --git a/code/modules/mob/living/living.dm b/code/modules/mob/living/living.dm index 98f70fc3cc29..8d2f29de92f4 100644 --- a/code/modules/mob/living/living.dm +++ b/code/modules/mob/living/living.dm @@ -1432,6 +1432,7 @@ GLOBAL_VAR_INIT(ssd_indicator_overlay, mutable_appearance('icons/mob/ssd_indicat set_ssd_indicator(FALSE) /mob/living/Logout() + . = ..() lastclienttime = world.time set_ssd_indicator(TRUE)