From cc6e84b7521313acb327a37e356746355772fcc3 Mon Sep 17 00:00:00 2001 From: XDTM Date: Fri, 30 Dec 2016 16:01:17 +0100 Subject: [PATCH 1/3] Fixes --- code/modules/mob/living/say.dm | 8 +++--- code/modules/mob/living/silicon/silicon.dm | 12 ++++----- code/modules/surgery/organs/vocal_cords.dm | 29 ++++++++++++++-------- 3 files changed, 30 insertions(+), 19 deletions(-) diff --git a/code/modules/mob/living/say.dm b/code/modules/mob/living/say.dm index 736ccd94636a1..1821eb645592a 100644 --- a/code/modules/mob/living/say.dm +++ b/code/modules/mob/living/say.dm @@ -60,8 +60,9 @@ var/list/department_radio_keys = list( var/list/crit_allowed_modes = list(MODE_WHISPER,MODE_CHANGELING,MODE_ALIEN) -/mob/living/say(message, bubble_type,var/list/spans = list()) - message = trim(copytext(sanitize(message), 1, MAX_MESSAGE_LEN)) +/mob/living/say(message, bubble_type,var/list/spans = list(), sanitize = 1) + if(sanitize) + message = trim(copytext(sanitize(message), 1, MAX_MESSAGE_LEN)) if(!message || message == "") return @@ -250,7 +251,8 @@ var/list/crit_allowed_modes = list(MODE_WHISPER,MODE_CHANGELING,MODE_ALIEN) var/mob/living/carbon/C = src var/obj/item/organ/vocal_cords/V = C.getorganslot("vocal_cords") if(V && V.can_speak_with()) - C.say(V.speak_with(message), spans = V.spans) + C.say(V.handle_speech(message), spans = V.spans, sanitize = 0) + V.speak_with(message) //words come before actions return TRUE return FALSE diff --git a/code/modules/mob/living/silicon/silicon.dm b/code/modules/mob/living/silicon/silicon.dm index e06a6937d01de..b57673c85cccc 100644 --- a/code/modules/mob/living/silicon/silicon.dm +++ b/code/modules/mob/living/silicon/silicon.dm @@ -192,7 +192,7 @@ return -/mob/living/silicon/proc/statelaws() +/mob/living/silicon/proc/statelaws(force = 0) //"radiomod" is inserted before a hardcoded message to change if and how it is handled by an internal radio. src.say("[radiomod] Current Active Laws:") @@ -203,13 +203,13 @@ if (src.laws.devillaws && src.laws.devillaws.len) for(var/index = 1, index <= src.laws.devillaws.len, index++) - if (src.devillawcheck[index] == "Yes") + if (src.devillawcheck[index] == "Yes" || force) src.say("[radiomod] 666. [src.laws.devillaws[index]]") sleep(10) if (src.laws.zeroth) - if (src.lawcheck[1] == "Yes") + if (src.lawcheck[1] == "Yes" || force) src.say("[radiomod] 0. [src.laws.zeroth]") sleep(10) @@ -217,7 +217,7 @@ var/law = src.laws.ion[index] var/num = ionnum() if (length(law) > 0) - if (src.ioncheck[index] == "Yes") + if (src.ioncheck[index] == "Yes" || force) src.say("[radiomod] [num]. [law]") sleep(10) @@ -225,7 +225,7 @@ var/law = src.laws.inherent[index] if (length(law) > 0) - if (src.lawcheck[index+1] == "Yes") + if (src.lawcheck[index+1] == "Yes" || force) src.say("[radiomod] [number]. [law]") sleep(10) number++ @@ -236,7 +236,7 @@ if (length(law) > 0) if(src.lawcheck.len >= number+1) - if (src.lawcheck[number+1] == "Yes") + if (src.lawcheck[number+1] == "Yes" || force) src.say("[radiomod] [number]. [law]") sleep(10) number++ diff --git a/code/modules/surgery/organs/vocal_cords.dm b/code/modules/surgery/organs/vocal_cords.dm index f1a2615af3221..a35cc1468fad5 100644 --- a/code/modules/surgery/organs/vocal_cords.dm +++ b/code/modules/surgery/organs/vocal_cords.dm @@ -45,7 +45,10 @@ var/static/regex/multispin_words = regex("like a record baby") /obj/item/organ/vocal_cords/proc/can_speak_with() //if there is any limitation to speaking with these cords return TRUE -/obj/item/organ/vocal_cords/proc/speak_with(message) //do what the organ does and modify speech if needed +/obj/item/organ/vocal_cords/proc/speak_with(message) //do what the organ does + return + +/obj/item/organ/vocal_cords/proc/handle_speech(message) //change the message return message @@ -91,7 +94,7 @@ var/static/regex/multispin_words = regex("like a record baby") if(world.time < cords.next_command) owner << "You must wait [(cords.next_command - world.time)/10] seconds before Speaking again." return - var/command = stripped_input(owner, "Speak with the Voice of God", "Command", max_length = 140) + var/command = input(owner, "Speak with the Voice of God", "Command") if(!command) return owner.say(".x[command]") @@ -109,8 +112,11 @@ var/static/regex/multispin_words = regex("like a record baby") return FALSE return TRUE +/obj/item/organ/vocal_cords/colossus/handle_speech(message) + return uppertext(message) + /obj/item/organ/vocal_cords/colossus/speak_with(message) - var/spoken = uppertext(message) + message = lowertext(message) playsound(get_turf(owner), 'sound/magic/clockwork/invoke_general.ogg', 300, 1, 5) var/mob/living/list/listeners = list() @@ -274,8 +280,9 @@ var/static/regex/multispin_words = regex("like a record baby") //STATE LAWS else if((findtext(message, statelaws_words))) for(var/mob/living/silicon/S in listeners) - S.statelaws() - next_command = world.time + cooldown_meme + S.checklaws() + S.statelaws(force = 1) + next_command = world.time + cooldown_stun //MOVE else if((findtext(message, move_words))) @@ -288,14 +295,16 @@ var/static/regex/multispin_words = regex("like a record baby") else if((findtext(message, walk_words))) for(var/V in listeners) var/mob/living/L = V - L.m_intent = MOVE_INTENT_WALK + if(L.m_intent != MOVE_INTENT_WALK) + L.toggle_move_intent() next_command = world.time + cooldown_meme //RUN else if((findtext(message, run_words))) for(var/V in listeners) var/mob/living/L = V - L.m_intent = MOVE_INTENT_RUN + if(L.m_intent != MOVE_INTENT_RUN) + L.toggle_move_intent() next_command = world.time + cooldown_meme //HELP INTENT @@ -413,7 +422,9 @@ var/static/regex/multispin_words = regex("like a record baby") if(owner.mind && owner.mind.assigned_role == "Clown") for(var/mob/living/carbon/C in listeners) C.slip(0,7 * power_multiplier) - next_command = world.time + cooldown_meme + next_command = world.time + cooldown_stun + else + next_command = world.time + cooldown_meme //RIGHT ROUND else if((findtext(message, multispin_words))) @@ -425,5 +436,3 @@ var/static/regex/multispin_words = regex("like a record baby") else next_command = world.time + cooldown_none - return spoken - From e00158216152cda823e6a1ca47f9b7d3a7749fd4 Mon Sep 17 00:00:00 2001 From: XDTM Date: Tue, 3 Jan 2017 00:53:57 +0100 Subject: [PATCH 2/3] more stuff --- code/modules/surgery/organs/vocal_cords.dm | 32 ++++++++++++++-------- 1 file changed, 21 insertions(+), 11 deletions(-) diff --git a/code/modules/surgery/organs/vocal_cords.dm b/code/modules/surgery/organs/vocal_cords.dm index a35cc1468fad5..92c8fbde54fc8 100644 --- a/code/modules/surgery/organs/vocal_cords.dm +++ b/code/modules/surgery/organs/vocal_cords.dm @@ -150,23 +150,33 @@ var/static/regex/multispin_words = regex("like a record baby") power_multiplier *= 2 spans = list("ratvar") + //Try to check if the speaker specified a name or a job to focus on + var/list/specific_listeners = list() + var/found_string = null + for(var/V in listeners) var/mob/living/L = V - var/start if(L.mind && L.mind.devilinfo && findtext(message, L.mind.devilinfo.truename)) - start = findtext(message, L.mind.devilinfo.truename) - listeners = list(L) + var/start = findtext(message, L.mind.devilinfo.truename) + listeners = list(L) //let's be honest you're never going to find two devils with the same name power_multiplier *= 5 //if you're a devil and god himself addressed you, you fucked up //Cut out the name so it doesn't trigger commands message = copytext(message, 0, start)+copytext(message, start + length(L.mind.devilinfo.truename), length(message) + 1) break - else if(findtext(message, L.real_name)) - start = findtext(message, L.real_name) - listeners = list(L) //focus on a particular person - power_multiplier *= 2 + else if(findtext(message, L.real_name) == 1) + specific_listeners += L //focus on those with the specified name //Cut out the name so it doesn't trigger commands - message = copytext(message, 0, start)+copytext(message, start + length(L.real_name), length(message) + 1) - break + found_string = L.real_name + + else if(L.mind && findtext(message, L.mind.assigned_role) == 1) + specific_listeners += L //focus on those with the specified job + //Cut out the job so it doesn't trigger commands + found_string = L.mind.assigned_role + + if(specific_listeners.len) + listeners = specific_listeners + power_multiplier *= (1 + (1/specific_listeners.len)) //2x on a single guy, 1.5x on two and so on + message = copytext(message, 0, 1)+copytext(message, 1 + length(found_string), length(message) + 1) //STUN if(findtext(message, stun_words)) @@ -186,7 +196,7 @@ var/static/regex/multispin_words = regex("like a record baby") else if((findtext(message, sleep_words))) for(var/V in listeners) var/mob/living/L = V - L.Sleeping(3 * power_multiplier) + L.Sleeping(2 * power_multiplier) next_command = world.time + cooldown_stun //VOMIT @@ -208,7 +218,7 @@ var/static/regex/multispin_words = regex("like a record baby") for(var/V in listeners) var/mob/living/L = V new /obj/effect/hallucination/delusion(get_turf(L),L,duration=150 * power_multiplier,skip_nearby=0) - next_command = world.time + cooldown_damage + next_command = world.time + cooldown_meme //WAKE UP else if((findtext(message, wakeup_words))) From 9337cea937b9d8fe61aab4d9bea870ac95fb4ea1 Mon Sep 17 00:00:00 2001 From: XDTM Date: Wed, 4 Jan 2017 00:22:19 +0100 Subject: [PATCH 3/3] defines --- code/modules/mob/living/say.dm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/code/modules/mob/living/say.dm b/code/modules/mob/living/say.dm index 1821eb645592a..ffa330f6e00c1 100644 --- a/code/modules/mob/living/say.dm +++ b/code/modules/mob/living/say.dm @@ -60,7 +60,7 @@ var/list/department_radio_keys = list( var/list/crit_allowed_modes = list(MODE_WHISPER,MODE_CHANGELING,MODE_ALIEN) -/mob/living/say(message, bubble_type,var/list/spans = list(), sanitize = 1) +/mob/living/say(message, bubble_type,var/list/spans = list(), sanitize = TRUE) if(sanitize) message = trim(copytext(sanitize(message), 1, MAX_MESSAGE_LEN)) if(!message || message == "") @@ -251,7 +251,7 @@ var/list/crit_allowed_modes = list(MODE_WHISPER,MODE_CHANGELING,MODE_ALIEN) var/mob/living/carbon/C = src var/obj/item/organ/vocal_cords/V = C.getorganslot("vocal_cords") if(V && V.can_speak_with()) - C.say(V.handle_speech(message), spans = V.spans, sanitize = 0) + C.say(V.handle_speech(message), spans = V.spans, sanitize = FALSE) V.speak_with(message) //words come before actions return TRUE return FALSE