From 7b97739a495fa0482cefd799546a4444c522088d Mon Sep 17 00:00:00 2001 From: Markolie Date: Wed, 30 Sep 2015 15:34:17 +0200 Subject: [PATCH] Remove duplicate procs, fix examine text --- code/__HELPERS/unsorted.dm | 59 +------------------ .../mob/living/carbon/human/examine.dm | 16 ++--- 2 files changed, 9 insertions(+), 66 deletions(-) diff --git a/code/__HELPERS/unsorted.dm b/code/__HELPERS/unsorted.dm index 8a1fa72949e..afc03f3391f 100644 --- a/code/__HELPERS/unsorted.dm +++ b/code/__HELPERS/unsorted.dm @@ -173,67 +173,10 @@ Turf and target are seperate in case you want to teleport some distance from a t //A* helpers procs /////////////////// -// Returns true if a link between A and B is blocked -// Movement through doors allowed if ID has access -/proc/LinkBlockedWithAccess(turf/A, turf/B, obj/item/weapon/card/id/ID) - - if(A == null || B == null) return 1 - var/adir = get_dir(A,B) - var/rdir = get_dir(B,A) - if(adir & (adir-1)) // diagonal - var/turf/iStep = get_step(A,adir&(NORTH|SOUTH)) - if(!iStep.density && !LinkBlockedWithAccess(A,iStep, ID) && !LinkBlockedWithAccess(iStep,B,ID)) - return 0 - - var/turf/pStep = get_step(A,adir&(EAST|WEST)) - if(!pStep.density && !LinkBlockedWithAccess(A,pStep,ID) && !LinkBlockedWithAccess(pStep,B,ID)) - return 0 - - return 1 - - if(DirBlockedWithAccess(A,adir, ID)) - return 1 - - if(DirBlockedWithAccess(B,rdir, ID)) - return 1 - - for(var/obj/O in B) - if(O.density && !istype(O, /obj/machinery/door) && !(O.flags & ON_BORDER)) - return 1 - - return 0 - -// Returns true if a link between A and B is blocked -// Movement through doors allowed if door is open -/proc/LinkBlocked(turf/A, turf/B) - if(A == null || B == null) - return 1 - var/adir = get_dir(A,B) - var/rdir = get_dir(B,A) - if(adir & (adir-1)) //diagonal - var/turf/iStep = get_step(A,adir & (NORTH|SOUTH)) //check the north/south component - if(!iStep.density && !LinkBlocked(A,iStep) && !LinkBlocked(iStep,B)) - return 0 - - var/turf/pStep = get_step(A,adir & (EAST|WEST)) //check the east/west component - if(!pStep.density && !LinkBlocked(A,pStep) && !LinkBlocked(pStep,B)) - return 0 - - return 1 - - if(DirBlocked(A,adir)) return 1 - if(DirBlocked(B,rdir)) return 1 - - for(var/obj/O in B) - if(O.density && !istype(O, /obj/machinery/door) && !(O.flags & ON_BORDER)) - return 1 - - return 0 - // Returns true if a link is blocked and neither location has something climbable on // Used for inventory checks /proc/LinkBlockedUnclimbable(turf/A, turf/B) - if (!LinkBlocked(A, B)) + if (!A.LinkBlocked(A, B)) return 0 for (var/obj/structure/S in A.contents) if(S.climbable) diff --git a/code/modules/mob/living/carbon/human/examine.dm b/code/modules/mob/living/carbon/human/examine.dm index 1dcea3e1b4d..183640bb45b 100644 --- a/code/modules/mob/living/carbon/human/examine.dm +++ b/code/modules/mob/living/carbon/human/examine.dm @@ -266,9 +266,9 @@ var/obj/item/organ/external/E = organs_by_name[organ_tag] if(!E) - wound_flavor_text["[organ_tag]"] = "[t_He] is missing [t_his] [organ_descriptor].\n" + wound_flavor_text["[organ_tag]"] = "[t_He] [t_is] missing [t_his] [organ_descriptor].\n" else if(E.is_stump()) - wound_flavor_text["[organ_tag]"] = "[t_He] has a stump where [t_his] [organ_descriptor] should be.\n" + wound_flavor_text["[organ_tag]"] = "[t_He] [t_has] a stump where [t_his] [organ_descriptor] should be.\n" else continue @@ -277,10 +277,10 @@ if(temp.status & ORGAN_ROBOT) if(!(temp.brute_dam + temp.burn_dam)) if(!isSynthetic()) - wound_flavor_text["[temp.limb_name]"] = "[t_He] has a robotic [temp.name]!\n" + wound_flavor_text["[temp.limb_name]"] = "[t_He] [t_has] a robotic [temp.name]!\n" continue else - wound_flavor_text["[temp.limb_name]"] = "[t_He] has a robotic [temp.name]. It has" + wound_flavor_text["[temp.limb_name]"] = "[t_He] [t_has] a robotic [temp.name]. It has" if(temp.brute_dam) switch(temp.brute_dam) if(0 to 20) wound_flavor_text["[temp.limb_name]"] += " some dents" @@ -317,22 +317,22 @@ switch(wound_descriptors[wound]) if(1) if(!flavor_text.len) - flavor_text += "[t_He] has[prob(10) && !(wound in no_exclude) ? " what might be" : ""] a [wound]" + flavor_text += "[t_He] [t_has][prob(10) && !(wound in no_exclude) ? " what might be" : ""] a [wound]" else flavor_text += "[prob(10) && !(wound in no_exclude) ? " what might be" : ""] a [wound]" if(2) if(!flavor_text.len) - flavor_text += "[t_He] has[prob(10) && !(wound in no_exclude) ? " what might be" : ""] a pair of [wound]s" + flavor_text += "[t_He] [t_has][prob(10) && !(wound in no_exclude) ? " what might be" : ""] a pair of [wound]s" else flavor_text += "[prob(10) && !(wound in no_exclude) ? " what might be" : ""] a pair of [wound]s" if(3 to 5) if(!flavor_text.len) - flavor_text += "[t_He] has several [wound]s" + flavor_text += "[t_He] [t_has] several [wound]s" else flavor_text += " several [wound]s" if(6 to INFINITY) if(!flavor_text.len) - flavor_text += "[t_He] has a bunch of [wound]s" + flavor_text += "[t_He] [t_has] a bunch of [wound]s" else flavor_text += " a ton of [wound]\s" var/flavor_text_string = ""