why do I even bother
This commit is contained in:
@@ -0,0 +1,53 @@
|
||||
/datum/brain_trauma/hypnosis
|
||||
name = "Hypnosis"
|
||||
desc = "Patient's unconscious is completely enthralled by a word or sentence, focusing their thoughts and actions on it."
|
||||
scan_desc = "looping thought pattern"
|
||||
gain_text = ""
|
||||
lose_text = ""
|
||||
resilience = TRAUMA_RESILIENCE_SURGERY
|
||||
|
||||
var/hypnotic_phrase = ""
|
||||
var/regex/target_phrase
|
||||
|
||||
/datum/brain_trauma/hypnosis/New(phrase)
|
||||
if(!phrase)
|
||||
qdel(src)
|
||||
hypnotic_phrase = phrase
|
||||
try
|
||||
target_phrase = new("(\\b[hypnotic_phrase]\\b)","ig")
|
||||
catch(var/exception/e)
|
||||
stack_trace("[e] on [e.file]:[e.line]")
|
||||
qdel(src)
|
||||
..()
|
||||
|
||||
/datum/brain_trauma/hypnosis/on_gain()
|
||||
message_admins("[ADMIN_LOOKUPFLW(owner)] was hypnotized with the phrase '[hypnotic_phrase]'.")
|
||||
log_game("[key_name(owner)] was hypnotized with the phrase '[hypnotic_phrase]'.")
|
||||
to_chat(owner, "<span class='reallybig hypnophrase'>[hypnotic_phrase]</span>")
|
||||
to_chat(owner, "<span class='notice'>[pick("You feel your thoughts focusing on this phrase... you can't seem to get it out of your head.",\
|
||||
"Your head hurts, but this is all you can think of. It must be vitally important.",\
|
||||
"You feel a part of your mind repeating this over and over. You need to follow these words.",\
|
||||
"Something about this sounds... right, for some reason. You feel like you should follow these words.",\
|
||||
"These words keep echoing in your mind. You find yourself completely fascinated by them.")]</span>")
|
||||
to_chat(owner, "<span class='boldwarning'>You've been hypnotized by this sentence. You must follow these words. If it isn't a clear order, you can freely interpret how to do so,\
|
||||
as long as you act like the words are your highest priority.</span>")
|
||||
..()
|
||||
|
||||
/datum/brain_trauma/hypnosis/on_lose()
|
||||
message_admins("[ADMIN_LOOKUPFLW(owner)] is no longer hypnotized with the phrase '[hypnotic_phrase]'.")
|
||||
log_game("[key_name(owner)] is no longer hypnotized with the phrase '[hypnotic_phrase]'.")
|
||||
to_chat(owner, "<span class='userdanger'>You suddenly snap out of your hypnosis. The phrase '[hypnotic_phrase]' no longer feels important to you.</span>")
|
||||
..()
|
||||
|
||||
/datum/brain_trauma/hypnosis/on_life()
|
||||
..()
|
||||
if(prob(2))
|
||||
switch(rand(1,2))
|
||||
if(1)
|
||||
to_chat(owner, "<i>...[lowertext(hypnotic_phrase)]...</i>")
|
||||
if(2)
|
||||
new /datum/hallucination/chat(owner, TRUE, FALSE, "<span class='hypnophrase'>[hypnotic_phrase]</span>")
|
||||
|
||||
/datum/brain_trauma/hypnosis/on_hear(message, speaker, message_language, raw_message, radio_freq)
|
||||
message = target_phrase.Replace(message, "<span class='hypnophrase'>$1</span>")
|
||||
return message
|
||||
@@ -203,4 +203,20 @@
|
||||
|
||||
/datum/brain_trauma/severe/pacifism/on_lose()
|
||||
owner.remove_trait(TRAIT_PACIFISM, TRAUMA_TRAIT)
|
||||
..()
|
||||
..()
|
||||
|
||||
/datum/brain_trauma/severe/hypnotic_stupor
|
||||
name = "Hypnotic Stupor"
|
||||
desc = "Patient is prone to episodes of extreme stupor that leaves them extremely suggestible."
|
||||
scan_desc = "oneiric feedback loop"
|
||||
gain_text = "<span class='warning'>You feel somewhat dazed.</span>"
|
||||
lose_text = "<span class='notice'>You feel like a fog was lifted from your mind.</span>"
|
||||
|
||||
/datum/brain_trauma/severe/hypnotic_stupor/on_lose() //hypnosis must be cleared separately, but brain surgery should get rid of both anyway
|
||||
..()
|
||||
owner.remove_status_effect(/datum/status_effect/trance)
|
||||
|
||||
/datum/brain_trauma/severe/hypnotic_stupor/on_life()
|
||||
..()
|
||||
if(prob(1) && !owner.has_status_effect(/datum/status_effect/trance))
|
||||
owner.apply_status_effect(/datum/status_effect/trance, rand(100,300), FALSE)
|
||||
|
||||
@@ -507,3 +507,57 @@
|
||||
desc = "Your body is covered in blue ichor! You can't be revived by vitality matrices."
|
||||
icon_state = "ichorial_stain"
|
||||
alerttooltipstyle = "clockcult"
|
||||
|
||||
/datum/status_effect/trance
|
||||
id = "trance"
|
||||
status_type = STATUS_EFFECT_UNIQUE
|
||||
duration = 300
|
||||
tick_interval = 10
|
||||
examine_text = "<span class='warning'>SUBJECTPRONOUN seems slow and unfocused.</span>"
|
||||
var/stun = TRUE
|
||||
alert_type = /obj/screen/alert/status_effect/trance
|
||||
|
||||
/obj/screen/alert/status_effect/trance
|
||||
name = "Trance"
|
||||
desc = "Everything feels so distant, and you can feel your thoughts forming loops inside your head..."
|
||||
icon_state = "high"
|
||||
|
||||
/datum/status_effect/trance/tick()
|
||||
if(stun)
|
||||
owner.Stun(60, TRUE, TRUE)
|
||||
owner.dizziness = 20
|
||||
|
||||
/datum/status_effect/trance/on_apply()
|
||||
if(!iscarbon(owner))
|
||||
return FALSE
|
||||
RegisterSignal(owner, COMSIG_MOVABLE_HEAR, .proc/hypnotize)
|
||||
owner.add_trait(TRAIT_MUTE, "trance")
|
||||
if(!owner.has_quirk(/datum/quirk/monochromatic))
|
||||
owner.add_client_colour(/datum/client_colour/monochrome)
|
||||
owner.visible_message("[stun ? "<span class='warning'>[owner] stands still as [owner.p_their()] eyes seem to focus on a distant point.</span>" : ""]", \
|
||||
"<span class='warning'>[pick("You feel your thoughts slow down...", "You suddenly feel extremely dizzy...", "You feel like you're in the middle of a dream...","You feel incredibly relaxed...")]</span>")
|
||||
return TRUE
|
||||
|
||||
/datum/status_effect/trance/on_creation(mob/living/new_owner, _duration, _stun = TRUE)
|
||||
duration = _duration
|
||||
stun = _stun
|
||||
return ..()
|
||||
|
||||
/datum/status_effect/trance/on_remove()
|
||||
UnregisterSignal(owner, COMSIG_MOVABLE_HEAR)
|
||||
owner.remove_trait(TRAIT_MUTE, "trance")
|
||||
owner.dizziness = 0
|
||||
if(!owner.has_quirk(/datum/quirk/monochromatic))
|
||||
owner.remove_client_colour(/datum/client_colour/monochrome)
|
||||
to_chat(owner, "<span class='warning'>You snap out of your trance!</span>")
|
||||
|
||||
/datum/status_effect/trance/proc/hypnotize(datum/source, message, atom/movable/speaker, message_language, raw_message, radio_freq, list/spans, message_mode)
|
||||
if(!owner.can_hear())
|
||||
return
|
||||
if(speaker == owner)
|
||||
return
|
||||
var/mob/living/carbon/C = owner
|
||||
C.cure_trauma_type(/datum/brain_trauma/hypnosis, TRAUMA_RESILIENCE_SURGERY) //clear previous hypnosis
|
||||
addtimer(CALLBACK(C, /mob/living/carbon.proc/gain_trauma, /datum/brain_trauma/hypnosis, TRAUMA_RESILIENCE_SURGERY, raw_message), 10)
|
||||
addtimer(CALLBACK(C, /mob/living.proc/Stun, 60, TRUE, TRUE), 15) //Take some time to think about it
|
||||
qdel(src)
|
||||
|
||||
Reference in New Issue
Block a user