Skip to content

Commit

Permalink
SSD-Indicators-Will-Be-Real-In-2020
Browse files Browse the repository at this point in the history
  • Loading branch information
blinkdog committed Jun 19, 2024
1 parent c8c468c commit 7a5fa1b
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 17 deletions.
26 changes: 13 additions & 13 deletions TODO-commits.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion code/modules/mob/living/carbon/human/examine.dm
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@
if(!key)
msg += "<span class='deadsay'>[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.</span>\n"
else if(!client)
msg += "<span class='warning'>[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.</span>\n"
msg += "<span class='warning'>[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.</span>\n"
if (length(msg))
. += "<span class='warning'>[msg.Join("")]</span>"

Expand Down
9 changes: 6 additions & 3 deletions code/modules/mob/living/carbon/life.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
26 changes: 26 additions & 0 deletions code/modules/mob/living/living.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 7a5fa1b

Please sign in to comment.