/proc/issmall(A) if(A && istype(A, /mob/living/carbon/human)) var/mob/living/carbon/human/H = A if(H.species && H.species.is_small) return 1 return 0 /proc/ispet(A) if(istype(A, /mob/living/simple_animal)) var/mob/living/simple_animal/SA = A if(SA.can_collar) return 1 return 0 /mob/proc/isSynthetic() return 0 /mob/living/carbon/human/isSynthetic() // If they are 100% robotic, they count as synthetic. for(var/obj/item/organ/external/E in organs) if(!(E.status & ORGAN_ROBOT)) return 0 return 1 /proc/isloyal(A) //Checks to see if the person contains a mindshield implant, then checks that the implant is actually inside of them for(var/obj/item/weapon/implant/loyalty/L in A) if(L && L.implanted) return 1 return 0 /proc/ismindslave(A) //Checks to see if the person contains a mindslave implant, then checks that the implant is actually inside of them for(var/obj/item/weapon/implant/traitor/T in A) if(T && T.implanted) return 1 return 0 proc/isSSD(mob/M) return istype(M) && M.player_logged proc/isAntag(A) if(istype(A, /mob/living/carbon)) var/mob/living/carbon/C = A if(C.mind && C.mind.special_role) return 1 return 0 proc/isNonCrewAntag(A) if(!isAntag(A)) return 0 var/mob/living/carbon/C = A var/special_role = C.mind.special_role var/list/crew_roles = list("traitor", "Changeling", "Vampire", "Cultist", "Head Revolutionary", "Revolutionary", "malfunctioning AI", "Shadowling", "loyalist", "mutineer", "Response Team") if((special_role in crew_roles)) return 0 return 1 proc/iscuffed(A) if(istype(A, /mob/living/carbon)) var/mob/living/carbon/C = A if(C.handcuffed) return 1 return 0 proc/isdeaf(A) if(istype(A, /mob)) var/mob/M = A return (M.disabilities & DEAF) || M.ear_deaf return 0 proc/hassensorlevel(A, var/level) var/mob/living/carbon/human/H = A if(istype(H) && istype(H.w_uniform, /obj/item/clothing/under)) var/obj/item/clothing/under/U = H.w_uniform return U.sensor_mode >= level return 0 proc/getsensorlevel(A) var/mob/living/carbon/human/H = A if(istype(H) && istype(H.w_uniform, /obj/item/clothing/under)) var/obj/item/clothing/under/U = H.w_uniform return U.sensor_mode return SUIT_SENSOR_OFF /proc/check_zone(zone) if(!zone) return "chest" switch(zone) if("eyes") zone = "head" if("mouth") zone = "head" return zone // Returns zone with a certain probability. // If the probability misses, returns "chest" instead. // If "chest" was passed in as zone, then on a "miss" will return "head", "l_arm", or "r_arm" // Do not use this if someone is intentionally trying to hit a specific body part. // Use get_zone_with_miss_chance() for that. /proc/ran_zone(zone, probability = 80) zone = check_zone(zone) if(prob(probability)) return zone var/t = rand(1, 18) // randomly pick a different zone, or maybe the same one switch(t) if(1) return "head" if(2) return "chest" if(3 to 4) return "l_arm" if(5 to 6) return "l_hand" if(7 to 8) return "r_arm" if(9 to 10) return "r_hand" if(11 to 12) return "l_leg" if(13 to 14) return "l_foot" if(15 to 16) return "r_leg" if(17 to 18) return "r_foot" return zone /proc/above_neck(zone) var/list/zones = list("head", "mouth", "eyes") if(zones.Find(zone)) return 1 else return 0 /proc/stars(n, pr) if(pr == null) pr = 25 if(pr <= 0) return null else if(pr >= 100) return n var/te = n var/t = "" n = length(n) var/p = null p = 1 while(p <= n) if((copytext(te, p, p + 1) == " " || prob(pr))) t = text("[][]", t, copytext(te, p, p + 1)) else t = text("[]*", t) p++ return t proc/slur(phrase, var/list/slurletters = ("'"))//use a different list as an input if you want to make robots slur with $#@%! characters phrase = html_decode(phrase) var/leng=lentext(phrase) var/counter=lentext(phrase) var/newphrase="" var/newletter="" while(counter>=1) newletter=copytext(phrase,(leng-counter)+1,(leng-counter)+2) if(rand(1,3)==3) if(lowertext(newletter)=="o") newletter="u" if(lowertext(newletter)=="s") newletter="ch" if(lowertext(newletter)=="a") newletter="ah" if(lowertext(newletter)=="c") newletter="k" switch(rand(1,15)) if(1,3,5,8) newletter="[lowertext(newletter)]" if(2,4,6,15) newletter="[uppertext(newletter)]" if(7) newletter+=pick(slurletters) //if(9,10) newletter="[newletter]" //if(11,12) newletter="[newletter]" //if(13) newletter="[newletter]" newphrase+="[newletter]" counter-=1 return newphrase /proc/stutter(n) var/te = html_decode(n) var/t = ""//placed before the message. Not really sure what it's for. n = length(n)//length of the entire word var/p = null p = 1//1 is the start of any word while(p <= n)//while P, which starts at 1 is less or equal to N which is the length. var/n_letter = copytext(te, p, p + 1)//copies text from a certain distance. In this case, only one letter at a time. if(prob(80) && (ckey(n_letter) in list("b","c","d","f","g","h","j","k","l","m","n","p","q","r","s","t","v","w","x","y","z"))) if(prob(10)) n_letter = text("[n_letter]-[n_letter]-[n_letter]-[n_letter]")//replaces the current letter with this instead. else if(prob(20)) n_letter = text("[n_letter]-[n_letter]-[n_letter]") else if(prob(5)) n_letter = null else n_letter = text("[n_letter]-[n_letter]") t = text("[t][n_letter]")//since the above is ran through for each letter, the text just adds up back to the original word. p++//for each letter p is increased to find where the next letter will be. return sanitize(copytext(t,1,MAX_MESSAGE_LEN)) /proc/robostutter(n) //for robutts var/te = html_decode(n) var/t = ""//placed before the message. Not really sure what it's for. n = length(n)//length of the entire word var/p = null p = 1//1 is the start of any word while(p <= n)//while P, which starts at 1 is less or equal to N which is the length. var/robotletter = pick("@", "!", "#", "$", "%", "&", "?") //for beep boop var/n_letter = copytext(te, p, p + 1)//copies text from a certain distance. In this case, only one letter at a time. if(prob(80) && (ckey(n_letter) in list("b","c","d","f","g","h","j","k","l","m","n","p","q","r","s","t","v","w","x","y","z"))) if(prob(10)) n_letter = text("[n_letter]-[robotletter]-[n_letter]-[n_letter]")//replaces the current letter with this instead. else if(prob(20)) n_letter = text("[n_letter]-[robotletter]-[n_letter]") else if(prob(5)) n_letter = robotletter else n_letter = text("[n_letter]-[n_letter]") t = text("[t][n_letter]")//since the above is ran through for each letter, the text just adds up back to the original word. p++//for each letter p is increased to find where the next letter will be. return sanitize(copytext(t,1,MAX_MESSAGE_LEN)) proc/Gibberish(t, p)//t is the inputted message, and any value higher than 70 for p will cause letters to be replaced instead of added /* Turn text into complete gibberish! */ var/returntext = "" for(var/i = 1, i <= length(t), i++) var/letter = copytext(t, i, i+1) if(prob(50)) if(p >= 70) letter = "" for(var/j = 1, j <= rand(0, 2), j++) letter += pick("#","@","*","&","%","$","/", "<", ">", ";","*","*","*","*","*","*","*") returntext += letter return returntext proc/muffledspeech(phrase) phrase = html_decode(phrase) var/leng=lentext(phrase) var/counter=lentext(phrase) var/newphrase="" var/newletter="" while(counter>=1) newletter=copytext(phrase,(leng-counter)+1,(leng-counter)+2) if(newletter in list(" ", "!", "?", ".", ",")) //do nothing else if(lowertext(newletter) in list("a", "e", "i", "o", "u", "y")) newletter = "ph" else newletter = "m" newphrase+="[newletter]" counter-=1 return newphrase /proc/shake_camera(mob/M, duration, strength=1) if(!M || !M.client || M.shakecamera) return M.shakecamera = 1 spawn(1) var/atom/oldeye=M.client.eye var/aiEyeFlag = 0 if(istype(oldeye, /mob/camera/aiEye)) aiEyeFlag = 1 var/x for(x=0; x