From fb70b97d5ba32c3256107e18a933197fd1342d7e Mon Sep 17 00:00:00 2001 From: Thalpy Date: Sun, 16 Jun 2019 20:24:36 +0100 Subject: [PATCH] Tweaks hypnoquirk as the discord seems to really want it. --- code/datums/brain_damage/hypnosis.dm | 23 ++++++++++++++++++++--- code/datums/status_effects/debuffs.dm | 10 +++++++--- code/datums/traits/negative.dm | 2 +- 3 files changed, 28 insertions(+), 7 deletions(-) diff --git a/code/datums/brain_damage/hypnosis.dm b/code/datums/brain_damage/hypnosis.dm index d3ce57ca67..ba8890fea1 100644 --- a/code/datums/brain_damage/hypnosis.dm +++ b/code/datums/brain_damage/hypnosis.dm @@ -9,10 +9,13 @@ var/hypnotic_phrase = "" var/regex/target_phrase -/datum/brain_trauma/hypnosis/New(phrase) +/datum/brain_trauma/hypnosis/New(phrase, priority = TRUE) if(!phrase) qdel(src) - hypnotic_phrase = phrase + if(priority == TRUE) + hypnotic_phrase = phrase + else + phrase friendliify(phrase) try target_phrase = new("(\\b[hypnotic_phrase]\\b)","ig") catch(var/exception/e) @@ -20,6 +23,16 @@ qdel(src) ..() +/datum/brain_trauma/hypnosis/proc/friendliify(phrase) + phrase = replacetext(lowertext(phrase), "kill", "hug") + phrase = replacetext(lowertext(phrase), "murder", "cuddle") + phrase = replacetext(lowertext(phrase), "harm", "snuggle") + phrase = replacetext(lowertext(phrase), "decapitate", "headpat") + phrase = replacetext(lowertext(phrase), "strangle", "meow at") + phrase = replacetext(lowertext(phrase), "suicide", "self-love") + phrase = replacetext(lowertext(phrase), "lynch", "kiss") + hypnotic_phrase = phrase + /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]'.") @@ -29,8 +42,12 @@ "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.")]") - to_chat(owner, "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,\ + if(priority == TRUE) + to_chat(owner, "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.") + else + to_chat(owner, "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,\ + however this does not take precedence over your other objectives.") ..() /datum/brain_trauma/hypnosis/on_lose() diff --git a/code/datums/status_effects/debuffs.dm b/code/datums/status_effects/debuffs.dm index 17aedcdf10..be8a2ddd27 100644 --- a/code/datums/status_effects/debuffs.dm +++ b/code/datums/status_effects/debuffs.dm @@ -553,11 +553,12 @@ datum/status_effect/pacify ADD_TRAIT(owner, TRAIT_MUTE, "trance") if(!owner.has_quirk(/datum/quirk/monochromatic)) owner.add_client_colour(/datum/client_colour/monochrome) - owner.visible_message("[stun ? "[owner] stands still as [owner.p_their()] eyes seem to focus on a distant point." : ""]", \ + if(priority == TRUE) + owner.visible_message("[stun ? "[owner] stands still as [owner.p_their()] eyes seem to focus on a distant point." : ""]", \ "[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...")]") return TRUE -/datum/status_effect/trance/on_creation(mob/living/new_owner, _duration, _stun = TRUE) +/datum/status_effect/trance/on_creation(mob/living/new_owner, _duration, _stun = TRUE, priority = TRUE)//priority == FALSE makes no visible message, prevents self antag messages, and places phrase below objectives. duration = _duration stun = _stun return ..() @@ -577,6 +578,9 @@ datum/status_effect/pacify 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) + if(priority == TRUE) + addtimer(CALLBACK(C, /mob/living/carbon.proc/gain_trauma, /datum/brain_trauma/hypnosis, TRAUMA_RESILIENCE_SURGERY, raw_message), 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.proc/Stun, 60, TRUE, TRUE), 15) //Take some time to think about it qdel(src) diff --git a/code/datums/traits/negative.dm b/code/datums/traits/negative.dm index 03c11fb804..9aa2b4d6df 100644 --- a/code/datums/traits/negative.dm +++ b/code/datums/traits/negative.dm @@ -348,6 +348,6 @@ to_chat(H, "That object accidentally sets off your implanted trigger, sending you into a hypnotic daze!") else to_chat(H, "[pick(seen)] accidentally sets off your implanted trigger, sending you into a hypnotic daze!") - H.apply_status_effect(/datum/status_effect/trance, 200, TRUE) + H.apply_status_effect(/datum/status_effect/trance, 200, TRUE, FALSE) qdel(src) */