From 9874978c5c024abcd2d83e836595aedb52757ac6 Mon Sep 17 00:00:00 2001 From: CitadelStationBot Date: Sat, 8 Jul 2017 01:48:49 -0500 Subject: [PATCH] Dreams while sleeping are now slightly longer on average and will contain more possibilities (#1940) --- code/_globalvars/lists/names.dm | 1 + code/game/objects/structures/bedsheet_bin.dm | 43 ++++++++++--- code/modules/flufftext/Dreaming.dm | 32 +++++----- .../mob/living/carbon/carbon_defines.dm | 1 + strings/dreamstrings.txt | 61 +++++++++++++++++++ 5 files changed, 112 insertions(+), 26 deletions(-) create mode 100644 strings/dreamstrings.txt diff --git a/code/_globalvars/lists/names.dm b/code/_globalvars/lists/names.dm index 2565ba8cc1..522ff84ff0 100644 --- a/code/_globalvars/lists/names.dm +++ b/code/_globalvars/lists/names.dm @@ -19,5 +19,6 @@ GLOBAL_LIST_INIT(posibrain_names, world.file2list("strings/names/posibrain.txt") GLOBAL_LIST_INIT(verbs, world.file2list("strings/names/verbs.txt")) GLOBAL_LIST_INIT(adjectives, world.file2list("strings/names/adjectives.txt")) +GLOBAL_LIST_INIT(dream_strings, world.file2list("strings/dreamstrings.txt")) //loaded on startup because of " //would include in rsc if ' was used diff --git a/code/game/objects/structures/bedsheet_bin.dm b/code/game/objects/structures/bedsheet_bin.dm index 44be94501c..470e5c7bec 100644 --- a/code/game/objects/structures/bedsheet_bin.dm +++ b/code/game/objects/structures/bedsheet_bin.dm @@ -20,6 +20,7 @@ LINEN BINS resistance_flags = FLAMMABLE dog_fashion = /datum/dog_fashion/head/ghost + var/list/dream_messages = list("white") /obj/item/weapon/bedsheet/attack(mob/living/M, mob/user) if(!attempt_initiate_surgery(src, M, user)) @@ -49,149 +50,177 @@ LINEN BINS /obj/item/weapon/bedsheet/blue icon_state = "sheetblue" item_color = "blue" + dream_messages = list("blue") /obj/item/weapon/bedsheet/green icon_state = "sheetgreen" item_color = "green" - + dream_messages = list("green") + /obj/item/weapon/bedsheet/grey icon_state = "sheetgrey" item_color = "grey" + dream_messages = list("grey") /obj/item/weapon/bedsheet/orange icon_state = "sheetorange" item_color = "orange" + dream_messages = list("orange") /obj/item/weapon/bedsheet/purple icon_state = "sheetpurple" item_color = "purple" + dream_messages = list("purple") /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") /obj/item/weapon/bedsheet/rainbow name = "rainbow bedsheet" desc = "A multicolored 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") /obj/item/weapon/bedsheet/red icon_state = "sheetred" item_color = "red" + dream_messages = list("red") /obj/item/weapon/bedsheet/yellow icon_state = "sheetyellow" item_color = "yellow" + dream_messages = list("yellow") /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") /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") /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") /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") // for Free Golems. /obj/item/weapon/bedsheet/rd/royal_cape name = "Royal Cape of the Liberator" desc = "Majestic." + dream_messages = list("mining", "stone", "a golem", "freedom", "doing whatever") /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") /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") /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") /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") /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") /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") /obj/item/weapon/bedsheet/brown icon_state = "sheetbrown" item_color = "cargo" + dream_messages = list("brown") /obj/item/weapon/bedsheet/black icon_state = "sheetblack" item_color = "black" + dream_messages = list("black") /obj/item/weapon/bedsheet/centcom name = "\improper 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") /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") /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") /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") /obj/item/weapon/bedsheet/nanotrasen name = "nanotrasen bedsheet" desc = "It has the Nanotrasen logo on it and has an aura of duty." icon_state = "sheetNT" item_color = "nanotrasen" + dream_messages = list("authority", "an ending") /obj/item/weapon/bedsheet/ian icon_state = "sheetian" item_color = "ian" + dream_messages = list("a dog", "a corgi", "woof", "bark", "arf") /obj/item/weapon/bedsheet/random @@ -200,13 +229,11 @@ LINEN BINS name = "random bedsheet" desc = "If you're reading this description ingame, something has gone wrong! Honk!" -/obj/item/weapon/bedsheet/random/New() - var/obj/item/weapon/bedsheet/B = pick(subtypesof(/obj/item/weapon/bedsheet) - /obj/item/weapon/bedsheet/random) - name = initial(B.name) - desc = initial(B.desc) - icon_state = initial(B.icon_state) - item_state = initial(B.item_state) - item_color = initial(B.item_color) +/obj/item/weapon/bedsheet/random/Initialize() + . = INITIALIZE_HINT_QDEL + ..() + var/type = pick(typesof(/obj/item/weapon/bedsheet) - /obj/item/weapon/bedsheet/random) + new type(loc) /obj/structure/bedsheetbin name = "linen bin" diff --git a/code/modules/flufftext/Dreaming.dm b/code/modules/flufftext/Dreaming.dm index 002b9815af..7e81ae4700 100644 --- a/code/modules/flufftext/Dreaming.dm +++ b/code/modules/flufftext/Dreaming.dm @@ -1,26 +1,22 @@ /mob/living/carbon/proc/dream() set waitfor = 0 - dreaming = TRUE - var/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", - "a hat","the Luna","a ruined station","a planet","plasma","air","the medical bay","the bridge","blinking lights", - "a blue light","an abandoned laboratory","Nanotrasen","The Syndicate","blood","healing","power","respect", - "riches","space","a crash","happiness","pride","a fall","water","flames","ice","melons","flying" - ) - for(var/i in 1 to rand(1, rand(3, 7))) - var/dream_image = pick(dreams) - dreams -= dream_image - to_chat(src, "... [dream_image] ...") - sleep(rand(40,70)) - if(stat != UNCONSCIOUS || InCritical()) - break - dreaming = FALSE + var/list/dreams = GLOB.dream_strings.Copy() + 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]), ((i - 1) * rand(30,60))) return 1 /mob/living/carbon/proc/handle_dreams() if(prob(5) && !dreaming) dream() -/mob/living/carbon/var/dreaming = FALSE \ No newline at end of file +/mob/living/carbon/proc/experience_dream(dream_image) + dreaming-- + if(stat != UNCONSCIOUS || InCritical()) + return + to_chat(src, "... [dream_image] ...") diff --git a/code/modules/mob/living/carbon/carbon_defines.dm b/code/modules/mob/living/carbon/carbon_defines.dm index 1acc2a9264..f447261dd5 100644 --- a/code/modules/mob/living/carbon/carbon_defines.dm +++ b/code/modules/mob/living/carbon/carbon_defines.dm @@ -6,6 +6,7 @@ var/list/internal_organs = list() //List of /obj/item/organ in the mob. They don't go in the contents for some reason I don't want to know. var/list/internal_organs_slot= list() //Same as above, but stores "slot ID" - "organ" pairs for easy access. var/silent = 0 //Can't talk. Value goes down every life proc. //NOTE TO FUTURE CODERS: DO NOT INITIALIZE NUMERICAL VARS AS NULL OR I WILL MURDER YOU. + var/dreaming = 0 //How many dream images we have left to send var/obj/item/handcuffed = null //Whether or not the mob is handcuffed var/obj/item/legcuffed = null //Same as handcuffs but for legs. Bear traps use this. diff --git a/strings/dreamstrings.txt b/strings/dreamstrings.txt new file mode 100644 index 0000000000..72e0fe3764 --- /dev/null +++ b/strings/dreamstrings.txt @@ -0,0 +1,61 @@ +a familiar face +a crewmember +a security officer +a doctor +an engineer +a miner +a slime +an alien +a traitor +an ally +a scientist +a monkey +a loved one +a monster +the captain +a hat +an ID card +a bottle +a toolbox +a gun +the sun +the engine +the station +a planet +the medical bay +the bridge +the brig +a shuttle +a laboratory +Nanotrasen +the Syndicate +the Wizard Federation +blood +plasma +air +warmth +freezing +wind +darkness +light +life +death +blinking lights +healing +power +respect +riches +space +time +deep space +a crash +a catastrophe +happiness +pride +a fall +water +flames +ice +melons +flying +voices from all around \ No newline at end of file