From 7a5fa1ba52f33619e2668372ecbf8ab60a4dd9f0 Mon Sep 17 00:00:00 2001 From: Patrick Meade Date: Tue, 18 Jun 2024 23:53:12 -0500 Subject: [PATCH] SSD-Indicators-Will-Be-Real-In-2020 --- TODO-commits.txt | 26 +++++++++---------- .../mob/living/carbon/human/examine.dm | 2 +- code/modules/mob/living/carbon/life.dm | 9 ++++--- code/modules/mob/living/living.dm | 26 +++++++++++++++++++ 4 files changed, 46 insertions(+), 17 deletions(-) diff --git a/TODO-commits.txt b/TODO-commits.txt index 6c34dd2fec8..22dbd2cac4d 100644 --- a/TODO-commits.txt +++ b/TODO-commits.txt @@ -15,19 +15,19 @@ X = compiles without errors [*] 5cdc04bcba1d594878be878d80ab713cb67278c8 Constructable Suit Storage Units part 2 [@] 69820b0b662fad1657dfa6fdb3cda9427cfc4a19 Constructable Suit Storage Units part 3 [*] 2dab8af3a192f6705c4d42e3fcb2a558a47803d6 Constructable Suit Storage Units part 4 (final) -[^] de71c609003df6a255c22d50fe47100f827f76fc Gun Lore Update -[^] 4b727c9f03905a2d113e169474f23f11433df546 Armor value changes -[^] 17efcbf73d4e15789f90bddfacea6286f950ab4d Defib cargo/station -[^] 61d82bda46ee76216524c12f73f71832a789b6ba secret documents randomization -[^] 21162817d06e60b8bcce6a4c970a9577643236dc soul removal 1 -[^] 5dbf574b2fe63c492f5a27d2f4b2d0c47201ad3b Makes Sinta'Unathi playable again. -[^] 11b7bc7ea21c875d3a1b419ae5d3acd83a40ef50 Ship spawn adjustments -[-] fa0eb54c7a03fcddb94de87450d3df2fe7264a76 Kills-legion-disease-cause-its-bad-and-weird -[^] 21709d390eef4fa1cbab5af1d8d0919b978f8173 Mindbreaker Tweak -[^] a0ae6ee50f7dcc336843897d508128518a6b1245 Ports-a-super-small-TG-signal-optimization -[^] 4bb50ced53aff3902a0c87bd47ae63887d5efa2d makes-plant-analyzer-usable -[^] d830853fa2cf567ad15a167242698a16b86546ed no-more-ammo-boxes-in-sec-belts -[^] ee1c8e30a5b4afa865a37b82173a509b12d829b7 Fix-shadow-AP-bonus +[*] de71c609003df6a255c22d50fe47100f827f76fc Gun Lore Update +[@] 4b727c9f03905a2d113e169474f23f11433df546 Armor value changes +[@] 17efcbf73d4e15789f90bddfacea6286f950ab4d Defib cargo/station +[@] 61d82bda46ee76216524c12f73f71832a789b6ba secret documents randomization +[@] 21162817d06e60b8bcce6a4c970a9577643236dc soul removal 1 +[*] 5dbf574b2fe63c492f5a27d2f4b2d0c47201ad3b Makes Sinta'Unathi playable again. +[*] 11b7bc7ea21c875d3a1b419ae5d3acd83a40ef50 Ship spawn adjustments +[*] fa0eb54c7a03fcddb94de87450d3df2fe7264a76 Kills-legion-disease-cause-its-bad-and-weird +[@] 21709d390eef4fa1cbab5af1d8d0919b978f8173 Mindbreaker Tweak +[@] a0ae6ee50f7dcc336843897d508128518a6b1245 Ports-a-super-small-TG-signal-optimization +[@] 4bb50ced53aff3902a0c87bd47ae63887d5efa2d makes-plant-analyzer-usable +[@] d830853fa2cf567ad15a167242698a16b86546ed no-more-ammo-boxes-in-sec-belts +[@] ee1c8e30a5b4afa865a37b82173a509b12d829b7 Fix-shadow-AP-bonus [^] 55268e0620e0af5d2e5f9cb50246c72e173c9325 SSD-Indicators-Will-Be-Real-In-2020- [^] 21fe09b54c2d2fa776b0a47b55740d2411e63403 respriting egg boxes [^] f165b98f242246de7a2ed737c074f155e57ccbe0 Knife-visibility-quick-fix diff --git a/code/modules/mob/living/carbon/human/examine.dm b/code/modules/mob/living/carbon/human/examine.dm index f92e8d762f2..7bbe9fb1de7 100644 --- a/code/modules/mob/living/carbon/human/examine.dm +++ b/code/modules/mob/living/carbon/human/examine.dm @@ -326,7 +326,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 0fc21db37d8..c5145600bbf 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 5c499fe2102..269c74a837b 100644 --- a/code/modules/mob/living/living.dm +++ b/code/modules/mob/living/living.dm @@ -1410,6 +1410,32 @@ 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(state) + if(state == ssd_indicator) + return + ssd_indicator = state + if(ssd_indicator && stat != DEAD) + 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)