diff --git a/code/game/objects/structures/bedsheet_bin.dm b/code/game/objects/structures/bedsheet_bin.dm index 3190a69177d..c03bbc7eba5 100644 --- a/code/game/objects/structures/bedsheet_bin.dm +++ b/code/game/objects/structures/bedsheet_bin.dm @@ -19,6 +19,10 @@ LINEN BINS burn_state = FLAMMABLE slot_flags = SLOT_BACK + var/list/dream_messages = list("white") + var/list/nightmare_messages = list("black") + + /obj/item/weapon/bedsheet/attack_self(mob/user as mob) user.drop_item() @@ -33,126 +37,174 @@ LINEN BINS /obj/item/weapon/bedsheet/blue icon_state = "sheetblue" item_color = "blue" + dream_messages = list("blue") + nightmare_messages = list("vox blood") /obj/item/weapon/bedsheet/green icon_state = "sheetgreen" item_color = "green" + dream_messages = list("green") + nightmare_messages = list("unathi flesh") /obj/item/weapon/bedsheet/orange icon_state = "sheetorange" item_color = "orange" + dream_messages = list("orange") + nightmare_messages = list("exploding fruit") /obj/item/weapon/bedsheet/purple icon_state = "sheetpurple" item_color = "purple" + dream_messages = list("purple") + nightmare_messages = list("Grey blood") /obj/item/weapon/bedsheet/patriot name = "patriotic bedsheet" desc = "You've never felt more free than when sleeping on this." icon_state = "sheetUSA" item_color = "sheetUSA" + dream_messages = list("America", "freedom", "fireworks", "bald eagles") + nightmare_messages = list("communism") /obj/item/weapon/bedsheet/rainbow name = "rainbow bedsheet" desc = "A multi_colored blanket. It's actually several different sheets cut up and sewn together." icon_state = "sheetrainbow" item_color = "rainbow" + dream_messages = list("red", "orange", "yellow", "green", "blue", "purple", "a rainbow") + nightmare_messages = list("green", "a cluwne", "fLoOr ClUwNe") /obj/item/weapon/bedsheet/red icon_state = "sheetred" item_color = "red" + dream_messages = list("red") + nightmare_messages = list("gibs") /obj/item/weapon/bedsheet/yellow icon_state = "sheetyellow" item_color = "yellow" + dream_messages = list("yellow") + nightmare_messages = list("locker full of banana peels") /obj/item/weapon/bedsheet/mime name = "mime's blanket" desc = "A very soothing striped blanket. All the noise just seems to fade out when you're under the covers in this." icon_state = "sheetmime" item_color = "mime" + dream_messages = list("silence", "gestures", "a pale face", "a gaping mouth", "the mime") + nightmare_messages = list("honk", "laughter", "a prank", "a joke", "a smiling face", "the clown") /obj/item/weapon/bedsheet/clown name = "clown's blanket" desc = "A rainbow blanket with a clown mask woven in. It smells faintly of bananas." icon_state = "sheetclown" item_color = "clown" + dream_messages = list("honk", "laughter", "a prank", "a joke", "a smiling face", "the clown") + nightmare_messages = list("silence", "gestures", "a pale face", "a gaping mouth", "the mime") /obj/item/weapon/bedsheet/captain name = "captain's bedsheet." desc = "It has a Nanotrasen symbol on it, and was woven with a revolutionary new kind of thread guaranteed to have 0.01% permeability for most non-chemical substances, popular among most modern captains." icon_state = "sheetcaptain" item_color = "captain" + dream_messages = list("authority", "a golden ID", "sunglasses", "a green disc", "an antique gun", "the captain") + nightmare_messages = list("condom", "clown with all access", "the syndicate") /obj/item/weapon/bedsheet/rd name = "research director's bedsheet" desc = "It appears to have a beaker emblem, and is made out of fire-resistant material, although it probably won't protect you in the event of fires you're familiar with every day." icon_state = "sheetrd" item_color = "director" + dream_messages = list("authority", "a silvery ID", "a bomb", "a mech", "a facehugger", "maniacal laughter", "the research director") + nightmare_messages = list("toxins full of plasma", "UPGRADE THE SLEEPERS", "rogue ai") /obj/item/weapon/bedsheet/medical name = "medical blanket" desc = "It's a sterilized* blanket commonly used in the Medbay. *Sterilization is voided if a virologist is present onboard the station." icon_state = "sheetmedical" item_color = "medical" + dream_messages = list("healing", "life", "surgery", "a doctor") + nightmare_messages = list("death", "no cryox", "cryo is off") /obj/item/weapon/bedsheet/cmo name = "chief medical officer's bedsheet" desc = "It's a sterilized blanket that has a cross emblem. There's some cat fur on it, likely from Runtime." icon_state = "sheetcmo" item_color = "cmo" + dream_messages = list("authority", "a silvery ID", "healing", "life", "surgery", "a cat", "the chief medical officer") + nightmare_messages = list("chemists making meth", "cryo if off", "where is the defib") /obj/item/weapon/bedsheet/hos name = "head of security's bedsheet" desc = "It is decorated with a shield emblem. While crime doesn't sleep, you do, but you are still THE LAW!" icon_state = "sheethos" item_color = "hosred" + dream_messages = list("authority", "a silvery ID", "handcuffs", "a baton", "a flashbang", "sunglasses", "the head of security") + nightmare_messages = list("the clown", "a toolbox", "sHiTcUrItY", "why did you put them in for 50 minutes") + /obj/item/weapon/bedsheet/hop name = "head of personnel's bedsheet" desc = "It is decorated with a key emblem. For those rare moments when you can rest and cuddle with Ian without someone screaming for you over the radio." icon_state = "sheethop" item_color = "hop" + dream_messages = list("authority", "a silvery ID", "obligation", "a computer", "an ID", "a corgi", "the head of personnel") + nightmare_messages = list("improper paperwork", "all access clown", "50 open clown slots", "dead ian") /obj/item/weapon/bedsheet/ce name = "chief engineer's bedsheet" desc = "It is decorated with a wrench emblem. It's highly reflective and stain resistant, so you don't need to worry about ruining it with oil." icon_state = "sheetce" item_color = "chief" + dream_messages = list("authority", "a silvery ID", "the engine", "power tools", "an APC", "a parrot", "the chief engineer") + nightmare_messages = list("forced airlock", "syndicate bomb", "explosion in research chem", "iT's LoOsE") /obj/item/weapon/bedsheet/qm name = "quartermaster's bedsheet" desc = "It is decorated with a crate emblem in silver lining. It's rather tough, and just the thing to lie on after a hard day of pushing paper." icon_state = "sheetqm" item_color = "qm" + dream_messages = list("a grey ID", "a shuttle", "a crate", "a sloth", "the quartermaster") + nightmare_messages = list("a blad person", "no points", "wheres the ore", "space carp") /obj/item/weapon/bedsheet/brown icon_state = "sheetbrown" item_color = "cargo" + dream_messages = list("brown") + nightmare_messages = list("dead monkey") /obj/item/weapon/bedsheet/centcom name = "centcom bedsheet" desc = "Woven with advanced nanothread for warmth as well as being very decorated, essential for all officials." icon_state = "sheetcentcom" item_color = "centcom" + dream_messages = list("a unique ID", "authority", "artillery", "an ending") + nightmare_messages = list("a butt fax") /obj/item/weapon/bedsheet/syndie name = "syndicate bedsheet" desc = "It has a syndicate emblem and it has an aura of evil." icon_state = "sheetsyndie" item_color = "syndie" + dream_messages = list("a green disc", "a red crystal", "a glowing blade", "a wire-covered ID") + nightmare_messages = list("stunbaton", "taser", "lasers", "a toolbox") /obj/item/weapon/bedsheet/cult name = "cultist's bedsheet" desc = "You might dream of Nar'Sie if you sleep with this. It seems rather tattered and glows of an eldritch presence." icon_state = "sheetcult" item_color = "cult" + dream_messages = list("a tome", "a floating red crystal", "a glowing sword", "a bloody symbol", "a massive humanoid figure") + nightmare_messages = list("a tome", "a floating red crystal", "a glowing sword", "a bloody symbol", "a massive humanoid figure") + /obj/item/weapon/bedsheet/wiz name = "wizard's bedsheet" desc = "A special fabric enchanted with magic so you can have an enchanted night. It even glows!" icon_state = "sheetwiz" item_color = "wiz" + dream_messages = list("a book", "an explosion", "lightning", "a staff", "a skeleton", "a robe", "magic") + nightmare_messages = list("a toolbox", "solars") diff --git a/code/modules/flufftext/Dreaming.dm b/code/modules/flufftext/Dreaming.dm index 3b165750d0b..da5d4c02694 100644 --- a/code/modules/flufftext/Dreaming.dm +++ b/code/modules/flufftext/Dreaming.dm @@ -1,6 +1,6 @@ -mob/living/carbon/proc/dream() - dreaming = 1 - var/list/dreams = list( +///DREAMS +/mob/living/carbon/proc/dream() + var/global/list/dreams = list( "an ID card","a bottle","a familiar face","a crewmember","a toolbox","a security officer","the captain", "voices from all around","deep space","a doctor","the engine","a traitor","an ally","darkness", "light","a scientist","a monkey","a catastrophe","a loved one","a gun","warmth","freezing","the sun", @@ -13,23 +13,55 @@ mob/living/carbon/proc/dream() "the virologist","the roboticist","the chef","the bartender","the chaplain","the librarian", "the brig physician", "the pod pilot", "the barber", "the mechanic", "the magistrate", "the nanotrasen representative", "the blueshield", "a mouse","an ert member", "a beach","the holodeck","a smokey room","a voice","the cold","a mouse","an operating table","the bar","the rain","a skrell", - "a unathi","a tajaran", "a vulpkanin", "a slime", "an ipc", "a vox", "a plasmaman", "a grey", "a kidan", "a diona", "the ai core", + "a unathi","a tajaran", "a vulpkanin", "a slime", "an ipc", "a vox", "a plasmaman", "a grey", "a kidan", "a diona", "a drask", "the ai core", "the mining station","the research station", "a beaker of strange liquid" ) - spawn(0) - for(var/i = rand(1,4),i > 0, i--) - var/dream_image = pick(dreams) - dreams -= dream_image - to_chat(src, "... [dream_image] ...") - sleep(rand(40,70)) - if(paralysis <= 0) - dreaming = 0 - return 0 - dreaming = 0 - return 1 + + for(var/obj/item/weapon/bedsheet/sheet in loc) + dreams += sheet.dream_messages + var/list/dream_images = list() + for(var/i in 1 to rand(3, rand(5, 10))) + dream_images += pick_n_take(dreams) + dreaming++ + for(var/i in 1 to dream_images.len) + addtimer(CALLBACK(src, proc/experience_dream, dream_images[i], FALSE), ((i - 1) * rand(30,60))) + return 1 + +//NIGHTMARES +/mob/living/carbon/proc/nightmare() + var/global/list/nightmares = list( + "a dead skrell", "a dead unathi", "a dead tajaran", "a dead vulpkanin", "a dead slime", "an dead ipc", "a dead vox", "a dead plasmaman", + "a dead grey", "a dead kidan", "a dead diona", "a dead drask", "the malf ai core", "bLoOd", "has been called", + "horrible sense of dread come over you", "red lights", "a talking mime", "WHY ARE YOU DOING THAT", "they know", "kIlL tHeM", "why", + "HoNk" + ) + + for(var/obj/item/weapon/bedsheet/sheet in loc) + nightmares += sheet.nightmare_messages + var/list/dream_images = list() + for(var/i in 1 to rand(3, rand(5, 10))) + dream_images += pick_n_take(nightmares) + nightmare++ + for(var/i in 1 to dream_images.len) + addtimer(CALLBACK(src, proc/experience_dream, dream_images[i], TRUE), ((i - 1) * rand(30,60))) + return 1 /mob/living/carbon/proc/handle_dreams() if(client && !dreaming && prob(5)) dream() + else if(client && !nightmare && prob(40)) + nightmare() + if(ishuman(src)) + Stuttering(1) + Jitter(20) + Dizzy(20) + +/mob/living/carbon/proc/experience_dream(dream_image, isNightmare) + dreaming-- + nightmare-- + if(stat != UNCONSCIOUS || InCritical()) + return + if(isNightmare) + dream_image = "[dream_image]" + to_chat(src, "... [dream_image] ...") -/mob/living/carbon/var/dreaming = 0 diff --git a/code/modules/mob/living/carbon/carbon_defines.dm b/code/modules/mob/living/carbon/carbon_defines.dm index 67a8fb7fa20..f2ad7b372b5 100644 --- a/code/modules/mob/living/carbon/carbon_defines.dm +++ b/code/modules/mob/living/carbon/carbon_defines.dm @@ -30,5 +30,7 @@ var/failed_last_breath = 0 //This is used to determine if the mob failed a breath. If they did fail a brath, they will attempt to breathe each tick, otherwise just once per 4 ticks. var/co2overloadtime = null + var/dreaming = 0 //How many dream images we have left to send + var/nightmare = 0 blood_volume = BLOOD_VOLUME_NORMAL