From 393593046ef8f2dccb8a7189ab86eaffaad06485 Mon Sep 17 00:00:00 2001 From: Ravensdale Date: Sat, 27 Dec 2014 09:16:50 -0800 Subject: [PATCH] Overhauls SSD mechanic. --- code/modules/mob/living/carbon/alien/life.dm | 2 +- code/modules/mob/living/carbon/carbon.dm | 7 +++++-- code/modules/mob/living/carbon/human/life.dm | 9 ++++++++- code/modules/mob/living/login.dm | 2 ++ code/modules/mob/living/logout.dm | 8 +++++--- code/modules/mob/living/silicon/silicon.dm | 1 - code/modules/mob/mob_defines.dm | 5 +++-- 7 files changed, 24 insertions(+), 10 deletions(-) diff --git a/code/modules/mob/living/carbon/alien/life.dm b/code/modules/mob/living/carbon/alien/life.dm index 67488df9ebc..68831c2446b 100644 --- a/code/modules/mob/living/carbon/alien/life.dm +++ b/code/modules/mob/living/carbon/alien/life.dm @@ -79,7 +79,7 @@ if(sleeping) adjustHalLoss(-3) if (mind) - if((mind.active && client != null) || immune_to_ssd) + if(mind.active && client != null) sleeping = max(sleeping-1, 0) blinded = 1 stat = UNCONSCIOUS diff --git a/code/modules/mob/living/carbon/carbon.dm b/code/modules/mob/living/carbon/carbon.dm index ef5856026c1..9b019895054 100644 --- a/code/modules/mob/living/carbon/carbon.dm +++ b/code/modules/mob/living/carbon/carbon.dm @@ -200,8 +200,11 @@ if (istype(src,/mob/living/carbon/human) && src:w_uniform) var/mob/living/carbon/human/H = src H.w_uniform.add_fingerprint(M) - - if(lying || src.sleeping) + + if(player_logged) + M.visible_message("[M] shakes [src], but they do not respond. Probably suffering from SSD.", \ + "You shake [src], but they are unresponsive. Probably suffering from SSD.") + else if(lying || src.sleeping) src.sleeping = max(0,src.sleeping-5) if(src.sleeping == 0) src.resting = 0 diff --git a/code/modules/mob/living/carbon/human/life.dm b/code/modules/mob/living/carbon/human/life.dm index 03dae189d9c..cfdecbeda8f 100644 --- a/code/modules/mob/living/carbon/human/life.dm +++ b/code/modules/mob/living/carbon/human/life.dm @@ -995,6 +995,10 @@ proc/handle_regular_status_updates() if(status_flags & GODMODE) return 0 + + //SSD check, if a logged player is awake put them back to sleep! + if(player_logged && sleeping < 2) + sleeping = 2 if(stat == DEAD) //DEAD. BROWN BREAD. SWIMMING WITH THE SPESS CARP blinded = 1 @@ -1050,7 +1054,10 @@ handle_dreams() adjustHalLoss(-3) if (mind) - if((mind.active && client != null) || immune_to_ssd) //This also checks whether a client is connected, if not, sleep is not reduced. + //Are they SSD? If so we'll keep them asleep but work off some of that sleep var in case of stoxin or similar. + if(player_logged) + sleeping = max(sleeping-1, 2) + else sleeping = max(sleeping-1, 0) blinded = 1 stat = UNCONSCIOUS diff --git a/code/modules/mob/living/login.dm b/code/modules/mob/living/login.dm index b43da76953d..52f0630a39c 100644 --- a/code/modules/mob/living/login.dm +++ b/code/modules/mob/living/login.dm @@ -4,6 +4,8 @@ //Mind updates mind_initialize() //updates the mind (or creates and initializes one if one doesn't exist) mind.active = 1 //indicates that the mind is currently synced with a client + //If they're SSD, remove it so they can wake back up. + player_logged = 0 //Round specific stuff like hud updates if(ticker && ticker.mode) diff --git a/code/modules/mob/living/logout.dm b/code/modules/mob/living/logout.dm index 8fdcdb0ec46..c11eaaf5455 100644 --- a/code/modules/mob/living/logout.dm +++ b/code/modules/mob/living/logout.dm @@ -1,7 +1,9 @@ /mob/living/Logout() ..() if (mind) - if(!key) //key and mind have become seperated. + if(!key) //key and mind have become seperated. I believe this is for when a staff member aghosts. mind.active = 0 //This is to stop say, a mind.transfer_to call on a corpse causing a ghost to re-enter its body. - if(!immune_to_ssd && sleeping < 2 && mind.active) - sleeping = 2 //This causes instant sleep, but does not prolong it. See life.dm for furthering SSD. + //This causes instant sleep and tags a player as SSD. See life.dm for furthering SSD. + if(sleeping < 2 && mind.active) + sleeping = 2 + player_logged = 1 diff --git a/code/modules/mob/living/silicon/silicon.dm b/code/modules/mob/living/silicon/silicon.dm index a22bcfd02d9..c20e8e058b1 100644 --- a/code/modules/mob/living/silicon/silicon.dm +++ b/code/modules/mob/living/silicon/silicon.dm @@ -11,7 +11,6 @@ var/ioncheck[1] var/obj/item/device/radio/common_radio - immune_to_ssd = 1 var/list/hud_list[9] var/list/speech_synthesizer_langs = list() //which languages can be vocalized by the speech synthesizer diff --git a/code/modules/mob/mob_defines.dm b/code/modules/mob/mob_defines.dm index 15e0db47fc8..296d58d0786 100644 --- a/code/modules/mob/mob_defines.dm +++ b/code/modules/mob/mob_defines.dm @@ -214,8 +214,9 @@ var/universal_understand = 0 // Set to 1 to enable the mob to understand everyone, not necessarily speak var/stance_damage = 0 //Whether this mob's ability to stand has been affected - - var/immune_to_ssd = 0 + + //SSD var, changed it up some so people can have special things happen for different mobs when SSD. + var/player_logged = 0 var/turf/listed_turf = null //the current turf being examined in the stat panel var/list/shouldnt_see = list() //list of objects that this mob shouldn't see in the stat panel. this silliness is needed because of AI alt+click and cult blood runes