mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2026-08-23 13:05:44 +01:00
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:
@@ -0,0 +1,4 @@
|
||||
/area/centcom/shared_dream
|
||||
name = "\improper The Shared Dream"
|
||||
icon_state = "dream"
|
||||
dynamic_lighting = 0
|
||||
@@ -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="")
|
||||
@@ -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>"
|
||||
Reference in New Issue
Block a user