diff --git a/baystation12.dme b/baystation12.dme index 943c966012c..38a32a1a4cd 100644 --- a/baystation12.dme +++ b/baystation12.dme @@ -699,6 +699,7 @@ #include "code\modules\admin\verbs\adminsay.dm" #include "code\modules\admin\verbs\atmosdebug.dm" #include "code\modules\admin\verbs\BrokenInhands.dm" +#include "code\modules\admin\verbs\custom_event.dm" #include "code\modules\admin\verbs\deadsay.dm" #include "code\modules\admin\verbs\debug.dm" #include "code\modules\admin\verbs\diagnostics.dm" diff --git a/code/defines/global.dm b/code/defines/global.dm index ac16bb8d921..d3a29ab23e8 100644 --- a/code/defines/global.dm +++ b/code/defines/global.dm @@ -139,6 +139,8 @@ var no_auth_motd = null forceblob = 0 + custom_event_msg = null + //airlockWireColorToIndex takes a number representing the wire color, e.g. the orange wire is always 1, the dark red wire is always 2, etc. It returns the index for whatever that wire does. //airlockIndexToWireColor does the opposite thing - it takes the index for what the wire does, for example AIRLOCK_WIRE_IDSCAN is 1, AIRLOCK_WIRE_POWER1 is 2, etc. It returns the wire color number. //airlockWireColorToFlag takes the wire color number and returns the flag for it (1, 2, 4, 8, 16, etc) diff --git a/code/defines/mob/mob.dm b/code/defines/mob/mob.dm index 56575936ce6..db1bd81df09 100644 --- a/code/defines/mob/mob.dm +++ b/code/defines/mob/mob.dm @@ -87,6 +87,7 @@ var/antitoxs = null var/plasma = null var/sleeping = 0.0//Carbon + var/sleeping_willingly = 0.0 //Carbon, allows people to sleep forever if desired var/resting = 0.0//Carbon var/lying = 0.0 var/canmove = 1.0 diff --git a/code/game/mecha/equipment/weapons/weapons.dm b/code/game/mecha/equipment/weapons/weapons.dm index 8017ed9a9d9..14b0794bf6a 100644 --- a/code/game/mecha/equipment/weapons/weapons.dm +++ b/code/game/mecha/equipment/weapons/weapons.dm @@ -125,7 +125,8 @@ if(istype(H.ears, /obj/item/clothing/ears/earmuffs)) continue M << "HONK" - M.sleeping = 0 + if(!M.sleeping_willingly) + M.sleeping = 0 M.stuttering += 20 M.ear_deaf += 30 M.weakened = 3 diff --git a/code/modules/admin/admin_verbs.dm b/code/modules/admin/admin_verbs.dm index ffd2046c514..0b8952d95f2 100644 --- a/code/modules/admin/admin_verbs.dm +++ b/code/modules/admin/admin_verbs.dm @@ -225,7 +225,7 @@ verbs += /client/proc/cmd_admin_create_centcom_report verbs += /client/proc/toggle_hear_deadcast verbs += /client/proc/toggle_hear_radio - + verbs += /client/proc/cmd_admin_change_custom_event if (holder.level >= 0)//Mod******************************************************************** verbs += /obj/admins/proc/toggleAI //Toggle the AI @@ -391,6 +391,7 @@ verbs -= /client/proc/toggle_hear_deadcast verbs -= /client/proc/toggle_hear_radio verbs -= /client/proc/tension_report + verbs -= /client/proc/cmd_admin_change_custom_event return diff --git a/code/modules/admin/verbs/custom_event.dm b/code/modules/admin/verbs/custom_event.dm new file mode 100644 index 00000000000..c4eed427a44 --- /dev/null +++ b/code/modules/admin/verbs/custom_event.dm @@ -0,0 +1,35 @@ +// verb for admins to set custom event +/client/proc/cmd_admin_change_custom_event() + set category = "Fun" + set name = "Change Custom Event" + + if(!authenticated || !holder) + src << "Only administrators may use this command." + return + + var/input = input(usr, "Enter the description of the custom event. Be descriptive. To cancel the event, make this blank or hit cancel.", "Custom Event", custom_event_msg) as message|null + if(!input || input == "") + custom_event_msg = null + return + + custom_event_msg = input + + world << "

Custom Event

" + world << "

A custom event is starting. OOC Info:

" + world << "[html_encode(custom_event_msg)]" + world << "
" + +// normal verb for players to view info +/client/verb/cmd_view_custom_event() + set category = "OOC" + set name = "Custom Event Info" + + if(!custom_event_msg || custom_event_msg == "") + src << "There currently is no known custom event taking place." + src << "Keep in mind: it is possible that an admin has not properly set this." + return + + src << "

Custom Event

" + src << "

A custom event is taking place. OOC Info:

" + src << "[html_encode(custom_event_msg)]" + src << "
" diff --git a/code/modules/chemical/Chemistry-Reagents.dm b/code/modules/chemical/Chemistry-Reagents.dm index 8152683ca91..94248ba3119 100644 --- a/code/modules/chemical/Chemistry-Reagents.dm +++ b/code/modules/chemical/Chemistry-Reagents.dm @@ -1257,7 +1257,8 @@ datum M:drowsyness = 0 M:stuttering = 0 M:confused = 0 - M:sleeping = 0 + if(!M:sleeping_willingly) + M:sleeping = 0 M:jitteriness = 0 for(var/datum/disease/D in M.viruses) D.spread = "Remissive" @@ -2147,7 +2148,8 @@ datum ..() M.dizziness = max(0,M.dizziness-5) M:drowsyness = max(0,M:drowsyness-3) - M:sleeping = 0 + if(!M:sleeping_willingly) + M:sleeping = 0 if (M.bodytemperature < 310)//310 is the normal bodytemp. 310.055 M.bodytemperature = min(310, M.bodytemperature+5) M.make_jittery(5) @@ -2166,7 +2168,8 @@ datum M.dizziness = max(0,M.dizziness-2) M:drowsyness = max(0,M:drowsyness-1) M:jitteriness = max(0,M:jitteriness-3) - M:sleeping = 0 + if(!M:sleeping_willingly) + M:sleeping = 0 if(M:getToxLoss() && prob(20)) M:adjustToxLoss(-1) if (M.bodytemperature < 310) //310 is the normal bodytemp. 310.055 @@ -2185,7 +2188,8 @@ datum ..() M.dizziness = max(0,M.dizziness-5) M:drowsyness = max(0,M:drowsyness-3) - M:sleeping = 0 + if(!M:sleeping_willingly) + M:sleeping = 0 if (M.bodytemperature > 310)//310 is the normal bodytemp. 310.055 M.bodytemperature = min(310, M.bodytemperature-5) M.make_jittery(5) @@ -2203,7 +2207,8 @@ datum ..() M.dizziness = max(0,M.dizziness-2) M:drowsyness = max(0,M:drowsyness-1) - M:sleeping = 0 + if(!M:sleeping_willingly) + M:sleeping = 0 if(M:getToxLoss() && prob(20)) M:adjustToxLoss(-1) if (M.bodytemperature > 310)//310 is the normal bodytemp. 310.055 @@ -2237,7 +2242,8 @@ datum M.druggy = max(M.druggy, 30) M.dizziness +=5 M:drowsyness = 0 - M:sleeping = 0 + if(!M:sleeping_willingly) + M:sleeping = 0 if (M.bodytemperature > 310)//310 is the normal bodytemp. 310.055 M.bodytemperature = max(310, M.bodytemperature-5) M:nutrition += 1 @@ -2253,7 +2259,8 @@ datum on_mob_life(var/mob/living/M as mob) M:drowsyness = max(0,M:drowsyness-7) - M:sleeping = 0 + if(!M:sleeping_willingly) + M:sleeping = 0 if (M.bodytemperature > 310) M.bodytemperature = max(310, M.bodytemperature-5) M.make_jittery(5) @@ -2270,7 +2277,8 @@ datum on_mob_life(var/mob/living/M as mob) M:drowsyness = max(0,M:drowsyness-7) - M:sleeping = 0 + if(!M:sleeping_willingly) + M:sleeping = 0 if (M.bodytemperature > 310) M.bodytemperature = max(310, M.bodytemperature-5) M.make_jittery(5) @@ -2538,7 +2546,8 @@ datum on_mob_life(var/mob/living/M as mob) M.dizziness = max(0,M.dizziness-5) M:drowsyness = max(0,M:drowsyness-3) - M:sleeping = 0 + if(!M:sleeping_willingly) + M:sleeping = 0 if (M.bodytemperature > 310) M.bodytemperature = max(310, M.bodytemperature-5) ..() @@ -2554,7 +2563,8 @@ datum on_mob_life(var/mob/living/M as mob) M.dizziness = max(0,M.dizziness-5) M:drowsyness = max(0,M:drowsyness-3) - M:sleeping = 0//Copy-paste from Coffee, derp + if(!M:sleeping_willingly) + M:sleeping = 0 M.make_jittery(5) ..() return @@ -2627,7 +2637,8 @@ datum on_mob_life(var/mob/living/M as mob) M.dizziness = max(0,M.dizziness-5) M:drowsyness = max(0,M:drowsyness-3) - M:sleeping = 0 + if(!M:sleeping_willingly) + M:sleeping = 0 if (M.bodytemperature > 310) M.bodytemperature = max(310, M.bodytemperature-5) ..() diff --git a/code/modules/mob/living/carbon/alien/humanoid/caste/hunter.dm b/code/modules/mob/living/carbon/alien/humanoid/caste/hunter.dm index ec396649eff..26887cb561c 100644 --- a/code/modules/mob/living/carbon/alien/humanoid/caste/hunter.dm +++ b/code/modules/mob/living/carbon/alien/humanoid/caste/hunter.dm @@ -40,7 +40,11 @@ src.see_in_dark = 5 src.see_invisible = 2 - if (src.sleep) src.sleep.icon_state = text("sleep[]", src.sleeping) + if (src.sleep) + src.sleep.icon_state = text("sleep[]", src.sleeping > 0 ? 1 : 0) + src.sleep.overlays = null + if(src.sleeping_willingly) + src.sleep.overlays += icon(src.sleep.icon, "sleep_willing") if (src.rest) src.rest.icon_state = text("rest[]", src.resting) if (src.healths) @@ -83,7 +87,8 @@ if(src.sleeping) src.paralysis = max(src.paralysis, 3) if (prob(10) && health) spawn(0) emote("snore") - src.sleeping-- + if(!src.sleeping_willingly) + src.sleeping-- if(src.resting) src.weakened = max(src.weakened, 5) diff --git a/code/modules/mob/living/carbon/alien/humanoid/caste/sentinel.dm b/code/modules/mob/living/carbon/alien/humanoid/caste/sentinel.dm index 40e669c0487..c155f1eaac2 100644 --- a/code/modules/mob/living/carbon/alien/humanoid/caste/sentinel.dm +++ b/code/modules/mob/living/carbon/alien/humanoid/caste/sentinel.dm @@ -40,7 +40,11 @@ src.see_in_dark = 7 src.see_invisible = 3 - if (src.sleep) src.sleep.icon_state = text("sleep[]", src.sleeping) + if (src.sleep) + src.sleep.icon_state = text("sleep[]", src.sleeping > 0 ? 1 : 0) + src.sleep.overlays = null + if(src.sleeping_willingly) + src.sleep.overlays += icon(src.sleep.icon, "sleep_willing") if (src.rest) src.rest.icon_state = text("rest[]", src.resting) if (src.healths) @@ -84,7 +88,8 @@ if(src.sleeping) src.paralysis = max(src.paralysis, 3) if (prob(10) && health) spawn(0) emote("snore") - src.sleeping-- + if(!src.sleeping_willingly) + src.sleeping-- if(src.resting) src.weakened = max(src.weakened, 5) diff --git a/code/modules/mob/living/carbon/alien/humanoid/humanoid.dm b/code/modules/mob/living/carbon/alien/humanoid/humanoid.dm index 6101c6c0720..7675f890e6c 100644 --- a/code/modules/mob/living/carbon/alien/humanoid/humanoid.dm +++ b/code/modules/mob/living/carbon/alien/humanoid/humanoid.dm @@ -702,7 +702,8 @@ In all, this is a lot like the monkey code. /N switch(M.a_intent) if ("help") - sleeping = 0 + if(!sleeping_willingly) + sleeping = 0 resting = 0 if (paralysis >= 3) paralysis -= 3 if (stunned >= 3) stunned -= 3 diff --git a/code/modules/mob/living/carbon/alien/humanoid/life.dm b/code/modules/mob/living/carbon/alien/humanoid/life.dm index a6f08cee3f7..e32495dcf51 100644 --- a/code/modules/mob/living/carbon/alien/humanoid/life.dm +++ b/code/modules/mob/living/carbon/alien/humanoid/life.dm @@ -403,7 +403,8 @@ if(src.sleeping) src.paralysis = max(src.paralysis, 3) if (prob(10) && health) spawn(0) emote("snore") - src.sleeping-- + if(!src.sleeping_willingly) + src.sleeping-- if(src.resting) src.weakened = max(src.weakened, 5) @@ -493,7 +494,11 @@ src.see_in_dark = 4 src.see_invisible = 2 - if (src.sleep) src.sleep.icon_state = text("sleep[]", src.sleeping) + if (src.sleep) + src.sleep.icon_state = text("sleep[]", src.sleeping > 0 ? 1 : 0) + src.sleep.overlays = null + if(src.sleeping_willingly) + src.sleep.overlays += icon(src.sleep.icon, "sleep_willing") if (src.rest) src.rest.icon_state = text("rest[]", src.resting) if (src.healths) diff --git a/code/modules/mob/living/carbon/alien/humanoid/queen.dm b/code/modules/mob/living/carbon/alien/humanoid/queen.dm index 72bcf28ad6d..7f3b8837c5c 100644 --- a/code/modules/mob/living/carbon/alien/humanoid/queen.dm +++ b/code/modules/mob/living/carbon/alien/humanoid/queen.dm @@ -43,7 +43,11 @@ src.see_in_dark = 8 src.see_invisible = 2 - if (src.sleep) src.sleep.icon_state = text("sleep[]", src.sleeping) + if (src.sleep) + src.sleep.icon_state = text("sleep[]", src.sleeping > 0 ? 1 : 0) + src.sleep.overlays = null + if(src.sleeping_willingly) + src.sleep.overlays += icon(src.sleep.icon, "sleep_willing") if (src.rest) src.rest.icon_state = text("rest[]", src.resting) if (src.healths) @@ -85,7 +89,8 @@ if(src.sleeping) src.paralysis = max(src.paralysis, 3) if (prob(10) && health) spawn(0) emote("snore") - src.sleeping-- + if(!src.sleeping_willingly) + src.sleeping-- if(src.resting) src.weakened = max(src.weakened, 5) diff --git a/code/modules/mob/living/carbon/alien/larva/larva.dm b/code/modules/mob/living/carbon/alien/larva/larva.dm index a1972b669dd..6d59ab7f36f 100644 --- a/code/modules/mob/living/carbon/alien/larva/larva.dm +++ b/code/modules/mob/living/carbon/alien/larva/larva.dm @@ -455,7 +455,8 @@ switch(M.a_intent) if ("help") - sleeping = 0 + if(!sleeping_willingly) + sleeping = 0 resting = 0 if (paralysis >= 3) paralysis -= 3 if (stunned >= 3) stunned -= 3 diff --git a/code/modules/mob/living/carbon/alien/larva/life.dm b/code/modules/mob/living/carbon/alien/larva/life.dm index f42624d3c3b..ce956a1ed5d 100644 --- a/code/modules/mob/living/carbon/alien/larva/life.dm +++ b/code/modules/mob/living/carbon/alien/larva/life.dm @@ -330,7 +330,8 @@ if(sleeping) paralysis = max(paralysis, 3) if (prob(10) && health) spawn(0) emote("snore") - sleeping-- + if(!src.sleeping_willingly) + src.sleeping-- if(resting) weakened = max(weakened, 5) @@ -420,7 +421,11 @@ see_in_dark = 4 see_invisible = 2 - if (sleep) sleep.icon_state = text("sleep[]", sleeping) + if (src.sleep) + src.sleep.icon_state = text("sleep[]", src.sleeping > 0 ? 1 : 0) + src.sleep.overlays = null + if(src.sleeping_willingly) + src.sleep.overlays += icon(src.sleep.icon, "sleep_willing") if (rest) rest.icon_state = text("rest[]", resting) if (healths) diff --git a/code/modules/mob/living/carbon/brain/life.dm b/code/modules/mob/living/carbon/brain/life.dm index 1713e449595..4520e48f49c 100644 --- a/code/modules/mob/living/carbon/brain/life.dm +++ b/code/modules/mob/living/carbon/brain/life.dm @@ -240,7 +240,11 @@ see_in_dark = 2 see_invisible = 0 - if (sleep) sleep.icon_state = text("sleep[]", sleeping) + if (src.sleep) + src.sleep.icon_state = text("sleep[]", src.sleeping > 0 ? 1 : 0) + src.sleep.overlays = null + if(src.sleeping_willingly) + src.sleep.overlays += icon(src.sleep.icon, "sleep_willing") if (rest) rest.icon_state = text("rest[]", resting) if (healths) diff --git a/code/modules/mob/living/carbon/carbon.dm b/code/modules/mob/living/carbon/carbon.dm index 72780bc7cbe..b0e8b08af8b 100644 --- a/code/modules/mob/living/carbon/carbon.dm +++ b/code/modules/mob/living/carbon/carbon.dm @@ -164,7 +164,8 @@ if (istype(src,/mob/living/carbon/human) && src:w_uniform) var/mob/living/carbon/human/H = src H.w_uniform.add_fingerprint(M) - src.sleeping = 0 + if(!src.sleeping_willingly) + src.sleeping = 0 src.resting = 0 if (src.paralysis >= 3) src.paralysis -= 3 if (src.stunned >= 3) src.stunned -= 3 @@ -176,4 +177,19 @@ ) /mob/living/carbon/proc/eyecheck() - return 0 \ No newline at end of file + return 0 + +// in a coma from logitis! +/mob/living/carbon/Logout() + ..() + + if(!src.sleeping) // would be exploited by stoxin'd people otherwise ;) + src.sleeping = 1 + src.sleeping_willingly = 1 + +/mob/living/carbon/Login() + ..() + + if(src.sleeping_willingly) + src.sleeping = 0 + src.sleeping_willingly = 0 \ No newline at end of file diff --git a/code/modules/mob/living/carbon/human/life.dm b/code/modules/mob/living/carbon/human/life.dm index 4bbe1663bf5..a2bb90c89a6 100644 --- a/code/modules/mob/living/carbon/human/life.dm +++ b/code/modules/mob/living/carbon/human/life.dm @@ -663,7 +663,8 @@ if(sleeping) paralysis = max(paralysis, 3) if (prob(10) && health) spawn(0) emote("snore") - sleeping-- + if(!src.sleeping_willingly) + src.sleeping-- if(resting) weakened = max(weakened, 3) @@ -866,7 +867,11 @@ - if (sleep) sleep.icon_state = text("sleep[]", sleeping) + if (src.sleep) + src.sleep.icon_state = text("sleep[]", src.sleeping > 0 ? 1 : 0) + src.sleep.overlays = null + if(src.sleeping_willingly) + src.sleep.overlays += icon(src.sleep.icon, "sleep_willing") if (rest) rest.icon_state = text("rest[]", resting) if (healths) diff --git a/code/modules/mob/living/carbon/monkey/life.dm b/code/modules/mob/living/carbon/monkey/life.dm index 9b9afb40841..ef452964200 100644 --- a/code/modules/mob/living/carbon/monkey/life.dm +++ b/code/modules/mob/living/carbon/monkey/life.dm @@ -493,7 +493,11 @@ src.see_in_dark = 2 src.see_invisible = 0 - if (src.sleep) src.sleep.icon_state = text("sleep[]", src.sleeping) + if (src.sleep) + src.sleep.icon_state = text("sleep[]", src.sleeping > 0 ? 1 : 0) + src.sleep.overlays = null + if(src.sleeping_willingly) + src.sleep.overlays += icon(src.sleep.icon, "sleep_willing") if (src.rest) src.rest.icon_state = text("rest[]", src.resting) if (src.healths) diff --git a/code/modules/mob/living/silicon/robot/life.dm b/code/modules/mob/living/silicon/robot/life.dm index 98fd2d08913..6f054c950aa 100644 --- a/code/modules/mob/living/silicon/robot/life.dm +++ b/code/modules/mob/living/silicon/robot/life.dm @@ -93,7 +93,8 @@ if(src.sleeping) src.paralysis = max(src.paralysis, 3) - src.sleeping-- + if(!src.sleeping_willingly) + src.sleeping-- if(src.resting) src.weakened = max(src.weakened, 5) @@ -181,7 +182,11 @@ if(hud && hud.hud) hud.hud.process_hud(src) - if (src.sleep) src.sleep.icon_state = text("sleep[]", src.sleeping) + if (src.sleep) + src.sleep.icon_state = text("sleep[]", src.sleeping > 0 ? 1 : 0) + src.sleep.overlays = null + if(src.sleeping_willingly) + src.sleep.overlays += icon(src.sleep.icon, "sleep_willing") if (src.rest) src.rest.icon_state = text("rest[]", src.resting) if (src.healths) diff --git a/code/modules/mob/mob.dm b/code/modules/mob/mob.dm index 14d703cf080..caaec2d1bd1 100644 --- a/code/modules/mob/mob.dm +++ b/code/modules/mob/mob.dm @@ -684,6 +684,12 @@ authorize() + if(custom_event_msg && custom_event_msg != "") + src << "

Custom Event

" + src << "

A custom event is taking place. OOC Info:

" + src << "[html_encode(custom_event_msg)]" + src << "
" + if(admins.Find(ckey)) holder = new /obj/admins(src) holder.rank = admins[ckey] diff --git a/code/modules/mob/new_player/preferences.dm b/code/modules/mob/new_player/preferences.dm index 01174aeb6bb..d1e60625d19 100644 --- a/code/modules/mob/new_player/preferences.dm +++ b/code/modules/mob/new_player/preferences.dm @@ -178,9 +178,9 @@ datum/preferences // slot options if (!IsGuestKey(user.key)) if(!curslot) - dat += "Save Slot 1
" - else - dat += "Save Slot [curslot]
" + curslot = 1 + slotname = savefile_getslots(user)[1] + dat += "Save Slot [curslot] ([slotname])
" dat += "Load
" dat += "Create New Slot
" @@ -573,6 +573,7 @@ datum/preferences alert(user, "You do not have a savefile.") else curslot = slot + slotname = savefile_getslots(user)[curslot] loadsave(user) if(link_tags["removeslot"]) var/slot = text2num(link_tags["removeslot"]) @@ -583,6 +584,7 @@ datum/preferences usr << "Slot [slot] Deleted." curslot = 1 + slotname = savefile_getslots(user)[curslot] loadsave(usr) if(link_tags["loadslot2"]) loadsave(user) @@ -593,7 +595,7 @@ datum/preferences if(count > 10) usr << "You have reached the character limit." return - var/slotname = input(usr,"Choose a name for your slot","Name","Default") + slotname = input(usr,"Choose a name for your slot","Name","Default") curslot = savefile_createslot(user, slotname) diff --git a/code/modules/mob/new_player/savefile.dm b/code/modules/mob/new_player/savefile.dm index 7243cca918b..ad9543abee4 100644 --- a/code/modules/mob/new_player/savefile.dm +++ b/code/modules/mob/new_player/savefile.dm @@ -22,7 +22,7 @@ datum/preferences/proc/savefile_getslots(mob/user) for(var/i=1, i<=F.dir.len, i++) var/dname = F.dir[i] if(copytext(dname, 1, 6) == "slot.") - slots.Add(copytext(dname, 6)) + slots.Insert(2, copytext(dname, 6)) // reverse order so it's oldest->newest, like old system return slots diff --git a/code/modules/mob/screen.dm b/code/modules/mob/screen.dm index 271c808e5a0..57978a409a0 100644 --- a/code/modules/mob/screen.dm +++ b/code/modules/mob/screen.dm @@ -386,7 +386,12 @@ if("pull") usr.pulling = null if("sleep") - usr.sleeping = !( usr.sleeping ) + if(usr.sleeping && usr.sleeping_willingly) + usr.sleeping = 0 + usr.sleeping_willingly = 0 + else if(!usr.sleeping) + usr.sleeping = 1 + usr.sleeping_willingly = 1 if("rest") usr.resting = !( usr.resting ) if("throw") diff --git a/icons/mob/screen1_old.dmi b/icons/mob/screen1_old.dmi index 1a70335cafd..ae9ed11ff79 100644 Binary files a/icons/mob/screen1_old.dmi and b/icons/mob/screen1_old.dmi differ