Dreams while sleeping are now slightly longer on average and will contain more possibilities (#1940)

This commit is contained in:
CitadelStationBot
2017-07-08 01:48:49 -05:00
committed by kevinz000
parent a85476ec78
commit 9874978c5c
5 changed files with 112 additions and 26 deletions
+14 -18
View File
@@ -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, "<span class='notice'><i>... [dream_image] ...</i></span>")
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
/mob/living/carbon/proc/experience_dream(dream_image)
dreaming--
if(stat != UNCONSCIOUS || InCritical())
return
to_chat(src, "<span class='notice'><i>... [dream_image] ...</i></span>")
@@ -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.