Adds Skrell Shared Dreaming (#5707)

Implements skrell shared dreaming.

Whilst Unconscious and alive, skrell will enter the Srom, aka Dream, in which they telepathically link to one another.
In game, they will appear in a custom area, able to communicate with one another.
Whilst in Srom, skrell find it very hard to keep their own secrets, if not impossible, and will often 'mumble' important information.
This commit is contained in:
William Lemon
2018-12-11 20:44:28 +11:00
committed by Erki
parent c887940c3b
commit d9450e5dab
12 changed files with 2024 additions and 1469 deletions
+1
View File
@@ -380,6 +380,7 @@
usr << "<span class='warning'>You are already sleeping</span>"
return
if(alert(src,"You sure you want to sleep for a while?","Sleep","Yes","No") == "Yes")
willfully_sleeping = 1
usr.sleeping = 20 //Short nap
/mob/living/carbon/Collide(atom/A)
@@ -31,4 +31,6 @@
var/last_smell_time = 0
var/last_smell_text = ""
var/coughedtime = null // should only be useful for carbons as the only thing using it has a carbon arg.
var/coughedtime = null // should only be useful for carbons as the only thing using it has a carbon arg.
var/willfully_sleeping = 0
@@ -172,6 +172,16 @@
if(M.stat == 2)
M.gib()
// Simple mobs cannot use Skrellepathy
/mob/proc/can_commune()
return 0
/mob/living/carbon/human/can_commune()
if(/mob/living/carbon/human/proc/commune in verbs)
return 1
return ..()
/mob/living/carbon/human/proc/commune()
set category = "Abilities"
set name = "Commune with creature"
@@ -243,19 +253,19 @@
to_chat(M,"<span class='notice'>[src] telepathically says to [target]:</span> [text]")
var/mob/living/carbon/human/H = target
if (/mob/living/carbon/human/proc/commune in target.verbs)
if (target.can_commune())
to_chat(H,"<span class='psychic'>You instinctively sense [src] sending their thoughts into your mind, hearing:</span> [text]")
else if(prob(25) && (target.mind && target.mind.assigned_role=="Chaplain"))
to_chat(H,"<span class='changeling'>You sense [src]'s thoughts enter your mind, whispering quietly:</span> [text]")
else
to_chat(H,"<span class='alium'>You feel pressure behind your eyes as alien thoughts enter your mind:</span> [text]")
if(istype(H))
if (/mob/living/carbon/human/proc/commune in target.verbs)
if (target.can_commune())
return
if(prob(10) && (H.species.flags & NO_BLOOD))
if(prob(10) && !(H.species.flags & NO_BLOOD))
to_chat(H,"<span class='warning'>Your nose begins to bleed...</span>")
H.drip(3)
else if(prob(25) && (H.species.flags & NO_PAIN))
else if(prob(25) && !(H.species.flags & NO_PAIN))
to_chat(H,"<span class='warning'>Your head hurts...</span>")
else if(prob(50))
to_chat(H,"<span class='warning'>Your mind buzzes...</span>")
+4 -1
View File
@@ -87,6 +87,8 @@
if (is_diona())
diona_handle_light(DS)
handle_shared_dreaming()
handle_stasis_bag()
if(!handle_some_updates())
@@ -1044,7 +1046,7 @@
handle_dreams()
if (mind)
//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(client || sleeping > 3)
if(client || sleeping > 3 || istype(bg))
AdjustSleeping(-1)
if( prob(2) && health && !hal_crit )
spawn(0)
@@ -1052,6 +1054,7 @@
//CONSCIOUS
else
stat = CONSCIOUS
willfully_sleeping = 0
// Check everything else.
+4
View File
@@ -0,0 +1,4 @@
/area/centcom/shared_dream
name = "\improper The Shared Dream"
icon_state = "dream"
dynamic_lighting = 0
+64
View File
@@ -0,0 +1,64 @@
/mob/living/brain_ghost
name = "Brain Ghost"
desc = "A Telepathic connection."
alpha = 200
var/image/ghostimage = null
var/mob/living/carbon/human/body = null
/mob/living/brain_ghost/Initialize()
. = ..()
var/mob/living/carbon/human/form = loc
if(!istype(form))
qdel(src)
return
overlays += image(form.icon,form,form.icon_state)
overlays += form.overlays
name = form.real_name
loc = pick(dream_entries)
body = form
/mob/living/brain_ghost/verb/awaken()
set name = "Awaken"
set category = "IC"
if(body.willfully_sleeping)
body.sleeping = max(body.sleeping - 5, 0)
body.willfully_sleeping = 0
src << "<span class='notice'>You release your concentration on sleep, allowing yourself to awake.</span>"
else
src << "<span class='warning'>You've already released concentration. Wait to wake up naturally.</span>"
/mob/living/brain_ghost/Life()
..()
// Out body was probs gibbed or somefin
if(!istype(body))
show_message("<span class='danger'>[src] suddenly pops from the Srom.</span>")
src << "<span class='danger'>Your body was destroyed!</span>"
qdel(src)
return
if(body.stat == DEAD) // Body is dead, and won't get a life tick.
body.handle_shared_dreaming()
/mob/living/brain_ghost/say(var/message, var/datum/language/speaking = null, var/verb="says", var/alt_name="")
if(!istype(body) || body.stat!=UNCONSCIOUS)
return
if(prob(20)) // 1/5 chance to mumble out anything you say in the dream.
var/list/words = text2list(replacetext(message, "\[^a-zA-Z]*$", ""), " ")
var/word_count = rand(1, words.len) // How many words to mumble out from within the sentance
var/words_start = rand(1, words.len - (word_count - 1)) // Where the chunk of said words should start.
var/mumble_into = words_start == 1 ? "" : "..." // Text to show if we start mumbling after the start of a sentance
words = words.Copy(words_start, word_count + words_start) // Copy the chunk of the message we mumbled.
var/mumble_message = "[mumble_into][words.Join(" ")]..."
body.stat = CONSCIOUS // FILTHY hack to get the sleeping person to say something.
body.say(mumble_message) // Mumble in Nral Malic
body.stat = UNCONSCIOUS // Toggled before anything else can happen. Ideally.
..(message, speaking, verb="says", alt_name="")
+32
View File
@@ -0,0 +1,32 @@
var/list/dream_entries = list()
/mob/living/carbon/human
var/mob/living/brain_ghost/bg = null
/mob/living/carbon/human/proc/handle_shared_dreaming()
// If they're an Unconsious person with the abillity to do Skrellepathy.
// If either changes, they should be nocked back to the real world.
if(can_commune() && stat == UNCONSCIOUS && sleeping > 1)
if(!istype(bg) && client) // Don't spawn a brainghost if we're not logged in.
bg = new(src) // Generate a new brainghost.
bg.ckey = ckey
bg.client = client
ckey = "@[bg.ckey]"
bg << "<span class='notice'>As you lose consiousness, you feel yourself entering Srom.</span>"
bg << "<span class='warning'>Whilst in shared dreaming, you find it difficult to hide your secrets.</span>"
if(willfully_sleeping)
bg << "To wake up, use the \"Awaken\" verb in the IC tab."
// Does NOT
else
if(istype(bg))
// If we choose to be asleep, keep sleeping.
if(willfully_sleeping && sleeping && stat == UNCONSCIOUS)
sleeping = 5
return
var/mob/living/brain_ghost/old_bg = bg
bg = null
ckey = old_bg.ckey
old_bg.show_message("<span class='notice'>[bg] fades as their connection is severed.</span>")
animate(old_bg, alpha=0, time = 200)
QDEL_IN(old_bg, 20)
src << "<span class='warning'>You are ripped from the Srom as your body awakens.</span>"