Commented out hypnoquirk and edited it so that it functions differently

This commit is contained in:
Fermi
2019-06-23 18:59:15 +01:00
parent 7c19f5e0fa
commit 8992dbfa4d
4 changed files with 45 additions and 25 deletions

View File

@@ -5,14 +5,13 @@
gain_text = ""
lose_text = ""
resilience = TRAUMA_RESILIENCE_SURGERY
var/priority = TRUE
var/hypnotic_phrase = ""
var/regex/target_phrase
/datum/brain_trauma/hypnosis/New(phrase, priority)
/datum/brain_trauma/hypnosis/New(phrase, quirk = FALSE)
if(!phrase)
qdel(src)
if(priority == TRUE)
if(quirk == TRUE)
hypnotic_phrase = phrase
else
friendliify(phrase)
@@ -42,11 +41,11 @@
"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>")
if(priority == TRUE)
if(!HAS_TRAIT(owner, "hypnotherapy"))
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>")
else
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,\
to_chat(owner, "<span class='boldwarning'>You've been hypnotized by this sentence. You feel an incredible desire to follow these words, but are able to resist it somewhat. If it isn't a clear order, you can freely interpret how to do so,\
however this does not take precedence over your other objectives.</span>")
..()

View File

@@ -534,8 +534,8 @@ datum/status_effect/pacify
tick_interval = 10
examine_text = "<span class='warning'>SUBJECTPRONOUN seems slow and unfocused.</span>"
var/stun = TRUE
var/priority = TRUE
alert_type = /obj/screen/alert/status_effect/trance
var/triggered = FALSE
alert_type = null
/obj/screen/alert/status_effect/trance
name = "Trance"
@@ -543,6 +543,22 @@ datum/status_effect/pacify
icon_state = "high"
/datum/status_effect/trance/tick()
if(HAS_TRAIT(owner, "hypnotherapy"))
message_admins("has trait")
if(triggered == TRUE)
message_admins("triggered")
UnregisterSignal(owner, COMSIG_MOVABLE_HEAR)
RegisterSignal(owner, COMSIG_MOVABLE_HEAR, .proc/hypnotize)
ADD_TRAIT(owner, TRAIT_MUTE, "trance")
if(!owner.has_quirk(/datum/quirk/monochromatic))
owner.add_client_colour(/datum/client_colour/monochrome)
to_chat(owner, "<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>")
triggered = FALSE
duration = 300
else
message_admins("not triggered")
return
message_admins("stunning")
if(stun)
owner.Stun(60, TRUE, TRUE)
owner.dizziness = 20
@@ -550,19 +566,26 @@ datum/status_effect/pacify
/datum/status_effect/trance/on_apply()
if(!iscarbon(owner))
return FALSE
if(HAS_TRAIT(owner, "hypnotherapy"))
message_admins("stunning")
RegisterSignal(owner, COMSIG_MOVABLE_HEAR, .proc/listen)
return TRUE
alert_type = /obj/screen/alert/status_effect/trance
RegisterSignal(owner, COMSIG_MOVABLE_HEAR, .proc/hypnotize)
ADD_TRAIT(owner, TRAIT_MUTE, "trance")
if(!owner.has_quirk(/datum/quirk/monochromatic))
owner.add_client_colour(/datum/client_colour/monochrome)
if(priority == TRUE)
owner.visible_message("[stun ? "<span class='warning'>[owner] stands still as [owner.p_their()] eyes seem to focus on a distant point.</span>" : ""]", \
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, _priority = priority)//priority == FALSE makes no visible message, prevents self antag messages, and places phrase below objectives.
/datum/status_effect/trance/on_creation(mob/living/new_owner, _duration, _stun = TRUE, source_quirk = FALSE)//hypnoquirk makes no visible message, prevents self antag messages, and places phrase below objectives.
duration = _duration
stun = _stun
priority = _priority
var/mob/living/carbon/C = new_owner
if(source_quirk == FALSE && HAS_TRAIT(C, "hypnotherapy"))
message_admins("removing quirk")
REMOVE_TRAIT(owner, "hypnotherapy", ROUNDSTART_TRAIT)
return ..()
/datum/status_effect/trance/on_remove()
@@ -573,16 +596,22 @@ datum/status_effect/pacify
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/listen(datum/source, message, atom/movable/speaker, message_language, raw_message, radio_freq, list/spans, message_mode)
message_admins("Trigger start")
to_chat(owner, "<span class='notice'><i>[speaker] accidentally sets off your implanted trigger, sending you into a hypnotic daze!</i></span>")
triggered = TRUE
/datum/status_effect/trance/proc/hypnotize(datum/source, message, atom/movable/speaker, message_language, raw_message, radio_freq, list/spans, message_mode)
message_admins("Hypnotize")
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
if(priority == TRUE)
addtimer(CALLBACK(C, /mob/living/carbon.proc/gain_trauma, /datum/brain_trauma/hypnosis, TRAUMA_RESILIENCE_SURGERY, raw_message), 10)
if(HAS_TRAIT(C, "hypnotherapy"))
addtimer(CALLBACK(C, /mob/living/carbon.proc/gain_trauma, /datum/brain_trauma/hypnosis, TRAUMA_RESILIENCE_SURGERY, raw_message, TRUE), 10)
else
addtimer(CALLBACK(C, /mob/living/carbon.proc/gain_trauma, /datum/brain_trauma/hypnosis, TRAUMA_RESILIENCE_SURGERY, raw_message, FALSE), 10)
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)

View File

@@ -380,12 +380,5 @@
//DOES NOT give any indication when someone is triggered - this is intentional so people don't abuse it, you're supposed to get a random thing said to you as a mini objective.
/datum/quirk/hypno/proc/triggered(quirk_holder)//I figured I might as well make a trait of code I added.
var/mob/living/carbon/human/H = quirk_holder
var/list/seen = viewers(8, get_turf(H))
seen -= quirk_holder
if(LAZYLEN(seen) == 0)
to_chat(H, "<span class='notice'><i>That object accidentally sets off your implanted trigger, sending you into a hypnotic daze!</i></span>")
else
to_chat(H, "<span class='notice'><i>[pick(seen)] accidentally sets off your implanted trigger, sending you into a hypnotic daze!</i></span>")
H.apply_status_effect(/datum/status_effect/trance, 200, TRUE, FALSE)
qdel(src)
var/mob/living/carbon/human/H = quirk_holder
H.apply_status_effect(/datum/status_effect/trance, 1000, TRUE, TRUE)

View File

@@ -1236,11 +1236,10 @@
var/trigger = html_decode(stripped_input(user, "Enter the trigger phrase", MAX_MESSAGE_LEN))
var/custom_words_words_list = list("Speak", "Echo", "Shock", "Cum", "Kneel", "Strip", "Trance", "Cancel")
var/trigger2 = input(user, "Pick an effect", "Effects") in custom_words_words_list
//var/trigger2 = stripped_input(user, "Enter the effect.", MAX_MESSAGE_LEN)
trigger2 = lowertext(trigger2)
if ((findtext(trigger2, custom_words_words)))
if (trigger2 == "speak" || trigger2 == "echo")
var/trigger3 = html_decode(stripped_input(user, "Enter the phrase spoken.", MAX_MESSAGE_LEN))
var/trigger3 = html_decode(stripped_input(user, "Enter the phrase spoken. Abusing this to self antag is bannable.", MAX_MESSAGE_LEN))
E.customTriggers[trigger] = list(trigger2, trigger3)
message_admins("[H] has been implanted by [user] with [trigger], triggering [trigger2], to send [trigger3].")
else