From cf886f84aa0907718a19c9ee90f307a105d637d0 Mon Sep 17 00:00:00 2001 From: "giacomand@gmail.com" Date: Thu, 14 Feb 2013 11:31:29 +0000 Subject: [PATCH] - Added a death check to voice manipulating code. Fixes Issue 1244. - Made a proc for grabbing which updates the grab status, as it is usually done in the grab's process, then made tables update the grab and check if the grab still exists. Fixes Issue 1285. - Made the blind check remove the blind screen if they're not blind but the layer is set to a non-zero layer. Fixes Issue 1286. git-svn-id: http://tgstation13.googlecode.com/svn/trunk@5704 316c924e-a436-60f5-8080-3fe189b3f50e --- code/game/objects/structures/tables_racks.dm | 2 + code/modules/mob/living/carbon/human/say.dm | 164 ++++++++++--------- code/modules/mob/living/silicon/ai/life.dm | 9 +- code/modules/mob/mob_grab.dm | 29 ++-- 4 files changed, 107 insertions(+), 97 deletions(-) diff --git a/code/game/objects/structures/tables_racks.dm b/code/game/objects/structures/tables_racks.dm index 0f11cf4b5ff..58c98dc649a 100644 --- a/code/game/objects/structures/tables_racks.dm +++ b/code/game/objects/structures/tables_racks.dm @@ -322,6 +322,8 @@ if(G.state<2) user << "\red You need a better grip to do that!" return + if(!G.update()) + return G.affecting.loc = src.loc G.affecting.Weaken(5) visible_message("\red [G.assailant] puts [G.affecting] on the table.") diff --git a/code/modules/mob/living/carbon/human/say.dm b/code/modules/mob/living/carbon/human/say.dm index c8ba8c0f366..3fd095c94ae 100644 --- a/code/modules/mob/living/carbon/human/say.dm +++ b/code/modules/mob/living/carbon/human/say.dm @@ -3,38 +3,40 @@ if(silent) return - //Mimes dont speak! Changeling hivemind and emotes are allowed. - if(miming) - if(length(message) >= 2) - if(mind && mind.changeling) - if(copytext(message, 1, 2) != "*" && copytext(message, 1, 3) != ":g" && copytext(message, 1, 3) != ":G" && copytext(message, 1, 3) != ":ï") - return - else - return ..(message) - if(stat == DEAD) - return ..(message) - - if(length(message) >= 1) //In case people forget the '*help' command, this will slow them the message and prevent people from saying one letter at a time - if (copytext(message, 1, 2) != "*") - return - - if(dna) - if(dna.mutantrace == "lizard") - if(copytext(message, 1, 2) != "*") - message = replacetext(message, "s", stutter("ss")) - - /*if(dna.mutantrace == "slime" && prob(5)) - if(copytext(message, 1, 2) != "*") - if(copytext(message, 1, 2) == ";") - message = ";" - else - message = "" - message += "SKR" - var/imax = rand(5,20) - for(var/i = 0,i= 2) + if(mind && mind.changeling) + if(copytext(message, 1, 2) != "*" && copytext(message, 1, 3) != ":g" && copytext(message, 1, 3) != ":G" && copytext(message, 1, 3) != ":ï") + return + else + return ..(message) + if(stat == DEAD) + return ..(message) + + if(length(message) >= 1) //In case people forget the '*help' command, this will slow them the message and prevent people from saying one letter at a time + if (copytext(message, 1, 2) != "*") + return + + if(dna) + if(dna.mutantrace == "lizard") + if(copytext(message, 1, 2) != "*") + message = replacetext(message, "s", stutter("ss")) + + /*if(dna.mutantrace == "slime" && prob(5)) + if(copytext(message, 1, 2) != "*") + if(copytext(message, 1, 2) == ";") + message = ";" + else + message = "" + message += "SKR" + var/imax = rand(5,20) + for(var/i = 0,i= 25 && length(message)) if(copytext(message, 1, 2) != "*") - var/list/temp_message = text2list(message, " ") - var/list/pick_list = list() - for(var/i = 1, i <= temp_message.len, i++) - pick_list += i - for(var/i=1, i <= abs(temp_message.len/3), i++) - var/H = pick(pick_list) - if(findtext(temp_message[H], "*") || findtext(temp_message[H], ";") || findtext(temp_message[H], ":")) continue - temp_message[H] = ninjaspeak(temp_message[H]) - pick_list -= H - message = dd_list2text(temp_message, " ") - message = replacetext(message, "o", "¤") - message = replacetext(message, "p", "þ") - message = replacetext(message, "l", "£") - message = replacetext(message, "s", "§") - message = replacetext(message, "u", "µ") - message = replacetext(message, "b", "ß") - - else if(istype(wear_mask, /obj/item/clothing/mask/luchador)) - if(copytext(message, 1, 2) != "*") - message = replacetext(message, "captain", "CAPITÁN") - message = replacetext(message, "station", "ESTACIÓN") - message = replacetext(message, "sir", "SEÑOR") - message = replacetext(message, "the ", "el ") - message = replacetext(message, "my ", "mi ") - message = replacetext(message, "is ", "es ") - message = replacetext(message, "it's", "es") - message = replacetext(message, "friend", "amigo") - message = replacetext(message, "buddy", "amigo") - message = replacetext(message, "hello", "hola") - message = replacetext(message, " hot", " caliente") - message = replacetext(message, " very ", " muy ") - message = replacetext(message, "sword", "espada") - message = replacetext(message, "library", "biblioteca") - message = replacetext(message, "traitor", "traidor") - message = replacetext(message, "wizard", "mago") - message = uppertext(message) //Things end up looking better this way (no mixed cases), and it fits the macho wrestler image. - if(prob(25)) - message += " OLE!" - - else if(istype(wear_mask, /obj/item/clothing/mask/horsehead)) - var/obj/item/clothing/mask/horsehead/hoers = wear_mask - if(hoers.voicechange) - if(!(copytext(message, 1, 2) == "*" || (mind && mind.changeling && (copytext(message, 1, 3) == ":g" || copytext(message, 1, 3) == ":G" || copytext(message, 1, 3) == ":ï")))) - message = pick("NEEIIGGGHHHH!", "NEEEIIIIGHH!", "NEIIIGGHH!", "HAAWWWWW!", "HAAAWWW!") - - if ((HULK in mutations) && health >= 25 && length(message)) - if(copytext(message, 1, 2) != "*") - message = "[uppertext(message)]!!" //because I don't know how to code properly in getting vars from other files -Bro + message = "[uppertext(message)]!!" //because I don't know how to code properly in getting vars from other files -Bro ..(message) diff --git a/code/modules/mob/living/silicon/ai/life.dm b/code/modules/mob/living/silicon/ai/life.dm index 37f0fdd1f8b..e0606e0c0e5 100644 --- a/code/modules/mob/living/silicon/ai/life.dm +++ b/code/modules/mob/living/silicon/ai/life.dm @@ -28,7 +28,7 @@ src.reset_view(null) // Handle power damage (oxy) - if(src:aiRestorePowerRoutine != 0) + if(src.aiRestorePowerRoutine != 0) // Lost power adjustOxyLoss(1) else @@ -49,9 +49,10 @@ //stage = 5 blind = 1 - if (!blind) //lol? if(!blind) #if(src.blind.layer) <--something here is clearly wrong :P - //I'll get back to this when I find out how this is -supposed- to work ~Carn //removed this shit since it was confusing as all hell --39kk9t + if (!blind) //stage = 4.5 + if (src.blind.layer != 0) + src.blind.layer = 0 src.sight |= SEE_TURFS src.sight |= SEE_MOBS src.sight |= SEE_OBJS @@ -102,7 +103,7 @@ if (loc.master.power_equip) if (!istype(T, /turf/space)) src << "Alert cancelled. Power has been restored without our assistance." - src:aiRestorePowerRoutine = 0 + src.aiRestorePowerRoutine = 0 src.blind.layer = 0 return src << "Fault confirmed: missing external power. Shutting down main control system to save power." diff --git a/code/modules/mob/mob_grab.dm b/code/modules/mob/mob_grab.dm index 71546fe7114..05f460a6000 100644 --- a/code/modules/mob/mob_grab.dm +++ b/code/modules/mob/mob_grab.dm @@ -54,19 +54,8 @@ /obj/item/weapon/grab/process() - if(!assailant || (!affecting && !structure)) - del(src) - return - if(affecting && !structure) - if ((!( isturf(assailant.loc) ) || (!( isturf(affecting.loc) ) || (assailant.loc != affecting.loc && get_dist(assailant, affecting) > 1)))) - //SN src = null - del(src) - return - else if(!affecting && structure) - if (!isturf(structure.loc) || !isturf(structure.loc) || (assailant.loc != structure.loc && get_dist(assailant, structure) > 1)) - del(src) - return + update() if (assailant.client) assailant.client.screen -= hud1 @@ -251,6 +240,22 @@ hud1.master = src return +/obj/item/weapon/grab/proc/update() + if(!assailant || (!affecting && !structure)) + del(src) + return + + if(affecting && !structure) + if ((!( isturf(assailant.loc) ) || (!( isturf(affecting.loc) ) || (assailant.loc != affecting.loc && get_dist(assailant, affecting) > 1)))) + //SN src = null + del(src) + return + else if(!affecting && structure) + if (!isturf(structure.loc) || !isturf(structure.loc) || (assailant.loc != structure.loc && get_dist(assailant, structure) > 1)) + del(src) + return + return 1 + /obj/item/weapon/grab/attack(mob/M as mob, mob/user as mob) if(!affecting) return