From 59867b4fb7099a187445e035cb20fbc4914a29c1 Mon Sep 17 00:00:00 2001 From: Ovilum Date: Wed, 12 Jun 2024 17:20:01 -0500 Subject: [PATCH] yey https://github.com/shiptest-ss13/Shiptest/pull/3067/files --- .../mob/living/carbon/human/examine.dm | 5 ++- code/modules/mob/living/carbon/life.dm | 9 ++-- code/modules/mob/living/living.dm | 41 +++++++++++++----- icons/mob/ssd_indicator.dmi | Bin 0 -> 311 bytes 4 files changed, 38 insertions(+), 17 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 59f97d172ad..283976adcea 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("")]" @@ -416,4 +416,5 @@ . = ..() if ((wear_mask && (wear_mask.flags_inv & HIDEFACE)) || (head && (head.flags_inv & HIDEFACE))) return - . += list(span_notice("[p_they(TRUE)] appear[p_s()] to be [get_age()].")) + if(get_age()) + . += list(span_notice("[p_they(TRUE)] appear[p_s()] to be [get_age()].")) 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 b240836b55e..8d2f29de92f 100644 --- a/code/modules/mob/living/living.dm +++ b/code/modules/mob/living/living.dm @@ -507,7 +507,7 @@ /mob/living/proc/get_up(instant = FALSE) set waitfor = FALSE - if(!instant && !do_mob(src, src, 2 SECONDS, uninterruptible = TRUE, extra_checks = CALLBACK(src, TYPE_PROC_REF(/mob/living, rest_checks_callback)))) + if(!instant && !do_after(src, 1 SECONDS, src, timed_action_flags = (IGNORE_USER_LOC_CHANGE|IGNORE_TARGET_LOC_CHANGE|IGNORE_HELD_ITEM), extra_checks = CALLBACK(src, TYPE_PROC_REF(/mob/living, rest_checks_callback)), interaction_key = DOAFTER_SOURCE_GETTING_UP)) return if(resting || body_position == STANDING_UP || HAS_TRAIT(src, TRAIT_FLOORED)) return @@ -977,7 +977,7 @@ "[src] tries to remove your [what.name].", null, null, src) to_chat(src, "You try to remove [who]'s [what.name]...") what.add_fingerprint(src) - if(do_mob(src, who, what.strip_delay)) + if(do_after(src, what.strip_delay, who, interaction_key = what)) if(what && Adjacent(who)) if(islist(where)) var/list/L = where @@ -1024,7 +1024,7 @@ who.visible_message("[src] tries to put [what] on [who].", \ "[src] tries to put [what] on you.", null, null, src) to_chat(src, "You try to put [what] on [who]...") - if(do_mob(src, who, what.equip_delay_other)) + if(do_after(src, what.equip_delay_other, who)) if(what && Adjacent(who) && what.mob_can_equip(who, src, final_where, TRUE, TRUE)) if(temporarilyRemoveItemFromInventory(what)) if(where_list) @@ -1144,15 +1144,6 @@ devilInfo.remove_soul(mind) mind.soulOwner = mind -/mob/living/proc/has_bane(banetype) - var/datum/antagonist/devil/devilInfo = is_devil(src) - return devilInfo && banetype == devilInfo.bane - -/mob/living/proc/check_weakness(obj/item/weapon, mob/living/attacker) - if(mind && mind.has_antag_datum(/datum/antagonist/devil)) - return check_devil_bane_multiplier(weapon, attacker) - return 1 //This is not a boolean, it's the multiplier for the damage the weapon does. - /mob/living/proc/check_acedia() if(mind && mind.has_objective(/datum/objective/sintouched/acedia)) return TRUE @@ -1419,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) 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|`}